diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 7368db5..955ea10 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -47,6 +47,7 @@ import { isPrimaryLoggedIn, isCreditorLoggedIn, isINDLoggedIn, + isPasswordExpiry, // isORGLoggedIn, // getUserId } from "utils/Utils"; @@ -84,120 +85,179 @@ function Header(props) { const loginContent = ( isGLDLoggedIn() ?
-
  • - - - Dashboard - - -
  • -
  • - Application -
  • - { - isGrantedAny(["VIEW_PROOF", "MAINTAIN_PROOF"]) ? + {isPasswordExpiry()? +
  • - Proof + + + + + +
  • +
    + : +
    +
  • + + + Dashboard + +
  • - : <> - } - - { - isGrantedAny(["MAINTAIN_PAYMENT", "MAINTAIN_RECON", "VIEW_DEMANDNOTE", "MAINTAIN_DEMANDNOTE"]) ?
  • - Payment -
      - { - isGranted("MAINTAIN_DEMANDNOTE") ? -
    • - Export for GDN -
    • - : - <> - } + Application + + { + isGrantedAny(["VIEW_PROOF", "MAINTAIN_PROOF"]) ? +
    • + Proof +
    • + : <> + } - { - isGranted("MAINTAIN_PAYMENT") ? -
    • - Mark Payment -
    • - : - <> - } + { + isGrantedAny(["MAINTAIN_PAYMENT", "MAINTAIN_RECON", "VIEW_DEMANDNOTE", "MAINTAIN_DEMANDNOTE"]) ? +
    • + Payment +
        + { + isGranted("MAINTAIN_DEMANDNOTE") ? +
      • + Export for GDN +
      • + : + <> + } - { - isGranted("MAINTAIN_PAYMENT") ? -
      • - Online Payment Record -
      • - : - <> - } - - { - isGranted("MAINTAIN_RECON") ? - <> -
      • - GFMIS Generate XML -
      • - + { + isGranted("MAINTAIN_PAYMENT") ? +
      • + Mark Payment +
      • + : + <> + } - : - <> - } + { + isGranted("MAINTAIN_PAYMENT") ? +
      • + Online Payment Record +
      • + : + <> + } + + { + isGranted("MAINTAIN_RECON") ? + <> +
      • + GFMIS Generate XML +
      • + - { - isGranted("MAINTAIN_DEMANDNOTE") ? -
      • - Create Demand Note -
      • - : - <> - } + : + <> + } - { - isGrantedAny(["VIEW_DEMANDNOTE", "MAINTAIN_DEMANDNOTE"]) ? -
      • - Demand Note -
      • - : - <> - } -{ - isGranted("MAINTAIN_RECON") ? - <> -
      • - Recon Report -
      • - + { + isGranted("MAINTAIN_DEMANDNOTE") ? +
      • + Create Demand Note +
      • + : + <> + } + { + isGrantedAny(["VIEW_DEMANDNOTE", "MAINTAIN_DEMANDNOTE"]) ? +
      • + Demand Note +
      • + : + <> + } + { + isGranted("MAINTAIN_RECON") ? + <> +
      • + Recon Report +
      • + - : - <> - } - + : + <> + } +
      +
    • + : + <> + } -
    -
  • - : - <> - } + { + isGrantedAny(["VIEW_USER", "MAINTAIN_USER", "VIEW_ORG", "MAINTAIN_ORG", "VIEW_GROUP", "MAINTAIN_GROUP"]) ? +
  • + Client +
      + { + isGrantedAny(["VIEW_USER", "MAINTAIN_USER"]) ? + <> +
    • + Users (GLD) +
    • +
    • + Users (Individual) +
    • +
    • + Users (Organisation) +
    • + + : + <> + } + + { + isGrantedAny(["VIEW_ORG", "MAINTAIN_ORG"]) ? +
    • + Organisation +
    • + : + <> + } + + { + isGrantedAny(["VIEW_GROUP", "MAINTAIN_GROUP"]) ? +
    • + User Group +
    • + : + <> + } - { - isGrantedAny(["VIEW_USER", "MAINTAIN_USER", "VIEW_ORG", "MAINTAIN_ORG", "VIEW_GROUP", "MAINTAIN_GROUP"]) ? +
    +
  • + : + <> + }
  • - Client + Settings
      +
    • + My Profile +
    • +
    • + + + + + +
    • { - isGrantedAny(["VIEW_USER", "MAINTAIN_USER"]) ? + isGranted("MAINTAIN_GAZETTE_ISSUE") ? <>
    • - Users (GLD) -
    • -
    • - Users (Individual) + Holiday Settings
    • - Users (Organisation) + Gazette Issues
    • : @@ -205,238 +265,209 @@ function Header(props) { } { - isGrantedAny(["VIEW_ORG", "MAINTAIN_ORG"]) ? + isGranted("MAINTAIN_ANNOUNCEMENT") ?
    • - Organisation + Announcement
    • : <> } + {isGranted("MAINTAIN_EMAIL") ? +
    • + Email Template +
    • + : + <> + } + { - isGrantedAny(["VIEW_GROUP", "MAINTAIN_GROUP"]) ? + isGranted("MAINTAIN_DR") ?
    • - User Group + DR Import
    • : <> } -
    -
  • - : - <> - } - - -
  • - Settings -
      -
    • - My Profile -
    • - { - isGranted("MAINTAIN_GAZETTE_ISSUE") ? - <> -
    • - Holiday Settings -
    • -
    • - Gazette Issues -
    • - - : - <> - } + { + isGranted("MAINTAIN_SETTING") ? +
    • + System Settings +
    • + : + <> + } - { - isGranted("MAINTAIN_ANNOUNCEMENT") ?
    • - Announcement + Audit Log
    • - : - <> - } - - {isGranted("MAINTAIN_EMAIL") ? +
    +
  • +
  • - Email Template + Logout
  • - : - <> - } - - { - isGranted("MAINTAIN_DR") ? -
  • - DR Import -
  • - : - <> - } - - { - isGranted("MAINTAIN_SETTING") ? -
  • - System Settings -
  • - : - <> - } - -
  • - Audit Log -
  • - - - -
  • - Logout -
  • -
    +
    +
    + }
    :
    -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
  • - {isCreditorLoggedIn() ? - <> - - - - - - -
      -
    • - - - -
    • -
    • - - - -
    • -
    - - : - - - - } -
  • -
  • - - {isPrimaryLoggedIn() ? - <> - - console.log(event)}> - + {isPasswordExpiry()? +
    +
  • + + + - -
      -
    • - - - - - -
    • -
    • - - - {/* */} - - - -
    • -
    • - - - +
    • +
  • + : +
    +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + {isCreditorLoggedIn() ? + <> + + + + -
  • -
  • - - - {/* */} - +
      +
    • + + + +
    • +
    • + + + +
    • +
    + + : + + + + } +
  • +
  • + + {isPrimaryLoggedIn() ? + <> + + console.log(event)}> + + -
  • - - - : - isINDLoggedIn() ? - <> - - console.log(event)}> - - - - - - - : - <> - - console.log(event)}> - - - - -
      -
    • - - - +
        +
      • + + + + + +
      • +
      • + + + {/* */} + + + +
      • +
      • + + + + + +
      • +
      • + + + {/* */} + + + +
      • +
      + + : + isINDLoggedIn() ? + <> + + console.log(event)}> + + -
    • -
    • - - - +
        +
      • + + + {/* */} + + + +
      • +
      • + + + + + +
      • +
      + + : + <> + + console.log(event)}> + + -
    • -
    - - } - +
      +
    • + + + + + +
    • +
    • + + + + + +
    • +
    + + } + +
    + }
  • diff --git a/src/pages/Payment/index.js b/src/pages/Payment/index.js index 82c4e31..ae965ca 100644 --- a/src/pages/Payment/index.js +++ b/src/pages/Payment/index.js @@ -520,7 +520,9 @@ const Index = () => { }} > - 行動失敗 + + + { diff --git a/src/pages/User/ChangePasswordPage/index.js b/src/pages/User/ChangePasswordPage/index.js index 02dc937..6d92c40 100644 --- a/src/pages/User/ChangePasswordPage/index.js +++ b/src/pages/User/ChangePasswordPage/index.js @@ -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 = () => {
    {isPasswordExpiry()? - - - - - - - + + + + : - - - - - + + + } @@ -373,6 +376,74 @@ const Index = () => { +
    + setComfirmChangeMessage(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + + + + + + + + + + + + + + + setExpiryErr(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + + + + + + + + + { + expiryErrText + } + + + + + + + +
    : diff --git a/src/translations/en.json b/src/translations/en.json index 3de08dc..e2f093a 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -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", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 45fcc81..7e01a6d 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -334,7 +334,10 @@ "requireIdDocNumber": "请输入证件号码", "requiredNumberInQuote": "请输入括号内的数字或字母", "sameAsYourIdDoc": "与你的身份证明文件相同", - + "passwordReused": "旧密码不允许重复使用。", + "changePasswordConfirm": "确认修改密码", + "passwordWrong": "旧密码不正确。", + "pwRemark1": "至少8个字元,字元越多越好", "pwRemark2": "字母和数字的混合", "pwRemark3": "英文字母大写与小写的混合", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 79c245c..40ebbb6 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -337,7 +337,10 @@ "requireIdDocNumber": "請輸入證件號碼", "requiredNumberInQuote": "請輸入括號內的數字或字母", "sameAsYourIdDoc": "與你的身份證明文件相同", - + "passwordReused": "舊密碼不允許重複使用。", + "changePasswordConfirm": "確認更改密碼", + "passwordWrong": "舊密碼不正確。", + "pwRemark1": "至少8個字元,字元越多越好", "pwRemark2": "字母和數字的混合", "pwRemark3": "英文字母大寫與小寫的混合",