diff --git a/src/assets/style/styles.css b/src/assets/style/styles.css index e5738cb..07d26ce 100644 --- a/src/assets/style/styles.css +++ b/src/assets/style/styles.css @@ -46,4 +46,6 @@ img .huerotate {-webkit-filter: hue-rotate(180deg);} .rss.opacity {-webkit-filter: opacity(50%);} -img:hover{-webkit-filter:none;} \ No newline at end of file +img:hover{-webkit-filter:none;} + +/* iframe#webpack-dev-server-client-overlay{display:none!important} */ \ No newline at end of file diff --git a/src/auth/index.js b/src/auth/index.js index e92350c..2d7c611 100644 --- a/src/auth/index.js +++ b/src/auth/index.js @@ -12,6 +12,7 @@ export const predictUsageCount = 'predictUsageCount' export const windowCount = 'windowCount' import {useNavigate} from "react-router-dom"; import {useDispatch} from "react-redux"; +import { REFRESH_TOKEN } from 'utils/ApiPathConst'; // ** Handle User Login export const handleLogin = data => { @@ -25,7 +26,7 @@ export const handleLogin = data => { refreshToken: data['refreshToken'] }) - console.log(data) + // console.log(data) // ** Add to user, accessToken & refreshToken to localStorage localStorage.setItem('userData', JSON.stringify(data)) localStorage.setItem('accessToken', data.accessToken) @@ -104,6 +105,8 @@ export const SetupAxiosInterceptors = () => { const navigate = useNavigate() const dispatch = useDispatch(); //const updateLastRequestTime = useContext(TimerContext); + let isRefreshToken= false; + axios.interceptors.request.use( config => { // ** Get token from localStorage @@ -126,39 +129,77 @@ export const SetupAxiosInterceptors = () => { //updateLastRequestTime(Date.now()); return response; }, - error => { + async (error) => { // ** const { config, response: { status } } = error - const {response} = error - if (error.response.status === 401) { - if (localStorage.getItem("expiredAlertShown") === null) { - localStorage.setItem("expiredAlertShown", true) - alert("登入驗證已過期,請重新登入。") - } - - } - - // ** if (status === 401) { - if (response.status === 401) { - if (localStorage.getItem("expiredAlertShown") === null) { - localStorage.setItem("expiredAlertShown", true) - alert("登入驗證已過期,請重新登入。") + if (error.response.status === 401 && error.config.url !== apiPath + REFRESH_TOKEN) { + // Make a request to refresh the access token + const refreshToken = localStorage.getItem('refreshToken'); + if (isRefreshToken) { + return; } - } - - if (response && response.status === 401) { - if (localStorage.getItem("expiredAlertShown") === null) { - localStorage.setItem("expiredAlertShown", true) - alert("登入驗證已過期,請重新登入。") + isRefreshToken = true; + return axios + .post(`${apiPath}${REFRESH_TOKEN}`, { + refreshToken: refreshToken // Replace with your refresh token + }) + .then((response) => { + if (response.status === 200) { + const newAccessToken = response.data.accessToken; + const newRefreshToken = response.data.refreshToken; + localStorage.setItem('accessToken', newAccessToken); + localStorage.setItem('refreshToken', newRefreshToken); + isRefreshToken = false; + window.location.reload(); + } + }) + .catch((refreshError) => { + dispatch(handleLogoutFunction()); + navigate('/login'); + isRefreshToken = false; + window.location.reload(); + throw refreshError; + }); + } else { + if (isUserLoggedIn()){ + if (error.response.status === 401) { + if (localStorage.getItem("expiredAlertShown") === null) { + localStorage.setItem("expiredAlertShown", true) + alert("登入驗證已過期,請重新登入。") + } + + } + + // ** if (status === 401) { + if (response.status === 401) { + if (localStorage.getItem("expiredAlertShown") === null) { + localStorage.setItem("expiredAlertShown", true) + alert("登入驗證已過期,請重新登入。") + } + } + + if (response && response.status === 401) { + if (localStorage.getItem("expiredAlertShown") === null) { + localStorage.setItem("expiredAlertShown", true) + alert("登入驗證已過期,請重新登入。") + } + } + + if (localStorage.getItem("expiredAlertShown")) { + await dispatch(handleLogoutFunction()); + await navigate('/login'); + await window.location.reload(); + } + } else { + if (error.response.status === 401) { + await dispatch(handleLogoutFunction()); + await navigate('/login'); + // await window.location.reload(); + } } } - if (localStorage.getItem("expiredAlertShown")) { - dispatch(handleLogoutFunction()); - navigate('/login'); - } - return Promise.reject(error) - }, + } ) } diff --git a/src/auth/utils.js b/src/auth/utils.js index 869d555..839444c 100644 --- a/src/auth/utils.js +++ b/src/auth/utils.js @@ -44,7 +44,7 @@ export const getNonce = () => { }; export const getBowserType = () => { - console.log(navigator.userAgent) + // console.log(navigator.userAgent) // const regex = /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Mi|huawei|Opera Mini|SAMSUNG|Samsung|SGH-[I|N|T]|GT-[I|N]|SM-[A|N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L/i; // if(!regex.test(navigator.userAgent)) if (navigator.userAgent.indexOf("Edg") != -1) { diff --git a/src/components/AutoLogoutProvider.js b/src/components/AutoLogoutProvider.js index 8387458..27ccd6b 100644 --- a/src/components/AutoLogoutProvider.js +++ b/src/components/AutoLogoutProvider.js @@ -1,17 +1,29 @@ import React, { createContext, useState, useEffect } from 'react'; -//import {useNavigate} from "react-router-dom"; +import {useNavigate} from "react-router-dom"; //import axios from "axios"; -import {getUserData} from "../auth/utils"; -import {isObjEmpty} from "../utils/Utils"; +// import {getUserData} from "auth/utils"; +// import {isObjEmpty} from "../utils/Utils"; import {useIdleTimer} from "react-idle-timer"; +import { handleLogoutFunction } from 'auth/index'; +import { useDispatch } from "react-redux"; +import { + isUserLoggedIn, + isGLDLoggedIn, + // isPrimaryLoggedIn, + // isCreditorLoggedIn, + // isINDLoggedIn, + // isORGLoggedIn, + // getUserId +} from "utils/Utils"; const TimerContext = createContext(); const AutoLogoutProvider = ({ children }) => { const [lastRequestTime, setLastRequestTime] = useState(Date.now()); - //const navigate = useNavigate(); - const [logoutInterval /*, setLogoutInterval*/] = useState(1); + const navigate = useNavigate(); + const [logoutInterval, setLogoutInterval] = useState(1); const [state, setState] = useState('Active'); + const dispatch = useDispatch() const onIdle = () => { setLastRequestTime(Date.now()); @@ -30,7 +42,7 @@ const AutoLogoutProvider = ({ children }) => { } = useIdleTimer({ onIdle, onActive, - timeout: 10_000, + timeout: 1_000, throttle: 500, crossTab: true, syncTimers: 200, @@ -39,42 +51,55 @@ const AutoLogoutProvider = ({ children }) => { const lastActiveTab = isLastActiveTab() === null ? 'loading' : isLastActiveTab() //const tabId = getTabId() === null ? 'loading' : getTabId().toString() - useEffect(() => { - const userData = getUserData(); - if(!isObjEmpty(userData)){ + const getLogoutInterval = () =>{ + if(isUserLoggedIn()&&logoutInterval===1){ //TODO: get auto logout time here - + if(isGLDLoggedIn()){ + setLogoutInterval(240); + console.log("Set Logout Interval: 240") + }else{ + setLogoutInterval(60); + console.log("Set Logout Interval: 60") + } // axios.get(`${apiPath}${GET_IDLE_LOGOUT_TIME}`, // ) - // .then((response) => { - // if (response.status === 200) { - // setLastRequestTime(Date.now()); - // setLogoutInterval(parseInt(response.data.data)); - // } - // }) - // .catch(error => { - // console.log(error); - // return false; - // }); + // .then((response) => { + // if (response.status === 200) { + // setLastRequestTime(Date.now()); + // setLogoutInterval(parseInt(response.data.data)); + // } + // }) + // .catch(error => { + // console.log(error); + // return false; + // }); } else{ + if(!isUserLoggedIn()&&logoutInterval>1){ + setLogoutInterval(1); + } //navigate('/login'); } - }, []); + } useEffect(() => { + getLogoutInterval() + // console.log("AutoLogoutProvider Start") + // console.log(logoutInterval) const interval = setInterval(async () => { const currentTime = Date.now(); getRemainingTime(); if(state !== "Active" && lastActiveTab){ const timeElapsed = currentTime - lastRequestTime; - // console.log(timeElapsed); + // console.log(parseInt(timeElapsed/1000)); + // console.log(logoutInterval* 60); if (timeElapsed >= logoutInterval * 60 * 1000) { - //TODO: auto logout here - // console.log("logout"); - //await dispatch(handleLogoutFunction()); - //await navigate('/login'); - //await window.location.reload(); + if(isUserLoggedIn()){ + alert("登入驗證已過期,請重新登入。") + dispatch(handleLogoutFunction()); + navigate('/login'); + window.location.reload(); + } } } else if(state === "Active"){ diff --git a/src/components/FiDataGrid.js b/src/components/FiDataGrid.js index 76a4ee2..e2eb70b 100644 --- a/src/components/FiDataGrid.js +++ b/src/components/FiDataGrid.js @@ -1,15 +1,17 @@ // material-ui import * as React from 'react'; import { - DataGrid, + DataGrid, GridOverlay, } from "@mui/x-data-grid"; +import {FormattedMessage, useIntl} from "react-intl"; +import {TablePagination, Typography} from '@mui/material'; // ==============================|| EVENT TABLE ||============================== // export function FiDataGrid({ rows, columns, sx, autoHeight, - hideFooterSelectedRowCount, rowModesModel, editMode, - pageSizeOptions, filterItems, - ...props }) { + hideFooterSelectedRowCount, rowModesModel, editMode, + pageSizeOptions, filterItems, customPageSize, ...props }) { + const intl = useIntl(); const [_rows, set_rows] = React.useState([]); const [_columns, set_columns] = React.useState([]); const [_rowModesModel, set_rowModesModel] = React.useState({}); @@ -17,13 +19,12 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, const [_pageSizeOptions, set_pageSizeOptions] = React.useState([10, 25, 50]); const [_filterItems, set_filterItems] = React.useState([]); + const [page, setPage] = React.useState(0); + const [pageSize, setPageSize] = React.useState(10); const [_autoHeight, set_autoHeight] = React.useState(true); const [myHideFooterSelectedRowCount, setMyHideFooterSelectedRowCount] = React.useState(true); const [_sx, set_sx] = React.useState({ padding: "4 2 4 2", - // boxShadow: 1, - // border: 1, - // borderColor: '#DDD', '& .MuiDataGrid-cell': { borderTop: 1, borderBottom: 1, @@ -35,7 +36,6 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, }, }); - React.useEffect(() => { if (sx) { set_sx(sx); @@ -55,80 +55,74 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, if (pageSizeOptions) { set_pageSizeOptions(pageSizeOptions) } - if(autoHeight != undefined){ + if(autoHeight !== undefined){ set_autoHeight(autoHeight) } if(editMode){ set_editMode(editMode); } - }, []); - - React.useEffect(() => { - if (sx) { - set_sx(sx); - } - }, [sx]); - - React.useEffect(() => { - if (hideFooterSelectedRowCount) { - setMyHideFooterSelectedRowCount(hideFooterSelectedRowCount); + if(filterItems){ + set_filterItems(filterItems); } - }, [hideFooterSelectedRowCount]); - React.useEffect(() => { - if (rowModesModel) { - set_rowModesModel(rowModesModel) + if(customPageSize){ + setPageSize(customPageSize); } - }, [rowModesModel]); + }, [sx, hideFooterSelectedRowCount, rowModesModel, rows, columns, pageSizeOptions, autoHeight, editMode, filterItems, customPageSize]); - React.useEffect(() => { - if (rows) { - set_rows(rows) - } - }, [rows]); + const handleChangePage = (event, newPage) => { + setPage(newPage); + }; - React.useEffect(() => { - if (columns) { - set_columns(columns) - } - }, [columns]); + const handleChangePageSize = (event) => { + setPageSize(parseInt(event.target.value, 10)); + setPage(0); + }; - React.useEffect(() => { - if (pageSizeOptions) { - set_pageSizeOptions(pageSizeOptions) - } - }, [pageSizeOptions]); + const startIndex = page * pageSize; + const endIndex = (page + 1) * pageSize; + const slicedRows = _rows.slice(startIndex, endIndex); - React.useEffect(() => { - if(autoHeight != undefined){ - set_autoHeight(autoHeight) - } - }, [autoHeight]); + function CustomNoRowsOverlay() { + return ( + + + + + + ); + } - React.useEffect(() => { - if(editMode){ - set_editMode(editMode); - } - }, [editMode]); - - React.useEffect(() => { - if(filterItems){ - set_filterItems(filterItems); - } - }, [filterItems]); - return ( ( + + `${from}-${to} ${intl.formatMessage({ id: "of" })} ${count}` + } + labelRowsPerPage={intl.formatMessage({ id: "rowsPerPage" }) + ":"} + onPageChange={handleChangePage} + onRowsPerPageChange={handleChangePageSize} + /> + ), + }} /> ); } diff --git a/src/components/RefreshTokenProvider.js b/src/components/RefreshTokenProvider.js new file mode 100644 index 0000000..0978d79 --- /dev/null +++ b/src/components/RefreshTokenProvider.js @@ -0,0 +1,72 @@ +import { createContext, useEffect, useRef, useCallback } from 'react'; +import { apiPath } from 'auth/utils'; +import { REFRESH_TOKEN } from 'utils/ApiPathConst'; +import axios from 'axios'; + +const RefreshTokenContext = createContext(); + +const RefreshTokenProvider = ({ children }) => { + const token = useRef(localStorage.getItem('accessToken')); + const isRefresh = useRef(false); + + // handle Refresh Token Logic + const handleRefreshToken = useCallback(() => { + if (!isRefresh.current) { + const refreshToken = localStorage.getItem('refreshToken'); + isRefresh.current = true; + axios + .post(`${apiPath}${REFRESH_TOKEN}`, { + refreshToken: refreshToken + }) + .then((response) => { + if (response.status === 200) { + const newAccessToken = response.data.accessToken; + const newRefreshToken = response.data.refreshToken; + localStorage.setItem('accessToken', newAccessToken); + localStorage.setItem('refreshToken', newRefreshToken); + token.current = newAccessToken; + isRefresh.current = false; + } else { + token.current = null; + isRefresh.current = false; + } + }) + .catch((refreshError) => { + console.log('Failed to refresh token'); + console.log(refreshError) + token.current = null + isRefresh.current = false; + }); + } + }, []); + + // Function to check token expiry + const checkTokenExpiry = useCallback(() => { + // Check if token is present and its expiry time + if (token.current) { + const tokenExp = JSON.parse(atob(token.current.split('.')[1])).exp; + const currentTime = Math.floor(Date.now() / 1000); + const expiryTime = tokenExp - 30; // Refresh 30 seconds before expiry + // console.log("check refresh Token"); + // console.log(currentTime); + // console.log(new Date(currentTime*1000).toLocaleString()); + // console.log(expiryTime); + // console.log(new Date(expiryTime*1000).toLocaleString()); + // console.log('accessToken: ' + localStorage.getItem('accessToken')); + // console.log('refreshToken: ' + localStorage.getItem('refreshToken')); + if (currentTime >= expiryTime) { + handleRefreshToken(); + } + } + }, [token]); + + // Start the timer on component mount + useEffect(() => { + const timer = setInterval(checkTokenExpiry, 10000); // Check every 10 second + return () => clearInterval(timer); // Cleanup timer on unmount + }, [checkTokenExpiry]); + + return {children}; +}; + +export { RefreshTokenContext, RefreshTokenProvider }; diff --git a/src/index.js b/src/index.js index 2c85d6f..c58b3ca 100644 --- a/src/index.js +++ b/src/index.js @@ -18,6 +18,7 @@ import { store } from 'store'; import reportWebVitals from './reportWebVitals'; import {I18nProvider} from "./components/I18nProvider"; import {AutoLogoutProvider} from "./components/AutoLogoutProvider"; +import {RefreshTokenProvider} from "./components/RefreshTokenProvider"; // ==============================|| MAIN - REACT DOM RENDER ||============================== // @@ -29,11 +30,13 @@ root.render( - - - - - + + + + + + + diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index effef0e..084d817 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -137,6 +137,17 @@ function Header(props) {
  • Email Template
  • +
  • + Setting +
      +
    • + Users Profile +
    • +
    • + System Setting +
    • +
    +
  • Logout
  • @@ -216,7 +227,7 @@ function Header(props) { {/* */} - Organisation Profile + @@ -252,8 +263,7 @@ function Header(props) {
  • - {/* */} - User Profile +
  • diff --git a/src/pages/DemandNote/Create/DataGrid.js b/src/pages/DemandNote/Create/DataGrid.js index 74b9389..9c71016 100644 --- a/src/pages/DemandNote/Create/DataGrid.js +++ b/src/pages/DemandNote/Create/DataGrid.js @@ -103,18 +103,14 @@ export default function SearchPublicNoticeTable({ recordList }) { ]; return ( -
    +
    diff --git a/src/pages/DemandNote/Create/SearchForm.js b/src/pages/DemandNote/Create/SearchForm.js index 339e8c9..f88bd65 100644 --- a/src/pages/DemandNote/Create/SearchForm.js +++ b/src/pages/DemandNote/Create/SearchForm.js @@ -1,7 +1,6 @@ // material-ui import { Button, - CardContent, Grid, TextField, Autocomplete, Typography, @@ -15,6 +14,8 @@ import * as UrlUtils from "utils/ApiPathConst"; import * as HttpUtils from "utils/HttpUtils"; import { useNavigate } from "react-router-dom"; import { notifyDownloadSuccess } from 'utils/CommonFunction'; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -35,22 +36,6 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p const [issueCombo, setIssueCombo] = React.useState([]); const navigate = useNavigate() - const _sx = { - padding: "4 2 4 2", - boxShadow: 1, - border: 1, - borderColor: '#DDD', - '& .MuiDataGrid-cell': { - borderTop: 1, - borderBottom: 1, - borderColor: "#EEE" - }, - '& .MuiDataGrid-footerContainer': { - border: 1, - borderColor: "#EEE" - } - } - React.useEffect(() => { if (issueComboData && issueComboData.length > 0) { setIssueCombo(issueComboData); @@ -128,22 +113,24 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p
    {/*row 1*/} - - - Please Select Gazette Issue : + + {/*row 1*/} + + + Please Select Gazette Issue : + - + {/*row 2*/} - {/*row 2*/} - - + + */} + + @@ -198,9 +183,20 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p Pending Publish: {publishCount} +
    - setIsFailPopUp(false)} > + setIsFailPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Action Fail {failText} @@ -211,7 +207,17 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p
    - setIsSuccessPopUp(false)} > + setIsSuccessPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Create Result diff --git a/src/pages/DemandNote/Create/index.js b/src/pages/DemandNote/Create/index.js index b8740ac..e35b484 100644 --- a/src/pages/DemandNote/Create/index.js +++ b/src/pages/DemandNote/Create/index.js @@ -80,16 +80,18 @@ const Index = () => { !onReady ? : - +
    - Create Demand Note + + Create Demand Note +
    {/*row 1*/} - + +
    + - Attach DN + Attach DN + 'auto'} onRowDoubleClick={handleRowDoubleClick} />
    - setIsErrorPopUp(false)} > + setIsErrorPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Action Fail Number of DN record must less than 100.
    Please edit search form.
    @@ -382,7 +374,17 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
    - setSelectonWarning(false)} > + setSelectonWarning(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Warning Please Select DN. @@ -393,7 +395,17 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
    - setConfirmPopUp(false)} > + setConfirmPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Confirm Are you sure to mark DN paid? @@ -405,7 +417,17 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
    - setSendPopUp(false)} > + setSendPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Confirm Are you sure to send DN? @@ -417,7 +439,17 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch })
    - setWait(false)} > + setWait(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Calculating, please wait ... diff --git a/src/pages/DemandNote/Search/SearchForm.js b/src/pages/DemandNote/Search/SearchForm.js index d58283d..8717699 100644 --- a/src/pages/DemandNote/Search/SearchForm.js +++ b/src/pages/DemandNote/Search/SearchForm.js @@ -1,7 +1,6 @@ // material-ui import { Button, - CardContent, Grid, TextField, Autocomplete, Typography @@ -12,6 +11,8 @@ import * as React from "react"; import * as ComboData from "utils/ComboData"; import * as DateUtils from "utils/DateUtils"; import * as FormatUtils from "utils/FormatUtils"; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -88,14 +89,12 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue >
    - + {/*row 1*/} - - - - Search Form - - + + + Search Form + {/*row 2*/} @@ -105,6 +104,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue {...register("issueId")} disablePortal id="issueId" + size="small" options={issueCombo} value={issueSelected} inputValue={(issueSelected?.id) ? getIssueLabel(issueSelected) : ""} @@ -145,6 +145,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue {...register("orgId")} disablePortal id="orgId" + size="small" options={orgCombo} value={orgSelected} inputValue={(orgSelected?.label) ? orgSelected?.label : ""} @@ -220,6 +221,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue - + + - + + diff --git a/src/pages/DemandNote/Search/index.js b/src/pages/DemandNote/Search/index.js index 23eaa30..bc6e38c 100644 --- a/src/pages/DemandNote/Search/index.js +++ b/src/pages/DemandNote/Search/index.js @@ -94,16 +94,18 @@ const UserSearchPage_Individual = () => { !onReady ? : - +
    - Demand Note + + Demand Note +
    {/*row 1*/} - + 'auto'} /> diff --git a/src/pages/DemandNote/Search_Public/SearchForm.js b/src/pages/DemandNote/Search_Public/SearchForm.js index cd5f59b..10ad3ba 100644 --- a/src/pages/DemandNote/Search_Public/SearchForm.js +++ b/src/pages/DemandNote/Search_Public/SearchForm.js @@ -13,6 +13,8 @@ import * as ComboData from "utils/ComboData"; import * as DateUtils from "utils/DateUtils"; import * as FormatUtils from "utils/FormatUtils"; import {FormattedMessage, useIntl} from "react-intl"; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -76,13 +78,13 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData >
    - + {/*row 1*/} - - - + + + @@ -210,35 +212,26 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData {/*last row*/} - - - + + - - - + + +
    diff --git a/src/pages/DemandNote/Search_Public/index.js b/src/pages/DemandNote/Search_Public/index.js index 8c246f3..2602a46 100644 --- a/src/pages/DemandNote/Search_Public/index.js +++ b/src/pages/DemandNote/Search_Public/index.js @@ -98,14 +98,14 @@ const UserSearchPage_Individual = () => {
    - +
    {/*row 1*/} - + import('components/MainCard'))); import { useForm } from 'react-hook-form'; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const ApplicationDetailCard = ({ formData, @@ -35,59 +36,30 @@ const ApplicationDetailCard = ({ // initialValues: data, // }); - const DisplayField = ({ name, width, value, rows = 1, disabled = false }) => { - return { + return ; } - const { register, handleSubmit } = useForm() - - - - // const DisplaySelection = ({ name = "test", value = "", onChange }) => { - // return ( - // - // )} - // /> - // } return ( @@ -168,14 +141,14 @@ const ApplicationDetailCard = ({ - + - Subject (Cht): - + - + - Subject (Chs): - + @@ -236,18 +209,18 @@ const ApplicationDetailCard = ({ - + - Subject (Eng): - + @@ -273,33 +246,25 @@ const ApplicationDetailCard = ({ {/*bottom button*/} + + diff --git a/src/pages/EmailTemplate/Detail_GLD/index.js b/src/pages/EmailTemplate/Detail_GLD/index.js index 78cf80f..3471fa6 100644 --- a/src/pages/EmailTemplate/Detail_GLD/index.js +++ b/src/pages/EmailTemplate/Detail_GLD/index.js @@ -129,7 +129,7 @@ const Index = () => {
    - diff --git a/src/pages/EmailTemplate/Search_GLD/DataGrid.js b/src/pages/EmailTemplate/Search_GLD/DataGrid.js index 542ce2e..7484569 100644 --- a/src/pages/EmailTemplate/Search_GLD/DataGrid.js +++ b/src/pages/EmailTemplate/Search_GLD/DataGrid.js @@ -87,11 +87,7 @@ export default function EmailTemplateTable({ recordList }) { 'auto'} /> diff --git a/src/pages/EmailTemplate/Search_GLD/index.js b/src/pages/EmailTemplate/Search_GLD/index.js index 2556ba1..f45730b 100644 --- a/src/pages/EmailTemplate/Search_GLD/index.js +++ b/src/pages/EmailTemplate/Search_GLD/index.js @@ -25,6 +25,8 @@ const BackgroundHead = { backgroundPosition: 'right' } import { useNavigate } from "react-router"; +import {PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -56,7 +58,7 @@ const Index = () => { : ( - +
    @@ -78,18 +80,18 @@ const Index = () => { - + + + diff --git a/src/pages/GFMIS/DataGrid.js b/src/pages/GFMIS/DataGrid.js index b3e6bfc..88108e9 100644 --- a/src/pages/GFMIS/DataGrid.js +++ b/src/pages/GFMIS/DataGrid.js @@ -69,18 +69,14 @@ export default function SearchPublicNoticeTable({ recordList }) { return ( -
    +
    diff --git a/src/pages/GFMIS/SearchForm.js b/src/pages/GFMIS/SearchForm.js index 01e65fb..7f9bebc 100644 --- a/src/pages/GFMIS/SearchForm.js +++ b/src/pages/GFMIS/SearchForm.js @@ -1,7 +1,6 @@ // material-ui import { Button, - CardContent, Grid, TextField, // Autocomplete, Typography @@ -10,6 +9,8 @@ import MainCard from "components/MainCard"; import { useForm } from "react-hook-form"; import * as React from "react"; import * as DateUtils from "utils/DateUtils"; +import {PNSPS_BUTTON_THEME} from "../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // import * as ComboData from "utils/ComboData"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -20,22 +21,6 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) => const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); // const [status, setStatus] = React.useState(ComboData.paymentStatus[0]); - const _sx = { - padding: "4 2 4 2", - boxShadow: 1, - border: 1, - borderColor: '#DDD', - '& .MuiDataGrid-cell': { - borderTop: 1, - borderBottom: 1, - borderColor: "#EEE" - }, - '& .MuiDataGrid-footerContainer': { - border: 1, - borderColor: "#EEE" - } - } - const { register, handleSubmit, getValues } = useForm() const onSubmit = (data) => { @@ -67,20 +52,19 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) => -
    - {/*row 1*/} - - - Credit Date + + + {/*row 1*/} + + + Credit Date + - - - {/*row 2*/} - + {/*row 2*/} + */} - + + + +
    diff --git a/src/pages/GFMIS/index.js b/src/pages/GFMIS/index.js index aaecf68..30a5f20 100644 --- a/src/pages/GFMIS/index.js +++ b/src/pages/GFMIS/index.js @@ -42,7 +42,7 @@ const Index = () => { }, [record]); React.useEffect(() => { - console.log(searchCriteria) + // console.log(searchCriteria) loadGrid(); }, [searchCriteria]); @@ -57,14 +57,14 @@ const Index = () => { } function downloadXML(input) { - console.log(input) + // console.log(input) HttpUtils.get({ url: UrlUtils.GEN_GFMIS_XML + "/today", params:{dateTo: input.dateTo, dateFrom: input.dateFrom, }, onSuccess: (responseData) => { - console.log(responseData) + // console.log(responseData) const parser = new DOMParser(); const xmlDoc = parser.parseFromString(responseData, 'application/xml'); const filename = xmlDoc.querySelector('FileHeader').getAttribute('H_Filename'); @@ -100,7 +100,7 @@ const Index = () => { !onReady ? : - +
    @@ -109,7 +109,7 @@ const Index = () => {
    {/*row 1*/} - + {
    - + {record?.subject} {DateUtils.datetimeStr(record?.sentDate)} @@ -87,7 +87,7 @@ const Index = () => {
    - +
    diff --git a/src/pages/Message/Search/SearchForm.js b/src/pages/Message/Search/SearchForm.js index 1900f9a..63d41b6 100644 --- a/src/pages/Message/Search/SearchForm.js +++ b/src/pages/Message/Search/SearchForm.js @@ -63,8 +63,8 @@ const SearchForm = ({ applySearch, searchCriteria }) => { {/*row 1*/} - - + + @@ -77,6 +77,7 @@ const SearchForm = ({ applySearch, searchCriteria }) => { fullWidth {...register("keyword")} id='keyword' + aria-label={intl.formatMessage({id: 'keyword'})} label={intl.formatMessage({id: 'keyword'}) + ":"} defaultValue={searchCriteria.code} InputLabelProps={{ @@ -93,6 +94,7 @@ const SearchForm = ({ applySearch, searchCriteria }) => { {...register("dateFrom")} id="dateFrom" type="date" + aria-label={intl.formatMessage({id: 'dateFrom'})} label={intl.formatMessage({id: 'dateFrom'})} defaultValue={searchCriteria.dateFrom} InputProps={{ inputProps: { max: maxDate } }} @@ -120,6 +122,7 @@ const SearchForm = ({ applySearch, searchCriteria }) => { onChange={(newValue) => { setMaxDate(DateUtils.dateStr(newValue)); }} + aria-label={intl.formatMessage({id: 'dateTo'})} id="dateTo" type="date" //label="付款日期(到)" @@ -138,7 +141,9 @@ const SearchForm = ({ applySearch, searchCriteria }) => { @@ -148,6 +153,7 @@ const SearchForm = ({ applySearch, searchCriteria }) => { diff --git a/src/pages/Message/Search/index.js b/src/pages/Message/Search/index.js index 9706d5d..b96ae87 100644 --- a/src/pages/Message/Search/index.js +++ b/src/pages/Message/Search/index.js @@ -69,7 +69,7 @@ const Index = () => {
    - + diff --git a/src/pages/Organization/DetailPage/CreditorHistoryTable.js b/src/pages/Organization/DetailPage/CreditorHistoryTable.js index ae2b301..1f51735 100644 --- a/src/pages/Organization/DetailPage/CreditorHistoryTable.js +++ b/src/pages/Organization/DetailPage/CreditorHistoryTable.js @@ -42,11 +42,7 @@ export default function CreditorHistoryTable({ recordList }) {
    ); diff --git a/src/pages/Organization/DetailPage/OrganizationCard.js b/src/pages/Organization/DetailPage/OrganizationCard.js index ee27cfd..52cc841 100644 --- a/src/pages/Organization/DetailPage/OrganizationCard.js +++ b/src/pages/Organization/DetailPage/OrganizationCard.js @@ -4,20 +4,22 @@ import { Dialog, DialogTitle, DialogContent, DialogActions, } from '@mui/material'; // import { FormControlLabel } from '@material-ui/core'; -import MainCard from "../../../components/MainCard"; +import MainCard from "components/MainCard"; import * as React from "react"; import { useFormik } from 'formik'; import * as yup from 'yup'; import { useEffect, useState } from "react"; -import * as HttpUtils from '../../../utils/HttpUtils'; -import * as UrlUtils from "../../../utils/ApiPathConst"; -import * as FieldUtils from "../../../utils/FieldUtils"; -import * as ComboData from "../../../utils/ComboData"; +import * as HttpUtils from 'utils/HttpUtils'; +import * as UrlUtils from "utils/ApiPathConst"; +import * as FieldUtils from "utils/FieldUtils"; +import * as ComboData from "utils/ComboData"; const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); import Loadable from 'components/Loadable'; import { lazy } from 'react'; import { notifySaveSuccess } from 'utils/CommonFunction'; import { useIntl } from "react-intl"; +import {PNSPS_BUTTON_THEME} from "themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -92,8 +94,8 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { faxNumber: vaule.faxNumber }, addressTemp: { - country: vaule.country, - district: vaule.district, + country: vaule.country.id, + district: vaule.district.id, addressLine1: vaule.addressLine1, addressLine2: vaule.addressLine2, addressLine3: vaule.addressLine3, @@ -170,97 +172,80 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { <> {createMode ? <> - - - + + + + + : <> + + } : <> - + + + { currentUserData.creditor ? + + : - + + + } @@ -275,7 +260,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { - Organisation Details + Organization Details @@ -400,7 +385,17 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { }
    - setCreditorConfirmPopUp(false)} > + setCreditorConfirmPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Confirm Are you sure mark as Creditor? @@ -412,7 +407,17 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
    - setNonCreditorConfirmPopUp(false)} > + setNonCreditorConfirmPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Confirm Are you sure mark as Non-Creditor? diff --git a/src/pages/Organization/DetailPage/OrganizationPubCard.js b/src/pages/Organization/DetailPage/OrganizationPubCard.js index b02e724..1a53a8c 100644 --- a/src/pages/Organization/DetailPage/OrganizationPubCard.js +++ b/src/pages/Organization/DetailPage/OrganizationPubCard.js @@ -1,23 +1,27 @@ // material-ui import { - Grid, Button, Checkbox, FormControlLabel, Typography, + Grid, Button, + // Checkbox, FormControlLabel, + Typography, Dialog, DialogTitle, DialogContent, DialogActions, } from '@mui/material'; // import { FormControlLabel } from '@material-ui/core'; -import MainCard from "../../../components/MainCard"; +import MainCard from "components/MainCard"; import * as React from "react"; import { useFormik } from 'formik'; import * as yup from 'yup'; import { useEffect, useState } from "react"; -import * as HttpUtils from '../../../utils/HttpUtils'; -import * as UrlUtils from "../../../utils/ApiPathConst"; -import * as FieldUtils from "../../../utils/FieldUtils"; -import * as ComboData from "../../../utils/ComboData"; +import * as HttpUtils from 'utils/HttpUtils'; +import * as UrlUtils from "utils/ApiPathConst"; +import * as FieldUtils from "utils/FieldUtils"; +import * as ComboData from "utils/ComboData"; const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); import Loadable from 'components/Loadable'; import { lazy } from 'react'; import { notifySaveSuccess } from 'utils/CommonFunction'; -import {useIntl} from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; +import {PNSPS_BUTTON_THEME} from "themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -48,52 +52,25 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { enableReinitialize: true, initialValues: currentUserData, validationSchema: yup.object().shape({ - enCompanyName: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({id: 'userRequireEnglishName'}))), - chCompanyName: yup.string().max(255, displayErrorMsg(intl.formatMessage({id: 'userRequireChineseName'}))).nullable(), addressLine1: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({id: 'validateAddressLine1'}))), addressLine2: yup.string().max(255, displayErrorMsg(intl.formatMessage({id: 'noMoreThen255Words'}))), addressLine3: yup.string().max(255, displayErrorMsg(intl.formatMessage({id: 'noMoreThen255Words'}))), - fax_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({id: 'requireDialingCode'}))).nullable(), tel_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({id: 'requireDialingCode'}))), phoneNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({id: 'requiredValidNumber'}))).required(displayErrorMsg(intl.formatMessage({id: 'requireContactNumber'}))), - faxNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({id: 'require8Number'}))).nullable(), - brExpiryDate: yup.string().min(8).required(displayErrorMsg(intl.formatMessage({id: 'pleaseFillInBusinessRegCertValidityDate'}))), - brNo: yup.string().required(displayErrorMsg(intl.formatMessage({id: 'pleaseFillInBusinessRegCertNumber'}))).test('checkBrNoFormat', displayErrorMsg(displayErrorMsg(intl.formatMessage({id: 'pleaseFillInValidBusinessRegCertNumber'}))), function (value) { - var brNo_pattern = /[0-9]{8}/ - if (value !== undefined) { - if (value.match(brNo_pattern)) { - return true - } else { - return false - } - } - }), }), onSubmit: vaule => { console.log(vaule) HttpUtils.post({ - url: UrlUtils.POST_ORG_SAVE_PATH, + url: UrlUtils.POST_PUB_ORG_SAVE_PATH, params: { - id: id > 0 ? id : null, - enCompanyName: vaule.enCompanyName, - chCompanyName: vaule.chCompanyName, - brNo: vaule.brNo, - brExpiryDate: vaule.brExpiryDate, - enCompanyNameTemp: vaule.enCompanyNameTemp, - chCompanyNameTemp: vaule.chCompanyNameTemp, - brExpiryDateTemp: vaule.brExpiryDateTemp, contactPerson: vaule.contactPerson, contactTel: { countryCode: vaule.tel_countryCode, phoneNumber: vaule.phoneNumber }, - faxNo: { - countryCode: vaule.fax_countryCode, - faxNumber: vaule.faxNumber - }, addressTemp: { - country: vaule.country, - district: vaule.district, + country: vaule.country.id, + district: vaule.district.id, addressLine1: vaule.addressLine1, addressLine2: vaule.addressLine2, addressLine3: vaule.addressLine3, @@ -134,26 +111,6 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { setEditMode(true); }; - const markAsCreditor = () => { - setCreditorConfirmPopUp(false); - HttpUtils.get({ - url: UrlUtils.GET_ORG_MARK_AS_CREDITOR + "/" + id, - onSuccess: () => { - loadDataFun(); - } - }); - } - - const markAsNonCreditor = () => { - setNonCreditorConfirmPopUp(false); - HttpUtils.get({ - url: UrlUtils.GET_ORG_MARK_AS_NON_CREDITOR + "/" + id, - onSuccess: () => { - loadDataFun(); - } - }); - } - return ( { {createMode ? <> - + + + : <> - + + + - + + + } @@ -218,45 +168,15 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { : <> - - - - - - - + + + } @@ -270,20 +190,25 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { - Organisation Details + {FieldUtils.getTextField({ - label: FieldUtils.notNullFieldLabel("BR No.:"), + label: intl.formatMessage({id: 'brNo'}) + ":", valueName: "brNo", - disabled: (!editMode && !createMode), + disabled: true, form: formik })} - - } label="is Creditor" name="creditor" @@ -292,41 +217,41 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { }} disabled={true} //disabled={!editMode && !createMode} - /> + /> */} {FieldUtils.getTextField({ - label: FieldUtils.notNullFieldLabel("Name (Eng):"), + label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'nameEng'}) + ":"), valueName: "enCompanyName", - disabled: (!editMode && !createMode), + disabled: true, form: formik })} {FieldUtils.getTextField({ - label: "Name (Ch):", + label: intl.formatMessage({id: 'nameChi'}) + ":", valueName: "chCompanyName", - disabled: (!editMode && !createMode), + disabled: true, form: formik })} {FieldUtils.getDateField({ - label: FieldUtils.notNullFieldLabel("Expiry Date:"), + label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'expiryDate'}) + ":"), valueName: "brExpiryDate", - disabled: (!editMode && !createMode), + disabled: true, form: formik })} {FieldUtils.getTextField({ - label: FieldUtils.notNullFieldLabel("Contact Person:"), + label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'contactPerson'}) + ":"), valueName: "contactPerson", disabled: (!editMode && !createMode), form: formik @@ -335,7 +260,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { {FieldUtils.getPhoneField({ - label: FieldUtils.notNullFieldLabel("Contact Tel:"), + label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'userContactNumber'}) + ":"), valueName: { code: "tel_countryCode", num: "phoneNumber" @@ -347,19 +272,19 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { {FieldUtils.getPhoneField({ - label: "Fax No:", + label: intl.formatMessage({id: 'contactFaxNumber'}) + ":", valueName: { code: "fax_countryCode", num: "faxNumber" }, - disabled: (!editMode && !createMode), + disabled: true, form: formik })} {FieldUtils.getComboField({ - label: FieldUtils.notNullFieldLabel("Country:"), + label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'country'}) + ":"), valueName: "country", disabled: (!editMode && !createMode), dataList: ComboData.country, @@ -370,7 +295,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { {FieldUtils.getComboField({ - label: FieldUtils.notNullFieldLabel("District:"), + label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'district'}) + ":"), valueName: "district", disabled: (!editMode && !createMode), dataList: ComboData.district, @@ -382,7 +307,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { {FieldUtils.getAddressField({ - label: FieldUtils.notNullFieldLabel("Address:"), + label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'formAddress'}) + ":"), valueName: ["addressLine1", "addressLine2", "addressLine3"], disabled: (!editMode && !createMode), form: formik @@ -395,7 +320,17 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { }
    - setCreditorConfirmPopUp(false)} > + setCreditorConfirmPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Confirm Are you sure mark as Creditor? @@ -407,7 +342,17 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
    - setNonCreditorConfirmPopUp(false)} > + setNonCreditorConfirmPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Confirm Are you sure mark as Non-Creditor? diff --git a/src/pages/Organization/DetailPage/index.js b/src/pages/Organization/DetailPage/index.js index b5d7e5b..7e0d8c5 100644 --- a/src/pages/Organization/DetailPage/index.js +++ b/src/pages/Organization/DetailPage/index.js @@ -32,6 +32,11 @@ const BackgroundHead = { backgroundColor: '#0C489E', backgroundPosition: 'right' } +import { + FormattedMessage, + // FormattedMessage, + useIntl +} from "react-intl"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -43,9 +48,14 @@ const OrganizationDetailPage = () => { const [isLoading, setLoding] = React.useState(true); const [isEditMode, setEditMode] = React.useState(false); const navigate = useNavigate(); + const intl = useIntl(); + const { locale } = intl; + + const isCreditor = locale === 'en' ?"Yes":locale === 'zh-HK' ?"是":"是"; + const notCreditor = locale === 'en' ?"No":locale === 'zh-HK' ?"否":"否"; React.useEffect(() => { - console.log(formData); + // console.log(formData); if (isINDLoggedIn()||isORGLoggedIn()&&!isPrimaryLoggedIn()){ navigate('/dashboard'); }else{ @@ -61,9 +71,9 @@ const OrganizationDetailPage = () => { HttpUtils.get({ url: UrlUtils.GET_ORG_PATH + "/" + params.id, onSuccess: function (response) { - console.log(response) - response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.address?.country); - response.data["district"] = getObjectByValue(ComboData.district, "key", response.data.address?.district); + // console.log(response) + response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.addressTemp?.country); + response.data["district"] = getObjectByValue(ComboData.district, "key", response.data.addressTemp?.district); response.data["addressLine1"] = response.data.addressTemp?.addressLine1; response.data["addressLine2"] = response.data.addressTemp?.addressLine2; response.data["addressLine3"] = response.data.addressTemp?.addressLine3; @@ -85,9 +95,10 @@ const OrganizationDetailPage = () => { HttpUtils.get({ url: UrlUtils.GET_PUB_ORG_PATH, onSuccess: function (response) { - console.log(response) - response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.address?.country); - response.data["district"] = getObjectByValue(ComboData.district, "key", response.data.address?.district); + // console.log(response) + response.data["creditor"] = response.data.creditor!=null?response.data.creditor?isCreditor:notCreditor:notCreditor; + response.data["country"] = getObjectByValue(ComboData.country, "key", response.data.addressTemp?.country); + response.data["district"] = getObjectByValue(ComboData.district, "key", response.data.addressTemp?.district); response.data["addressLine1"] = response.data.addressTemp?.addressLine1; response.data["addressLine2"] = response.data.addressTemp?.addressLine2; response.data["addressLine3"] = response.data.addressTemp?.addressLine3; @@ -115,16 +126,24 @@ const OrganizationDetailPage = () => { isLoading ? : - +
    - Maintain Organisation + {isGLDLoggedIn()? + + Maintain Organization + + : + + + + }
    - @@ -133,7 +152,7 @@ const OrganizationDetailPage = () => { - {isGLDLoggedIn? + {isGLDLoggedIn()? {
    - setIsFailPopUp(false)} > + setIsFailPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Action Fail {failText} diff --git a/src/pages/Organization/DetailPage_FromUser/index.js b/src/pages/Organization/DetailPage_FromUser/index.js index b22849a..32ce97c 100644 --- a/src/pages/Organization/DetailPage_FromUser/index.js +++ b/src/pages/Organization/DetailPage_FromUser/index.js @@ -24,7 +24,7 @@ const OrganizationDetailPage_FromUser = () => { useEffect(()=>{ - console.log(formData); + // console.log(formData); loadData(); },[]); diff --git a/src/pages/Organization/SearchPage/OrganizationSearchForm.js b/src/pages/Organization/SearchPage/OrganizationSearchForm.js index 987e284..c29e940 100644 --- a/src/pages/Organization/SearchPage/OrganizationSearchForm.js +++ b/src/pages/Organization/SearchPage/OrganizationSearchForm.js @@ -1,7 +1,6 @@ // material-ui import { Button, - CardContent, Grid, TextField, Typography, Autocomplete, @@ -15,6 +14,8 @@ import * as React from "react"; import * as UrlUtils from "utils/ApiPathConst"; import * as HttpUtils from "utils/HttpUtils"; import * as ComboData from "utils/ComboData"; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -62,119 +63,109 @@ const OrganizationSearchForm = ({ applySearch }) => {
    {/*row 1*/} - - - Search Form + + {/*row 1*/} + + + Search Form + - - - {/*row 2*/} - - - - - - - - - - - - - - - { - setCreditorSelected(newValue); + {/*row 2*/} + + + + option.label} - renderInput={(params) => ( - - )} /> - - - - + + + + + + + + + + + + { + setCreditorSelected(newValue); + }} + getOptionLabel={(option) => option.label} + renderInput={(params) => ( + + )} + /> + - {/*last row*/} - - - - - - - - - + {/*last row*/} + + + + + + + + + + + + + + - - diff --git a/src/pages/Organization/SearchPage/OrganizationTable.js b/src/pages/Organization/SearchPage/OrganizationTable.js index 73de8a0..ced795c 100644 --- a/src/pages/Organization/SearchPage/OrganizationTable.js +++ b/src/pages/Organization/SearchPage/OrganizationTable.js @@ -102,11 +102,7 @@ export default function OrganizationTable({ recordList }) {
    diff --git a/src/pages/Organization/SearchPage/index.js b/src/pages/Organization/SearchPage/index.js index 770549f..a805885 100644 --- a/src/pages/Organization/SearchPage/index.js +++ b/src/pages/Organization/SearchPage/index.js @@ -76,7 +76,7 @@ const OrganizationSearchPage = () => {
    {/*row 1*/} - + {/*row 2*/} diff --git a/src/pages/Payment/Details_GLD/DataGrid.js b/src/pages/Payment/Details_GLD/DataGrid.js index 15d2bcb..af608b4 100644 --- a/src/pages/Payment/Details_GLD/DataGrid.js +++ b/src/pages/Payment/Details_GLD/DataGrid.js @@ -69,11 +69,7 @@ export default function SearchPublicNoticeTable({ recordList }) { rowHeight={150} rows={rows} columns={columns} - initialState={{ - pagination: { - paginationModel: { page: 0, pageSize: 5 }, - }, - }} + customPageSize={5} /> Total Amount: HK$ {FormatUtils.currencyFormat(total)} diff --git a/src/pages/Payment/Details_Public/DataGrid.js b/src/pages/Payment/Details_Public/DataGrid.js index 86216ee..b05ccb2 100644 --- a/src/pages/Payment/Details_Public/DataGrid.js +++ b/src/pages/Payment/Details_Public/DataGrid.js @@ -79,11 +79,7 @@ export default function SearchPublicNoticeTable({ recordList }) { rowHeight={150} rows={rows} columns={columns} - initialState={{ - pagination: { - paginationModel: { page: 0, pageSize: 5 }, - }, - }} + customPageSize={5} /> : diff --git a/src/pages/Payment/Details_Public/index.js b/src/pages/Payment/Details_Public/index.js index d851721..fa0960c 100644 --- a/src/pages/Payment/Details_Public/index.js +++ b/src/pages/Payment/Details_Public/index.js @@ -4,7 +4,7 @@ import { Typography, Stack, Box, - // Button + Button } from '@mui/material'; import * as UrlUtils from "utils/ApiPathConst"; import * as React from "react"; @@ -17,8 +17,9 @@ import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); const PaymentDetails = Loadable(React.lazy(() => import('./PaymentDetails'))); const DataGrid = Loadable(React.lazy(() => import('./DataGrid'))); +import ForwardIcon from '@mui/icons-material/Forward'; import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' -import {FormattedMessage} from "react-intl"; +import {FormattedMessage,useIntl} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -34,6 +35,7 @@ const BackgroundHead = { const Index = () => { const params = useParams(); const navigate = useNavigate() + const intl = useIntl(); const [record, setRecord] = React.useState(); const [itemList, setItemList] = React.useState([]); @@ -99,6 +101,15 @@ const Index = () => {
    + + + {/*row 1*/} diff --git a/src/pages/Payment/MultiPaymentWindow.js b/src/pages/Payment/MultiPaymentWindow.js index a962987..8d846e4 100644 --- a/src/pages/Payment/MultiPaymentWindow.js +++ b/src/pages/Payment/MultiPaymentWindow.js @@ -89,7 +89,7 @@ const MultiPaymentWindow = (props) => { // }, [availableMethodData]); useEffect(() => { - console.log(paymentMethod) + // console.log(paymentMethod) // const subtype = (paymentMethod === "Visa" || paymentMethod === "MasterCard" || paymentMethod === "JCB" || paymentMethod === "UnionPay") ? "CreditCard" : paymentMethod; // const filteredPaymentMethod = availableMethodData.filter(obj => obj.subtype === subtype); const filteredPaymentMethod = availableMethodData.filter(obj => { @@ -98,7 +98,7 @@ const MultiPaymentWindow = (props) => { } return obj.subtype === paymentMethod; }); - console.log(filteredPaymentMethod) + // console.log(filteredPaymentMethod) setFilteredPaymentMethod(filteredPaymentMethod); setFpsClass(paymentMethod == "FPS" || paymentMethod == "" ? "" : "grayscale") @@ -237,12 +237,12 @@ const MultiPaymentWindow = (props) => { - + (HK$):  - + {" HK$ " + FormatUtils.currencyFormat(props.totalAmount)} diff --git a/src/pages/Payment/Search_GLD/DataGrid.js b/src/pages/Payment/Search_GLD/DataGrid.js index 0123a64..f8e4e46 100644 --- a/src/pages/Payment/Search_GLD/DataGrid.js +++ b/src/pages/Payment/Search_GLD/DataGrid.js @@ -87,18 +87,13 @@ export default function SearchPublicNoticeTable({ recordList }) { ]; return ( -
    - +
    diff --git a/src/pages/Payment/Search_GLD/SearchForm.js b/src/pages/Payment/Search_GLD/SearchForm.js index 505c814..4f359db 100644 --- a/src/pages/Payment/Search_GLD/SearchForm.js +++ b/src/pages/Payment/Search_GLD/SearchForm.js @@ -1,7 +1,6 @@ // material-ui import { Button, - CardContent, Grid, TextField, Autocomplete, Typography @@ -11,6 +10,8 @@ import { useForm } from "react-hook-form"; import * as React from "react"; import * as DateUtils from "utils/DateUtils"; import * as ComboData from "utils/ComboData"; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -20,22 +21,6 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); const [status, setStatus] = React.useState(ComboData.paymentStatus[0]); - const _sx = { - padding: "4 2 4 2", - boxShadow: 1, - border: 1, - borderColor: '#DDD', - '& .MuiDataGrid-cell': { - borderTop: 1, - borderBottom: 1, - borderColor: "#EEE" - }, - '& .MuiDataGrid-footerContainer': { - border: 1, - borderColor: "#EEE" - } - } - const { reset, register, handleSubmit } = useForm() const onSubmit = (data) => { @@ -58,20 +43,19 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { -
    - {/*row 1*/} - - - Search + + + {/*row 1*/} + + + Search Form + - - - {/*row 2*/} - + {/*row 2*/} + { options} options={ComboData.paymentStatus} @@ -159,39 +144,32 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { }} /> - - + {/*last row*/} - - + + - + +
    diff --git a/src/pages/Payment/Search_GLD/index.js b/src/pages/Payment/Search_GLD/index.js index 13cb5d0..a63903d 100644 --- a/src/pages/Payment/Search_GLD/index.js +++ b/src/pages/Payment/Search_GLD/index.js @@ -64,16 +64,18 @@ const Index = () => { !onReady ? : - +
    - Online Payment Record + + Payment Record +
    {/*row 1*/} - +
    diff --git a/src/pages/Payment/Search_Public/SearchForm.js b/src/pages/Payment/Search_Public/SearchForm.js index 4030aed..a7b5c65 100644 --- a/src/pages/Payment/Search_Public/SearchForm.js +++ b/src/pages/Payment/Search_Public/SearchForm.js @@ -68,8 +68,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {/*row 1*/} - - + + @@ -182,17 +182,20 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { - + diff --git a/src/pages/Payment/Search_Public/index.js b/src/pages/Payment/Search_Public/index.js index 0930897..1b2e72d 100644 --- a/src/pages/Payment/Search_Public/index.js +++ b/src/pages/Payment/Search_Public/index.js @@ -69,7 +69,7 @@ const Index = () => {
    - + diff --git a/src/pages/Payment/index.js b/src/pages/Payment/index.js index 9324740..db89bcc 100644 --- a/src/pages/Payment/index.js +++ b/src/pages/Payment/index.js @@ -301,7 +301,7 @@ const Index = () => { } useEffect(() => { - console.log(availableMethods) + // console.log(availableMethods) if (availableMethods.length > 0) { availableMethods.forEach((method) => { if (method.subtype === "FPS") { @@ -433,7 +433,17 @@ const Index = () => { {/*row 2*/}
    - setExpiryDateErr(false)} > + setExpiryDateErr(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > 行動失敗 diff --git a/src/pages/Proof/Create_FromApp/ProofForm.js b/src/pages/Proof/Create_FromApp/ProofForm.js index 14dfdfa..359521a 100644 --- a/src/pages/Proof/Create_FromApp/ProofForm.js +++ b/src/pages/Proof/Create_FromApp/ProofForm.js @@ -428,7 +428,17 @@ const FormPanel = ({ formData }) => {
    - setIsWarningPopUp(false)} > + setIsWarningPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Warning {warningText} @@ -439,7 +449,17 @@ const FormPanel = ({ formData }) => {
    - setWait(false)} > + setWait(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Calculating, please wait ... diff --git a/src/pages/Proof/Payment/Pay.js b/src/pages/Proof/Payment/Pay.js index 3350f76..9fad007 100644 --- a/src/pages/Proof/Payment/Pay.js +++ b/src/pages/Proof/Payment/Pay.js @@ -85,9 +85,9 @@ const Index = () => { ( -
    +
    - + @@ -166,7 +166,7 @@ const Index = () => { - (HK$): {FormatUtils.currencyFormat(fee)} + (HK$): {FormatUtils.currencyFormat(fee)} diff --git a/src/pages/Proof/Payment/Pay_Creditor.js b/src/pages/Proof/Payment/Pay_Creditor.js index 9d1631f..bea153b 100644 --- a/src/pages/Proof/Payment/Pay_Creditor.js +++ b/src/pages/Proof/Payment/Pay_Creditor.js @@ -65,9 +65,9 @@ const Index = () => { ( -
    - - +
    + + diff --git a/src/pages/Proof/Reply_GLD/ApplicationDetails.js b/src/pages/Proof/Reply_GLD/ApplicationDetails.js index 1b7de39..7207894 100644 --- a/src/pages/Proof/Reply_GLD/ApplicationDetails.js +++ b/src/pages/Proof/Reply_GLD/ApplicationDetails.js @@ -294,7 +294,10 @@ const ApplicationDetailCard = ({
    - setCancelPopUp(false)} > + setCancelPopUp(false)} + > Confirm Are you sure you want to cancel this proof? diff --git a/src/pages/Proof/Reply_GLD/index.js b/src/pages/Proof/Reply_GLD/index.js index 3aac47b..741f413 100644 --- a/src/pages/Proof/Reply_GLD/index.js +++ b/src/pages/Proof/Reply_GLD/index.js @@ -119,7 +119,9 @@ const Index = () => {
    - Proof Record + + Proof Record +
    diff --git a/src/pages/Proof/Reply_Public/ApplicationDetails.js b/src/pages/Proof/Reply_Public/ApplicationDetails.js index de693e7..fa77bd7 100644 --- a/src/pages/Proof/Reply_Public/ApplicationDetails.js +++ b/src/pages/Proof/Reply_Public/ApplicationDetails.js @@ -79,7 +79,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + : @@ -93,7 +93,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + : @@ -112,7 +112,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + : @@ -132,7 +132,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + : @@ -149,7 +149,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + : @@ -164,7 +164,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + : @@ -181,7 +181,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + : @@ -205,7 +205,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + @@ -248,7 +248,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + : @@ -259,9 +259,9 @@ const ApplicationDetailCard = ({ formData, }) => { { formik.values.groupType === "Private Bill" ? - ( {data.noOfPages} {intl.formatMessage({id: 'page'})} x $6,552 ) + ( {data.noOfPages} {intl.formatMessage({id: 'page'})} x $6,552 ) : - ( {data.length} cm x {data.colCount === 2 ? "$364 二格位" : "$182 一格位"} ) + ( {data.length} cm x {data.colCount === 2 ? "$364 二格位" : "$182 一格位"} ) } diff --git a/src/pages/Proof/Reply_Public/ProofForm.js b/src/pages/Proof/Reply_Public/ProofForm.js index 7c6c05a..15b2735 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -251,6 +251,7 @@ const FormPanel = ({ formData }) => { color="save" component="span" variant="contained" + aria-label={intl.formatMessage({id: 'upload'})} disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)} > @@ -303,6 +304,7 @@ const FormPanel = ({ formData }) => { variant="contained" color="success" type="submit" + aria-label={intl.formatMessage({id: 'submitReply'})} > @@ -320,7 +322,17 @@ const FormPanel = ({ formData }) => {
    - setIsWarningPopUp(false)} > + setIsWarningPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > @@ -328,7 +340,12 @@ const FormPanel = ({ formData }) => { {warningText} - +
    diff --git a/src/pages/Proof/Reply_Public/index.js b/src/pages/Proof/Reply_Public/index.js index 642ea76..bed3ac6 100644 --- a/src/pages/Proof/Reply_Public/index.js +++ b/src/pages/Proof/Reply_Public/index.js @@ -84,18 +84,22 @@ const Index = () => { : ( - +
    - +
    - diff --git a/src/pages/Proof/Search_GLD/DataGrid.js b/src/pages/Proof/Search_GLD/DataGrid.js index a1810a9..1d95455 100644 --- a/src/pages/Proof/Search_GLD/DataGrid.js +++ b/src/pages/Proof/Search_GLD/DataGrid.js @@ -2,7 +2,6 @@ import * as React from 'react'; import { Button, - Box } from '@mui/material'; import * as DateUtils from "utils/DateUtils"; import * as FormatUtils from "utils/FormatUtils" @@ -130,21 +129,14 @@ export default function SearchPublicNoticeTable({ recordList }) { } return ( -
    - - 'auto'} - /> - +
    + 'auto'} + />
    ); } diff --git a/src/pages/Proof/Search_GLD/SearchForm.js b/src/pages/Proof/Search_GLD/SearchForm.js index f364d23..84b9455 100644 --- a/src/pages/Proof/Search_GLD/SearchForm.js +++ b/src/pages/Proof/Search_GLD/SearchForm.js @@ -1,7 +1,6 @@ // material-ui import { Button, - CardContent, Grid, TextField, Autocomplete } from '@mui/material'; @@ -12,6 +11,8 @@ import * as ComboData from "utils/ComboData"; import * as DateUtils from "utils/DateUtils"; import * as FormatUtils from "utils/FormatUtils"; import { Typography } from '../../../../node_modules/@mui/material/index'; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -91,14 +92,14 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss >
    - + {/*row 1*/} - - - Search Form - - + + + Search Form + + {/*row 2*/} @@ -132,6 +133,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss options} options={ComboData.proofStatus} value={status} @@ -256,6 +260,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss {...register("orgId")} disablePortal={false} id="orgId" + size="small" options={orgCombo} value={orgSelected} inputValue={(orgSelected?.label) ? orgSelected?.label : ""} @@ -281,32 +286,25 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss {/*last row*/} - - + + - + + diff --git a/src/pages/Proof/Search_GLD/index.js b/src/pages/Proof/Search_GLD/index.js index 30119d1..4cd5764 100644 --- a/src/pages/Proof/Search_GLD/index.js +++ b/src/pages/Proof/Search_GLD/index.js @@ -92,7 +92,7 @@ const UserSearchPage_Individual = () => { !onReady ? : -
    @@ -102,7 +102,7 @@ const UserSearchPage_Individual = () => {
    {/*row 1*/} - + "auto"} onRowDoubleClick={handleRowDoubleClick} /> diff --git a/src/pages/Proof/Search_Public/SearchForm.js b/src/pages/Proof/Search_Public/SearchForm.js index b4b69a9..17bb7a7 100644 --- a/src/pages/Proof/Search_Public/SearchForm.js +++ b/src/pages/Proof/Search_Public/SearchForm.js @@ -102,8 +102,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData {/*row 1*/} - - + + @@ -276,16 +276,19 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData - + diff --git a/src/pages/Proof/Search_Public/index.js b/src/pages/Proof/Search_Public/index.js index 4aed5a9..b0de3f1 100644 --- a/src/pages/Proof/Search_Public/index.js +++ b/src/pages/Proof/Search_Public/index.js @@ -82,9 +82,9 @@ const UserSearchPage_Individual = () => { : -
    - - +
    + + diff --git a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js index 6366de6..09b1d72 100644 --- a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js +++ b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js @@ -132,19 +132,23 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
    - +
    - {/* - 申請公共啟事 + 申請公共啟事 */} @@ -184,13 +188,13 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { - + : { - - + ({intl.formatMessage({id: 'fileSizeWarning'})}): @@ -227,15 +230,35 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { /> {attachment.name} - + {/* + + */} + + + + + + + + + {isORGLoggedIn()? @@ -260,6 +283,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => {
    +
    diff --git a/src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js b/src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js index 4ddf106..0deff31 100644 --- a/src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js +++ b/src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js @@ -537,7 +537,17 @@ const ApplicationDetailCard = (
    - setIsWarningPopUp(false)} > + setIsWarningPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Warning {warningText} diff --git a/src/pages/PublicNotice/Details_GLD/GazetteDetailCard.js b/src/pages/PublicNotice/Details_GLD/GazetteDetailCard.js index 5c0b7a8..6e32f86 100644 --- a/src/pages/PublicNotice/Details_GLD/GazetteDetailCard.js +++ b/src/pages/PublicNotice/Details_GLD/GazetteDetailCard.js @@ -262,7 +262,16 @@ const GazetteDetailCard = (
    - setIsWarningPopUp(false)} > + setIsWarningPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }}> Warning {warningText} diff --git a/src/pages/PublicNotice/Details_GLD/tabTableDetail/PaymentTab.js b/src/pages/PublicNotice/Details_GLD/tabTableDetail/PaymentTab.js index f9aba55..e9ecf64 100644 --- a/src/pages/PublicNotice/Details_GLD/tabTableDetail/PaymentTab.js +++ b/src/pages/PublicNotice/Details_GLD/tabTableDetail/PaymentTab.js @@ -70,11 +70,7 @@ export default function SubmittedTab({ rows }) {
    diff --git a/src/pages/PublicNotice/Details_GLD/tabTableDetail/ProofTab.js b/src/pages/PublicNotice/Details_GLD/tabTableDetail/ProofTab.js index 759829e..19a6e55 100644 --- a/src/pages/PublicNotice/Details_GLD/tabTableDetail/ProofTab.js +++ b/src/pages/PublicNotice/Details_GLD/tabTableDetail/ProofTab.js @@ -109,11 +109,7 @@ export default function ProofTab({rows}) {
    ); diff --git a/src/pages/PublicNotice/Details_GLD/tabTableDetail/StatusHistoryTab.js b/src/pages/PublicNotice/Details_GLD/tabTableDetail/StatusHistoryTab.js index 4cd4dc4..1788537 100644 --- a/src/pages/PublicNotice/Details_GLD/tabTableDetail/StatusHistoryTab.js +++ b/src/pages/PublicNotice/Details_GLD/tabTableDetail/StatusHistoryTab.js @@ -52,11 +52,7 @@ export default function StatusHistoryTab({rows}) {
    ); diff --git a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js index 3056e19..e2f1516 100644 --- a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js +++ b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js @@ -157,6 +157,7 @@ const ApplicationDetailCard = ( || currentApplicationDetailData.status == "paid" || currentApplicationDetailData.creditor} startIcon={} + aria-label={intl.formatMessage({id: 'payFor'})} > @@ -169,6 +170,7 @@ const ApplicationDetailCard = ( disabled={currentApplicationDetailData.status !== "submitted"} title={intl.formatMessage({id: 'cancel'})} startIcon={} + aria-label={intl.formatMessage({id: 'cancel'})} > @@ -188,7 +190,7 @@ const ApplicationDetailCard = ( - + : @@ -218,7 +220,7 @@ const ApplicationDetailCard = ( - + : @@ -234,11 +236,11 @@ const ApplicationDetailCard = ( - 原因: + 原因: - + {currentApplicationDetailData.reason} @@ -257,7 +259,7 @@ const ApplicationDetailCard = ( - + : @@ -304,7 +306,7 @@ const ApplicationDetailCard = ( - + : @@ -338,7 +340,7 @@ const ApplicationDetailCard = ( - + : @@ -368,7 +370,7 @@ const ApplicationDetailCard = ( - + : @@ -403,7 +405,7 @@ const ApplicationDetailCard = ( - + : @@ -452,13 +454,13 @@ const ApplicationDetailCard = ( - + (HK$): - {FormatUtils.currencyFormat(fee)} + {FormatUtils.currencyFormat(fee)} @@ -471,7 +473,7 @@ const ApplicationDetailCard = ( - + : @@ -522,34 +524,32 @@ const ApplicationDetailCard = ( - + : - - - - {fileDetail.filename} - - - - - - + {fileDetail.filename} +
    + + @@ -564,10 +564,10 @@ const ApplicationDetailCard = ( - Care Of: + Care Of: - {currentApplicationDetailData.careOf} + {currentApplicationDetailData.careOf} : null @@ -576,12 +576,12 @@ const ApplicationDetailCard = ( - + : - {currentApplicationDetailData.remarks} + {currentApplicationDetailData.remarks} @@ -607,22 +607,40 @@ const ApplicationDetailCard = ( - (HK$): {FormatUtils.currencyFormat(fee)} + (HK$): {FormatUtils.currencyFormat(fee)} - -
    - setErrorPopUp(false)} > + setErrorPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > 行動失敗 @@ -633,8 +651,11 @@ const ApplicationDetailCard = ( - diff --git a/src/pages/PublicNotice/Details_Public/StatusChangeDialog.js b/src/pages/PublicNotice/Details_Public/StatusChangeDialog.js index 4c786b6..6f042b0 100644 --- a/src/pages/PublicNotice/Details_Public/StatusChangeDialog.js +++ b/src/pages/PublicNotice/Details_Public/StatusChangeDialog.js @@ -21,15 +21,16 @@ import * as yup from 'yup'; import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; import {FormattedMessage} from "react-intl"; - +import {useIntl} from "react-intl"; const StatusChangeDialog = (props) => { const [status, setStatus] = useState(""); - + const intl = useIntl(); + useEffect(() => { console.log(Object.keys(!props.selectedGazetteGroup).length) if(props.getStatus === "cancel"){ - setStatus("取消") + setStatus(intl.formatMessage({id: 'cancel'})) } }, [props.getStatus]); @@ -60,8 +61,8 @@ const StatusChangeDialog = (props) => { maxWidth={'xs'} > - - {status}公共啟事 + + {status} {intl.formatMessage({id: 'publicNotice'})} @@ -69,7 +70,8 @@ const StatusChangeDialog = (props) => { - 確定{status}公共啟事? + + {intl.formatMessage({id: 'confirmTo'})}{status} {intl.formatMessage({id: 'publicNotice'})}? @@ -82,7 +84,7 @@ const StatusChangeDialog = (props) => { variant="contained" onClick={props.handleClose} autoFocus - color="delete" + color="cancel" > diff --git a/src/pages/PublicNotice/Details_Public/index.js b/src/pages/PublicNotice/Details_Public/index.js index 5bf0544..7744770 100644 --- a/src/pages/PublicNotice/Details_Public/index.js +++ b/src/pages/PublicNotice/Details_Public/index.js @@ -154,7 +154,7 @@ const DashboardDefault = () => {
    - + @@ -164,7 +164,12 @@ const DashboardDefault = () => { - {title} diff --git a/src/pages/PublicNotice/Details_Public/tabTableDetail/PaymentTab.js b/src/pages/PublicNotice/Details_Public/tabTableDetail/PaymentTab.js index f30e650..6a78c58 100644 --- a/src/pages/PublicNotice/Details_Public/tabTableDetail/PaymentTab.js +++ b/src/pages/PublicNotice/Details_Public/tabTableDetail/PaymentTab.js @@ -72,11 +72,7 @@ export default function SubmittedTab({ rows }) {
    diff --git a/src/pages/PublicNotice/Details_Public/tabTableDetail/ProofTab.js b/src/pages/PublicNotice/Details_Public/tabTableDetail/ProofTab.js index 45e6d6f..3448b71 100644 --- a/src/pages/PublicNotice/Details_Public/tabTableDetail/ProofTab.js +++ b/src/pages/PublicNotice/Details_Public/tabTableDetail/ProofTab.js @@ -80,11 +80,7 @@ export default function ProofTab({rows}) {
    ); diff --git a/src/pages/PublicNotice/Details_Public/tabTableDetail/StatusHistoryTab.js b/src/pages/PublicNotice/Details_Public/tabTableDetail/StatusHistoryTab.js index 43ed2cc..8a06c52 100644 --- a/src/pages/PublicNotice/Details_Public/tabTableDetail/StatusHistoryTab.js +++ b/src/pages/PublicNotice/Details_Public/tabTableDetail/StatusHistoryTab.js @@ -44,11 +44,7 @@ export default function StatusHistoryTab({rows}) {
    ); diff --git a/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js b/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js index 5e34b08..0785c20 100644 --- a/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js +++ b/src/pages/PublicNotice/Details_Public/tabTableDetail/TabTable.js @@ -56,11 +56,15 @@ const PublicNotice = ({ proofList, paymentList }) => { - - - + diff --git a/src/pages/PublicNotice/ListPanel/BaseGrid.js b/src/pages/PublicNotice/ListPanel/BaseGrid.js index 7727eee..8789cc2 100644 --- a/src/pages/PublicNotice/ListPanel/BaseGrid.js +++ b/src/pages/PublicNotice/ListPanel/BaseGrid.js @@ -80,13 +80,13 @@ export default function BaseGrid({rows}) { renderCell: (params) => ( isORGLoggedIn()?
    - Care Of: {params.row.careOf} + Care Of: {params.row.careOf} - : {params.row.remarks} + : {params.row.remarks}
    :
    - {params.row.remarks} + {params.row.remarks}
    ) }, @@ -106,7 +106,7 @@ export default function BaseGrid({rows}) { width: 160, cellClassName: 'actions', renderCell: (params) => { - return ; }, @@ -118,15 +118,11 @@ export default function BaseGrid({rows}) { } return ( -
    +
    'auto'} /> diff --git a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js index e1f2df8..44b8765 100644 --- a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js +++ b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js @@ -166,12 +166,12 @@ export default function SubmittedTab({ rows }) { renderCell: (params) => ( isORGLoggedIn() ?
    - Care Of: {params.row.careOf} - + Care Of: {params.row.careOf} + : {params.row.remarks}
    :
    - {params.row.remarks} + {params.row.remarks}
    ) }, @@ -202,7 +202,7 @@ export default function SubmittedTab({ rows }) { width: 150, cellClassName: 'actions', renderCell: (params) => { - return ; }, @@ -230,7 +230,7 @@ export default function SubmittedTab({ rows }) { totalAmount += datas[i].fee; } content.push( - (HK$): {FormatUtils.currencyFormat(totalAmount)} + (HK$): {FormatUtils.currencyFormat(totalAmount)}

    ); //setAmount(totalAmount); @@ -307,11 +307,7 @@ export default function SubmittedTab({ rows }) { disableRowSelectionOnClick rows={rowList} columns={columns} - initialState={{ - pagination: { - paginationModel: { page: 0, pageSize: 20 }, - }, - }} + customPageSize={20} onRowSelectionModelChange={(newSelection) => { setSelectedRowItems(newSelection); }} @@ -323,6 +319,7 @@ export default function SubmittedTab({ rows }) { - @@ -366,7 +365,17 @@ export default function SubmittedTab({ rows }) {
    - setCheckCareOf(false)} > + setCheckCareOf(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Warning @@ -377,11 +386,13 @@ export default function SubmittedTab({ rows }) { - - @@ -389,7 +400,17 @@ export default function SubmittedTab({ rows }) {
    - setExpiryDateErr(false)} > + setExpiryDateErr(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > 行動失敗 @@ -400,7 +421,7 @@ export default function SubmittedTab({ rows }) { - diff --git a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js index e0b5508..f668a49 100644 --- a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js +++ b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeForm.js @@ -64,8 +64,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => {
    {/*row 1*/} - - + + {/*row 2*/} @@ -75,6 +75,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { fullWidth {...register("appNo")} id='appNo' + aria-label={intl.formatMessage({id: 'applicationId'})} label={intl.formatMessage({id: 'applicationId'})} defaultValue={searchCriteria.appNo} InputLabelProps={{ @@ -89,6 +90,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {...register("dateFrom")} id="dateFrom" type="date" + aria-label={intl.formatMessage({id: 'submitDateFrom'})} label={intl.formatMessage({id: 'submitDateFrom'})} defaultValue={searchCriteria.dateFrom} InputProps={{ inputProps: { max: maxDate } }} @@ -110,6 +112,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {...register("dateTo")} id="dateTo" type="date" + aria-label={intl.formatMessage({id: 'submitDateTo'})} label={intl.formatMessage({id: 'submitDateTo'})} defaultValue={searchCriteria.dateTo} InputProps={{ inputProps: { min: minDate } }} @@ -125,6 +128,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {...register("careOf")} id="careOf" label="Care Of" + aria-label={"Care Of"} defaultValue={searchCriteria.careOf} InputLabelProps={{ shrink: true @@ -139,6 +143,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { {...register("contact")} id="contact" label={intl.formatMessage({id: 'contactPerson'})} + aria-label={intl.formatMessage({id: 'contactPerson'})} defaultValue={searchCriteria.contact} InputLabelProps={{ shrink: true @@ -183,6 +188,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { renderInput={(params) => ( { - + ; }, @@ -121,15 +123,11 @@ export default function SearchPublicNoticeTable({ recordList }) { } return ( -
    +
    'auto'} /> diff --git a/src/pages/PublicNotice/ListPanel/index.js b/src/pages/PublicNotice/ListPanel/index.js index 72112f0..2d36982 100644 --- a/src/pages/PublicNotice/ListPanel/index.js +++ b/src/pages/PublicNotice/ListPanel/index.js @@ -108,7 +108,7 @@ const PublicNotice = () => {
    - + @@ -118,7 +118,7 @@ const PublicNotice = () => { - @@ -129,14 +129,14 @@ const PublicNotice = () => { { JSON.parse(localStorage.getItem('userData')).creditor ? ( - + - + - - - - + + + + @@ -166,14 +166,14 @@ const PublicNotice = () => { ) : ( - + - - - - + + + + diff --git a/src/pages/PublicNotice/Search_GLD/DataGrid.js b/src/pages/PublicNotice/Search_GLD/DataGrid.js index 617e81a..3f3237a 100644 --- a/src/pages/PublicNotice/Search_GLD/DataGrid.js +++ b/src/pages/PublicNotice/Search_GLD/DataGrid.js @@ -1,8 +1,7 @@ // material-ui import * as React from 'react'; import { - Button, - Box + Button } from '@mui/material'; import * as DateUtils from "utils/DateUtils"; import * as FormatUtils from "utils/FormatUtils"; @@ -111,20 +110,14 @@ export default function SearchPublicNoticeTable({ recordList }) { } return ( -
    - - 'auto'} - onRowDoubleClick={handleRowDoubleClick} - /> - +
    + 'auto'} + onRowDoubleClick={handleRowDoubleClick} + />
    ); } diff --git a/src/pages/PublicNotice/Search_GLD/SearchForm.js b/src/pages/PublicNotice/Search_GLD/SearchForm.js index b0376c6..0bd2150 100644 --- a/src/pages/PublicNotice/Search_GLD/SearchForm.js +++ b/src/pages/PublicNotice/Search_GLD/SearchForm.js @@ -94,7 +94,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss {/*row 1*/} - + Search Form @@ -237,6 +237,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss disablePortal id="orgId" options={orgCombo} + size="small" value={orgSelected} inputValue={(orgSelected?.label) ? orgSelected?.label : ""} onChange={(event, newValue) => { @@ -261,8 +262,8 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss - + + + + : + + Please select system params. + + + } + + + ); +}; + +export default Form; diff --git a/src/pages/Setting/SystemSetting/Table.js b/src/pages/Setting/SystemSetting/Table.js new file mode 100644 index 0000000..8006676 --- /dev/null +++ b/src/pages/Setting/SystemSetting/Table.js @@ -0,0 +1,73 @@ +// material-ui +import { + Box, + Typography +} from '@mui/material'; +import MainCard from "components/MainCard"; +import * as React from "react"; +import { FiDataGrid } from "components/FiDataGrid"; + + +// ==============================|| DASHBOARD - DEFAULT ||============================== // +const Table = ({onRowClick, dataList}) => { + const [rows, setRows] = React.useState(dataList); + + React.useEffect(() => { + setRows(dataList); + }, [dataList]); + + const columns = [ + { + field: 'name', + headerName: 'Name', + width: 300, + }, + { + id: 'type', + field: 'type', + headerName: 'Type', + width: 150, + valueGetter: (params) => { + return params.row.type + } + }, + { + id: 'category', + field: 'category', + headerName: 'Category', + width: 150, + }, + { + id: 'value', + field: 'value', + headerName: 'Value', + flex: 1 + }, + ]; + return ( + + + + System Params + + +
    + + 'auto'} + onRowClick={onRowClick} + /> + +
    +
    + ); +}; + +export default Table; diff --git a/src/pages/Setting/SystemSetting/index.js b/src/pages/Setting/SystemSetting/index.js new file mode 100644 index 0000000..016e401 --- /dev/null +++ b/src/pages/Setting/SystemSetting/index.js @@ -0,0 +1,110 @@ + +import { + Grid, + Typography, + Stack, + Box, +} from '@mui/material'; +import * as React from "react"; + +import { GET_SYS_PARAMS, } from "utils/ApiPathConst"; + +import Loadable from 'components/Loadable'; +const Table = Loadable(React.lazy(() => import('./Table'))); +const Form = Loadable(React.lazy(() => import('./Form'))); + +import { notifyActionSuccess } from 'utils/CommonFunction'; + +import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' + +import * as HttpUtils from "utils/HttpUtils"; + +const BackgroundHead = { + backgroundImage: `url(${titleBackgroundImg})`, + width: '100%', + height: '100%', + backgroundSize: 'contain', + backgroundRepeat: 'no-repeat', + backgroundColor: '#0C489E', + backgroundPosition: 'right' +} +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const SystemSetting = () => { + const [dataList, setDataList] = React.useState([]); + const [selectedItem, setSelectedItem] = React.useState({}); + + React.useEffect(() => { + loadList(); + }, []); + + const loadList=()=>{ + HttpUtils.get({ + url: GET_SYS_PARAMS, + onSuccess: (responseData)=>{ + setDataList(responseData); + } + }); + } + + const onRowClick=(param)=>{ + setSelectedItem(param.row); + } + + const onSave=(param)=>{ + HttpUtils.post({ + url: GET_SYS_PARAMS+"/update", + params:{ + name: param.name, + value: param.value + }, + onSuccess: ()=>{ + notifyActionSuccess(); + loadList(); + } + }); + } + + + return ( + + + <> + +
    + + System Setting + +
    +
    + + {/*col 1*/} + + + + + + + + + +
    +
    +
    + + + {/*col 2*/} + + + ); +}; + +export default SystemSetting; diff --git a/src/pages/User/DetailPage/UserAuthTable.js b/src/pages/User/DetailPage/UserAuthTable.js index 2f53a39..da7c455 100644 --- a/src/pages/User/DetailPage/UserAuthTable.js +++ b/src/pages/User/DetailPage/UserAuthTable.js @@ -4,10 +4,10 @@ import { } from "@mui/x-data-grid"; import {useEffect, useState} from "react"; import axios from "axios"; -import {apiPath} from "../../../auth/utils"; +import {apiPath} from "auth/utils"; //import LoadingComponent from "../extra-pages/LoadingComponent"; import * as React from "react"; -import {GET_AUTH_LIST} from "../../../utils/ApiPathConst"; +import {GET_AUTH_LIST} from "utils/ApiPathConst"; import Loadable from 'components/Loadable'; import { lazy } from 'react'; @@ -20,22 +20,18 @@ export default function UserAuthTable({setSelectedRow, userAuth,isNewRecord}) { const [onReady, setOnReady] = useState(false); const [currentSelectedRow, setCurrentSelectedRow] = useState(userAuth); const _sx = { - ml: 3, - mb: 3, - mr: 3, - padding: "4 2 4 2", boxShadow: 1, border: 1, borderColor: '#DDD', '& .MuiDataGrid-cell': { borderTop: 1, - borderBottom: 1, + //borderBottom: 1, borderColor: "#EEE" }, - '& .MuiDataGrid-footerContainer': { - border: 1, - borderColor: "#EEE" - } + // '& .MuiDataGrid-footerContainer': { + // border: 1, + // borderColor: "#EEE" + // } } useEffect(() => { axios.get(`${apiPath}${GET_AUTH_LIST}`) diff --git a/src/pages/User/DetailPage/UserAuthorityCard.js b/src/pages/User/DetailPage/UserAuthorityCard.js index fd2dd27..756a33a 100644 --- a/src/pages/User/DetailPage/UserAuthorityCard.js +++ b/src/pages/User/DetailPage/UserAuthorityCard.js @@ -49,8 +49,9 @@ const UserAuthorityCard = ({ isCollectData, updateUserAuthList, userData, isNewR - + User Authority diff --git a/src/pages/User/DetailPage/UserGroupCard.js b/src/pages/User/DetailPage/UserGroupCard.js index d926c95..e798706 100644 --- a/src/pages/User/DetailPage/UserGroupCard.js +++ b/src/pages/User/DetailPage/UserGroupCard.js @@ -23,6 +23,7 @@ const UserGroupCard = ({isCollectData, updateUserGroupList,userData,isNewRecord} useEffect(() => { //if user data from parent are not null if (Object.keys(userData).length > 0 && userData !== undefined) { + // console.log(userData.groupIds) setCurrentUserData(userData.data); setSelectedRow(userData.groupIds); } @@ -48,8 +49,9 @@ const UserGroupCard = ({isCollectData, updateUserGroupList,userData,isNewRecord} - + Group(s) import('../../extra-pages/LoadingComponent'))); @@ -19,9 +19,6 @@ export default function UserGroupTable({setSelectedRow, userGroup,isNewRecord}) const [currentSelectedRow, setCurrentSelectedRow] = useState(userGroup); const _sx = { - ml: 3, - mb: 3, - mr: 3, padding: "4 2 4 2", boxShadow: 1, border: 1, @@ -41,7 +38,9 @@ export default function UserGroupTable({setSelectedRow, userGroup,isNewRecord}) axios.get(`${apiPath}${GET_GROUP_COMBO_PATH}`) .then((response) => { if (response.status === 200) { + // console.log(userGroup) setGroupData(response.data.records); + setCurrentSelectedRow(userGroup); } }) .catch(error => { @@ -85,7 +84,7 @@ export default function UserGroupTable({setSelectedRow, userGroup,isNewRecord}) checkboxSelection rowSelectionModel={currentSelectedRow} onRowSelectionModelChange={(ids) => { - console.log(ids); + // console.log(ids); setSelectedRow(ids); setCurrentSelectedRow(ids); }} diff --git a/src/pages/User/DetailPage/UserInformationCard.js b/src/pages/User/DetailPage/UserInformationCard.js index 265d9dc..07b5cab 100644 --- a/src/pages/User/DetailPage/UserInformationCard.js +++ b/src/pages/User/DetailPage/UserInformationCard.js @@ -67,8 +67,9 @@ const UserInformationCard = ({isCollectData, updateUserObject,userData,isNewReco - + Information @@ -236,10 +237,10 @@ const UserInformationCard = ({isCollectData, updateUserObject,userData,isNewReco */} - + + sx={{ml: 3, mr: 3, mb:3, display: 'flex', alignItems: 'center'}}> Locked: diff --git a/src/pages/User/DetailPage/index.js b/src/pages/User/DetailPage/index.js index fc21433..9ae8562 100644 --- a/src/pages/User/DetailPage/index.js +++ b/src/pages/User/DetailPage/index.js @@ -10,7 +10,7 @@ import { useEffect, useState } from "react"; import * as React from "react"; import axios from "axios"; import { useNavigate, useParams } from "react-router-dom"; -import { GLD_USER_PATH, DELETE_USER, POST_ADMIN_USER_REGISTER } from "../../../utils/ApiPathConst"; +import { GLD_USER_PATH, DELETE_USER, POST_ADMIN_USER_REGISTER } from "utils/ApiPathConst"; import Loadable from 'components/Loadable'; import { lazy } from 'react'; @@ -23,7 +23,7 @@ import { getDeletedRecordWithRefList, notifyDeleteSuccess, notifySaveSuccess, -} from "../../../utils/CommonFunction"; +} from "utils/CommonFunction"; import ForwardIcon from '@mui/icons-material/Forward'; import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' @@ -221,7 +221,7 @@ const UserMaintainPage = () => { - + { - - + + { {/*col 2*/} - + { {/*bottom button*/} - + + : <> + + } @@ -321,16 +313,14 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { })} + + } @@ -454,31 +444,27 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { {locked ? + + : + + } diff --git a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js index 4c9f5ac..2a2bb86 100644 --- a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js +++ b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js @@ -116,7 +116,9 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { diff --git a/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js b/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js index 47bbf86..1f229f3 100644 --- a/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js +++ b/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js @@ -18,6 +18,8 @@ import Loadable from 'components/Loadable'; import { lazy } from 'react'; import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction'; import {useIntl} from "react-intl"; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -196,50 +198,39 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => {editMode ? <> + - + : <> + + } @@ -380,17 +371,14 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => })} + + } @@ -436,33 +424,27 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => {formik.values.locked ? + + : + + } @@ -478,11 +460,13 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => {currentUserData.orgId == null ? + + : null } @@ -577,25 +561,55 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => }
    - setIsWarningPopUp(false)} > + setIsWarningPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Warning {warningText} - + + +
    - setIsConfirmPopUp(false)} > + setIsConfirmPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Confirm {confirmText} - - + + + +
    diff --git a/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization_Pub.js b/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization_Pub.js index 6d0fc88..ed94098 100644 --- a/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization_Pub.js +++ b/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization_Pub.js @@ -114,6 +114,7 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => {
    diff --git a/src/pages/User/GLDUserProfile/UserInformationCard.js b/src/pages/User/GLDUserProfile/UserInformationCard.js new file mode 100644 index 0000000..873cae7 --- /dev/null +++ b/src/pages/User/GLDUserProfile/UserInformationCard.js @@ -0,0 +1,160 @@ +// material-ui +import { + FormControl, + // IconButton, + Grid, + // InputAdornment, + Typography, FormLabel, + OutlinedInput, +} from '@mui/material'; +import MainCard from "components/MainCard"; +import * as React from "react"; + +import {useEffect, useState} from "react"; +import Loadable from 'components/Loadable'; +import { lazy } from 'react'; +const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); + + +// ==============================|| DASHBOARD - DEFAULT ||============================== // +const UserInformationCard = ({userData}) => { + const [currentUserData, setCurrentUserData] = React.useState({}); + // const [locked, setLocked] = useState(false); + const [onReady, setOnReady] = useState(false); + + useEffect(() => { + //if user data from parent are not null + if (Object.keys(userData).length > 0 && userData !== undefined) { + setCurrentUserData(userData.data); + } + }, [userData]); + + useEffect(() => { + //if state data are ready and assign to different field + if (Object.keys(userData).length > 0 &¤tUserData !== undefined&¤tUserData.id!==undefined) { + // console.log(currentUserData) + // setLocked(currentUserData.locked); + setOnReady(true); + } + }, [currentUserData]); + + return ( + !onReady ? + + : + + + Information + + +
    + + + + + Username: + + + + + + + + + + + + + + Full Name: + + + + + + + + + + + + + + Post: + + + + + + + + + + + + + + Email: + + + + + + + + + + + + + +
    + ); +}; + +export default UserInformationCard; diff --git a/src/pages/User/GLDUserProfile/index.js b/src/pages/User/GLDUserProfile/index.js new file mode 100644 index 0000000..f77df99 --- /dev/null +++ b/src/pages/User/GLDUserProfile/index.js @@ -0,0 +1,110 @@ +// material-ui +import { + // Button, + Grid, + Typography, + Stack, + Box, +} from '@mui/material'; +import { useEffect, useState } from "react"; +import * as React from "react"; +import axios from "axios"; +// import { useNavigate, + // useParams +// } from "react-router-dom"; +import { GLD_USER_PATH, + // DELETE_USER, + // POST_ADMIN_USER_REGISTER +} from "utils/ApiPathConst"; + +import Loadable from 'components/Loadable'; +import { lazy } from 'react'; +const UserInformationCard = Loadable(lazy(() => import('./UserInformationCard'))); +const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); +// const UserGroupCard = Loadable(lazy(() => import('./UserGroupCard'))); +// const UserAuthorityCard = Loadable(lazy(() => import('./UserAuthorityCard'))); +import { + // GeneralConfirmWindow, + // getDeletedRecordWithRefList, + // notifyDeleteSuccess, + // notifySaveSuccess, +} from "utils/CommonFunction"; +// import ForwardIcon from '@mui/icons-material/Forward'; +import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' + +import { + getUserId, +} from "utils/Utils"; + +const BackgroundHead = { + backgroundImage: `url(${titleBackgroundImg})`, + width: '100%', + height: '100%', + backgroundSize: 'contain', + backgroundRepeat: 'no-repeat', + backgroundColor: '#0C489E', + backgroundPosition: 'right' +} +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const UserMaintainPage = () => { + // const params = useParams(); + // const navigate = useNavigate(); + const [userData, setUserData] = React.useState({}); + const [onReady, setOnReady] = useState(false); + + useEffect(() => { + axios.get(`${GLD_USER_PATH}/${getUserId()}`) + .then((response) => { + if (response.status === 200) { + setUserData(response.data); + } + }) + .catch(error => { + console.log(error); + return false; + }); + }, []); + + useEffect(() => { + if (Object.keys(userData).length > 0 && userData !== undefined) { + setOnReady(true); + } + }, [userData]); + + return ( + !onReady ? + + : + + +
    + + + User Profile + + +
    +
    + + {/*col 1*/} + + + + + + + + + + {/*col 2*/} + +
    + ); +}; + +export default UserMaintainPage; diff --git a/src/pages/User/ManagePage_OrgPublic/index.js b/src/pages/User/ManagePage_OrgPublic/index.js index 02325e5..cf7fa21 100644 --- a/src/pages/User/ManagePage_OrgPublic/index.js +++ b/src/pages/User/ManagePage_OrgPublic/index.js @@ -222,7 +222,7 @@ const ManageOrgUserPage = () => {
    - + @@ -234,15 +234,21 @@ const ManageOrgUserPage = () => { sx={_sx} rows={rows} columns={columns} - initialState={{ - pagination: { - paginationModel: { page: 0, pageSize: 10 }, - }, - }} + customPageSize={10} />
    - setIsWarningPopUp(false)} > + setIsWarningPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > diff --git a/src/pages/User/SearchPage/UserSearchForm.js b/src/pages/User/SearchPage/UserSearchForm.js index a2949d7..6581070 100644 --- a/src/pages/User/SearchPage/UserSearchForm.js +++ b/src/pages/User/SearchPage/UserSearchForm.js @@ -1,7 +1,7 @@ // material-uisubDivision import { Button, - CardContent, FormControlLabel, + FormControlLabel, Grid, TextField, Typography } from '@mui/material'; @@ -19,6 +19,8 @@ import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; import { useNavigate } from "react-router"; import axios from "axios"; import { GET_EMAIL_LIST } from 'utils/ApiPathConst'; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -76,15 +78,16 @@ const UserSearchForm = ({ applySearch }) => { content={false}>
    - {/*row 1*/} - - - Search Form (GLD User) + + {/*row 1*/} + + + Search Form (GLD User) + - + {/*row 2*/} - {/*row 2*/} - + { size="small" /> } - label={Locked} + label={Locked} /> - {/*last row*/} - - - - - - - - - - - - + {/*last row*/} + + + + + + + + + + + + + + + + diff --git a/src/pages/User/SearchPage/UserTable.js b/src/pages/User/SearchPage/UserTable.js index f6c63e4..919bfb7 100644 --- a/src/pages/User/SearchPage/UserTable.js +++ b/src/pages/User/SearchPage/UserTable.js @@ -133,11 +133,7 @@ export default function UserTable({recordList,setChangeLocked}) { 'auto'} /> diff --git a/src/pages/User/SearchPage/index.js b/src/pages/User/SearchPage/index.js index 09ab603..fba0ad2 100644 --- a/src/pages/User/SearchPage/index.js +++ b/src/pages/User/SearchPage/index.js @@ -82,7 +82,7 @@ const UserSettingPage = () => { {/*row 1*/} - + {/*row 2*/} diff --git a/src/pages/User/SearchPage_Individual/UserSearchForm_Individual.js b/src/pages/User/SearchPage_Individual/UserSearchForm_Individual.js index 28a9ceb..046fb8e 100644 --- a/src/pages/User/SearchPage_Individual/UserSearchForm_Individual.js +++ b/src/pages/User/SearchPage_Individual/UserSearchForm_Individual.js @@ -1,7 +1,6 @@ // material-ui import { Button, - CardContent, Grid, TextField, Autocomplete, Typography @@ -10,6 +9,8 @@ import MainCard from "../../../components/MainCard"; import { useForm } from "react-hook-form"; import { useState } from "react"; import * as React from "react"; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -48,15 +49,16 @@ const UserSearchForm_Individual = ({ applySearch }) => { content={false}>
    - {/*row 1*/} - - - Search Form + + {/*row 1*/} + + + Search Form + - + {/*row 2*/} - {/*row 2*/} - + { {...register("accountFilter")} disablePortal id="accountFilter" + size="small" options={["Active", "Locked", "Not verified"]} value={accountFilter} onChange={(event, newValue) => { @@ -141,32 +144,26 @@ const UserSearchForm_Individual = ({ applySearch }) => { {/*last row*/} - - + + - + + + diff --git a/src/pages/User/SearchPage_Individual/UserTable_Individual.js b/src/pages/User/SearchPage_Individual/UserTable_Individual.js index 77e84d4..37d3218 100644 --- a/src/pages/User/SearchPage_Individual/UserTable_Individual.js +++ b/src/pages/User/SearchPage_Individual/UserTable_Individual.js @@ -140,11 +140,7 @@ export default function UserTable_Individual({ recordList }) {
    diff --git a/src/pages/User/SearchPage_Individual/index.js b/src/pages/User/SearchPage_Individual/index.js index 2d9f4f4..131505b 100644 --- a/src/pages/User/SearchPage_Individual/index.js +++ b/src/pages/User/SearchPage_Individual/index.js @@ -71,13 +71,15 @@ const UserSearchPage_Individual = () => {
    - View Individual User + + View Individual User +
    {/*row 1*/} - + {/*row 2*/} diff --git a/src/pages/User/SearchPage_Organization/UserSearchForm_Organization.js b/src/pages/User/SearchPage_Organization/UserSearchForm_Organization.js index 1e414ef..f946a39 100644 --- a/src/pages/User/SearchPage_Organization/UserSearchForm_Organization.js +++ b/src/pages/User/SearchPage_Organization/UserSearchForm_Organization.js @@ -1,7 +1,7 @@ // material-ui import { Button, - CardContent, Autocomplete, + Autocomplete, Grid, TextField, Typography } from '@mui/material'; @@ -10,6 +10,8 @@ import {useForm} from "react-hook-form"; import { useState} from "react"; import * as React from "react"; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -51,150 +53,145 @@ const UserSearchForm_Organization = ({applySearch}) => { border={false} content={false}> -
    - {/*row 1*/} - - - Search Form - - - - {/*row 2*/} - - - - - - - - + + + {/*row 1*/} + + + Search Form + + {/*row 2*/} + - - - - - - - - - - - - - - - - - { - if (newValue !== null){ - setAccountFilter(newValue); - } - }} - renderInput={(params) => ( - + + + + + + + + + + + + + + + + + + + + + + + + { + if (newValue !== null){ + setAccountFilter(newValue); + } + }} + renderInput={(params) => ( + + )} /> - )} - /> - - {/**/} - {/* */} - {/**/} - - + + {/**/} + {/* */} + {/**/} - - {/*last row*/} - - - - - - + + {/*last row*/} + + + + + + + + + + diff --git a/src/pages/User/SearchPage_Organization/UserTable_Organization.js b/src/pages/User/SearchPage_Organization/UserTable_Organization.js index 6db5c22..7fe38ba 100644 --- a/src/pages/User/SearchPage_Organization/UserTable_Organization.js +++ b/src/pages/User/SearchPage_Organization/UserTable_Organization.js @@ -135,11 +135,7 @@ export default function UserTable_Organization({recordList}) {
    diff --git a/src/pages/User/SearchPage_Organization/index.js b/src/pages/User/SearchPage_Organization/index.js index 98f9553..e789caa 100644 --- a/src/pages/User/SearchPage_Organization/index.js +++ b/src/pages/User/SearchPage_Organization/index.js @@ -77,7 +77,7 @@ const UserSearchPage_Organization = () => {
    {/*row 1*/} - + {/*row 2*/} diff --git a/src/pages/_Test/Mail/index.js b/src/pages/_Test/Mail/index.js index d91727d..e469905 100644 --- a/src/pages/_Test/Mail/index.js +++ b/src/pages/_Test/Mail/index.js @@ -92,7 +92,17 @@ const Mail = () => {
    - setIsResponsPopUp(false)} > + setIsResponsPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > Respons {responsText} diff --git a/src/pages/authentication/ForgotPassword/AfterForgotPasswordPage.js b/src/pages/authentication/ForgotPassword/AfterForgotPasswordPage.js new file mode 100644 index 0000000..84ca616 --- /dev/null +++ b/src/pages/authentication/ForgotPassword/AfterForgotPasswordPage.js @@ -0,0 +1,391 @@ +// material-ui +import { + Grid, + Typography, + Button, + // RadioGroup, + Dialog, DialogTitle, DialogContent, DialogActions, + Stack, + InputLabel, + // OutlinedInput, + FormHelperText, + TextField, + IconButton, InputAdornment, + // Box, + // FormControl +} from '@mui/material'; +import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; +// import { strengthColorChi, strengthIndicator } from 'utils/password-strength'; + +import { useFormik } from 'formik'; +import * as yup from 'yup'; +import * as React from "react"; +// import * as HttpUtils from "utils/HttpUtils"; +// import * as UrlUtils from "utils/ApiPathConst"; +// import * as FieldUtils from "utils/FieldUtils"; +import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import ForwardIcon from '@mui/icons-material/Forward'; +import MainCard from 'components/MainCard'; + + +import { useNavigate } from "react-router-dom"; +// import { notifyActionSuccess } from 'utils/CommonFunction'; +import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; +import {FormattedMessage, useIntl} from "react-intl"; + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const AfterForgotPasswordPage = () => { + const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); + const [showPassword, setShowPassword] = React.useState(false); + const [showConfirmPassword, setshowConfirmPassword] = React.useState(false); + // const [level, setLevel] = React.useState(); + const intl = useIntl(); + + // const [issueId, setIssueId] = React.useState(loadedData.issueId); + const navigate = useNavigate(); + + const BackgroundHead = { + backgroundImage: `url(${titleBackgroundImg})`, + width: 'auto', + height: 'auto', + backgroundSize: 'contain', + backgroundRepeat: 'no-repeat', + backgroundColor: '#0C489E', + backgroundPosition: 'right' + } + + const handleClickShowPassword = () => { + setShowPassword(!showPassword); + }; + + const handleClickShowConfirmPassword = () => { + setshowConfirmPassword(!showConfirmPassword); + }; + + const handleMouseDownPassword = (event) => { + event.preventDefault(); + }; + + const changePassword = ( + // value + ) => { + // const temp = strengthIndicator(value); + // setLevel(strengthColorChi(temp)); + }; + + const formik = useFormik({ + enableReinitialize: true, + initialValues: { + username: '', + password: '', + confirmPassword: '', + emailVerifyHash: '', + }, + validationSchema: yup.object().shape({ + emailVerifyHash: yup.string().required(intl.formatMessage({id: 'requireSecurityCode'})), + username: yup.string().required(intl.formatMessage({id: 'requireUsername'})), + password: yup.string().min(8, (intl.formatMessage({id: 'atLeast8CharPassword'}))).required(intl.formatMessage({id: 'requirePassword'})) + .matches(/^\S*$/, { message: (intl.formatMessage({id: 'noSpacePassword'})) }) + .matches(/^(?=.*[a-z])/, { message: (intl.formatMessage({id: 'atLeastOneSmallLetter'})) }) + .matches(/^(?=.*[A-Z])/, { message: (intl.formatMessage({id: 'atLeastOneCapLetter'})) }) + .matches(/^(?=.*[0-9])/, { message: (intl.formatMessage({id: 'atLeast1Number'})) }) + .matches(/^(?=.*[!@#%&])/, { message: (intl.formatMessage({id: 'atLeast1SpecialChar'})) }), + confirmPassword: yup.string().min(8, (intl.formatMessage({id: 'atLeast8CharPassword'}))).required((intl.formatMessage({id: 'pleaseConfirmPassword'}))).oneOf([yup.ref('password'), null], (intl.formatMessage({id: 'samePassword'}))), + }), + onSubmit: values => { + console.log(values) + } + }); + + return ( + + +
    + + + + + +
    +
    + + + + {/* + 申請公共啟事 + */} + + *': { + flexGrow: 1, + flexBasis: '50%' + } + }} + content={false} + border={false} + boxShadow + > +
    + + + + + + + + + + + + + + + + + + + + + + { + if (e.key === 'Enter') { + e.preventDefault(); + } + }, + }} + InputLabelProps={{ + shrink: true + }} + /> + + {formik.touched.emailVerifyHash && formik.errors.emailVerifyHash && ( + + {formik.errors.emailVerifyHash} + + )} + + + + + + { + if (e.key === 'Enter') { + e.preventDefault(); + } + }, + }} + InputLabelProps={{ + shrink: true + }} + /> + + {formik.touched.username && formik.errors.username && ( + + {formik.errors.username} + + )} + + + + + + { + formik.handleChange(e); + changePassword(e.target.value); + }} + id="password" + type={showPassword ? 'text' : 'password'} + name="password" + placeholder={intl.formatMessage({id: 'userPassword'})} + label={intl.formatMessage({id: 'userPassword'}) + ":"} + // defaultValue={formik.values.password.trim()} + value={formik.values.password.trim()} + error={Boolean(formik.touched.password && formik.errors.password)} + onBlur={formik.handleBlur} + inputProps={{ + onKeyDown: (e) => { + if (e.key === 'Enter') { + e.preventDefault(); + } + }, + }} + InputLabelProps={{ + shrink: true + }} + InputProps={{ + endAdornment:( + + + {showPassword ? : } + + + ) + }} + /> + + {/* + + + + + + + + + + + */} + {formik.touched.password && formik.errors.password && ( + + {formik.errors.password} + + )} + + + + + + { + formik.handleChange(e); + // changePassword(e.target.value); + }} + id="confirmPassword" + type={showConfirmPassword ? 'text' : 'password'} + name="confirmPassword" + placeholder={intl.formatMessage({id: 'confirmPassword'})} + label={intl.formatMessage({id: 'confirmPassword'}) + ":"} + defaultValue={formik.values.confirmPassword.trim()} + value={formik.values.confirmPassword.trim()} + error={Boolean(formik.touched.confirmPassword && formik.errors.confirmPassword)} + onBlur={formik.handleBlur} + inputProps={{ + maxLength: 50, + onKeyDown: (e) => { + if (e.key === 'Enter') { + e.preventDefault(); + } + }, + }} + InputLabelProps={{ + shrink: true + }} + InputProps={{ + endAdornment:( + + + {showConfirmPassword ? : } + + + ) + }} + /> + + {formik.touched.confirmPassword && formik.errors.confirmPassword && ( + + {formik.errors.confirmPassword} + + )} + + + + + + + + + +
    +
    +
    + setIsWarningPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + + + + + {/* {warningText} */} + + + + + +
    +
    + ); +}; + + +export default AfterForgotPasswordPage; diff --git a/src/pages/authentication/ForgotPassword/AuthCallback/index.js b/src/pages/authentication/ForgotPassword/AuthCallback/index.js new file mode 100644 index 0000000..cf89e89 --- /dev/null +++ b/src/pages/authentication/ForgotPassword/AuthCallback/index.js @@ -0,0 +1,86 @@ + +import * as React from "react"; +import * as HttpUtils from "utils/HttpUtils"; +import * as UrlUtils from "utils/ApiPathConst"; +import { useNavigate } from "react-router-dom"; +import { useDispatch } from "react-redux"; +import { handleLogoutFunction, handleLogin } from 'auth/index'; + +import Loadable from 'components/Loadable'; +const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); + + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const Index = () => { + + const dispatch = useDispatch() + const navigate = useNavigate() + + React.useEffect(() => { + goLogin(); + }, []); + + function goLogin(){ + dispatch(handleLogoutFunction()); + + let params = new URLSearchParams(window.location.search) + if(params.get("code")){ + HttpUtils.post({ + url: UrlUtils.GET_SMART_LOGIN, + params:{ + code: params.get("code") + }, + onSuccess: (responseData) => { + console.log("responseData"); + console.log(responseData); + const userData = { + id: responseData.id, + fullenName: responseData.name, + fullchName: responseData.chName, + email: responseData.email, + type: responseData.type, + role: responseData.role, + abilities: responseData.abilities, + creditor: responseData.creditor, + locale: responseData.preferLocale, + //avatar: require('src/assets/images/users/avatar-3.png').default, + } + const data = { ...userData, accessToken: responseData.accessToken, refreshToken: responseData.refreshToken } + if(responseData.type === "GLD"){ + setLocale("en"); + localStorage.setItem('locale','en'); + }else{ + if (responseData.preferLocale ==="zh_HK"){ + setLocale("zh-HK"); + localStorage.setItem('locale','zh-HK'); + } + if (responseData.preferLocale ==="zh-CN"){ + setLocale("zh-CN"); + localStorage.setItem('locale','zh-CN'); + } + } + dispatch(handleLogin(data)) + navigate('/dashboard'); + }, + onFail: (response)=>{ + console.log("Fail"); + console.log(response); + window.location.assign("/iamsmart/loginFail"); + }, + onError:(error)=>{ + console.log(error); + window.location.assign("/iamsmart/loginFail"); + } + }); + }else{ + window.location.assign("/iamsmart/loginFail"); + } + } + + return ( + + ); +}; + +export default Index; \ No newline at end of file diff --git a/src/pages/authentication/ForgotPassword/ForgotPasswordApplyForm.js b/src/pages/authentication/ForgotPassword/ForgotPasswordApplyForm.js new file mode 100644 index 0000000..daf877f --- /dev/null +++ b/src/pages/authentication/ForgotPassword/ForgotPasswordApplyForm.js @@ -0,0 +1,229 @@ +// material-ui +import { + Grid, + Typography, + Button, + // RadioGroup, + Dialog, DialogTitle, DialogContent, DialogActions, + Stack, + InputLabel, + // OutlinedInput, + FormHelperText, + TextField, + // Box +} from '@mui/material'; +import { useFormik } from 'formik'; +import * as yup from 'yup'; +import * as React from "react"; +// import * as HttpUtils from "utils/HttpUtils"; +// import * as UrlUtils from "utils/ApiPathConst"; +// import * as FieldUtils from "utils/FieldUtils"; +import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import ForwardIcon from '@mui/icons-material/Forward'; +import MainCard from 'components/MainCard'; + + +import { useNavigate } from "react-router-dom"; +// import { notifyActionSuccess } from 'utils/CommonFunction'; +import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; +import {FormattedMessage, useIntl} from "react-intl"; + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const ForgotPasswordApplyForm = () => { + const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); + // const [warningText, setWarningText] = React.useState("");s + // const [attachment, setAttachment] = React.useState({}); + const intl = useIntl(); + + // const [issueId, setIssueId] = React.useState(loadedData.issueId); + const navigate = useNavigate(); + + const BackgroundHead = { + backgroundImage: `url(${titleBackgroundImg})`, + width: 'auto', + height: 'auto', + backgroundSize: 'contain', + backgroundRepeat: 'no-repeat', + backgroundColor: '#0C489E', + backgroundPosition: 'right' + } + + const formik = useFormik({ + enableReinitialize: true, + initialValues: { + username: '', + }, + validationSchema: yup.object().shape({ + username: yup.string().required(intl.formatMessage({id: 'requireUsername'})), + }), + onSubmit: values => { + console.log(values) + + // HttpUtils.postWithFiles({ + // url: UrlUtils.POST_PUBLIC_NOTICE_APPLY, + // params: { + // id: 0, + // contactPerson: values.contactPerson, + // contactTelNo: { + // countryCode: values.tel_countryCode, + // phoneNumber: values.phoneNumber + // }, + // contactFaxNo: { + // countryCode: values.fax_countryCode, + // faxNumber: values.faxNumber + // }, + // issueId: issueId, + // careOf: values.careOf ? values.careOf: "", + // remarks: values.remarks ? values.remarks : "", + // }, + // // files: [attachment], + // onSuccess: function () { + // notifyActionSuccess(intl.formatMessage({id: 'submissionSuccess'}) + '!') + // navigate("/publicNotice"); + // // location.reload(); + // } + // }); + } + }); + + return ( + + +
    + + + + + +
    +
    + + + + {/* + 申請公共啟事 + */} + + *': { + flexGrow: 1, + flexBasis: '50%' + } + }} + content={false} + border={false} + boxShadow + > +
    + + + + + + + + + + + + + + + + + + + + + + { + if (e.key === 'Enter') { + e.preventDefault(); + } + }, + }} + InputLabelProps={{ + shrink: true + }} + /> + + {formik.touched.username && formik.errors.username && ( + + {formik.errors.username} + + )} + + + + + + + + + +
    +
    +
    + setIsWarningPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } + } + }} + > + + + + + {/* {warningText} */} + + + + + +
    +
    + ); +}; + + +export default ForgotPasswordApplyForm; diff --git a/src/pages/authentication/ForgotPassword/index.js b/src/pages/authentication/ForgotPassword/index.js new file mode 100644 index 0000000..50628b6 --- /dev/null +++ b/src/pages/authentication/ForgotPassword/index.js @@ -0,0 +1,46 @@ +// material-ui +import * as React from "react"; +// import * as HttpUtils from "utils/HttpUtils"; +// import * as UrlUtils from "utils/ApiPathConst"; +// import * as DateUtils from "utils/DateUtils"; +// import * as FormatUtils from "utils/FormatUtils"; + +// import { +// Radio, +// FormControlLabel +// } from '@mui/material'; + +import Loadable from 'components/Loadable'; +import { lazy } from 'react'; +const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); +const ForgotPasswordApplyForm = Loadable(lazy(() => import('./ForgotPasswordApplyForm'))); + + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + +const ApplyForm = () => { + // const [userData, setUserData] = React.useState(null); + // const [selections, setSelection] = React.useState([]); + const [isLoading, setLoding] = React.useState(true); + + React.useEffect(() => { + loadUserData(); + }, []); + + const loadUserData = () => { + setLoding(false); + }; + + return ( + isLoading ? + + : + + ); +}; + + +export default ApplyForm; diff --git a/src/pages/authentication/Verify.js b/src/pages/authentication/Verify.js index 4fa15ac..c337f0a 100644 --- a/src/pages/authentication/Verify.js +++ b/src/pages/authentication/Verify.js @@ -63,7 +63,7 @@ export default function Verify() { 帳戶已成功驗證。 - @@ -73,7 +73,7 @@ export default function Verify() { {/* */} 驗證失敗,請聯絡相關的系統管理員協助。 - diff --git a/src/pages/authentication/auth-forms/AuthLogin.js b/src/pages/authentication/auth-forms/AuthLogin.js index 9e962fe..4eb1de5 100644 --- a/src/pages/authentication/auth-forms/AuthLogin.js +++ b/src/pages/authentication/auth-forms/AuthLogin.js @@ -1,4 +1,4 @@ -import React, {useEffect, useState} from 'react'; +import React, {useContext, useEffect, useState} from 'react'; import {useNavigate} from 'react-router-dom'; // material-ui @@ -36,6 +36,7 @@ import {useDispatch} from "react-redux"; import {handleLogin} from "auth/index"; import { notifyActionSuccess } from 'utils/CommonFunction'; import {FormattedMessage} from "react-intl"; +import LocaleContext from "../../../components/I18nProvider"; // ============================|| FIREBASE - LOGIN ||============================ // const AuthLogin = () => { @@ -69,6 +70,7 @@ const AuthLogin = () => { }) .then((response) => { //setPosts("12354") + console.log(response.data); setPosts(response.data); const userData = { id: response.data.id, diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index 0784c6a..94798c2 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -1,7 +1,7 @@ import React, { useEffect, useState, - lazy + lazy, useContext } from 'react'; import { Link as RouterLink } from 'react-router-dom'; import { useNavigate } from 'react-router-dom'; @@ -45,12 +45,14 @@ import { handleLogin } from "auth/index"; import useJwt from "../../../auth/jwt/useJwt"; import { handleLogoutFunction } from 'auth/index'; import {FormattedMessage, useIntl} from "react-intl"; +import LocaleContext from "../../../components/I18nProvider"; // ============================|| FIREBASE - LOGIN ||============================ // const AuthLoginCustom = () => { const dispatch = useDispatch() const navigate = useNavigate() const intl = useIntl(); + const { setLocale } = useContext(LocaleContext); const [showPassword, setShowPassword] = useState(false); const handleClickShowPassword = () => { @@ -74,7 +76,7 @@ const AuthLoginCustom = () => { useJwt .login({ username: values.username, password: values.password }) .then((response) => { - console.log(response) + // console.log(response) const userData = { id: response.data.id, fullenName: response.data.name, @@ -84,10 +86,25 @@ const AuthLoginCustom = () => { role: response.data.role, abilities: response.data.abilities, creditor: response.data.creditor, + locale: response.data.preferLocale, //avatar: require('src/assets/images/users/avatar-3.png').default, } const data = { ...userData, accessToken: response.data.accessToken, refreshToken: response.data.refreshToken } // setSuccess(true) + // console.log(response.data); + if(response.data.type === "GLD"){ + setLocale("en"); + localStorage.setItem('locale','en'); + }else{ + if (response.data.preferLocale ==="zh_HK"){ + setLocale("zh-HK"); + localStorage.setItem('locale','zh-HK'); + } + if (response.data.preferLocale ==="zh-CN"){ + setLocale("zh-CN"); + localStorage.setItem('locale','zh-CN'); + } + } dispatch(handleLogin(data)) navigate('/dashboard'); location.reload() @@ -320,7 +337,7 @@ const AuthLoginCustom = () => { - + ? diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index a1519a3..438542b 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -220,7 +220,7 @@ const BusCustomFormWizard = (props) => { }; const handleCheckBoxChange = (event) => { - console.log(event.target) + // console.log(event.target) if (event.target.name == 'termsAndConAccept') { setTermsAndConAccept(event.target.checked) setTermsAndConNotAccept(!event.target.checked) @@ -295,8 +295,8 @@ const BusCustomFormWizard = (props) => { saveFileList.push(file) updateList.items.add(file); } - console.log("currentIndex") - console.log(currentIndex) + // console.log("currentIndex") + // console.log(currentIndex) } let updatedFileList = updateList.files; @@ -323,8 +323,8 @@ const BusCustomFormWizard = (props) => { const { handleSubmit } = useForm({}) const _onSubmit = () => { setLoding(true); - values.address4 = selectedAddress4 - values.address5 = selectedAddress5 + values.address4 = selectedAddress4==null?"":selectedAddress4.key + values.address5 = selectedAddress5.key // console.log(values) const busUserAddress = { "addressLine1": "", @@ -391,8 +391,10 @@ const BusCustomFormWizard = (props) => { "Content-Type": "multipart/form-data" } }) - .then((response) => { - console.log(response) + .then(( + // response + ) => { + // console.log(response) setCheckUpload(true) setLoding(false); }) @@ -1637,7 +1639,8 @@ const BusCustomFormWizard = (props) => { - @@ -1646,8 +1649,10 @@ const BusCustomFormWizard = (props) => { {/* */} - 申請失敗,請稍後嘗試 - diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 99fabad..ae5e2bd 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -1,26 +1,21 @@ -import { useEffect, useState, } from 'react'; +import { useEffect, useState } from 'react'; // material-ui import { Box, - Button, - FormControl, - FormHelperText, + Button, Checkbox + // MenuItem + , FormControl, FormGroup, FormHelperText, Grid, IconButton, InputAdornment, InputLabel, OutlinedInput, - Stack, - Typography, - FormGroup, - TextField, - Checkbox - // MenuItem + Stack, TextField, Typography } from '@mui/material'; -import { useForm, } from 'react-hook-form' import Autocomplete from "@mui/material/Autocomplete"; +import { useForm } from 'react-hook-form'; // third party -import { useFormik, FormikProvider } from 'formik'; +import { FormikProvider, useFormik } from 'formik'; import * as yup from 'yup'; // import axios from "axios"; @@ -29,7 +24,7 @@ import * as yup from 'yup'; import { strengthColorChi, strengthIndicator } from 'utils/password-strength'; // import {apiPath} from "auth/utils"; import axios from "axios"; -import { POST_PUBLIC_USER_REGISTER, POST_CAPTCHA, GET_USERNAME, GET_USER_EMAIL } from "utils/ApiPathConst"; +import { GET_USERNAME, GET_USER_EMAIL, POST_CAPTCHA, POST_PUBLIC_USER_REGISTER } from "utils/ApiPathConst"; // import * as HttpUtils from 'utils/HttpUtils'; import * as ComboData from "utils/ComboData"; @@ -44,15 +39,15 @@ const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingCo // assets import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons'; // import { Paper } from '../../../../node_modules/@mui/material/index'; -import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; +import { ThemeProvider } from "@emotion/react"; import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; -import { Link } from 'react-router-dom'; -import * as HttpUtils from "../../../utils/HttpUtils"; +import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; import LoopIcon from '@mui/icons-material/Loop'; import { useTheme } from '@mui/material/styles'; -import {PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; -import {ThemeProvider} from "@emotion/react"; -import {FormattedMessage, useIntl} from "react-intl"; +import { FormattedMessage, useIntl } from "react-intl"; +import { Link } from 'react-router-dom'; +import { PNSPS_LONG_BUTTON_THEME } from "../../../themes/buttonConst"; +import * as HttpUtils from "../../../utils/HttpUtils"; // ============================|| FIREBASE - REGISTER ||============================ // @@ -89,7 +84,7 @@ const CustomFormWizard = (props) => { const [selectedIdDocInputType, setSelectedIdDocInputType] = useState(""); // const [selectedIdDocLabel, setSelectedIdDocLabel] = useState(null); const [selectedAddress4, setSelectedAddress4] = useState(null); - console.log(ComboData.country[0]); + // console.log(ComboData.country[0]); const [selectedAddress5, setSelectedAddress5] = useState(ComboData.country[0]); const [termsAndConAccept, setTermsAndConAccept] = useState(false); const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false); @@ -314,8 +309,9 @@ const CustomFormWizard = (props) => { const _onSubmit = () => { setLoding(true); values.idDocType = selectedIdDocType.type - values.address4 = selectedAddress4.key + values.address4 = selectedAddress4==null?"":selectedAddress4.key values.address5 = selectedAddress5.key + // console.log(values) const userAddress = { "addressLine1": "", "addressLine2": "", @@ -385,8 +381,10 @@ const CustomFormWizard = (props) => { "Content-Type": "multipart/form-data" } }) - .then((response) => { - console.log(response) + .then(( + // response + ) => { + // console.log(response) setCheckUpload(true) setLoding(false); }) @@ -1801,7 +1799,7 @@ const CustomFormWizard = (props) => { - @@ -1810,8 +1808,10 @@ const CustomFormWizard = (props) => { {/* */} - 申請失敗,請稍後嘗試 - diff --git a/src/pages/authentication/auth-forms/IAmSmartFormWizard.js b/src/pages/authentication/auth-forms/IAmSmartFormWizard.js index 4b36712..7fcf174 100644 --- a/src/pages/authentication/auth-forms/IAmSmartFormWizard.js +++ b/src/pages/authentication/auth-forms/IAmSmartFormWizard.js @@ -142,7 +142,7 @@ const CustomFormWizard = (props) => { const getAddressStr = (strs) => { let add = "" strs.forEach(str => { - add += str ? str + ", " : ""; + add += str.trim() ? str.trim() + ", " : ""; }); add = add.trim(); if (add.slice(- 1) == ",") { @@ -1041,7 +1041,7 @@ const CustomFormWizard = (props) => { - @@ -1050,8 +1050,10 @@ const CustomFormWizard = (props) => { {/* */} - 申請失敗,請稍後嘗試 - diff --git a/src/pages/authentication/auth-forms/UploadFileTable.js b/src/pages/authentication/auth-forms/UploadFileTable.js index b4dd0cc..21cc7af 100644 --- a/src/pages/authentication/auth-forms/UploadFileTable.js +++ b/src/pages/authentication/auth-forms/UploadFileTable.js @@ -1,11 +1,11 @@ // material-ui -import * as React from 'react'; +import RemoveCircleOutlineIcon from '@mui/icons-material/RemoveCircleOutline'; import { DataGrid, GridActionsCellItem, GridRowModes } from "@mui/x-data-grid"; -import RemoveCircleOutlineIcon from '@mui/icons-material/RemoveCircleOutline'; +import * as React from 'react'; import { useEffect } from "react"; // import {useNavigate} from "react-router-dom"; // import { useTheme } from '@mui/material/styles'; @@ -14,7 +14,7 @@ import { Stack, Typography } from '@mui/material'; -import {FormattedMessage} from "react-intl"; +import { FormattedMessage } from "react-intl"; // ==============================|| EVENT TABLE ||============================== // export default function UploadFileTable({ recordList, setUpdateRows, }) { @@ -46,10 +46,10 @@ export default function UploadFileTable({ recordList, setUpdateRows, }) { ...rowModesModel, [id]: { mode: GridRowModes.View, ignoreModifications: true }, }); - console.log("Starting Delete") - const editedRow = rows.find((row) => row.id === id); - console.log(editedRow) - console.log(editedRow.isNew) + // console.log("Starting Delete") + // const editedRow = rows.find((row) => row.id === id); + // console.log(editedRow) + // console.log(editedRow.isNew) setUpdateRows(rows.filter((row) => row.id !== id)); setRows(rows.filter((row) => row.id !== id)); } diff --git a/src/pages/dashboard/GLD/index.js b/src/pages/dashboard/GLD/index.js index f720e4c..4d6443f 100644 --- a/src/pages/dashboard/GLD/index.js +++ b/src/pages/dashboard/GLD/index.js @@ -25,7 +25,9 @@ const DashboardDefault = () => {
    - Morning, {userData.fullenName} + + Morning, {userData.fullenName} +
    diff --git a/src/pages/dashboard/Public/index.js b/src/pages/dashboard/Public/index.js index b895e9f..aaa3d18 100644 --- a/src/pages/dashboard/Public/index.js +++ b/src/pages/dashboard/Public/index.js @@ -10,7 +10,7 @@ import { } from '@mui/material'; import { isORGLoggedIn, } from "utils/Utils"; import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' -import { FormattedMessage } from "react-intl"; +import {FormattedMessage, useIntl} from "react-intl"; import AdsClickRoundedIcon from '@mui/icons-material/AdsClickRounded'; import * as React from "react"; import Loadable from 'components/Loadable'; @@ -23,6 +23,7 @@ import { useNavigate } from "react-router-dom"; const DashboardDefault = () => { const navigate = useNavigate() + const intl = useIntl(); const userData = JSON.parse(localStorage.getItem("userData")); const BackgroundHead = { // backgroundColor: '#0d47a1', @@ -49,7 +50,12 @@ const DashboardDefault = () => { - @@ -80,7 +89,10 @@ const DashboardDefault = () => { - diff --git a/src/pages/extra-pages/LoadingComponent.js b/src/pages/extra-pages/LoadingComponent.js index ecfff5e..4152295 100644 --- a/src/pages/extra-pages/LoadingComponent.js +++ b/src/pages/extra-pages/LoadingComponent.js @@ -1,4 +1,5 @@ -import {Box, CircularProgress, Grid} from "@mui/material"; +import {Box, CircularProgress, Grid, Typography} from "@mui/material"; +import {FormattedMessage} from "react-intl"; const LoadingComponent = () => { return ( @@ -9,7 +10,13 @@ const LoadingComponent = () => { alignItems="center" // autoHeight={true} > - + + + + + + + ) diff --git a/src/pages/iAmSmart/AuthCallback/index.js b/src/pages/iAmSmart/AuthCallback/index.js index b83ba04..cf89e89 100644 --- a/src/pages/iAmSmart/AuthCallback/index.js +++ b/src/pages/iAmSmart/AuthCallback/index.js @@ -43,9 +43,23 @@ const Index = () => { role: responseData.role, abilities: responseData.abilities, creditor: responseData.creditor, + locale: responseData.preferLocale, //avatar: require('src/assets/images/users/avatar-3.png').default, } const data = { ...userData, accessToken: responseData.accessToken, refreshToken: responseData.refreshToken } + if(responseData.type === "GLD"){ + setLocale("en"); + localStorage.setItem('locale','en'); + }else{ + if (responseData.preferLocale ==="zh_HK"){ + setLocale("zh-HK"); + localStorage.setItem('locale','zh-HK'); + } + if (responseData.preferLocale ==="zh-CN"){ + setLocale("zh-CN"); + localStorage.setItem('locale','zh-CN'); + } + } dispatch(handleLogin(data)) navigate('/dashboard'); }, diff --git a/src/pages/pnspsUserGroupSearchPage/UserGroupSearchForm.js b/src/pages/pnspsUserGroupSearchPage/UserGroupSearchForm.js index 1c956ce..3e5ff42 100644 --- a/src/pages/pnspsUserGroupSearchPage/UserGroupSearchForm.js +++ b/src/pages/pnspsUserGroupSearchPage/UserGroupSearchForm.js @@ -1,7 +1,6 @@ // material-ui import { Button, - CardContent, Grid, TextField, Typography } from '@mui/material'; @@ -10,6 +9,8 @@ import { useForm } from "react-hook-form"; import * as React from "react"; import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; import { useNavigate } from "react-router"; +import {PNSPS_BUTTON_THEME} from "../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -37,87 +38,82 @@ const UserGroupSearchForm = ({ applySearch }) => { >
    - {/*row 1*/} - - - Search Form + + {/*row 1*/} + + + Search Form + - + {/*row 2*/} - {/*row 2*/} - - - - + + + + - - + + + - - {/*last row*/} - - - - - - - - - + {/*last row*/} + + + + + + + + + + - - + + + + diff --git a/src/pages/pnspsUserGroupSearchPage/UserGroupTable.js b/src/pages/pnspsUserGroupSearchPage/UserGroupTable.js index a583fb1..86384a3 100644 --- a/src/pages/pnspsUserGroupSearchPage/UserGroupTable.js +++ b/src/pages/pnspsUserGroupSearchPage/UserGroupTable.js @@ -63,11 +63,7 @@ export default function UserGroupTable({recordList}) { diff --git a/src/pages/pnspsUserGroupSearchPage/index.js b/src/pages/pnspsUserGroupSearchPage/index.js index fbde832..c0bb997 100644 --- a/src/pages/pnspsUserGroupSearchPage/index.js +++ b/src/pages/pnspsUserGroupSearchPage/index.js @@ -79,13 +79,15 @@ const UserGroupSearchPanel = () => {
    - View User Group + + View User Group +
    {/*row 1*/} - + {/*row 2*/} diff --git a/src/routes/GLDUserRoutes.js b/src/routes/GLDUserRoutes.js index a56c2b8..475de96 100644 --- a/src/routes/GLDUserRoutes.js +++ b/src/routes/GLDUserRoutes.js @@ -18,6 +18,9 @@ const DemandNote_Create = Loadable(lazy(() => import('pages/DemandNote/Create')) const DemandNote_Search = Loadable(lazy(() => import('pages/DemandNote/Search'))); const DemandNote_Details = Loadable(lazy(() => import('pages/DemandNote/Details'))); const GFMIS_Search = Loadable(lazy(() => import('pages/GFMIS'))); +const UserMaintainPage = Loadable(lazy(() => import('pages/User/GLDUserProfile'))); +const SystemSetting = Loadable(lazy(() => import('pages/Setting/SystemSetting'))); + // ==============================|| MAIN ROUTING ||============================== // const GLDUserRoutes = { @@ -78,7 +81,15 @@ const GLDUserRoutes = { { path: '/gfmis/search', element: - } + }, + { + path: '/user/profile', + element: + }, + { + path: '/setting/sys', + element: + }, ] }, ] diff --git a/src/routes/LoginRoutes.js b/src/routes/LoginRoutes.js index b3c7533..56e8166 100644 --- a/src/routes/LoginRoutes.js +++ b/src/routes/LoginRoutes.js @@ -12,6 +12,9 @@ const RegisterForm = Loadable(lazy(() => import('pages/authentication/Register') const BusRegisterForm = Loadable(lazy(() => import('pages/authentication/BusRegister'))); const IAmSmartRegister = Loadable(lazy(() => import('pages/authentication/IAmSmartRegister'))); const ErrorPage = Loadable(lazy(() => import('pages/extra-pages/ErrorPage'))); +const ForgotPassword = Loadable(lazy(() => import('pages/authentication/ForgotPassword'))); +const AfterForgotPasswordPage = Loadable(lazy(() => import('pages/authentication/ForgotPassword/AfterForgotPasswordPage'))); + const IAmSmart_DirectLoginCallback = Loadable(lazy(() => import('pages/iAmSmart/DirectLoginCallback'))); //const IAmSmart_FallCallback = Loadable(lazy(() => import('pages/iAmSmart/FallCallback'))); const IAmSmart_FailCallback = Loadable(lazy(() => import('pages/iAmSmart/FailCallback'))); @@ -98,7 +101,15 @@ const LoginRoutes = { { path: 'testfpscallback', element: - } + }, + { + path: 'forgot/password', + element: + }, + { + path: 'forgot/password/verify', + element: + }, ] }; diff --git a/src/themes/buttonConst.js b/src/themes/buttonConst.js index e803fe1..6ac414b 100644 --- a/src/themes/buttonConst.js +++ b/src/themes/buttonConst.js @@ -35,10 +35,24 @@ export const PNSPS_BUTTON_THEME = createTheme({ main: '#F3AF2B', contrastText: '#FFFFFF', }, + error:{ + main: '#F3AF2B', + contrastText: '#FFFFFF', + }, exportExcel:{ main: '#6A8B9E', contrastText: '#FFFFFF', - } + }, + success:{ + main: '#448DF2', + contrastText: '#FFFFFF', + }, + orange: { + main: '#ed9740', + light: '#ff5e5e', + dark: '#b0671e', + contrastText: '#fff', + }, }, components: { MuiDataGrid: { @@ -121,7 +135,17 @@ export const PNSPS_LONG_BUTTON_THEME = createTheme({ exportExcel:{ main: '#60667E', contrastText: '#FFFFFF', - } + }, + success:{ + main: '#3f50b5', + contrastText: '#FFFFFF', + }, + orange: { + main: '#ed9740', + light: '#ff5e5e', + dark: '#b0671e', + contrastText: '#fff', + }, }, components: { MuiDataGrid: { diff --git a/src/themes/themeConst.js b/src/themes/themeConst.js index 7ff2665..40247d4 100644 --- a/src/themes/themeConst.js +++ b/src/themes/themeConst.js @@ -77,7 +77,8 @@ export const PNSPS_THEME = createTheme({ }, '&.MuiButton-root':{ fontSize: '1.2rem', - alignItems: 'normal', + fontWeight: '600', + alignItems: 'center', }, } } @@ -369,6 +370,13 @@ export const PNSPS_THEME = createTheme({ } } }, + MuiFormLabel: { + styleOverrides: { + root:{ + color: "#000000" + } + } + }, MuiTabPanel:{ styleOverrides:{ root:{ diff --git a/src/themes/typography.js b/src/themes/typography.js index 0b8b739..46b8c6c 100644 --- a/src/themes/typography.js +++ b/src/themes/typography.js @@ -23,9 +23,19 @@ const Typography = (fontFamily) => ({ lineHeight: 1.5 }, pnspsFormParagraph: { - fontWeight: 400, + fontWeight: 500, fontSize: '1.1rem', - lineHeight: 0.8 + lineHeight: 1 + }, + pnspsFormParagraphBold: { + fontWeight: 600, + fontSize: '1.1rem', + lineHeight: 1 + }, + pnspsNormalText: { + fontWeight: 600, + fontSize: '1.0rem', + lineHeight: 1.0 }, h1: { fontWeight: 600, diff --git a/src/translations/en.json b/src/translations/en.json index 5bc6c43..343441b 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -39,9 +39,11 @@ "submit": "Submit", "backToLogin": "Return to login page", "registerSubmitted": "Account application submitted successfully.", + "registerFail": "Application failed, please try again later", "mainPage": "Main Page", "myPublicNotice": "My Public Notice", + "publicNotice": "Public Notice", "publicNoticePayment": "Public Notice: Payment", "publicNoticePaymentFail": "Public Notice: Payment Failed", "publicNoticePaymentSuccess": "Public Notice: Payment Success", @@ -68,6 +70,12 @@ "userLoginName": "Username", "userPassword": "Password", "forgotUserPassword": "Forgot Password", + "forgotPasswordTitle": "Find Your Account", + "forgotPasswordSubTitle": "Please enter your username to receive the code to reset your password", + "forgotPasswordSubTitle1": "Please enter your username to receive", + "forgotPasswordSubTitle2": "the code to reset your password", + "securityCode": "Security Code", + "requireSecurityCode": "Please enter security code", "learnMore": "Learn More", "createOrReActivate": "Create account", "usernameTaken": "This user login name has been registered, please use another user login name", @@ -264,6 +272,7 @@ "contactPerson": "Contact Person", "requireContactPerson": "Please enter contact person", "search": "Search", + "searchForm": "Search Form", "cancel": "Cancel", "extraMark": "Remarks", "totalAmount": "Total Amount", @@ -352,6 +361,25 @@ "idNo": "ID No.", "country": "Country", "district": "District", + "noRecordFound": "No record found", + "rowsPerPage": "Rows Per Page", + "date" : "Date", + "keyword": "Key word", + "dateFrom": "Date(From)", + "dateTo": "Date(To)", + "of": "of", + "loading": "Loading...", + "ok": "Ok", + + "organizationProfile": "Organization Profile", + "organizationDetails": "Organization Details", + "brNo": "BR No.", + "creditorAccount": "Creditor account", + "nameEng": "Name (Eng)", + "nameChi": "Name (Ch)", + "expiryDate": "Expiry date", + "create": "Create", + "confirmTo": "Confirm to ", "Dashboard": "Dashboard", "event": "Event" diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 6f9e55f..da341ce 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -39,8 +39,10 @@ "submit": "提交", "backToLogin": "返回登入页面", "registerSubmitted": "帐户申请已成功提交。", + "registerFail": "申请失败,请稍后尝试", "mainPage": "主页", + "publicNotice": "公共启事", "myPublicNotice": "我的公共启事", "publicNoticePayment": "公共启事:付款", "publicNoticePaymentFail": "公共启事:付款失败", @@ -68,6 +70,12 @@ "userLoginName": "用户登入名称", "userPassword": "密码", "forgotUserPassword": "忘记密码", + "forgotPasswordTitle": "寻找你的帐号", + "forgotPasswordSubTitle": "请输入你的用户登入名称以重设密码", + "forgotPasswordSubTitle1": "请输入你的用户登入名称收", + "forgotPasswordSubTitle2": "以重设密码", + "securityCode": "安全验证码", + "requireSecurityCode": "请输入安全验证码", "learnMore": "了解更多", "createOrReActivate": "建立帐户", "usernameTaken": "此用户登入名称已被注册,请使用其他用户登入名称", @@ -264,6 +272,7 @@ "contactPerson": "联络人", "requireContactPerson": "请输入联络人", "search": "搜寻", + "searchForm": "搜寻表格", "cancel": "取消", "extraMark": "备注", "totalAmount": "总额", @@ -352,6 +361,25 @@ "idNo": "身份证号码", "country": "国家", "district": "区", + "noRecordFound": "找不到記錄", + "rowsPerPage": "每页项数", + "date" : "日期", + "keyword": "关键字", + "dateFrom": "日期(从)", + "dateTo": "日期(到)", + "of": "於", + "loading": "加载中...", + "ok": "好的", + + "organizationProfile": "机构资料", + "organizationDetails": "机构详情", + "brNo": "商业登记证号码", + "creditorAccount": "债权人帐户", + "nameEng": "姓名(英文)", + "nameChi": "姓名(中文)", + "expiryDate": "过期日期", + "create": "创建", + "confirmTo": "确定", "Dashboard": "仪表板", "event": "活动" diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index bdcbc7a..1febe82 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -39,8 +39,10 @@ "submit": "提交", "backToLogin": "返回登入頁面", "registerSubmitted": "帳戶申請已成功提交。", + "registerFail": "申請失敗,請稍後嘗試", "mainPage": "主頁", + "publicNotice": "公共啟事", "myPublicNotice": "我的公共啟事", "publicNoticePayment": "公共啟事:付款", "publicNoticePaymentFail": "公共啟事:付款失敗", @@ -68,6 +70,12 @@ "userLoginName": "用戶登入名稱", "userPassword": "密碼", "forgotUserPassword": "忘記密碼", + "forgotPasswordTitle": "尋找你的帳號", + "forgotPasswordSubTitle": "請輸入你的用戶登入名稱以重設密碼", + "forgotPasswordSubTitle1": "請輸入你的用戶登入名稱", + "forgotPasswordSubTitle2": "以重設密碼", + "securityCode": "安全驗證碼", + "requireSecurityCode": "請輸入安全驗證碼", "learnMore": "了解更多", "createOrReActivate": "建立帳戶", "usernameTaken": "此用戶登入名稱已被注冊,請使用其他用戶登入名稱", @@ -264,6 +272,7 @@ "contactPerson": "聯絡人", "requireContactPerson": "請輸入聯絡人", "search": "搜尋", + "searchForm": "搜尋表格", "cancel": "取消", "extraMark": "備註", "totalAmount": "總額", @@ -352,6 +361,25 @@ "idNo": "身分證號碼", "country": "國家", "district": "區", + "noRecordFound": "找不到記錄", + "rowsPerPage": "每頁項數", + "date" : "日期", + "keyword": "關鍵字", + "dateFrom": "日期(從)", + "dateTo": "日期(到)", + "of": "於", + "loading": "加載中...", + "ok": "好的", + + "organizationProfile": "機構資料", + "organizationDetails": "機構詳情", + "brNo": "商業登記證號碼", + "creditorAccount": "債權人帳戶", + "nameEng": "姓名(英文)", + "nameChi": "姓名(中文)", + "expiryDate": "過期日期", + "create": "創建", + "confirmTo": "確定", "Dashboard": "儀表板", "event": "活動" diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index 76f0519..d536d9d 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -1,6 +1,10 @@ import {apiPath} from "../auth/utils"; // GET request +export const REFRESH_TOKEN = "/refresh-token" +export const CHANGE_PASSWORD_PATH = "/user/change-password" + +export const GET_SYS_PARAMS = apiPath+'/settings'; //Group Config export const GET_GROUP_LIST_PATH = '/group'; diff --git a/src/utils/CommonFunction.js b/src/utils/CommonFunction.js index f278c5a..b5d4627 100644 --- a/src/utils/CommonFunction.js +++ b/src/utils/CommonFunction.js @@ -177,7 +177,7 @@ export const notifyDownloadSuccess = () => { }; export const notifyActionSuccess = (actionMsg) => { - toast.success(`${actionMsg}`, { + toast.success(actionMsg??"Success", { position: "bottom-right", autoClose: 5000, hideProgressBar: false, diff --git a/src/utils/FieldUtils.js b/src/utils/FieldUtils.js index a1463f3..5e08b63 100644 --- a/src/utils/FieldUtils.js +++ b/src/utils/FieldUtils.js @@ -13,7 +13,7 @@ export const notNullFieldLabel = (label) => { export const getDateField = ({ label, valueName, form, disabled }) => { return - {label} + {label} {initField({ @@ -30,7 +30,7 @@ export const getTextField = ({ label, valueName, form, disabled }) => { return - {label} + {label} {initField({ @@ -47,7 +47,7 @@ export const getTextArea = ({ label, valueName, form, disabled, inputProps, ...p return - {label} + {label} {initField({ @@ -55,12 +55,13 @@ export const getTextArea = ({ label, valueName, form, disabled, inputProps, ...p valueName: valueName, form: form, disabled: disabled, - multiline: true, - row: 10, minRows: 4, maxRows: 4, inputProps: inputProps, InputProps: { + row: 10, + multiline: true, + inputComponent: 'textarea', style: { minHeight:'42.5px', maxHeight: '50vh',height: 'auto' }, }, props @@ -74,7 +75,7 @@ export const getPhoneField = ({ label, valueName, form, disabled }) => { return - {label} + {label} @@ -119,7 +120,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { return - {label} + {label} @@ -154,7 +155,7 @@ export const getAddressField = ({ label, valueName, form, disabled }) => { export const getComboField = ({ label, dataList, valueName, form, disabled, getOptionLabel, onInputChange, onChange, filterOptions, ...props }) => { return - {label} + {label} { }); }; +export const patch = ({url,params, onSuccess, onFail, onError}) =>{ + axios.patch(url,params).then( + (response)=>{onResponse(response, onSuccess, onFail);} + ).catch(error => { + return handleError(error,onError); + }); +}; + export const post = ({url, params, onSuccess, onFail, onError, headers}) =>{ headers = headers?headers:{ "Content-Type":"application/json" @@ -137,7 +145,7 @@ const onResponse= (response, onSuccess, onFail) =>{ } if(onSuccess){ - onSuccess(response.data); + onSuccess(response?.data); } }