Alex Cheung hace 1 año
padre
commit
37a6b1f9e9
Se han modificado 6 ficheros con 429 adiciones y 316 borrados
  1. +328
    -297
      src/layout/MainLayout/Header/index.js
  2. +3
    -1
      src/pages/Payment/index.js
  3. +87
    -16
      src/pages/User/ChangePasswordPage/index.js
  4. +3
    -0
      src/translations/en.json
  5. +4
    -1
      src/translations/zh-CN.json
  6. +4
    -1
      src/translations/zh-HK.json

+ 328
- 297
src/layout/MainLayout/Header/index.js Ver fichero

@@ -47,6 +47,7 @@ import {
isPrimaryLoggedIn,
isCreditorLoggedIn,
isINDLoggedIn,
isPasswordExpiry,
// isORGLoggedIn,
// getUserId
} from "utils/Utils";
@@ -84,120 +85,179 @@ function Header(props) {
const loginContent = (
isGLDLoggedIn() ?
<div id="adminContent">
<li>
<Link className="dashboard" to='/dashboard'>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} >
Dashboard
</Typography>
</Link>
</li>
<li>
<Link className="application" to='/application/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Application</Typography></Link>
</li>
{
isGrantedAny(["VIEW_PROOF", "MAINTAIN_PROOF"]) ?
{isPasswordExpiry()?
<div id="passwordExpiryedContent">
<li>
<Link className="proof" to='/proof/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Proof</Typography></Link>
<Link className="manageUser" to={'/user/changePassword'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userChangePassword" />
</Typography>
</Link>
</li>
</div>
:
<div id="adminContentList">
<li>
<Link className="dashboard" to='/dashboard'>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} >
Dashboard
</Typography>
</Link>
</li>
: <></>
}

{
isGrantedAny(["MAINTAIN_PAYMENT", "MAINTAIN_RECON", "VIEW_DEMANDNOTE", "MAINTAIN_DEMANDNOTE"]) ?
<li>
<Link className="paymentTop" ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Payment</Typography><KeyboardArrowDownIcon sx={{ fontSize: '1vw' }} /></Link>
<ul className='dropdown'>
{
isGranted("MAINTAIN_DEMANDNOTE") ?
<li>
<Link className="exportDemandNote" to='/paymentPage/exportGDN' ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Export for GDN</Typography></Link>
</li>
:
<></>
}
<Link className="application" to='/application/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Application</Typography></Link>
</li>
{
isGrantedAny(["VIEW_PROOF", "MAINTAIN_PROOF"]) ?
<li>
<Link className="proof" to='/proof/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Proof</Typography></Link>
</li>
: <></>
}

{
isGranted("MAINTAIN_PAYMENT") ?
<li>
<Link className="application" to='/application/markAsPaid/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Mark Payment</Typography></Link>
</li>
:
<></>
}
{
isGrantedAny(["MAINTAIN_PAYMENT", "MAINTAIN_RECON", "VIEW_DEMANDNOTE", "MAINTAIN_DEMANDNOTE"]) ?
<li>
<Link className="paymentTop" ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Payment</Typography><KeyboardArrowDownIcon sx={{ fontSize: '1vw' }} /></Link>
<ul className='dropdown'>
{
isGranted("MAINTAIN_DEMANDNOTE") ?
<li>
<Link className="exportDemandNote" to='/paymentPage/exportGDN' ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Export for GDN</Typography></Link>
</li>
:
<></>
}

{
isGranted("MAINTAIN_PAYMENT") ?
<li>
<Link className="payment" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Online Payment Record</Typography></Link>
</li>
:
<></>
}
{
isGranted("MAINTAIN_RECON") ?
<>
<li>
<Link className="downloadXML" to='/gfmis/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>GFMIS Generate XML</Typography></Link>
</li>
</>
{
isGranted("MAINTAIN_PAYMENT") ?
<li>
<Link className="application" to='/application/markAsPaid/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Mark Payment</Typography></Link>
</li>
:
<></>
}

:
<></>
}
{
isGranted("MAINTAIN_PAYMENT") ?
<li>
<Link className="payment" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Online Payment Record</Typography></Link>
</li>
:
<></>
}
{
isGranted("MAINTAIN_RECON") ?
<>
<li>
<Link className="downloadXML" to='/gfmis/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>GFMIS Generate XML</Typography></Link>
</li>
</>

{
isGranted("MAINTAIN_DEMANDNOTE") ?
<li>
<Link className="createDemandNote" to='/paymentPage/createDemandNote' ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Create Demand Note</Typography></Link>
</li>
:
<></>
}
:
<></>
}

{
isGrantedAny(["VIEW_DEMANDNOTE", "MAINTAIN_DEMANDNOTE"]) ?
<li>
<Link className="demandNote" to='/paymentPage/demandNote' ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Demand Note</Typography></Link>
</li>
:
<></>
}
{
isGranted("MAINTAIN_RECON") ?
<>
<li>
<Link className="reconReport" to='/paymentPage/reconReport'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Recon Report</Typography></Link>
</li>
</>
{
isGranted("MAINTAIN_DEMANDNOTE") ?
<li>
<Link className="createDemandNote" to='/paymentPage/createDemandNote' ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Create Demand Note</Typography></Link>
</li>
:
<></>
}
{
isGrantedAny(["VIEW_DEMANDNOTE", "MAINTAIN_DEMANDNOTE"]) ?
<li>
<Link className="demandNote" to='/paymentPage/demandNote' ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Demand Note</Typography></Link>
</li>
:
<></>
}
{
isGranted("MAINTAIN_RECON") ?
<>
<li>
<Link className="reconReport" to='/paymentPage/reconReport'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Recon Report</Typography></Link>
</li>
</>

:
<></>
}
:
<></>
}
</ul>
</li>
:
<></>
}

</ul>
</li>
:
<></>
}
{
isGrantedAny(["VIEW_USER", "MAINTAIN_USER", "VIEW_ORG", "MAINTAIN_ORG", "VIEW_GROUP", "MAINTAIN_GROUP"]) ?
<li>
<Link className="client" ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Client</Typography><KeyboardArrowDownIcon sx={{ fontSize: '1vw' }} /></Link>
<ul className='dropdown'>
{
isGrantedAny(["VIEW_USER", "MAINTAIN_USER"]) ?
<>
<li>
<Link className="userSearchview" to='/userSearchview'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (GLD)</Typography></Link>
</li>
<li>
<Link className="indUser" to='/indUser'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (Individual)</Typography></Link>
</li>
<li>
<Link className="orgUser" to='/orgUser'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (Organisation)</Typography></Link>
</li>
</>
:
<></>
}

{
isGrantedAny(["VIEW_ORG", "MAINTAIN_ORG"]) ?
<li>
<Link className="org" to='/org'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Organisation</Typography></Link>
</li>
:
<></>
}

{
isGrantedAny(["VIEW_GROUP", "MAINTAIN_GROUP"]) ?
<li>
<Link className="usergroupSearchview" to='/usergroupSearchview'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>User Group</Typography></Link>
</li>
:
<></>
}

{
isGrantedAny(["VIEW_USER", "MAINTAIN_USER", "VIEW_ORG", "MAINTAIN_ORG", "VIEW_GROUP", "MAINTAIN_GROUP"]) ?
</ul>
</li>
:
<></>
}
<li>
<Link className="client" ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Client</Typography><KeyboardArrowDownIcon sx={{ fontSize: '1vw' }} /></Link>
<Link className="setting" ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Settings</Typography><KeyboardArrowDownIcon sx={{ fontSize: '1vw' }} /></Link>
<ul className='dropdown'>
<li>
<Link className="userProfileGld" to='/user/profile'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>My Profile</Typography></Link>
</li>
<li>
<Link className="manageUser" to={'/user/changePassword'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userChangePassword" />
</Typography>
</Link>
</li>
{
isGrantedAny(["VIEW_USER", "MAINTAIN_USER"]) ?
isGranted("MAINTAIN_GAZETTE_ISSUE") ?
<>
<li>
<Link className="userSearchview" to='/userSearchview'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (GLD)</Typography></Link>
</li>
<li>
<Link className="indUser" to='/indUser'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (Individual)</Typography></Link>
<Link className="holidaySetting" to='/setting/holiday'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Holiday Settings</Typography></Link>
</li>
<li>
<Link className="orgUser" to='/orgUser'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (Organisation)</Typography></Link>
<Link className="gazetteissueSetting" to='/setting/gazetteissuepage'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Gazette Issues</Typography></Link>
</li>
</>
:
@@ -205,238 +265,209 @@ function Header(props) {
}

{
isGrantedAny(["VIEW_ORG", "MAINTAIN_ORG"]) ?
isGranted("MAINTAIN_ANNOUNCEMENT") ?
<li>
<Link className="org" to='/org'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Organisation</Typography></Link>
<Link className="announcement" to='/setting/announcement'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Announcement</Typography></Link>
</li>
:
<></>
}

{isGranted("MAINTAIN_EMAIL") ?
<li>
<Link className="emailTemplate" to='/setting/emailTemplate'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Email Template</Typography></Link>
</li>
:
<></>
}

{
isGrantedAny(["VIEW_GROUP", "MAINTAIN_GROUP"]) ?
isGranted("MAINTAIN_DR") ?
<li>
<Link className="usergroupSearchview" to='/usergroupSearchview'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>User Group</Typography></Link>
<Link className="drImport" to='/setting/drImport'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>DR Import</Typography></Link>
</li>
:
<></>
}

</ul>
</li>
:
<></>
}


<li>
<Link className="setting" ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Settings</Typography><KeyboardArrowDownIcon sx={{ fontSize: '1vw' }} /></Link>
<ul className='dropdown'>
<li>
<Link className="userProfileGld" to='/user/profile'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>My Profile</Typography></Link>
</li>
{
isGranted("MAINTAIN_GAZETTE_ISSUE") ?
<>
<li>
<Link className="holidaySetting" to='/setting/holiday'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Holiday Settings</Typography></Link>
</li>
<li>
<Link className="gazetteissueSetting" to='/setting/gazetteissuepage'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Gazette Issues</Typography></Link>
</li>
</>
:
<></>
}
{
isGranted("MAINTAIN_SETTING") ?
<li>
<Link className="systemSetting" to='/setting/sys'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>System Settings</Typography></Link>
</li>
:
<></>
}

{
isGranted("MAINTAIN_ANNOUNCEMENT") ?
<li>
<Link className="announcement" to='/setting/announcement'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Announcement</Typography></Link>
<Link className="auditLogSetting" to='/setting/auditLog'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Audit Log</Typography></Link>
</li>
:
<></>
}

{isGranted("MAINTAIN_EMAIL") ?
</ul>
</li>
<Box sx={{ display: { xs: 'none', sm: 'none', md: 'block' } }}>
<li>
<Link className="emailTemplate" to='/setting/emailTemplate'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Email Template</Typography></Link>
<Link className="logout" onClick={handleLogout}><Typography variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>Logout</Typography></Link>
</li>
:
<></>
}

{
isGranted("MAINTAIN_DR") ?
<li>
<Link className="drImport" to='/setting/drImport'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>DR Import</Typography></Link>
</li>
:
<></>
}

{
isGranted("MAINTAIN_SETTING") ?
<li>
<Link className="systemSetting" to='/setting/sys'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>System Settings</Typography></Link>
</li>
:
<></>
}

<li>
<Link className="auditLogSetting" to='/setting/auditLog'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Audit Log</Typography></Link>
</li>
</ul>
</li>
<Box sx={{ display: { xs: 'none', sm: 'none', md: 'block' } }}>
<li>
<Link className="logout" onClick={handleLogout}><Typography variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>Logout</Typography></Link>
</li>
</Box>
</Box>
</div>
}
</div>
:
<div id="individualUserContent">
<li>
<Link className="dashboard" to='/dashboard'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="mainPage" />
</Typography></Link>
</li>
<li>
<Link className="myDocumet" to='/publicNotice'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="myPublicNotice" />
</Typography></Link>
</li>
<li>
<Link className="documentRecord" to='/proof/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="proofRecord" />
</Typography></Link>
</li>
<li>
{isCreditorLoggedIn() ?
<>
<Link className="paymentRecord">
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="paymentHistory" />
</Typography>
<KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} />
</Link>
<ul className='dropdown'>
<li>
<Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="onlinePaymentHistory" />
</Typography></Link>
</li>
<li>
<Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="paymentInfoRecord" />
</Typography></Link>
</li>
</ul>
</>
:
<Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="onlinePaymentHistory" />
</Typography></Link>
}
</li>
<li>

{isPrimaryLoggedIn() ?
<>
<Link className="userSetting" >
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} onClick={(event) => console.log(event)}>
<FormattedMessage id="setting" />
{isPasswordExpiry()?
<div id="passwordExpiryedContent">
<li>
<Link className="manageUser" to={'/user/changePassword'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userChangePassword" />
</Typography>
<KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} />
</Link>
<ul className='dropdown' style={{ width: "max-content" }}>
<li>
<Link className="manageOrgUser" to='setting/manageUser'>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="companyOrUserRecord" />
</Typography>
</Link>
</li>
<li>
<Link className="manageUser" to={'/orgUser'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
{/* <FormattedMessage id="companyOrUserRecord" /> */}
<FormattedMessage id="userProfile" />
</Typography>
</Link>
</li>
<li>
<Link className="manageUser" to={'/user/changePassword'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userChangePassword" />
</li>
</div>
:
<div id="individualUserContentList">
<li>
<Link className="dashboard" to='/dashboard'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="mainPage" />
</Typography></Link>
</li>
<li>
<Link className="myDocumet" to='/publicNotice'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="myPublicNotice" />
</Typography></Link>
</li>
<li>
<Link className="documentRecord" to='/proof/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="proofRecord" />
</Typography></Link>
</li>
<li>
{isCreditorLoggedIn() ?
<>
<Link className="paymentRecord">
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="paymentHistory" />
</Typography>
<KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} />
</Link>
</li>
<li>
<Link className="manageUser" to={'/org'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
{/* <FormattedMessage id="companyOrUserRecord" /> */}
<FormattedMessage id="organizationProfile" />
<ul className='dropdown'>
<li>
<Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="onlinePaymentHistory" />
</Typography></Link>
</li>
<li>
<Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="paymentInfoRecord" />
</Typography></Link>
</li>
</ul>
</>
:
<Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>
<FormattedMessage id="onlinePaymentHistory" />
</Typography></Link>
}
</li>
<li>

{isPrimaryLoggedIn() ?
<>
<Link className="userSetting" >
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} onClick={(event) => console.log(event)}>
<FormattedMessage id="setting" />
</Typography>
<KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} />
</Link>
</li>
</ul>
</>
:
isINDLoggedIn() ?
<>
<Link className="userSetting" >
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} onClick={(event) => console.log(event)}>
<FormattedMessage id="setting" />
</Typography>
<KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} />
</Link>
<ul className='dropdown' style={{ width: "max-content" }}>
<li>
<Link className="manageUser" to={'/indUser'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
{/* <FormattedMessage id="companyOrUserRecord" /> */}
<FormattedMessage id="userProfile" />
</Typography>
</Link>
</li>
<li>
<Link className="manageUser" to={'/user/changePassword'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userChangePassword" />
</Typography>
</Link>
</li>
</ul>
</>
:
<>
<Link className="userSetting" >
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} onClick={(event) => console.log(event)}>
<FormattedMessage id="setting" />
</Typography>
<KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} />
</Link>
<ul className='dropdown' style={{ width: "max-content" }}>
<li>
<Link className="manageUser" to={'/orgUser'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userProfile" />
<ul className='dropdown' style={{ width: "max-content" }}>
<li>
<Link className="manageOrgUser" to='setting/manageUser'>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="companyOrUserRecord" />
</Typography>
</Link>
</li>
<li>
<Link className="manageUser" to={'/orgUser'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
{/* <FormattedMessage id="companyOrUserRecord" /> */}
<FormattedMessage id="userProfile" />
</Typography>
</Link>
</li>
<li>
<Link className="manageUser" to={'/user/changePassword'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userChangePassword" />
</Typography>
</Link>
</li>
<li>
<Link className="manageUser" to={'/org'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
{/* <FormattedMessage id="companyOrUserRecord" /> */}
<FormattedMessage id="organizationProfile" />
</Typography>
</Link>
</li>
</ul>
</>
:
isINDLoggedIn() ?
<>
<Link className="userSetting" >
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} onClick={(event) => console.log(event)}>
<FormattedMessage id="setting" />
</Typography>
<KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} />
</Link>
</li>
<li>
<Link className="manageUser" to={'/user/changePassword'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userChangePassword" />
<ul className='dropdown' style={{ width: "max-content" }}>
<li>
<Link className="manageUser" to={'/indUser'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
{/* <FormattedMessage id="companyOrUserRecord" /> */}
<FormattedMessage id="userProfile" />
</Typography>
</Link>
</li>
<li>
<Link className="manageUser" to={'/user/changePassword'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userChangePassword" />
</Typography>
</Link>
</li>
</ul>
</>
:
<>
<Link className="userSetting" >
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }} onClick={(event) => console.log(event)}>
<FormattedMessage id="setting" />
</Typography>
<KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} />
</Link>
</li>
</ul>
</>
}
</li>
<ul className='dropdown' style={{ width: "max-content" }}>
<li>
<Link className="manageUser" to={'/orgUser'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userProfile" />
</Typography>
</Link>
</li>
<li>
<Link className="manageUser" to={'/user/changePassword'}>
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>
<FormattedMessage id="userChangePassword" />
</Typography>
</Link>
</li>
</ul>
</>
}
</li>
</div>
}
<Box sx={{ display: { xs: 'none', sm: 'none', md: 'block' } }}>
<li>
<Link className="logout" onClick={handleLogout}><Typography variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>


+ 3
- 1
src/pages/Payment/index.js Ver fichero

@@ -520,7 +520,9 @@ const Index = () => {
}}
>
<DialogTitle></DialogTitle>
<Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography>
<Typography variant="h2" style={{ padding: '16px' }}>
<FormattedMessage id ="MSG.actionFail"/>
</Typography>
<DialogContent style={{ display: 'flex', }}>
<Stack direction="column" justifyContent="space-between">
{


+ 87
- 16
src/pages/User/ChangePasswordPage/index.js Ver fichero

@@ -10,9 +10,9 @@ import {
Typography,
Button,
// RadioGroup,
// Dialog, DialogTitle, DialogContent, DialogActions,
Dialog, DialogTitle, DialogContent, DialogActions,
Stack,
InputLabel,
// InputLabel,
// OutlinedInput,
FormHelperText,
TextField,
@@ -44,6 +44,10 @@ const Index = () => {
const [showConfirmPassword, setshowConfirmPassword] = React.useState(false);
const [isLoading, setLoding] = React.useState(true);
const [isChanged, setIsChanged] = React.useState(false);
const [comfirmChangeMessage, setComfirmChangeMessage] = React.useState(false);
const [expiryErr, setExpiryErr] = React.useState(false);
const [expiryErrText, setExpiryErrText] = React.useState("");
const [changePasswordValues, setChangePasswordValues] = React.useState();

const intl = useIntl();
@@ -52,7 +56,8 @@ const Index = () => {
}, []);

const goLogin = (values) =>{
console.log(values)
// console.log(values)
setComfirmChangeMessage(false)
HttpUtils.post({
url: UrlUtils.PATCH_CHANGE_PASSWORD,
params:{
@@ -64,6 +69,8 @@ const Index = () => {
},
onError:function (error) {
console.log(error.response.data);
setExpiryErrText(intl.formatMessage({ id: error.response.data.error }))
setExpiryErr(true)
// window.location.assign("/iamsmart/loginFail");
}
});
@@ -143,7 +150,8 @@ const Index = () => {
}),
onSubmit: values => {
// console.log(values)
goLogin(values)
setChangePasswordValues(values)
setComfirmChangeMessage(true)
}
});

@@ -184,21 +192,16 @@ const Index = () => {
<form onSubmit={formik.handleSubmit}>
<Grid container spacing={4} sx={{ minHeight: {xs:"80vh", sm:"50vh", md: "50vh", lg:"70vh", xl:"50vh"} }} direction="column" justifyContent="flex-start" alignItems="center">
{isPasswordExpiry()?
<Grid container direction="column" alignItems="center">
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5, }}>
<Typography display="inline" variant="h4">
<FormattedMessage id="passwordExpired"/>
</Typography>
</Grid>
<Grid item width="70%" xs={12} md={12} lg={12} sx={{ mb: 1, }}>
<Typography variant="h5">
<FormattedMessage id="passwordExpired"/>
</Typography>
</Grid>
:
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1,}}>
<InputLabel htmlFor="email-login-title3">
<Typography variant="h5" >
<FormattedMessage id="setNewPassword"/>
</Typography>
</InputLabel>
<Typography variant="h5" >
<FormattedMessage id="setNewPassword"/>
</Typography>
</Grid>
}
<Grid item xs={12} md={12} lg={12} width={{xs:"70%", sm:"60%",md:"50%", lg:"50%"}}>
@@ -373,6 +376,74 @@ const Index = () => {
</ThemeProvider>
</Grid>
</Grid>
<div>
<Dialog
open={comfirmChangeMessage}
onClose={() => setComfirmChangeMessage(false)}
PaperProps={{
sx: {
minWidth: '40vw',
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
}
}}
>
<DialogTitle></DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Stack direction="column" justifyContent="space-between">
<Typography variant="h5" style={{ padding: '10px' }}>
<FormattedMessage id ="changePasswordConfirm"/>
</Typography>
</Stack>
</DialogContent>
<DialogActions>
<Button onClick={() => setComfirmChangeMessage(false)}>
<Typography variant="h5">
<FormattedMessage id="close"/>
</Typography>
</Button>
<Button onClick={() => goLogin(changePasswordValues)}>
<Typography variant="h5">
<FormattedMessage id="confirm"/>
</Typography>
</Button>
</DialogActions>
</Dialog>

<Dialog
open={expiryErr}
onClose={() => setExpiryErr(false)}
PaperProps={{
sx: {
minWidth: '40vw',
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
}
}}
>
<DialogTitle>
<Typography variant="h5" style={{ padding: '10px' }}>
<FormattedMessage id ="MSG.actionFail"/>
</Typography>
</DialogTitle>
<DialogContent style={{ display: 'flex', }}>
<Stack direction="column" justifyContent="space-between">
<Typography variant="h5">
{
expiryErrText
}
</Typography>
</Stack>
</DialogContent>
<DialogActions>
<Button onClick={() => setExpiryErr(false)}>
<Typography variant="h5">
<FormattedMessage id="close"/>
</Typography>
</Button>
</DialogActions>
</Dialog>
</div>
</form>
:
<Grid container spacing={4} sx={{ minHeight: {xs:"80vh", sm:"70vh", md: "70vh", lg:"70vh", xl:"50vh"} }} direction="column" justifyContent="flex-start" alignItems="center">


+ 3
- 0
src/translations/en.json Ver fichero

@@ -312,6 +312,9 @@
"requireIdDocNumber": "Please enter the document ID",
"requiredNumberInQuote": "Please enter the numbers or letters in brackets",
"sameAsYourIdDoc": "Same as your ID document",
"passwordReused": "Old password is not allow to be reused.",
"changePasswordConfirm": "Confirm Change Password",
"passwordWrong": "Old password is not correct.",

"pwRemark1": "At least 8 characters, the more characters the better",
"pwRemark2": "A mix of letters and numbers",


+ 4
- 1
src/translations/zh-CN.json Ver fichero

@@ -334,7 +334,10 @@
"requireIdDocNumber": "请输入证件号码",
"requiredNumberInQuote": "请输入括号内的数字或字母",
"sameAsYourIdDoc": "与你的身份证明文件相同",

"passwordReused": "旧密码不允许重复使用。",
"changePasswordConfirm": "确认修改密码",
"passwordWrong": "旧密码不正确。",
"pwRemark1": "至少8个字元,字元越多越好",
"pwRemark2": "字母和数字的混合",
"pwRemark3": "英文字母大写与小写的混合",


+ 4
- 1
src/translations/zh-HK.json Ver fichero

@@ -337,7 +337,10 @@
"requireIdDocNumber": "請輸入證件號碼",
"requiredNumberInQuote": "請輸入括號內的數字或字母",
"sameAsYourIdDoc": "與你的身份證明文件相同",

"passwordReused": "舊密碼不允許重複使用。",
"changePasswordConfirm": "確認更改密碼",
"passwordWrong": "舊密碼不正確。",
"pwRemark1": "至少8個字元,字元越多越好",
"pwRemark2": "字母和數字的混合",
"pwRemark3": "英文字母大寫與小寫的混合",


Cargando…
Cancelar
Guardar