@@ -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>