Переглянути джерело

set and revoke primary user i18n

master
Anna Ho 1 рік тому
джерело
коміт
147195afb1
4 змінених файлів з 31 додано та 16 видалено
  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 Переглянути файл

@@ -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' }) })}
<Button variant="outlined" onClick={() => onActiveClick(params)}>
<FormattedMessage id="unlock" />
</Button>
</>
)
} 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 = () => {
<Checkbox
onClick={() => {
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 = () => {
<Grid item xs={12}>
<div style={BackgroundHead}>
<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" />
</Typography>
</Stack>


+ 2
- 0
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.",


+ 3
- 1
src/translations/zh-CN.json Переглянути файл

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

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


+ 2
- 0
src/translations/zh-HK.json Переглянути файл

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

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


Завантаження…
Відмінити
Зберегти