Browse Source

update uat title color change

CR003
Alex Cheung 1 year ago
parent
commit
78e85c246f
6 changed files with 30 additions and 8 deletions
  1. +4
    -1
      src/components/AdminLogo/index.js
  2. +2
    -0
      src/components/SysSettingProvider.js
  3. +7
    -6
      src/layout/MainLayout/Header/index.js
  4. +10
    -0
      src/pages/authentication/AuthWrapper.js
  5. +1
    -1
      src/utils/HttpUtils.js
  6. +6
    -0
      src/utils/Utils.js

+ 4
- 1
src/components/AdminLogo/index.js View File

@@ -11,6 +11,9 @@ import Logo from './AdminLogo';
import config from 'config'; import config from 'config';
import { activeItem } from 'store/reducers/menu'; import { activeItem } from 'store/reducers/menu';
import { Stack } from '@mui/material'; import { Stack } from '@mui/material';
import {
checkSysEnv
} from "utils/Utils";


// ==============================|| MAIN LOGO ||============================== // // ==============================|| MAIN LOGO ||============================== //


@@ -28,7 +31,7 @@ const LogoSection = ({ sx, to }) => {
> >
<Logo /> <Logo />
</ButtonBase> </ButtonBase>
<span id="systemTitle" >PNSPS</span>
<span style={{ color: checkSysEnv()!=''?'red':'#0C489E'}} id="systemTitle">PNSPS</span>
</Stack> </Stack>


); );


+ 2
- 0
src/components/SysSettingProvider.js View File

@@ -18,7 +18,9 @@ const SysSettingProvider = ({ children }) => {
get({ get({
url: GET_SYS_SETTING, url: GET_SYS_SETTING,
onSuccess: (responseData) => { onSuccess: (responseData) => {
// console.log(responseData)
setSysSetting(responseData); setSysSetting(responseData);
localStorage.setItem('sysEnv', responseData.sysEnv)
} }
}); });
} }


+ 7
- 6
src/layout/MainLayout/Header/index.js View File

@@ -51,6 +51,7 @@ import {
isPasswordExpiry, isPasswordExpiry,
haveOrgPaymentRecord, haveOrgPaymentRecord,
isORGLoggedIn, isORGLoggedIn,
checkSysEnv
// getUserId // getUserId
} from "utils/Utils"; } from "utils/Utils";
import { handleLogoutFunction } from 'auth/index'; import { handleLogoutFunction } from 'auth/index';
@@ -536,7 +537,7 @@ function Header(props) {
</Typography> */} </Typography> */}
<Box sx={{ mr: 2, mt: 1, display: { md: 'none' } }}> <Box sx={{ mr: 2, mt: 1, display: { md: 'none' } }}>
<MobileLogo /> <MobileLogo />
<span id="mobileTitle" >PNSPS</span>
<span style={{ color: checkSysEnv()!=''?'red':'#0C489E'}} id="mobileTitle" >PNSPS</span>
</Box> </Box>
<Divider /> <Divider />
<ul id="sidebartop"> <ul id="sidebartop">
@@ -555,7 +556,7 @@ function Header(props) {
<Stack id="sidebar" direction="column" justifyContent="center" alignItems="center" onClick={handleDrawerToggle} sx={{ textAlign: 'center' }}> <Stack id="sidebar" direction="column" justifyContent="center" alignItems="center" onClick={handleDrawerToggle} sx={{ textAlign: 'center' }}>
<Box sx={{ mr: 2, mt: 1, display: { md: 'none' } }}> <Box sx={{ mr: 2, mt: 1, display: { md: 'none' } }}>
<MobileLogo /> <MobileLogo />
<span id="mobileTitle" >PNSPS</span>
<span style={{ color: checkSysEnv()!=''?'red':'#0C489E'}} id="mobileTitle" >PNSPS</span>
</Box> </Box>
<Divider /> <Divider />
<ul id="logoutContent"> <ul id="logoutContent">
@@ -596,7 +597,7 @@ function Header(props) {
<Stack direction="row" justifyContent="space-between" alignItems="center" width="100%"> <Stack direction="row" justifyContent="space-between" alignItems="center" width="100%">
<MobileLogo /> <MobileLogo />
<Stack justifyContent="flex-start" alignItems="flex-start" width="100%" ml={2}> <Stack justifyContent="flex-start" alignItems="flex-start" width="100%" ml={2}>
<span id="mobileTitle">PNSPS</span>
<span style={{ color: checkSysEnv()!=''?'red':'#0C489E'}} id="mobileTitle">PNSPS</span>
</Stack> </Stack>
<Stack justifyContent="flex-end" alignItems="center"> <Stack justifyContent="flex-end" alignItems="center">
<span style={{color:"#B11B1B",fontWeight:'bold',fontSize:'15px'}}>RESTRICTED</span> <span style={{color:"#B11B1B",fontWeight:'bold',fontSize:'15px'}}>RESTRICTED</span>
@@ -617,7 +618,7 @@ function Header(props) {
<Stack justifyContent="flex-start" alignItems="center"> <Stack justifyContent="flex-start" alignItems="center">
{/*<span id="systemTitle">公共啟事提交</span>*/} {/*<span id="systemTitle">公共啟事提交</span>*/}
{/*<span id="systemTitle">及繳費系統</span>*/} {/*<span id="systemTitle">及繳費系統</span>*/}
<span id="systemTitle">
<span style={{ color: checkSysEnv()!=''?'red':'#0C489E'}} id="systemTitle">
<FormattedMessage id="PNSPS" /> <FormattedMessage id="PNSPS" />
</span> </span>
</Stack> </Stack>
@@ -636,7 +637,7 @@ function Header(props) {
<Stack direction="row" justifyContent="space-between" alignItems="center" width="100%"> <Stack direction="row" justifyContent="space-between" alignItems="center" width="100%">
<MobileLogo /> <MobileLogo />
<Stack justifyContent="flex-start" alignItems="flex-start" width="100%" ml={2}> <Stack justifyContent="flex-start" alignItems="flex-start" width="100%" ml={2}>
<span id="mobileTitle">
<span style={{ color: checkSysEnv()!=''?'red':'#0C489E'}} id="mobileTitle">
<FormattedMessage id="PNSPS" /> <FormattedMessage id="PNSPS" />
</span> </span>
</Stack> </Stack>
@@ -735,7 +736,7 @@ function Header(props) {
<Stack direction="row" justifyContent="space-between" alignItems="center" width="100%"> <Stack direction="row" justifyContent="space-between" alignItems="center" width="100%">
<MobileLogo /> <MobileLogo />
<Stack justifyContent="flex-start" alignItems="flex-start" width="100%" ml={2}> <Stack justifyContent="flex-start" alignItems="flex-start" width="100%" ml={2}>
<span id="mobileTitle">
<span style={{ color: checkSysEnv()!=''?'red':'#0C489E'}} id="mobileTitle">
<FormattedMessage id="PNSPS" /> <FormattedMessage id="PNSPS" />
</span> </span>
</Stack> </Stack>


+ 10
- 0
src/pages/authentication/AuthWrapper.js View File

@@ -22,6 +22,9 @@ const BackgroundHead = {
height: '100%', height: '100%',
backgroundSize:'cover' backgroundSize:'cover'
} }
import {
checkSysEnv
} from "utils/Utils";


// ==============================|| AUTHENTICATION - WRAPPER ||============================== // // ==============================|| AUTHENTICATION - WRAPPER ||============================== //


@@ -54,6 +57,13 @@ const AuthWrapper = ({ children }) => (
<Typography style={{textAlign: "center",fontSize: "1.8rem"}}> <Typography style={{textAlign: "center",fontSize: "1.8rem"}}>
<FormattedMessage id="PNSPS_fullname"/> <FormattedMessage id="PNSPS_fullname"/>
</Typography> </Typography>
{
checkSysEnv()!=''?
<Typography style={{color: 'red',textAlign: "center",fontSize: "1.8rem"}}>
User Acceptance Test Environment
</Typography>
:""
}
</Grid> </Grid>
<Grid <Grid
item item


+ 1
- 1
src/utils/HttpUtils.js View File

@@ -7,7 +7,7 @@ export const get = ({ url, params, onSuccess, onFail, onError }) => {
}).then( }).then(
(response) => { onResponse(response, onSuccess, onFail); } (response) => { onResponse(response, onSuccess, onFail); }
).catch((error) => { ).catch((error) => {
console.log(error);
// console.log(error);
return handleError(error, onError); return handleError(error, onError);
}); });
}; };


+ 6
- 0
src/utils/Utils.js View File

@@ -99,6 +99,12 @@ export const haveOrgPaymentRecord = () =>{
if (localStorage.getItem('userData') != null){ if (localStorage.getItem('userData') != null){
return JSON.parse(localStorage.getItem('userData')).orgPaymentRecord return JSON.parse(localStorage.getItem('userData')).orgPaymentRecord
} }
}
export const checkSysEnv = () =>{
if (localStorage.getItem('sysEnv') != null){
console.log(localStorage.getItem('sysEnv'))
return localStorage.getItem('sysEnv')
}
} }
/** /**
** This function is used for demo purpose route navigation ** This function is used for demo purpose route navigation


Loading…
Cancel
Save