Przeglądaj źródła

set and revoke primary user i18n

master
Anna Ho 1 rok temu
rodzic
commit
147195afb1
4 zmienionych plików z 31 dodań i 16 usunięć
  1. +24
    -15
      src/pages/User/ManagePage_OrgPublic/index.js
  2. +2
    -0
      src/translations/en.json
  3. +3
    -1
      src/translations/zh-CN.json
  4. +2
    -0
      src/translations/zh-HK.json

+ 24
- 15
src/pages/User/ManagePage_OrgPublic/index.js Wyświetl plik

@@ -10,8 +10,8 @@ import * as React from "react";
import * as HttpUtils from "utils/HttpUtils"; import * as HttpUtils from "utils/HttpUtils";
import * as UrlUtils from "utils/ApiPathConst"; import * as UrlUtils from "utils/ApiPathConst";
import * as DateUtils from "utils/DateUtils"; 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 = { const BackgroundHead = {
backgroundImage: `url(${titleBackgroundImg})`, backgroundImage: `url(${titleBackgroundImg})`,
@@ -87,16 +87,16 @@ const ManageOrgUserPage = () => {
if (params.row.locked) { if (params.row.locked) {
return ( return (
<> <>
{getStatusTag({ color: "#525150", text: intl.formatMessage({id: 'locked'}) })}
{getStatusTag({ color: "#525150", text: intl.formatMessage({ id: 'locked' }) })}
<Button variant="outlined" onClick={() => onActiveClick(params)}> <Button variant="outlined" onClick={() => onActiveClick(params)}>
<FormattedMessage id="unlock" /> <FormattedMessage id="unlock" />
</Button> </Button>
</> </>
) )
} else if (!params.row.verifiedBy) { } 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") { } 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 }) return getStatusTag({ text: params.row.status })
} }
@@ -126,7 +126,7 @@ const ManageOrgUserPage = () => {
{ {
id: 'username', id: 'username',
field: 'username', field: 'username',
headerName: getHeader(intl.formatMessage({id: 'loginName'})),
headerName: getHeader(intl.formatMessage({ id: 'loginName' })),
width: isMdOrLg ? 'auto' : 160, width: isMdOrLg ? 'auto' : 160,
flex: isMdOrLg ? 1 : undefined, flex: isMdOrLg ? 1 : undefined,


@@ -134,7 +134,7 @@ const ManageOrgUserPage = () => {
{ {
id: 'contactPerson', id: 'contactPerson',
field: 'contactPerson', field: 'contactPerson',
headerName: getHeader(intl.formatMessage({id: 'userName'})),
headerName: getHeader(intl.formatMessage({ id: 'userName' })),
width: isMdOrLg ? 'auto' : 160, width: isMdOrLg ? 'auto' : 160,
flex: isMdOrLg ? 1 : undefined, flex: isMdOrLg ? 1 : undefined,


@@ -142,7 +142,7 @@ const ManageOrgUserPage = () => {
{ {
id: 'contactTel', id: 'contactTel',
field: 'contactTel', field: 'contactTel',
headerName: getHeader(intl.formatMessage({id: 'userContactNumber'})),
headerName: getHeader(intl.formatMessage({ id: 'userContactNumber' })),
width: isMdOrLg ? 'auto' : 160, width: isMdOrLg ? 'auto' : 160,
flex: isMdOrLg ? 1 : undefined, flex: isMdOrLg ? 1 : undefined,
valueGetter: (params) => { valueGetter: (params) => {
@@ -153,14 +153,14 @@ const ManageOrgUserPage = () => {
{ {
id: 'emailBus', id: 'emailBus',
field: 'emailBus', field: 'emailBus',
headerName: getHeader(intl.formatMessage({id: 'userContactEmail'})),
headerName: getHeader(intl.formatMessage({ id: 'userContactEmail' })),
width: isMdOrLg ? 'auto' : 160, width: isMdOrLg ? 'auto' : 160,
flex: isMdOrLg ? 1 : undefined, flex: isMdOrLg ? 1 : undefined,
}, },
{ {
id: 'lastLogin', id: 'lastLogin',
field: 'lastLogin', field: 'lastLogin',
headerName: getHeader(intl.formatMessage({id: 'lastLoginDate'})),
headerName: getHeader(intl.formatMessage({ id: 'lastLoginDate' })),
width: isMdOrLg ? 'auto' : 160, width: isMdOrLg ? 'auto' : 160,
flex: isMdOrLg ? 1 : undefined, flex: isMdOrLg ? 1 : undefined,
valueGetter: (params) => { valueGetter: (params) => {
@@ -170,7 +170,7 @@ const ManageOrgUserPage = () => {
{ {
id: 'lastApply', id: 'lastApply',
field: 'lastApply', field: 'lastApply',
headerName: getHeader(intl.formatMessage({id: 'lastSubmissionDate'})),
headerName: getHeader(intl.formatMessage({ id: 'lastSubmissionDate' })),
width: isMdOrLg ? 'auto' : 160, width: isMdOrLg ? 'auto' : 160,
flex: isMdOrLg ? 1 : undefined, flex: isMdOrLg ? 1 : undefined,
valueGetter: () => { valueGetter: () => {
@@ -180,7 +180,7 @@ const ManageOrgUserPage = () => {
{ {
field: 'actions', field: 'actions',
type: 'actions', type: 'actions',
headerName: getHeader(intl.formatMessage({id: 'status'})),
headerName: getHeader(intl.formatMessage({ id: 'status' })),
width: isMdOrLg ? 'auto' : 160, width: isMdOrLg ? 'auto' : 160,
flex: isMdOrLg ? 1 : undefined, flex: isMdOrLg ? 1 : undefined,
cellClassName: 'actions', cellClassName: 'actions',
@@ -192,7 +192,7 @@ const ManageOrgUserPage = () => {
id: 'primaryUser', id: 'primaryUser',
field: 'primaryUser', field: 'primaryUser',
type: 'bool', type: 'bool',
headerName: getHeader(intl.formatMessage({id: 'primary'})),
headerName: getHeader(intl.formatMessage({ id: 'primary' })),
width: isMdOrLg ? 'auto' : 160, width: isMdOrLg ? 'auto' : 160,
flex: isMdOrLg ? 1 : undefined, flex: isMdOrLg ? 1 : undefined,
renderCell: (params) => { renderCell: (params) => {
@@ -204,7 +204,16 @@ const ManageOrgUserPage = () => {
<Checkbox <Checkbox
onClick={() => { onClick={() => {
setSelectUser(params); 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); setWarningText(str);
setIsWarningPopUp(true); setIsWarningPopUp(true);
}} }}
@@ -222,7 +231,7 @@ const ManageOrgUserPage = () => {
<Grid item xs={12}> <Grid item xs={12}>
<div style={BackgroundHead}> <div style={BackgroundHead}>
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center">
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}>
<Typography ml={15} color='#FFF' variant="h4" sx={{ display: { xs: 'none', sm: 'none', md: 'block' } }}>
<FormattedMessage id="companyOrUserRecord" /> <FormattedMessage id="companyOrUserRecord" />
</Typography> </Typography>
</Stack> </Stack>


+ 2
- 0
src/translations/en.json Wyświetl plik

@@ -362,6 +362,8 @@
"pendingFor": "Pending approval", "pendingFor": "Pending approval",
"active": "Active", "active": "Active",
"primary": "Primary", "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", "submitApplication": "Submit public notice application",
"applicationSubheading": "Provide your advertisement content with formatting, proofreading and pricing.", "applicationSubheading": "Provide your advertisement content with formatting, proofreading and pricing.",


+ 3
- 1
src/translations/zh-CN.json Wyświetl plik

@@ -357,7 +357,9 @@
"unlock": "解锁", "unlock": "解锁",
"pendingFor": "待批核", "pendingFor": "待批核",
"active": "生效中", "active": "生效中",
"primary": "源自",
"primary": "主要账户",
"MSG.setPrimay": "是否确定设定 “{username}” 为主要账户吗?",
"MSG.revokePrimay": "是否确定要撤销 “{username}” 为主要用户吗?",


"submitApplication": "提交公共启事申请", "submitApplication": "提交公共启事申请",
"applicationSubheading": "提供你的启事内容作排版,校对及计价。", "applicationSubheading": "提供你的启事内容作排版,校对及计价。",


+ 2
- 0
src/translations/zh-HK.json Wyświetl plik

@@ -363,6 +363,8 @@
"pendingFor": "待批核", "pendingFor": "待批核",
"active": "生效中", "active": "生效中",
"primary": "主要帳戶", "primary": "主要帳戶",
"MSG.setPrimay": "是否確定設定 “{username}” 為主要帳戶嗎?",
"MSG.revokePrimay": "是否確定要撤銷 “{username}” 為主要使用者嗎?",


"submitApplication": "提交公共啟事申請", "submitApplication": "提交公共啟事申請",
"applicationSubheading": "提供你的啟事內容作排版,校對及計價。", "applicationSubheading": "提供你的啟事內容作排版,校對及計價。",


Ładowanie…
Anuluj
Zapisz