Commit eef22d3e authored by Mai Thanh Cong's avatar Mai Thanh Cong

Merge branch 'develop/NamAnh/Login' of...

Merge branch 'develop/NamAnh/Login' of https://gitlab.kis-v.com/congmt_kis/aqbits-trace-code into develop/change-ui
parents 6bcaa3cb 3b453e46
...@@ -82,57 +82,69 @@ const DemoNavbar = () => { ...@@ -82,57 +82,69 @@ const DemoNavbar = () => {
authServices.logout(); authServices.logout();
history.push("/login-page"); history.push("/login-page");
} }
return ( return (
<> <>
<header className="header-global"> <header className="header-global">
<Navbar <Navbar
className="navbar-main navbar-transparent navbar-light headroom" className="navbar-main navbar-transparent navbar-light headroom"
expand="lg" expand="lg"
id="navbar-main" id="navbar-main"
> >
<Container> <Container>
<NavbarBrand className="mr-lg-5" to="/" tag={Link}> <NavbarBrand className="mr-lg-5" to="/" tag={Link}>
<img <img
alt="..." alt="..."
src={require("assets/img/brand/full_Logo.png")} src={require("assets/img/brand/full_Logo.png")}
/> />
</NavbarBrand> </NavbarBrand>
<button className="navbar-toggler" id="navbar_global"> <button className="navbar-toggler" id="navbar_global">
<span className="navbar-toggler-icon" /> <span className="navbar-toggler-icon" />
</button> </button>
<UncontrolledCollapse <UncontrolledCollapse
toggler="#navbar_global" toggler="#navbar_global"
navbar navbar
className={collapseClasses} className={collapseClasses}
onExiting={onExiting} onExiting={onExiting}
onExited={onExited} onExited={onExited}
> >
<div className="navbar-collapse-header"> <div className="navbar-collapse-header">
<Row> <Row>
<Col className="collapse-brand" xs="6"> <Col className="collapse-brand" xs="6">
<Link to="/"> <Link to="/">
<img <img
alt="..." alt="..."
src={require("assets/img/brand/full_Logo.png")} src={require("assets/img/brand/full_Logo.png")}
/> />
</Link> </Link>
</Col> </Col>
<Col className="collapse-close" xs="6"> <Col className="collapse-close" xs="6">
<button className="navbar-toggler" id="navbar_global"> <button className="navbar-toggler" id="navbar_global">
<span /> <span />
<span /> <span />
</button> </button>
</Col> </Col>
</Row> </Row>
</div> </div>
<Nav className="navbar-nav-hover align-items-lg-center" navbar> <Nav className="navbar-nav-hover align-items-lg-center" navbar>
<UncontrolledDropdown nav> <NavItem>
<NavLink
className="nav-link-icon"
href="#"
onClick={onHandleGoToHome}
>
<i className="fa fa-facebook-square d-lg-none" />
<span className="nav-link-inner--text ml-2">
Trang ch
</span>
</NavLink>
</NavItem>
{/* <UncontrolledDropdown nav>
<DropdownToggle nav> <DropdownToggle nav>
<i className="ni ni-ui-04 d-lg-none mr-1" /> <i className="ni ni-ui-04 d-lg-none mr-1" />
<span className="nav-link-inner--text" onClick={onHandleGoToHome}>Trang chủ</span> <span className="nav-link-inner--text" onClick={onHandleGoToHome}>Trang chủ</span>
</DropdownToggle> </DropdownToggle>
{/* <DropdownMenu className="dropdown-menu-xl"> <DropdownMenu className="dropdown-menu-xl">
<div className="dropdown-menu-inner"> <div className="dropdown-menu-inner">
<Media <Media
className="d-flex align-items-center" className="d-flex align-items-center"
...@@ -189,34 +201,10 @@ const DemoNavbar = () => { ...@@ -189,34 +201,10 @@ const DemoNavbar = () => {
</Media> </Media>
</Media> </Media>
</div> </div>
</DropdownMenu> */}
</UncontrolledDropdown>
<UncontrolledDropdown nav>
<DropdownToggle nav>
<i className="ni ni-collection d-lg-none mr-1" />
<span className="nav-link-inner--text">Dch v</span>
</DropdownToggle>
<DropdownMenu>
{/* <DropdownItem to="/trace-code" tag={Link}>
Profile
</DropdownItem> */}
<DropdownItem to="/login-page" tag={Link}>
Đăng nhp
</DropdownItem>
{/* <DropdownItem to="/register-page" tag={Link}>
Đăng kí
</DropdownItem> */}
<DropdownItem to="/" tag={Link}>
Tra cu thông tin
</DropdownItem>
<DropdownItem divider />
<DropdownItem onClick={onHandleLogout}>
Đăng xut
</DropdownItem>
</DropdownMenu> </DropdownMenu>
</UncontrolledDropdown> </UncontrolledDropdown> */}
</Nav> </Nav>
<Nav className="align-items-lg-center ml-lg-auto" navbar> {/* <Nav className="align-items-lg-center ml-lg-auto" navbar>
<NavItem> <NavItem>
<NavLink <NavLink
className="nav-link-icon" className="nav-link-icon"
...@@ -281,13 +269,45 @@ const DemoNavbar = () => { ...@@ -281,13 +269,45 @@ const DemoNavbar = () => {
Github Github
</UncontrolledTooltip> </UncontrolledTooltip>
</NavItem> </NavItem>
</Nav> </Nav> */}
</UncontrolledCollapse> <Nav className="navbar-nav-hover align-items-lg-center ml-lg-auto" navbar>
</Container> <UncontrolledDropdown nav>
</Navbar> <DropdownToggle nav>
</header> <div className="media align-items-center">
</> <span className="avatar avatar-sm rounded-circle">
); <img alt="Image placeholder" src={require("assets/img/theme/team-4-800x800.jpg")}/>
</span>
<div className="media-body ml-2 d-none d-lg-block">
<span className="mb-0 text-sm font-weight-bold">John Snow</span>
</div>
</div>
</DropdownToggle>
<DropdownMenu>
{/* <DropdownItem to="/trace-code" tag={Link}>
Profile
</DropdownItem> */}
{/* <DropdownItem to="/login-page" tag={Link}>
Đăng nhập
</DropdownItem> */}
{/* <DropdownItem to="/register-page" tag={Link}>
Đăng kí
</DropdownItem> */}
<DropdownItem to="/" tag={Link}>
Tra cu thông tin
</DropdownItem>
<DropdownItem divider />
<DropdownItem onClick={onHandleLogout}>
Đăng xut
</DropdownItem>
</DropdownMenu>
</UncontrolledDropdown>
</Nav>
</UncontrolledCollapse>
</Container>
</Navbar>
</header>
</>
);
// } // }
} }
......
import React from "react";
const AddDiary = () => {
return (
<div></div>
);
}
export default AddDiary;
\ No newline at end of file
...@@ -29,9 +29,6 @@ const AddProduct = () => { ...@@ -29,9 +29,6 @@ const AddProduct = () => {
history.push("/profile/add"); history.push("/profile/add");
} }
const newData = dummyData.data.filter(item => item.id === profileId);
console.log("newData", newData);
const onHandleAddProduct = (event) => { const onHandleAddProduct = (event) => {
event.preventDefault(); event.preventDefault();
const getTime = new Date().getTime(); const getTime = new Date().getTime();
...@@ -49,9 +46,7 @@ const AddProduct = () => { ...@@ -49,9 +46,7 @@ const AddProduct = () => {
} }
if(profileId){ if(profileId){
const newData = dummyData.data.filter(item => item.id === profileId); const newData = dummyData.data.filter(item => item.id === profileId);
console.log("newData", newData);
newData.profile_product.push(params); newData.profile_product.push(params);
console.log("newData", newData);
} }
history.push("/profile/add"); history.push("/profile/add");
} }
...@@ -77,6 +72,7 @@ const AddProduct = () => { ...@@ -77,6 +72,7 @@ const AddProduct = () => {
<Input <Input
placeholder="Tên sản phẩm" placeholder="Tên sản phẩm"
type="text" type="text"
className="text-dark"
value={productName} value={productName}
onChange={(e) => setProductName(e.target.value)} onChange={(e) => setProductName(e.target.value)}
/> />
...@@ -93,6 +89,7 @@ const AddProduct = () => { ...@@ -93,6 +89,7 @@ const AddProduct = () => {
<Input <Input
placeholder="Mã sản phẩm" placeholder="Mã sản phẩm"
type="text" type="text"
className="text-dark"
value={traceCode} value={traceCode}
onChange={(e) => setTraceCode(e.target.value)} onChange={(e) => setTraceCode(e.target.value)}
/> />
...@@ -109,6 +106,7 @@ const AddProduct = () => { ...@@ -109,6 +106,7 @@ const AddProduct = () => {
<Input <Input
placeholder="Giá sản phẩm" placeholder="Giá sản phẩm"
type="text" type="text"
className="text-dark"
value={cost} value={cost}
onChange={(e) => setCost(e.target.value)} onChange={(e) => setCost(e.target.value)}
/> />
...@@ -125,6 +123,7 @@ const AddProduct = () => { ...@@ -125,6 +123,7 @@ const AddProduct = () => {
<Input <Input
placeholder="Xuất xứ" placeholder="Xuất xứ"
type="text" type="text"
className="text-dark"
value={origin} value={origin}
onChange={(e) => setOrigin(e.target.value)} onChange={(e) => setOrigin(e.target.value)}
/> />
...@@ -136,6 +135,7 @@ const AddProduct = () => { ...@@ -136,6 +135,7 @@ const AddProduct = () => {
<Input <Input
placeholder="Mô tả" placeholder="Mô tả"
type="textarea" type="textarea"
className="text-dark"
value={description} value={description}
onChange={(e) => setDescription(e.target.value)} onChange={(e) => setDescription(e.target.value)}
/> />
...@@ -147,6 +147,7 @@ const AddProduct = () => { ...@@ -147,6 +147,7 @@ const AddProduct = () => {
<Input <Input
placeholder="Điều kiện nuôi trồng" placeholder="Điều kiện nuôi trồng"
type="textarea" type="textarea"
className="text-dark"
value={growingConditions} value={growingConditions}
onChange={(e) => setGrowingConditions(e.target.value)} onChange={(e) => setGrowingConditions(e.target.value)}
/> />
...@@ -154,7 +155,7 @@ const AddProduct = () => { ...@@ -154,7 +155,7 @@ const AddProduct = () => {
</FormGroup> </FormGroup>
<FormGroup row> <FormGroup row>
<Col sm={10}> <Col sm={10}>
<Input type="file" name="file" id="file-image" /> <Input type="file" name="file" id="file-image" className="w-auto" />
<FormText color="muted"> <FormText color="muted">
La chn nh sn phm La chn nh sn phm
</FormText> </FormText>
...@@ -165,7 +166,7 @@ const AddProduct = () => { ...@@ -165,7 +166,7 @@ const AddProduct = () => {
</div> </div>
<div className="d-flex justify-content-between mt-3"> <div className="d-flex justify-content-between mt-3">
<Button <Button
color="info" color="secondary"
type="button" type="button"
className="btn-1" className="btn-1"
onClick={onHandleBack} onClick={onHandleBack}
......
...@@ -40,7 +40,7 @@ const AddProfile = () => { ...@@ -40,7 +40,7 @@ const AddProfile = () => {
const onHandleAddNewProfile = async (event) => { const onHandleAddNewProfile = async (event) => {
event.preventDefault(); event.preventDefault();
if(validatePhoneNumber(phoneNumber)){ if (validatePhoneNumber(phoneNumber)) {
const getTime = new Date().getTime(); const getTime = new Date().getTime();
const params = { const params = {
id: uuidv4(), id: uuidv4(),
...@@ -56,7 +56,7 @@ const AddProfile = () => { ...@@ -56,7 +56,7 @@ const AddProfile = () => {
dummyData.data.push(params); dummyData.data.push(params);
history.push("/profile"); history.push("/profile");
setValidPhoneNumber(false); setValidPhoneNumber(false);
}else { } else {
setValidPhoneNumber(true); setValidPhoneNumber(true);
} }
} }
...@@ -82,6 +82,7 @@ const AddProfile = () => { ...@@ -82,6 +82,7 @@ const AddProfile = () => {
required required
placeholder="Tên doanh nghiệp" placeholder="Tên doanh nghiệp"
type="text" type="text"
className="text-dark"
value={profileName} value={profileName}
onChange={(e) => setProfileName(e.target.value)} onChange={(e) => setProfileName(e.target.value)}
/> />
...@@ -99,6 +100,7 @@ const AddProfile = () => { ...@@ -99,6 +100,7 @@ const AddProfile = () => {
required required
placeholder="Mã code" placeholder="Mã code"
type="text" type="text"
className="text-dark"
value={profileCode} value={profileCode}
onChange={(e) => setProfileCode(e.target.value)} onChange={(e) => setProfileCode(e.target.value)}
/> />
...@@ -106,7 +108,7 @@ const AddProfile = () => { ...@@ -106,7 +108,7 @@ const AddProfile = () => {
</FormGroup> </FormGroup>
<FormGroup className="mb-4"> <FormGroup className="mb-4">
<Label for="phone_number" >S đin thoi</Label> <Label for="phone_number" >S đin thoi</Label>
<InputGroup className="input-group-alternative mb-4"> <InputGroup className="mb-4">
<InputGroupAddon addonType="prepend"> <InputGroupAddon addonType="prepend">
<InputGroupText> <InputGroupText>
<i className="fa fa-phone" /> <i className="fa fa-phone" />
...@@ -115,11 +117,12 @@ const AddProfile = () => { ...@@ -115,11 +117,12 @@ const AddProfile = () => {
<Input <Input
placeholder="Số điện thoại" placeholder="Số điện thoại"
type={phoneNumber ? "text" : "number"} type={phoneNumber ? "text" : "number"}
className="text-dark"
value={phoneNumber} value={phoneNumber}
onChange={(e) => setPhoneNumber(e.target.value)} onChange={(e) => setPhoneNumber(e.target.value)}
invalid={validPhoneNumber} invalid={validPhoneNumber}
/> />
<FormFeedback invalid>{validPhoneNumber ? "Phải có 10 chữ số bắt đầu bằng chữ số 0" : false}</FormFeedback> <FormFeedback invalid>{validPhoneNumber ? "Phải có 10 chữ số bắt đầu bằng chữ số 0" : ""}</FormFeedback>
</InputGroup> </InputGroup>
</FormGroup> </FormGroup>
<FormGroup className="mb-4"> <FormGroup className="mb-4">
...@@ -128,6 +131,7 @@ const AddProfile = () => { ...@@ -128,6 +131,7 @@ const AddProfile = () => {
<Input <Input
placeholder="Địa chỉ" placeholder="Địa chỉ"
type="textarea" type="textarea"
className="text-dark"
value={profileAddress} value={profileAddress}
onChange={(e) => setProfileAddress(e.target.value)} onChange={(e) => setProfileAddress(e.target.value)}
/> />
...@@ -135,7 +139,7 @@ const AddProfile = () => { ...@@ -135,7 +139,7 @@ const AddProfile = () => {
</FormGroup> </FormGroup>
<FormGroup row> <FormGroup row>
<Col sm={10}> <Col sm={10}>
<Input type="file" name="file" id="file-logo" /> <Input type="file" name="file" id="file-logo" className="w-auto" />
<FormText color="muted"> <FormText color="muted">
La chn logo công ty La chn logo công ty
</FormText> </FormText>
...@@ -146,7 +150,7 @@ const AddProfile = () => { ...@@ -146,7 +150,7 @@ const AddProfile = () => {
</div> </div>
<div className="d-flex justify-content-between mt-3"> <div className="d-flex justify-content-between mt-3">
<Button <Button
color="info" color="secondary"
type="button" type="button"
className="btn-1" className="btn-1"
onClick={onHandleBack} onClick={onHandleBack}
......
...@@ -31,7 +31,7 @@ const DetailProfile = (props) => { ...@@ -31,7 +31,7 @@ const DetailProfile = (props) => {
{listData && listData.length > 0 ? {listData && listData.length > 0 ?
listData.map(data => { listData.map(data => {
return ( return (
<Container> <Container key={data.id}>
<Row className="row-grid align-items-center"> <Row className="row-grid align-items-center">
<Col md={6} > <Col md={6} >
<div className="d-flex justify-content-center"> <div className="d-flex justify-content-center">
...@@ -75,7 +75,7 @@ const DetailProfile = (props) => { ...@@ -75,7 +75,7 @@ const DetailProfile = (props) => {
}); });
} }
return ( return (
<Col lg={6} md={12} className="my-3"> <Col lg={6} md={12} className="my-3" key={product.product_id}>
<Card className="w-100 h-100 hover-shadow" onClick={onHandleTraceCode}> <Card className="w-100 h-100 hover-shadow" onClick={onHandleTraceCode}>
<CardHeader className="h5 mb-3">{product.name}</CardHeader> <CardHeader className="h5 mb-3">{product.name}</CardHeader>
<CardBody> <CardBody>
......
...@@ -53,7 +53,7 @@ const SearchProfile = (props) => { ...@@ -53,7 +53,7 @@ const SearchProfile = (props) => {
<MainBanner /> <MainBanner />
<section className="section pb-0 section-components"> <section className="section pb-0 section-components">
<Container className="mb-5"> <Container className="mb-5">
<h3 className="h4 text-success mb-4 font-weight-bold text-center">Tra cu thông tin doanh nghip</h3> <h3 className="h4 text-primary mb-4 font-weight-bold text-center">Tra cu thông tin doanh nghip</h3>
<Form className="justify-content-center" onSubmit={onHandleSearch}> <Form className="justify-content-center" onSubmit={onHandleSearch}>
<FormGroup> <FormGroup>
<InputGroup className="mb-4"> <InputGroup className="mb-4">
......
...@@ -122,7 +122,7 @@ const Tracecode = () => { ...@@ -122,7 +122,7 @@ const Tracecode = () => {
<TabPane tabId="plainTabs2"> <TabPane tabId="plainTabs2">
<div className="description"> <div className="description">
{product.product_chain_diary.map(diary => ( {product.product_chain_diary.map(diary => (
<div> <div key={diary.id}>
<div className="h5 font-weight-bold mt-3">{diary.company}</div> <div className="h5 font-weight-bold mt-3">{diary.company}</div>
<Row className="h6 mb-3"> <Row className="h6 mb-3">
<Col xs={4}>{formatDateTime(diary.date)}</Col> <Col xs={4}>{formatDateTime(diary.date)}</Col>
...@@ -137,7 +137,7 @@ const Tracecode = () => { ...@@ -137,7 +137,7 @@ const Tracecode = () => {
<div className="description"> <div className="description">
<Row> <Row>
{product.product_certification.map((certificate) => ( {product.product_certification.map((certificate) => (
<Col xs={4}> <Col xs={4} key={certificate.id}>
<img src={window.location.origin + certificate.image} alt="certificate" height="250px" /> <img src={window.location.origin + certificate.image} alt="certificate" height="250px" />
<div className="h5 mt-3 mb-3 font-weight-bold">{certificate.certification_information}</div> <div className="h5 mt-3 mb-3 font-weight-bold">{certificate.certification_information}</div>
</Col> </Col>
......
...@@ -111,7 +111,7 @@ export default () => { ...@@ -111,7 +111,7 @@ export default () => {
value={email} value={email}
onChange={(e) => setEmail(e.target.value)} onChange={(e) => setEmail(e.target.value)}
invalid={validEmail} /> invalid={validEmail} />
<FormFeedback className="bg-transparent shadow-0">{validEmail ? "Không đúng định dạng email" : false}</FormFeedback> <FormFeedback className="bg-transparent shadow-0">{validEmail === true ? "Không đúng định dạng email" : ""}</FormFeedback>
</InputGroup> </InputGroup>
</FormGroup> </FormGroup>
<div className="text-center"> <div className="text-center">
......
...@@ -149,7 +149,7 @@ export default () => { ...@@ -149,7 +149,7 @@ export default () => {
onChange={(e) => setConfirmPassword(e.target.value)} onChange={(e) => setConfirmPassword(e.target.value)}
invalid={checkPassword} invalid={checkPassword}
/> />
<FormFeedback>{checkPassword ? "Please input match password" : false}</FormFeedback> <FormFeedback>{checkPassword === true ? "Please input match password" : ""}</FormFeedback>
</InputGroup> </InputGroup>
</FormGroup> </FormGroup>
<div className="text-center"> <div className="text-center">
......
...@@ -136,7 +136,7 @@ export default () => { ...@@ -136,7 +136,7 @@ export default () => {
onChange={(e) => setEmail(e.target.value)} onChange={(e) => setEmail(e.target.value)}
invalid={validEmail} invalid={validEmail}
/> />
<FormFeedback className="bg-transparent shadow-0">{validEmail ? "Không đúng định dạng email" : ""}</FormFeedback> <FormFeedback className="bg-transparent shadow-0">{validEmail === true ? "Không đúng định dạng email" : ""}</FormFeedback>
</InputGroup> </InputGroup>
</FormGroup> </FormGroup>
<FormGroup id="password"> <FormGroup id="password">
......
...@@ -125,7 +125,7 @@ export default () => { ...@@ -125,7 +125,7 @@ export default () => {
value={email} value={email}
onChange={(e) => setEmail(e.target.value)} onChange={(e) => setEmail(e.target.value)}
invalid={validEmail} /> invalid={validEmail} />
<FormFeedback className="bg-transparent shadow-0">{validEmail ? "Không đúng định dạng email" : false}</FormFeedback> <FormFeedback className="bg-transparent shadow-0">{validEmail === true ? "Không đúng định dạng email" : ""}</FormFeedback>
</InputGroup> </InputGroup>
</FormGroup> </FormGroup>
...@@ -145,7 +145,7 @@ export default () => { ...@@ -145,7 +145,7 @@ export default () => {
onChange={(e) => setPassword(e.target.value)} onChange={(e) => setPassword(e.target.value)}
invalid={checkPassword} invalid={checkPassword}
/> />
<FormFeedback>{checkPassword ? "Mật khẩu không trùng nhau" : false}</FormFeedback> <FormFeedback>{checkPassword === true ? "Mật khẩu không trùng nhau" : ""}</FormFeedback>
</InputGroup> </InputGroup>
</FormGroup> </FormGroup>
...@@ -166,7 +166,7 @@ export default () => { ...@@ -166,7 +166,7 @@ export default () => {
onChange={(e) => setConfirmPassword(e.target.value)} onChange={(e) => setConfirmPassword(e.target.value)}
invalid={checkPassword} invalid={checkPassword}
/> />
<FormFeedback>{checkPassword ? "Mật khẩu không trùng nhau" : false}</FormFeedback> <FormFeedback>{checkPassword === true ? "Mật khẩu không trùng nhau" : ""}</FormFeedback>
</InputGroup> </InputGroup>
</FormGroup> </FormGroup>
<div className="text-center"> <div className="text-center">
......
...@@ -185,7 +185,6 @@ export const ProfileTable = (props) => { ...@@ -185,7 +185,6 @@ export const ProfileTable = (props) => {
export const ProductTable = (props) => { export const ProductTable = (props) => {
const history = useHistory(); const history = useHistory();
// const dispatch = useDispatch(); // const dispatch = useDispatch();
console.log("props", props);
const onHandleClickEdit = (productId) => { const onHandleClickEdit = (productId) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment