| @@ -23,7 +23,7 @@ const BackgroundHead = { | |||||
| } | } | ||||
| import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
| import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
| import {getObjectByType} from "utils/CommonFunction"; | |||||
| import {getObjectByType, formatUserVerifiedStatus} from "utils/CommonFunction"; | |||||
| import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
| const LoadingComponent = Loadable(React.lazy(() => import('../../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(React.lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
| const UserInformationCard = Loadable(React.lazy(() => import('./UserInformationCard_Individual'))); | const UserInformationCard = Loadable(React.lazy(() => import('./UserInformationCard_Individual'))); | ||||
| @@ -76,7 +76,11 @@ const UserMaintainPage_Individual = () => { | |||||
| let modifiedBy = DateUtils.datetimeStr(response.data.modified) + ", " + response.data.modifiedBy; | let modifiedBy = DateUtils.datetimeStr(response.data.modified) + ", " + response.data.modifiedBy; | ||||
| response.data["createDate"] = createDate; | response.data["createDate"] = createDate; | ||||
| response.data["modifieDate"] = modifiedBy; | response.data["modifieDate"] = modifiedBy; | ||||
| response.data["verifiedStatus"] = response.data.verifiedBy ? DateUtils.datetimeStr(response.data.verifiedDate) + ", " + response.data.verifiedByName : "Not Verified"; | |||||
| response.data["verifiedStatus"] = formatUserVerifiedStatus( | |||||
| response.data, | |||||
| DateUtils.datetimeStr, | |||||
| intl.formatMessage | |||||
| ); | |||||
| response.data["country"] = getObjectByType(ComboData.country, "type", response.data.address?.country); | response.data["country"] = getObjectByType(ComboData.country, "type", response.data.address?.country); | ||||
| response.data["district"] = getObjectByType(ComboData.district, "type", response.data.address?.district); | response.data["district"] = getObjectByType(ComboData.district, "type", response.data.address?.district); | ||||
| @@ -21,7 +21,7 @@ import ForwardIcon from '@mui/icons-material/Forward'; | |||||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
| import { useNavigate } from 'react-router-dom'; | import { useNavigate } from 'react-router-dom'; | ||||
| import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
| import {getObjectByType} from "utils/CommonFunction"; | |||||
| import {getObjectByType, formatUserVerifiedStatus} from "utils/CommonFunction"; | |||||
| const LoginGrid = Loadable(React.lazy(() => import('./LoginGrid'))); | const LoginGrid = Loadable(React.lazy(() => import('./LoginGrid'))); | ||||
| const BackgroundHead = { | const BackgroundHead = { | ||||
| @@ -163,7 +163,11 @@ const UserMaintainPage_Organization = () => { | |||||
| let modifiedBy = DateUtils.datetimeStr(response.data.modified) + ", " + response.data.modifiedBy; | let modifiedBy = DateUtils.datetimeStr(response.data.modified) + ", " + response.data.modifiedBy; | ||||
| response.data["createDate"] = createDate; | response.data["createDate"] = createDate; | ||||
| response.data["modifieDate"] = modifiedBy; | response.data["modifieDate"] = modifiedBy; | ||||
| response.data["verifiedStatus"] = response.data.verifiedBy ? DateUtils.datetimeStr(response.data.verifiedDate) + ", " + response.data.verifiedByName : "Not Verified"; | |||||
| response.data["verifiedStatus"] = formatUserVerifiedStatus( | |||||
| response.data, | |||||
| DateUtils.datetimeStr, | |||||
| intl.formatMessage | |||||
| ); | |||||
| response.data["lastLoginDate"] = response.data.lastLogin ? DateUtils.datetimeStr(response.data.lastLoginDate) : ""; | response.data["lastLoginDate"] = response.data.lastLogin ? DateUtils.datetimeStr(response.data.lastLoginDate) : ""; | ||||
| response.data["country"] = getObjectByType(ComboData.country, "type", response.data.addressBus?.country); | response.data["country"] = getObjectByType(ComboData.country, "type", response.data.addressBus?.country); | ||||
| @@ -303,6 +303,8 @@ | |||||
| "rejectTerms": "I do not accept", | "rejectTerms": "I do not accept", | ||||
| "verify": "Verify", | "verify": "Verify", | ||||
| "verifySuccess": "Account verified successfully", | "verifySuccess": "Account verified successfully", | ||||
| "userNotVerified": "Not Verified", | |||||
| "verifiedByIAmSmart": "Verified By iAM Smart", | |||||
| "passwordExpired": "Your password has expired, please change your password immediately to continue using the system.", | "passwordExpired": "Your password has expired, please change your password immediately to continue using the system.", | ||||
| "verifyFail": "Sorry, verification failed. Please contact us during office hours for assistance. The contact details can be found in \"About Us\" page (https://pnsps.gld.gov.hk/aboutUs).", | "verifyFail": "Sorry, verification failed. Please contact us during office hours for assistance. The contact details can be found in \"About Us\" page (https://pnsps.gld.gov.hk/aboutUs).", | ||||
| "verifyInfo": "Verification already completed or not required. Please contact us during office hours for assistance if needed. The contact details can be found in \"About Us\" page (https://pnsps.gld.gov.hk/aboutUs).", | "verifyInfo": "Verification already completed or not required. Please contact us during office hours for assistance if needed. The contact details can be found in \"About Us\" page (https://pnsps.gld.gov.hk/aboutUs).", | ||||
| @@ -292,6 +292,8 @@ | |||||
| "requireDialingCode": "请输入国际区号", | "requireDialingCode": "请输入国际区号", | ||||
| "requireVerify": "请输入验证", | "requireVerify": "请输入验证", | ||||
| "verifySuccess": "帐户已成功验证。", | "verifySuccess": "帐户已成功验证。", | ||||
| "userNotVerified": "未验证", | |||||
| "verifiedByIAmSmart": "Verified By iAM Smart", | |||||
| "passwordExpired": "你的密码已过期,请立即更改密码以继续使用系统。", | "passwordExpired": "你的密码已过期,请立即更改密码以继续使用系统。", | ||||
| "verifyFail": "十分抱歉,验证失败,请在办公时间与我们联络,联络方式可在『关于我们』页面找到(https://pnsps.gld.gov.hk/aboutUs)。", | "verifyFail": "十分抱歉,验证失败,请在办公时间与我们联络,联络方式可在『关于我们』页面找到(https://pnsps.gld.gov.hk/aboutUs)。", | ||||
| "verifyInfo": "验证已完成或无需验证。如需要,请在办公时间与我们联络,联络方式可在『关于我们』页面找到(https://pnsps.gld.gov.hk/aboutUs)。", | "verifyInfo": "验证已完成或无需验证。如需要,请在办公时间与我们联络,联络方式可在『关于我们』页面找到(https://pnsps.gld.gov.hk/aboutUs)。", | ||||
| @@ -339,6 +339,8 @@ | |||||
| "rejectTerms": "我不接受", | "rejectTerms": "我不接受", | ||||
| "verify": "驗證", | "verify": "驗證", | ||||
| "verifySuccess": "帳戶已成功驗證。", | "verifySuccess": "帳戶已成功驗證。", | ||||
| "userNotVerified": "未驗證", | |||||
| "verifiedByIAmSmart": "Verified By iAM Smart", | |||||
| "passwordExpired": "你的密碼已過期,請立即變更密碼以繼續使用系統。", | "passwordExpired": "你的密碼已過期,請立即變更密碼以繼續使用系統。", | ||||
| "verifyFail": "十分抱歉,驗證失敗,請在辦公時間與我們聯絡,聯絡方式可在『關於我們』頁面找到(https://pnsps.gld.gov.hk/aboutUs)。", | "verifyFail": "十分抱歉,驗證失敗,請在辦公時間與我們聯絡,聯絡方式可在『關於我們』頁面找到(https://pnsps.gld.gov.hk/aboutUs)。", | ||||
| "verifyInfo": "驗證已完成或無需驗證。如需要,請在辦公時間與我們聯絡,聯絡方式可在『關於我們』頁面找到(https://pnsps.gld.gov.hk/aboutUs)。", | "verifyInfo": "驗證已完成或無需驗證。如需要,請在辦公時間與我們聯絡,聯絡方式可在『關於我們』頁面找到(https://pnsps.gld.gov.hk/aboutUs)。", | ||||
| @@ -57,6 +57,20 @@ export function getObjectByType(list, valueName, value) { | |||||
| return obj === undefined || Object.keys(obj).length <= 0 ? null : obj | return obj === undefined || Object.keys(obj).length <= 0 ? null : obj | ||||
| } | } | ||||
| /** verifiedBy -1 = auto-verified via iAM Smart registration (User.VERIFIED_BY_IAM_SMART). */ | |||||
| export const VERIFIED_BY_IAM_SMART = -1; | |||||
| export function formatUserVerifiedStatus({ verifiedBy, verifiedDate, verifiedByName }, datetimeStr, formatMessage) { | |||||
| if (verifiedBy == null) { | |||||
| return formatMessage({ id: 'userNotVerified' }); | |||||
| } | |||||
| const dateStr = datetimeStr(verifiedDate); | |||||
| if (Number(verifiedBy) === VERIFIED_BY_IAM_SMART) { | |||||
| return `${dateStr}, ${formatMessage({ id: 'verifiedByIAmSmart' })}`; | |||||
| } | |||||
| return `${dateStr}, ${verifiedByName ?? ''}`; | |||||
| } | |||||
| export function removeObjectWithId(arr, id) { | export function removeObjectWithId(arr, id) { | ||||
| const arrCopy = Array.from(arr); | const arrCopy = Array.from(arr); | ||||