diff --git a/src/pages/User/ManagePage_OrgPublic/index.js b/src/pages/User/ManagePage_OrgPublic/index.js index cf7fa21..528b381 100644 --- a/src/pages/User/ManagePage_OrgPublic/index.js +++ b/src/pages/User/ManagePage_OrgPublic/index.js @@ -10,8 +10,8 @@ import * as React from "react"; import * as HttpUtils from "utils/HttpUtils"; import * as UrlUtils from "utils/ApiPathConst"; import * as DateUtils from "utils/DateUtils"; -import {FormattedMessage, useIntl} from "react-intl"; -import {useTheme} from "@emotion/react"; +import { FormattedMessage, useIntl } from "react-intl"; +import { useTheme } from "@emotion/react"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, @@ -87,16 +87,16 @@ const ManageOrgUserPage = () => { if (params.row.locked) { return ( <> - {getStatusTag({ color: "#525150", text: intl.formatMessage({id: 'locked'}) })} + {getStatusTag({ color: "#525150", text: intl.formatMessage({ id: 'locked' }) })} ) } else if (!params.row.verifiedBy) { - return getStatusTag({ color: "#fca503", text: intl.formatMessage({id: 'pendingFor'}) }) + return getStatusTag({ color: "#fca503", text: intl.formatMessage({ id: 'pendingFor' }) }) } else if (params.row.status === "active") { - return getStatusTag({ color: "#73AD21", text: intl.formatMessage({id: 'active'}) }) + return getStatusTag({ color: "#73AD21", text: intl.formatMessage({ id: 'active' }) }) } return getStatusTag({ text: params.row.status }) } @@ -126,7 +126,7 @@ const ManageOrgUserPage = () => { { id: 'username', field: 'username', - headerName: getHeader(intl.formatMessage({id: 'loginName'})), + headerName: getHeader(intl.formatMessage({ id: 'loginName' })), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, @@ -134,7 +134,7 @@ const ManageOrgUserPage = () => { { id: 'contactPerson', field: 'contactPerson', - headerName: getHeader(intl.formatMessage({id: 'userName'})), + headerName: getHeader(intl.formatMessage({ id: 'userName' })), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, @@ -142,7 +142,7 @@ const ManageOrgUserPage = () => { { id: 'contactTel', field: 'contactTel', - headerName: getHeader(intl.formatMessage({id: 'userContactNumber'})), + headerName: getHeader(intl.formatMessage({ id: 'userContactNumber' })), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { @@ -153,14 +153,14 @@ const ManageOrgUserPage = () => { { id: 'emailBus', field: 'emailBus', - headerName: getHeader(intl.formatMessage({id: 'userContactEmail'})), + headerName: getHeader(intl.formatMessage({ id: 'userContactEmail' })), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, }, { id: 'lastLogin', field: 'lastLogin', - headerName: getHeader(intl.formatMessage({id: 'lastLoginDate'})), + headerName: getHeader(intl.formatMessage({ id: 'lastLoginDate' })), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { @@ -170,7 +170,7 @@ const ManageOrgUserPage = () => { { id: 'lastApply', field: 'lastApply', - headerName: getHeader(intl.formatMessage({id: 'lastSubmissionDate'})), + headerName: getHeader(intl.formatMessage({ id: 'lastSubmissionDate' })), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, valueGetter: () => { @@ -180,7 +180,7 @@ const ManageOrgUserPage = () => { { field: 'actions', type: 'actions', - headerName: getHeader(intl.formatMessage({id: 'status'})), + headerName: getHeader(intl.formatMessage({ id: 'status' })), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, cellClassName: 'actions', @@ -192,7 +192,7 @@ const ManageOrgUserPage = () => { id: 'primaryUser', field: 'primaryUser', type: 'bool', - headerName: getHeader(intl.formatMessage({id: 'primary'})), + headerName: getHeader(intl.formatMessage({ id: 'primary' })), width: isMdOrLg ? 'auto' : 160, flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { @@ -204,7 +204,16 @@ const ManageOrgUserPage = () => { { setSelectUser(params); - let str = params.row.primaryUser ? "Are you sure to mark " + params.row.username + " as un-primary user?" : "Are you sure to mark " + params.row.username + " as primary user?" + let str = params.row.primaryUser ? + intl.formatMessage({ id: 'MSG.revokePrimay' }, + { + username: params.row.username + }) + : + intl.formatMessage({ id: 'MSG.setPrimay' }, + { + username: params.row.username + }); setWarningText(str); setIsWarningPopUp(true); }} @@ -222,7 +231,7 @@ const ManageOrgUserPage = () => {
- + diff --git a/src/translations/en.json b/src/translations/en.json index ec155ab..990a084 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -362,6 +362,8 @@ "pendingFor": "Pending approval", "active": "Active", "primary": "Primary", + "MSG.setPrimay": "Are you sure to mark user “{username}” as primary user?", + "MSG.revokePrimay": "Are you sure to revoke the primary user from user “{username}”?", "submitApplication": "Submit public notice application", "applicationSubheading": "Provide your advertisement content with formatting, proofreading and pricing.", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 9572bc6..8f6e243 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -357,7 +357,9 @@ "unlock": "解锁", "pendingFor": "待批核", "active": "生效中", - "primary": "源自", + "primary": "主要账户", + "MSG.setPrimay": "是否确定设定 “{username}” 为主要账户吗?", + "MSG.revokePrimay": "是否确定要撤销 “{username}” 为主要用户吗?", "submitApplication": "提交公共启事申请", "applicationSubheading": "提供你的启事内容作排版,校对及计价。", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index dfe82de..b6d2fb7 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -363,6 +363,8 @@ "pendingFor": "待批核", "active": "生效中", "primary": "主要帳戶", + "MSG.setPrimay": "是否確定設定 “{username}” 為主要帳戶嗎?", + "MSG.revokePrimay": "是否確定要撤銷 “{username}” 為主要使用者嗎?", "submitApplication": "提交公共啟事申請", "applicationSubheading": "提供你的啟事內容作排版,校對及計價。",