@@ -46,4 +46,6 @@ img | |||||
.huerotate {-webkit-filter: hue-rotate(180deg);} | .huerotate {-webkit-filter: hue-rotate(180deg);} | ||||
.rss.opacity {-webkit-filter: opacity(50%);} | .rss.opacity {-webkit-filter: opacity(50%);} | ||||
img:hover{-webkit-filter:none;} | |||||
img:hover{-webkit-filter:none;} | |||||
/* iframe#webpack-dev-server-client-overlay{display:none!important} */ |
@@ -12,6 +12,7 @@ export const predictUsageCount = 'predictUsageCount' | |||||
export const windowCount = 'windowCount' | export const windowCount = 'windowCount' | ||||
import {useNavigate} from "react-router-dom"; | import {useNavigate} from "react-router-dom"; | ||||
import {useDispatch} from "react-redux"; | import {useDispatch} from "react-redux"; | ||||
import { REFRESH_TOKEN } from 'utils/ApiPathConst'; | |||||
// ** Handle User Login | // ** Handle User Login | ||||
export const handleLogin = data => { | export const handleLogin = data => { | ||||
@@ -25,7 +26,7 @@ export const handleLogin = data => { | |||||
refreshToken: data['refreshToken'] | refreshToken: data['refreshToken'] | ||||
}) | }) | ||||
console.log(data) | |||||
// console.log(data) | |||||
// ** Add to user, accessToken & refreshToken to localStorage | // ** Add to user, accessToken & refreshToken to localStorage | ||||
localStorage.setItem('userData', JSON.stringify(data)) | localStorage.setItem('userData', JSON.stringify(data)) | ||||
localStorage.setItem('accessToken', data.accessToken) | localStorage.setItem('accessToken', data.accessToken) | ||||
@@ -104,6 +105,8 @@ export const SetupAxiosInterceptors = () => { | |||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
const dispatch = useDispatch(); | const dispatch = useDispatch(); | ||||
//const updateLastRequestTime = useContext(TimerContext); | //const updateLastRequestTime = useContext(TimerContext); | ||||
let isRefreshToken= false; | |||||
axios.interceptors.request.use( | axios.interceptors.request.use( | ||||
config => { | config => { | ||||
// ** Get token from localStorage | // ** Get token from localStorage | ||||
@@ -126,39 +129,77 @@ export const SetupAxiosInterceptors = () => { | |||||
//updateLastRequestTime(Date.now()); | //updateLastRequestTime(Date.now()); | ||||
return response; | return response; | ||||
}, | }, | ||||
error => { | |||||
async (error) => { | |||||
// ** const { config, response: { status } } = 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) | return Promise.reject(error) | ||||
}, | |||||
} | |||||
) | ) | ||||
} | } |
@@ -44,7 +44,7 @@ export const getNonce = () => { | |||||
}; | }; | ||||
export const getBowserType = () => { | 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; | // 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(!regex.test(navigator.userAgent)) | ||||
if (navigator.userAgent.indexOf("Edg") != -1) { | if (navigator.userAgent.indexOf("Edg") != -1) { | ||||
@@ -1,17 +1,29 @@ | |||||
import React, { createContext, useState, useEffect } from 'react'; | import React, { createContext, useState, useEffect } from 'react'; | ||||
//import {useNavigate} from "react-router-dom"; | |||||
import {useNavigate} from "react-router-dom"; | |||||
//import axios from "axios"; | //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 {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 TimerContext = createContext(); | ||||
const AutoLogoutProvider = ({ children }) => { | const AutoLogoutProvider = ({ children }) => { | ||||
const [lastRequestTime, setLastRequestTime] = useState(Date.now()); | 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 [state, setState] = useState('Active'); | ||||
const dispatch = useDispatch() | |||||
const onIdle = () => { | const onIdle = () => { | ||||
setLastRequestTime(Date.now()); | setLastRequestTime(Date.now()); | ||||
@@ -30,7 +42,7 @@ const AutoLogoutProvider = ({ children }) => { | |||||
} = useIdleTimer({ | } = useIdleTimer({ | ||||
onIdle, | onIdle, | ||||
onActive, | onActive, | ||||
timeout: 10_000, | |||||
timeout: 1_000, | |||||
throttle: 500, | throttle: 500, | ||||
crossTab: true, | crossTab: true, | ||||
syncTimers: 200, | syncTimers: 200, | ||||
@@ -39,42 +51,55 @@ const AutoLogoutProvider = ({ children }) => { | |||||
const lastActiveTab = isLastActiveTab() === null ? 'loading' : isLastActiveTab() | const lastActiveTab = isLastActiveTab() === null ? 'loading' : isLastActiveTab() | ||||
//const tabId = getTabId() === null ? 'loading' : getTabId().toString() | //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 | //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}`, | // 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{ | else{ | ||||
if(!isUserLoggedIn()&&logoutInterval>1){ | |||||
setLogoutInterval(1); | |||||
} | |||||
//navigate('/login'); | //navigate('/login'); | ||||
} | } | ||||
}, []); | |||||
} | |||||
useEffect(() => { | useEffect(() => { | ||||
getLogoutInterval() | |||||
// console.log("AutoLogoutProvider Start") | |||||
// console.log(logoutInterval) | |||||
const interval = setInterval(async () => { | const interval = setInterval(async () => { | ||||
const currentTime = Date.now(); | const currentTime = Date.now(); | ||||
getRemainingTime(); | getRemainingTime(); | ||||
if(state !== "Active" && lastActiveTab){ | if(state !== "Active" && lastActiveTab){ | ||||
const timeElapsed = currentTime - lastRequestTime; | const timeElapsed = currentTime - lastRequestTime; | ||||
// console.log(timeElapsed); | |||||
// console.log(parseInt(timeElapsed/1000)); | |||||
// console.log(logoutInterval* 60); | |||||
if (timeElapsed >= logoutInterval * 60 * 1000) { | 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"){ | else if(state === "Active"){ | ||||
@@ -1,15 +1,17 @@ | |||||
// material-ui | // material-ui | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { | import { | ||||
DataGrid, | |||||
DataGrid, GridOverlay, | |||||
} from "@mui/x-data-grid"; | } from "@mui/x-data-grid"; | ||||
import {FormattedMessage, useIntl} from "react-intl"; | |||||
import {TablePagination, Typography} from '@mui/material'; | |||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export function FiDataGrid({ rows, columns, sx, autoHeight, | 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 [_rows, set_rows] = React.useState([]); | ||||
const [_columns, set_columns] = React.useState([]); | const [_columns, set_columns] = React.useState([]); | ||||
const [_rowModesModel, set_rowModesModel] = 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 [_pageSizeOptions, set_pageSizeOptions] = React.useState([10, 25, 50]); | ||||
const [_filterItems, set_filterItems] = React.useState([]); | 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 [_autoHeight, set_autoHeight] = React.useState(true); | ||||
const [myHideFooterSelectedRowCount, setMyHideFooterSelectedRowCount] = React.useState(true); | const [myHideFooterSelectedRowCount, setMyHideFooterSelectedRowCount] = React.useState(true); | ||||
const [_sx, set_sx] = React.useState({ | const [_sx, set_sx] = React.useState({ | ||||
padding: "4 2 4 2", | padding: "4 2 4 2", | ||||
// boxShadow: 1, | |||||
// border: 1, | |||||
// borderColor: '#DDD', | |||||
'& .MuiDataGrid-cell': { | '& .MuiDataGrid-cell': { | ||||
borderTop: 1, | borderTop: 1, | ||||
borderBottom: 1, | borderBottom: 1, | ||||
@@ -35,7 +36,6 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||||
}, | }, | ||||
}); | }); | ||||
React.useEffect(() => { | React.useEffect(() => { | ||||
if (sx) { | if (sx) { | ||||
set_sx(sx); | set_sx(sx); | ||||
@@ -55,80 +55,74 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||||
if (pageSizeOptions) { | if (pageSizeOptions) { | ||||
set_pageSizeOptions(pageSizeOptions) | set_pageSizeOptions(pageSizeOptions) | ||||
} | } | ||||
if(autoHeight != undefined){ | |||||
if(autoHeight !== undefined){ | |||||
set_autoHeight(autoHeight) | set_autoHeight(autoHeight) | ||||
} | } | ||||
if(editMode){ | if(editMode){ | ||||
set_editMode(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 ( | |||||
<GridOverlay> | |||||
<Typography variant="body1"> | |||||
<FormattedMessage id="noRecordFound" /> | |||||
</Typography> | |||||
</GridOverlay> | |||||
); | |||||
} | |||||
React.useEffect(() => { | |||||
if(editMode){ | |||||
set_editMode(editMode); | |||||
} | |||||
}, [editMode]); | |||||
React.useEffect(() => { | |||||
if(filterItems){ | |||||
set_filterItems(filterItems); | |||||
} | |||||
}, [filterItems]); | |||||
return ( | return ( | ||||
<DataGrid | <DataGrid | ||||
{...props} | {...props} | ||||
rows={_rows} | |||||
rows={slicedRows} | |||||
columns={_columns} | columns={_columns} | ||||
disableColumnMenu | |||||
rowModesModel={_rowModesModel} | rowModesModel={_rowModesModel} | ||||
pageSizeOptions={_pageSizeOptions} | pageSizeOptions={_pageSizeOptions} | ||||
editMode={_editMode} | editMode={_editMode} | ||||
autoHeight={_autoHeight} | autoHeight={_autoHeight} | ||||
hideFooterSelectedRowCount={myHideFooterSelectedRowCount} | hideFooterSelectedRowCount={myHideFooterSelectedRowCount} | ||||
filterModel={{items:_filterItems}} | |||||
filterModel={{ items: _filterItems }} | |||||
sx={_sx} | sx={_sx} | ||||
components={{ | |||||
noRowsOverlay: CustomNoRowsOverlay, | |||||
Pagination: () => ( | |||||
<TablePagination | |||||
count={_rows.length} | |||||
page={page} | |||||
rowsPerPage={pageSize} | |||||
rowsPerPageOptions={[5,10,20,100]} | |||||
labelDisplayedRows={({ from, to, count }) => | |||||
`${from}-${to} ${intl.formatMessage({ id: "of" })} ${count}` | |||||
} | |||||
labelRowsPerPage={intl.formatMessage({ id: "rowsPerPage" }) + ":"} | |||||
onPageChange={handleChangePage} | |||||
onRowsPerPageChange={handleChangePageSize} | |||||
/> | |||||
), | |||||
}} | |||||
/> | /> | ||||
); | ); | ||||
} | } |
@@ -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 <RefreshTokenContext.Provider value={{}}>{children}</RefreshTokenContext.Provider>; | |||||
}; | |||||
export { RefreshTokenContext, RefreshTokenProvider }; |
@@ -18,6 +18,7 @@ import { store } from 'store'; | |||||
import reportWebVitals from './reportWebVitals'; | import reportWebVitals from './reportWebVitals'; | ||||
import {I18nProvider} from "./components/I18nProvider"; | import {I18nProvider} from "./components/I18nProvider"; | ||||
import {AutoLogoutProvider} from "./components/AutoLogoutProvider"; | import {AutoLogoutProvider} from "./components/AutoLogoutProvider"; | ||||
import {RefreshTokenProvider} from "./components/RefreshTokenProvider"; | |||||
// ==============================|| MAIN - REACT DOM RENDER ||============================== // | // ==============================|| MAIN - REACT DOM RENDER ||============================== // | ||||
@@ -29,11 +30,13 @@ root.render( | |||||
<StrictMode> | <StrictMode> | ||||
<ReduxProvider store={store}> | <ReduxProvider store={store}> | ||||
<I18nProvider> | <I18nProvider> | ||||
<BrowserRouter basename="/"> | |||||
<AutoLogoutProvider> | |||||
<App /> | |||||
</AutoLogoutProvider> | |||||
</BrowserRouter> | |||||
<BrowserRouter basename="/"> | |||||
<RefreshTokenProvider> | |||||
<AutoLogoutProvider> | |||||
<App /> | |||||
</AutoLogoutProvider> | |||||
</RefreshTokenProvider> | |||||
</BrowserRouter> | |||||
</I18nProvider> | </I18nProvider> | ||||
</ReduxProvider> | </ReduxProvider> | ||||
</StrictMode> | </StrictMode> | ||||
@@ -137,6 +137,17 @@ function Header(props) { | |||||
<li> | <li> | ||||
<Link className="emailTemplate" to='/emailTemplate'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Email Template</Typography></Link> | <Link className="emailTemplate" to='/emailTemplate'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Email Template</Typography></Link> | ||||
</li> | </li> | ||||
<li> | |||||
<Link className="client" ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>Setting</Typography><KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} /></Link> | |||||
<ul className='dropdown'> | |||||
<li> | |||||
<Link className="userProfileGld" to='/user/profile'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users Profile</Typography></Link> | |||||
</li> | |||||
<li> | |||||
<Link className="systemSetting" to='/setting/sys'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>System Setting</Typography></Link> | |||||
</li> | |||||
</ul> | |||||
</li> | |||||
<li> | <li> | ||||
<Link className="logout" onClick={handleLogout}><Typography variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>Logout</Typography></Link> | <Link className="logout" onClick={handleLogout}><Typography variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}>Logout</Typography></Link> | ||||
</li> | </li> | ||||
@@ -216,7 +227,7 @@ function Header(props) { | |||||
<Link className="manageUser" to={'/org'}> | <Link className="manageUser" to={'/org'}> | ||||
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | ||||
{/* <FormattedMessage id="companyOrUserRecord" /> */} | {/* <FormattedMessage id="companyOrUserRecord" /> */} | ||||
Organisation Profile | |||||
<FormattedMessage id="organizationProfile" /> | |||||
</Typography> | </Typography> | ||||
</Link> | </Link> | ||||
</li> | </li> | ||||
@@ -252,8 +263,7 @@ function Header(props) { | |||||
<li> | <li> | ||||
<Link className="manageUser" to={'/orgUser'}> | <Link className="manageUser" to={'/orgUser'}> | ||||
<Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2 }}> | ||||
{/* <FormattedMessage id="companyOrUserRecord" /> */} | |||||
User Profile | |||||
<FormattedMessage id="userProfile" /> | |||||
</Typography> | </Typography> | ||||
</Link> | </Link> | ||||
</li> | </li> | ||||
@@ -103,18 +103,14 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
]; | ]; | ||||
return ( | return ( | ||||
<div style={{ minHeight:400, width: '100%' }}> | |||||
<div style={{ width: '100%' }}> | |||||
<FiDataGrid | <FiDataGrid | ||||
sx={_sx} | sx={_sx} | ||||
rowHeight={80} | rowHeight={80} | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
onRowDoubleClick={handleEditClick} | onRowDoubleClick={handleEditClick} | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -1,7 +1,6 @@ | |||||
// material-ui | // material-ui | ||||
import { | import { | ||||
Button, | Button, | ||||
CardContent, | |||||
Grid, TextField, | Grid, TextField, | ||||
Autocomplete, | Autocomplete, | ||||
Typography, | Typography, | ||||
@@ -15,6 +14,8 @@ import * as UrlUtils from "utils/ApiPathConst"; | |||||
import * as HttpUtils from "utils/HttpUtils"; | import * as HttpUtils from "utils/HttpUtils"; | ||||
import { useNavigate } from "react-router-dom"; | import { useNavigate } from "react-router-dom"; | ||||
import { notifyDownloadSuccess } from 'utils/CommonFunction'; | import { notifyDownloadSuccess } from 'utils/CommonFunction'; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -35,22 +36,6 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p | |||||
const [issueCombo, setIssueCombo] = React.useState([]); | const [issueCombo, setIssueCombo] = React.useState([]); | ||||
const navigate = useNavigate() | 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(() => { | React.useEffect(() => { | ||||
if (issueComboData && issueComboData.length > 0) { | if (issueComboData && issueComboData.length > 0) { | ||||
setIssueCombo(issueComboData); | setIssueCombo(issueComboData); | ||||
@@ -128,22 +113,24 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p | |||||
<MainCard xs={12} md={12} lg={12} | <MainCard xs={12} md={12} lg={12} | ||||
border={false} | border={false} | ||||
content={false} | content={false} | ||||
sx={_sx} | |||||
> | > | ||||
<form> | <form> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | |||||
<Grid item justifyContent="space-between" alignItems="center" > | |||||
<Typography variant="h5">Please Select Gazette Issue :</Typography> | |||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1}} width="98%"> | |||||
{/*row 1*/} | |||||
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:2.5}}> | |||||
<Typography variant="h5" > | |||||
Please Select Gazette Issue : | |||||
</Typography> | |||||
</Grid> | </Grid> | ||||
</CardContent> | |||||
{/*row 2*/} | |||||
{/*row 2*/} | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 1 }}> | |||||
<Grid container display="flex" alignItems={"center"} sx={{mb:3}}> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3 }}> | |||||
<Autocomplete | <Autocomplete | ||||
disablePortal | disablePortal | ||||
size="small" | |||||
id="issueId" | id="issueId" | ||||
options={issueCombo} | options={issueCombo} | ||||
value={issueSelected} | value={issueSelected} | ||||
@@ -177,17 +164,15 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p | |||||
</Button> | </Button> | ||||
</Grid> */} | </Grid> */} | ||||
<Grid item sx={{ ml: 3, mr: 3 }} > | <Grid item sx={{ ml: 3, mr: 3 }} > | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={onSubmit} | onClick={onSubmit} | ||||
color="success" | color="success" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Create</Typography> | |||||
> | |||||
Create | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3 }} > | <Grid item sx={{ ml: 3, mr: 3 }} > | ||||
@@ -198,9 +183,20 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p | |||||
<Typography variant="h5">Pending Publish: {publishCount}</Typography> | <Typography variant="h5">Pending Publish: {publishCount}</Typography> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</Grid> | |||||
</form> | </form> | ||||
<div> | <div> | ||||
<Dialog open={isFailPopUp} onClose={() => setIsFailPopUp(false)} > | |||||
<Dialog | |||||
open={isFailPopUp} | |||||
onClose={() => setIsFailPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Action Fail</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Action Fail</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>{failText}</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>{failText}</Typography> | ||||
@@ -211,7 +207,17 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p | |||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={isSuccessPopUp} onClose={() => setIsSuccessPopUp(false)} > | |||||
<Dialog | |||||
open={isSuccessPopUp} | |||||
onClose={() => setIsSuccessPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Create Result</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Create Result</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
@@ -80,16 +80,18 @@ const Index = () => { | |||||
!onReady ? | !onReady ? | ||||
<LoadingComponent/> | <LoadingComponent/> | ||||
: | : | ||||
<Grid container sx={{minHeight: '85vh',backgroundColor:'#ffffff'}} direction="column"> | |||||
<Grid container sx={{backgroundColor: 'backgroundColor.default'}} direction="column"> | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4">Create Demand Note</Typography> | |||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
Create Demand Note | |||||
</Typography> | |||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{mb:-1}}> | |||||
<SearchForm | <SearchForm | ||||
applySearch={applySearch} | applySearch={applySearch} | ||||
issueComboData={issueCombo} | issueComboData={issueCombo} | ||||
@@ -18,6 +18,8 @@ import { notifyDownloadSuccess } from 'utils/CommonFunction'; | |||||
import * as UrlUtils from "utils/ApiPathConst"; | import * as UrlUtils from "utils/ApiPathConst"; | ||||
import * as HttpUtils from "utils/HttpUtils"; | import * as HttpUtils from "utils/HttpUtils"; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
export default function SearchDemandNote({ recordList, reloadFun, applySearch }) { | export default function SearchDemandNote({ recordList, reloadFun, applySearch }) { | ||||
@@ -270,8 +272,9 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
]; | ]; | ||||
return ( | return ( | ||||
<div style={{ height: '100%', width: '100%' }}> | |||||
<div style={{ width: '100%' }}> | |||||
<Grid container maxWidth justifyContent="flex-start"> | <Grid container maxWidth justifyContent="flex-start"> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | <Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | ||||
<input | <input | ||||
id="uploadFileBtn" | id="uploadFileBtn" | ||||
@@ -295,62 +298,45 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
<Button | <Button | ||||
component="span" | component="span" | ||||
variant="contained" | variant="contained" | ||||
size="large" | |||||
> | > | ||||
<Typography variant="h5">Attach DN</Typography> | |||||
Attach DN | |||||
</Button> | </Button> | ||||
</label> | </label> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | <Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={findReadyToSend} | onClick={findReadyToSend} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Ready Send</Typography> | |||||
> | |||||
Ready Send | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | <Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={() => setSendPopUp(true)} | onClick={() => setSendPopUp(true)} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Send DN</Typography> | |||||
> | |||||
Send DN | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | <Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={() => exportXml()} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Export XML</Typography> | |||||
onClick={() => exportXml()}> | |||||
Export GDNS | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | <Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={() => setConfirmPopUp(true)} | onClick={() => setConfirmPopUp(true)} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Mark as Paid</Typography> | |||||
> | |||||
Mark as Paid | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
<Box sx={{ backgroundColor: "#fff", ml: 2 }} width="98%"> | <Box sx={{ backgroundColor: "#fff", ml: 2 }} width="98%"> | ||||
<FiDataGrid | <FiDataGrid | ||||
@@ -361,17 +347,23 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
}} | }} | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 100 }, | |||||
}, | |||||
}} | |||||
customPageSize={100} | |||||
getRowHeight={() => 'auto'} | getRowHeight={() => 'auto'} | ||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
/> | /> | ||||
</Box> | </Box> | ||||
<div> | <div> | ||||
<Dialog open={isErrorPopUp} onClose={() => setIsErrorPopUp(false)} > | |||||
<Dialog | |||||
open={isErrorPopUp} | |||||
onClose={() => setIsErrorPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Action Fail</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Action Fail</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Number of DN record must less than 100.<br />Please edit search form.</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Number of DN record must less than 100.<br />Please edit search form.</Typography> | ||||
@@ -382,7 +374,17 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={selectonWarning} onClose={() => setSelectonWarning(false)} > | |||||
<Dialog | |||||
open={selectonWarning} | |||||
onClose={() => setSelectonWarning(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Please Select DN.</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Please Select DN.</Typography> | ||||
@@ -393,7 +395,17 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={isConfirmPopUp} onClose={() => setConfirmPopUp(false)} > | |||||
<Dialog | |||||
open={isConfirmPopUp} | |||||
onClose={() => setConfirmPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure to mark DN paid?</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Are you sure to mark DN paid?</Typography> | ||||
@@ -405,7 +417,17 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={isSendPopUp} onClose={() => setSendPopUp(false)} > | |||||
<Dialog | |||||
open={isSendPopUp} | |||||
onClose={() => setSendPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure to send DN?</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Are you sure to send DN?</Typography> | ||||
@@ -417,7 +439,17 @@ export default function SearchDemandNote({ recordList, reloadFun, applySearch }) | |||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={wait} onClose={() => setWait(false)} > | |||||
<Dialog | |||||
open={wait} | |||||
onClose={() => setWait(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Calculating, please wait ...</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Calculating, please wait ...</Typography> | ||||
</DialogContent> | </DialogContent> | ||||
@@ -1,7 +1,6 @@ | |||||
// material-ui | // material-ui | ||||
import { | import { | ||||
Button, | Button, | ||||
CardContent, | |||||
Grid, TextField, | Grid, TextField, | ||||
Autocomplete, | Autocomplete, | ||||
Typography | Typography | ||||
@@ -12,6 +11,8 @@ import * as React from "react"; | |||||
import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import * as FormatUtils from "utils/FormatUtils"; | import * as FormatUtils from "utils/FormatUtils"; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -88,14 +89,12 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||||
> | > | ||||
<form onSubmit={handleSubmit(onSubmit)}> | <form onSubmit={handleSubmit(onSubmit)}> | ||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 3, mb: 3 }} width="98%"> | |||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1 }} width="98%"> | |||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12}> | |||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | |||||
<Grid item justifyContent="space-between" alignItems="center"> | |||||
<Typography variant="h5">Search Form</Typography> | |||||
</Grid> | |||||
</CardContent> | |||||
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1, ml:3,mb:2.5}}> | |||||
<Typography variant="pnspsFormHeader" > | |||||
Search Form | |||||
</Typography> | |||||
</Grid> | </Grid> | ||||
{/*row 2*/} | {/*row 2*/} | ||||
<Grid container display="flex" alignItems={"center"}> | <Grid container display="flex" alignItems={"center"}> | ||||
@@ -105,6 +104,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||||
{...register("issueId")} | {...register("issueId")} | ||||
disablePortal | disablePortal | ||||
id="issueId" | id="issueId" | ||||
size="small" | |||||
options={issueCombo} | options={issueCombo} | ||||
value={issueSelected} | value={issueSelected} | ||||
inputValue={(issueSelected?.id) ? getIssueLabel(issueSelected) : ""} | inputValue={(issueSelected?.id) ? getIssueLabel(issueSelected) : ""} | ||||
@@ -145,6 +145,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||||
{...register("orgId")} | {...register("orgId")} | ||||
disablePortal | disablePortal | ||||
id="orgId" | id="orgId" | ||||
size="small" | |||||
options={orgCombo} | options={orgCombo} | ||||
value={orgSelected} | value={orgSelected} | ||||
inputValue={(orgSelected?.label) ? orgSelected?.label : ""} | inputValue={(orgSelected?.label) ? orgSelected?.label : ""} | ||||
@@ -220,6 +221,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | ||||
<Autocomplete | <Autocomplete | ||||
multiple | multiple | ||||
size="small" | |||||
{...register("status")} | {...register("status")} | ||||
id="status" | id="status" | ||||
options={ComboData.denmandNoteStatus} | options={ComboData.denmandNoteStatus} | ||||
@@ -258,31 +260,25 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||||
{/*last row*/} | {/*last row*/} | ||||
<Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ ml: 3, mb:3 }}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={resetForm} | onClick={resetForm} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Clear</Typography> | |||||
> | |||||
Clear | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<Grid item sx={{ ml: 3, mr: 3, mb:3}}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Submit</Typography> | |||||
> | |||||
Submit | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</form> | </form> | ||||
@@ -94,16 +94,18 @@ const UserSearchPage_Individual = () => { | |||||
!onReady ? | !onReady ? | ||||
<LoadingComponent /> | <LoadingComponent /> | ||||
: | : | ||||
<Grid container sx={{ minHeight: '85vh', backgroundColor: 'backgroundColor.default' }} direction="column"> | |||||
<Grid container sx={{ backgroundColor: 'backgroundColor.default' }} direction="column"> | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4">Demand Note</Typography> | |||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
Demand Note | |||||
</Typography> | |||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{mb: -1}}> | |||||
<SearchForm | <SearchForm | ||||
applySearch={applySearch} | applySearch={applySearch} | ||||
orgComboData={orgCombo} | orgComboData={orgCombo} | ||||
@@ -80,11 +80,7 @@ export default function SearchDemandNote({ recordList }) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 100 }, | |||||
}, | |||||
}} | |||||
customPageSize={100} | |||||
getRowHeight={() => 'auto'} | getRowHeight={() => 'auto'} | ||||
/> | /> | ||||
</Box> | </Box> | ||||
@@ -13,6 +13,8 @@ import * as ComboData from "utils/ComboData"; | |||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import * as FormatUtils from "utils/FormatUtils"; | import * as FormatUtils from "utils/FormatUtils"; | ||||
import {FormattedMessage, useIntl} from "react-intl"; | import {FormattedMessage, useIntl} from "react-intl"; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -76,13 +78,13 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData | |||||
> | > | ||||
<form onSubmit={handleSubmit(onSubmit)}> | <form onSubmit={handleSubmit(onSubmit)}> | ||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 3, mb: 3 }} width="98%"> | |||||
<Grid container sx={{ backgroundColor: '#ffffff' }} width="98%"> | |||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | <CardContent sx={{ px: 2.5, pt: 3 }}> | ||||
<Grid item justifyContent="space-between" alignItems="center"> | |||||
<Typography variant="h5"> | |||||
<FormattedMessage id="search"/> | |||||
<Grid item justifyContent="space-between" alignItems="center" > | |||||
<Typography variant="pnspsFormHeader"> | |||||
<FormattedMessage id="searchForm"/> | |||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
</CardContent> | </CardContent> | ||||
@@ -210,35 +212,26 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData | |||||
{/*last row*/} | {/*last row*/} | ||||
<Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
onClick={resetForm} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5"> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{mr: 3, mb: 3}}> | |||||
<Button | |||||
color="cancel" | |||||
variant="contained" | |||||
onClick={resetForm} | |||||
> | |||||
<FormattedMessage id="reset"/> | <FormattedMessage id="reset"/> | ||||
</Typography> | |||||
</Button> | |||||
</Grid> | |||||
</Button> | |||||
</Grid> | |||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
type="submit" | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5"> | |||||
<Grid item sx={{ mb: 3 }}> | |||||
<Button | |||||
variant="contained" | |||||
type="submit" | |||||
> | |||||
<FormattedMessage id="submit" /> | <FormattedMessage id="submit" /> | ||||
</Typography> | |||||
</Button> | |||||
</Grid> | |||||
</Button> | |||||
</Grid> | |||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</form> | </form> | ||||
@@ -98,14 +98,14 @@ const UserSearchPage_Individual = () => { | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | |||||
<FormattedMessage id="paymentInfoRecord" /> | <FormattedMessage id="paymentInfoRecord" /> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{mb:-1}}> | |||||
<SearchForm | <SearchForm | ||||
applySearch={applySearch} | applySearch={applySearch} | ||||
orgComboData={orgCombo} | orgComboData={orgCombo} | ||||
@@ -4,8 +4,7 @@ import { | |||||
Grid, | Grid, | ||||
Typography, | Typography, | ||||
FormLabel, | FormLabel, | ||||
OutlinedInput, | |||||
Button, | |||||
Button, TextField, | |||||
// TextField, | // TextField, | ||||
// Autocomplete, | // Autocomplete, | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
@@ -15,6 +14,8 @@ import * as React from "react"; | |||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); | const MainCard = Loadable(React.lazy(() => import('components/MainCard'))); | ||||
import { useForm } from 'react-hook-form'; | import { useForm } from 'react-hook-form'; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
const ApplicationDetailCard = ({ | const ApplicationDetailCard = ({ | ||||
formData, | formData, | ||||
@@ -35,59 +36,30 @@ const ApplicationDetailCard = ({ | |||||
// initialValues: data, | // initialValues: data, | ||||
// }); | // }); | ||||
const DisplayField = ({ name, width, value, rows = 1, disabled = false }) => { | |||||
return <OutlinedInput | |||||
const DisplayField = ({ name, rows, value, disabled = false }) => { | |||||
return <TextField | |||||
fullWidth | fullWidth | ||||
multiline | |||||
disabled={disabled} | disabled={disabled} | ||||
size="small" | |||||
// onChange={formik.handleChange} | |||||
inputProps={{ style: {fontSize: '1.1rem'}}} | |||||
InputProps={{ | |||||
style: { | |||||
minHeight:'42.5px', | |||||
maxHeight: '50vh', | |||||
padding: '0 0 0 0', | |||||
height: 'fit-content', | |||||
boxSizing: "inherit"}, | |||||
}} | |||||
sx={{ padding: '10.5px 14px 10.5px 12px'}} | |||||
{...register(name, | {...register(name, | ||||
{ | { | ||||
value: value, | value: value, | ||||
})} | })} | ||||
id={name} | |||||
name={name} | |||||
variant="outlined" | |||||
multiline | |||||
minRows={rows} | |||||
maxRows={6} | maxRows={6} | ||||
rows={rows} | |||||
sx={ | |||||
{ | |||||
"& .Mui-disabled": { | |||||
WebkitTextFillColor: "#000000", | |||||
background: "#f8f8f8", | |||||
}, | |||||
// "& .MuiInputBase-input.Mui-disabled": { | |||||
// WebkitTextFillColor: "#000000", | |||||
// background: "#f8f8f8", | |||||
// }, | |||||
width: width ? width : '100%' | |||||
} | |||||
} | |||||
/>; | />; | ||||
} | } | ||||
const { register, handleSubmit } = useForm() | const { register, handleSubmit } = useForm() | ||||
// const DisplaySelection = ({ name = "test", value = "", onChange }) => { | |||||
// return <Autocomplete | |||||
// {...register(name)} | |||||
// disablePortal | |||||
// id={name} | |||||
// options={formData} | |||||
// vale={value} | |||||
// onChange={onChange} | |||||
// renderInput={(params) => ( | |||||
// <TextField {...params} | |||||
// InputLabelProps={{ | |||||
// shrink: true | |||||
// }} | |||||
// /> | |||||
// )} | |||||
// /> | |||||
// } | |||||
return ( | return ( | ||||
<MainCard | <MainCard | ||||
id={"emailTemplateMainCard"} | id={"emailTemplateMainCard"} | ||||
@@ -141,6 +113,7 @@ const ApplicationDetailCard = ({ | |||||
<DisplayField | <DisplayField | ||||
name="description" | name="description" | ||||
value={formData?.description} | value={formData?.description} | ||||
rows={2} | |||||
/> | /> | ||||
</FormControl> | </FormControl> | ||||
</Grid> | </Grid> | ||||
@@ -168,14 +141,14 @@ const ApplicationDetailCard = ({ | |||||
<Grid container direction="row" justifyContent="space-between" | <Grid container direction="row" justifyContent="space-between" | ||||
alignItems="center"> | alignItems="center"> | ||||
<Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | |||||
<Grid item xs={12} md={1.5} lg={1.5} | |||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel>Subject (Cht):</FormLabel> | <FormLabel>Subject (Cht):</FormLabel> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={9} lg={9}> | |||||
<Grid item xs={12} md={10.5} lg={10.5}> | |||||
<DisplayField | <DisplayField | ||||
name="subjectCht" | name="subjectCht" | ||||
value={formData?.subjectCht} | value={formData?.subjectCht} | ||||
@@ -202,18 +175,18 @@ const ApplicationDetailCard = ({ | |||||
</Grid> | </Grid> | ||||
<Grid container direction="row" justifyContent="space-between" | <Grid container direction="row" justifyContent="space-between" | ||||
alignItems="center"> | alignItems="center"> | ||||
<Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | |||||
<Grid item xs={12} md={1.5} lg={1.5} | |||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel>Subject (Chs):</FormLabel> | <FormLabel>Subject (Chs):</FormLabel> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={9} lg={9}> | |||||
<Grid item xs={12} md={10.5} lg={10.5}> | |||||
<DisplayField | <DisplayField | ||||
name="subjectChs" | name="subjectChs" | ||||
value={formData?.subjectChs} | value={formData?.subjectChs} | ||||
rows={2} | |||||
rows={1} | |||||
/> | /> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -236,18 +209,18 @@ const ApplicationDetailCard = ({ | |||||
</Grid> | </Grid> | ||||
<Grid container direction="row" justifyContent="space-between" | <Grid container direction="row" justifyContent="space-between" | ||||
alignItems="center"> | alignItems="center"> | ||||
<Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1 }}> | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | |||||
<Grid item xs={12} md={1.5} lg={1.5} | |||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel>Subject (Eng):</FormLabel> | <FormLabel>Subject (Eng):</FormLabel> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={9} lg={9}> | |||||
<Grid item xs={12} md={10.5} lg={10.5}> | |||||
<DisplayField | <DisplayField | ||||
name="subjectEng" | name="subjectEng" | ||||
value={formData?.subjectEng} | value={formData?.subjectEng} | ||||
rows={2} | |||||
rows={1} | |||||
/> | /> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -273,33 +246,25 @@ const ApplicationDetailCard = ({ | |||||
{/*bottom button*/} | {/*bottom button*/} | ||||
<Grid item s={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"end"} justifyContent="center"> | <Grid item s={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"end"} justifyContent="center"> | ||||
<Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
color="error" | |||||
color="delete" | |||||
variant="contained" | variant="contained" | ||||
onClick={handleDelete} | onClick={handleDelete} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | > | ||||
<Typography variant="h5">Delete</Typography> | |||||
Delete | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | > | ||||
<Typography variant="h5">Save</Typography> | |||||
Save | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -129,7 +129,7 @@ const Index = () => { | |||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} width="100%"> | <Grid item xs={12} width="100%"> | ||||
<Button title="Back" sx={{ ml: 6, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate("/emailTemplate") }}> | |||||
<Button title="Back" sx={{ ml: 6, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate(-1) }}> | |||||
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | <ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | ||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
@@ -87,11 +87,7 @@ export default function EmailTemplateTable({ recordList }) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
getRowHeight={() => 'auto'} | getRowHeight={() => 'auto'} | ||||
/> | /> | ||||
@@ -25,6 +25,8 @@ const BackgroundHead = { | |||||
backgroundPosition: 'right' | backgroundPosition: 'right' | ||||
} | } | ||||
import { useNavigate } from "react-router"; | import { useNavigate } from "react-router"; | ||||
import {PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -56,7 +58,7 @@ const Index = () => { | |||||
<LoadingComponent /> | <LoadingComponent /> | ||||
: | : | ||||
( | ( | ||||
<Grid container sx={{ minHeight: '110vh', backgroundColor: 'backgroundColor.default' }} direction="column" justifyContent="flex-start" alignItems="center" > | |||||
<Grid container sx={{ backgroundColor: 'backgroundColor.default' }} direction="column" justifyContent="flex-start" alignItems="center" > | |||||
<Grid item xs={12} width="100%"> | <Grid item xs={12} width="100%"> | ||||
<div style={BackgroundHead} width="100%"> | <div style={BackgroundHead} width="100%"> | ||||
<Stack direction="row" height='70px'> | <Stack direction="row" height='70px'> | ||||
@@ -78,18 +80,18 @@ const Index = () => { | |||||
<Grid container direction="row" | <Grid container direction="row" | ||||
justifyContent="space-between" | justifyContent="space-between" | ||||
alignItems="center"> | alignItems="center"> | ||||
<Grid item xs={3} md={3} sx={{ ml: 3, mr: 1, mb: 3, mt: 3 }}> | |||||
<Grid item xs={3} md={3} sx={{ mb:3, ml: 3, mr: 1 }}> | |||||
<ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={()=>{navigate('/emailTemplate/-1')}} | onClick={()=>{navigate('/emailTemplate/-1')}} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<AddCircleOutlineIcon sx={{ mb: 0.5 }} /> | |||||
<Typography sx={{ ml: 1 }} variant="h5">New Email Template</Typography> | |||||
startIcon={<AddCircleOutlineIcon/>} | |||||
> | |||||
New Email Template | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</Grid > | </Grid > | ||||
@@ -69,18 +69,14 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
return ( | return ( | ||||
<div style={{ minHeight:400, width: '100%' }}> | |||||
<div style={{ width: '100%' }}> | |||||
<FiDataGrid | <FiDataGrid | ||||
sx={_sx} | sx={_sx} | ||||
rowHeight={80} | rowHeight={80} | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={10} | |||||
onRowDoubleClick={handleEditClick} | onRowDoubleClick={handleEditClick} | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -1,7 +1,6 @@ | |||||
// material-ui | // material-ui | ||||
import { | import { | ||||
Button, | Button, | ||||
CardContent, | |||||
Grid, TextField, | Grid, TextField, | ||||
// Autocomplete, | // Autocomplete, | ||||
Typography | Typography | ||||
@@ -10,6 +9,8 @@ import MainCard from "components/MainCard"; | |||||
import { useForm } from "react-hook-form"; | import { useForm } from "react-hook-form"; | ||||
import * as React from "react"; | import * as React from "react"; | ||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import {PNSPS_BUTTON_THEME} from "../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// import * as ComboData from "utils/ComboData"; | // import * as ComboData from "utils/ComboData"; | ||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -20,22 +21,6 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) => | |||||
const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | ||||
// const [status, setStatus] = React.useState(ComboData.paymentStatus[0]); | // 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 { register, handleSubmit, getValues } = useForm() | ||||
const onSubmit = (data) => { | const onSubmit = (data) => { | ||||
@@ -67,20 +52,19 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) => | |||||
<MainCard xs={12} md={12} lg={12} | <MainCard xs={12} md={12} lg={12} | ||||
border={false} | border={false} | ||||
content={false} | content={false} | ||||
sx={_sx} | |||||
> | > | ||||
<form onSubmit={handleSubmit(onSubmit)}> | |||||
{/*row 1*/} | |||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | |||||
<Grid item justifyContent="space-between" alignItems="center" > | |||||
<Typography variant="h5">Credit Date</Typography> | |||||
<form onSubmit={handleSubmit(onSubmit)} > | |||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1}} width="98%"> | |||||
{/*row 1*/} | |||||
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:2.5}}> | |||||
<Typography variant="h5" > | |||||
Credit Date | |||||
</Typography> | |||||
</Grid> | </Grid> | ||||
</CardContent> | |||||
{/*row 2*/} | |||||
<Grid container alignItems="center"> | |||||
{/*row 2*/} | |||||
<Grid container display="flex" alignItems={"center"}> | |||||
<Grid item xs={9} s={6} md={4} lg={4} sx={{ ml: 3, mr: 3, mb: 3 }}> | <Grid item xs={9} s={6} md={4} lg={4} sx={{ ml: 3, mr: 3, mb: 3 }}> | ||||
<TextField | <TextField | ||||
fullWidth | fullWidth | ||||
@@ -121,31 +105,26 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria }) => | |||||
</Grid> */} | </Grid> */} | ||||
</Grid> | </Grid> | ||||
<Grid container justifyContent="flex-end" direction="row" alignItems="center" spacing={3}> | <Grid container justifyContent="flex-end" direction="row" alignItems="center" spacing={3}> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, }} > | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ ml: 3, mb: 3, }} > | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Preview</Typography> | |||||
> | |||||
Preview | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, }} > | <Grid item sx={{ ml: 3, mr: 3, mb: 3, }} > | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={generateHandler} | onClick={generateHandler} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Generate</Typography> | |||||
> | |||||
Generate | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
</ThemeProvider> | |||||
</Grid> | |||||
</Grid> | </Grid> | ||||
</form> | </form> | ||||
</MainCard> | </MainCard> | ||||
@@ -42,7 +42,7 @@ const Index = () => { | |||||
}, [record]); | }, [record]); | ||||
React.useEffect(() => { | React.useEffect(() => { | ||||
console.log(searchCriteria) | |||||
// console.log(searchCriteria) | |||||
loadGrid(); | loadGrid(); | ||||
}, [searchCriteria]); | }, [searchCriteria]); | ||||
@@ -57,14 +57,14 @@ const Index = () => { | |||||
} | } | ||||
function downloadXML(input) { | function downloadXML(input) { | ||||
console.log(input) | |||||
// console.log(input) | |||||
HttpUtils.get({ | HttpUtils.get({ | ||||
url: UrlUtils.GEN_GFMIS_XML + "/today", | url: UrlUtils.GEN_GFMIS_XML + "/today", | ||||
params:{dateTo: input.dateTo, | params:{dateTo: input.dateTo, | ||||
dateFrom: input.dateFrom, | dateFrom: input.dateFrom, | ||||
}, | }, | ||||
onSuccess: (responseData) => { | onSuccess: (responseData) => { | ||||
console.log(responseData) | |||||
// console.log(responseData) | |||||
const parser = new DOMParser(); | const parser = new DOMParser(); | ||||
const xmlDoc = parser.parseFromString(responseData, 'application/xml'); | const xmlDoc = parser.parseFromString(responseData, 'application/xml'); | ||||
const filename = xmlDoc.querySelector('FileHeader').getAttribute('H_Filename'); | const filename = xmlDoc.querySelector('FileHeader').getAttribute('H_Filename'); | ||||
@@ -100,7 +100,7 @@ const Index = () => { | |||||
!onReady ? | !onReady ? | ||||
<LoadingComponent/> | <LoadingComponent/> | ||||
: | : | ||||
<Grid container sx={{minHeight: '85vh',backgroundColor:'#ffffff'}} direction="column"> | |||||
<Grid container sx={{ backgroundColor: 'backgroundColor.default'}} direction="column"> | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
@@ -109,7 +109,7 @@ const Index = () => { | |||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{mb:-1}}> | |||||
<SearchForm | <SearchForm | ||||
applySearch={applySearch} | applySearch={applySearch} | ||||
generateXML={generateXML} | generateXML={generateXML} | ||||
@@ -79,7 +79,7 @@ const Index = () => { | |||||
<Grid container justifyContent="flex-start" alignItems="center" > | <Grid container justifyContent="flex-start" alignItems="center" > | ||||
<center> | <center> | ||||
<Grid item xs={12} md={12} sx={{p:2}} > | <Grid item xs={12} md={12} sx={{p:2}} > | ||||
<Typography variant="h2" sx={{ textAlign: "left", borderBottom: "1px solid black" }}> | |||||
<Typography variant="h3" sx={{ textAlign: "left", borderBottom: "1px solid black" }}> | |||||
{record?.subject} | {record?.subject} | ||||
</Typography> | </Typography> | ||||
<Typography sx={{p:1}} align="justify">{DateUtils.datetimeStr(record?.sentDate)}</Typography> | <Typography sx={{p:1}} align="justify">{DateUtils.datetimeStr(record?.sentDate)}</Typography> | ||||
@@ -87,7 +87,7 @@ const Index = () => { | |||||
<div dangerouslySetInnerHTML={{__html: record?.content}}></div> | <div dangerouslySetInnerHTML={{__html: record?.content}}></div> | ||||
</Typography> | </Typography> | ||||
<Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}> | |||||
<Typography variant="h4" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}> | |||||
<Button | <Button | ||||
component="span" | component="span" | ||||
variant="contained" | variant="contained" | ||||
@@ -66,11 +66,7 @@ export default function MsgTable({ recordList }) { | |||||
rowHeight={80} | rowHeight={80} | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 20 }, | |||||
}, | |||||
}} | |||||
customPageSize={20} | |||||
onRowDoubleClick={handleEditClick} | onRowDoubleClick={handleEditClick} | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -63,8 +63,8 @@ const SearchForm = ({ applySearch, searchCriteria }) => { | |||||
{/*row 1*/} | {/*row 1*/} | ||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | <CardContent sx={{ px: 2.5, pt: 3 }}> | ||||
<Grid item justifyContent="space-between" alignItems="center" > | <Grid item justifyContent="space-between" alignItems="center" > | ||||
<Typography variant="h4"> | |||||
<FormattedMessage id="search"/> | |||||
<Typography variant="pnspsFormHeader"> | |||||
<FormattedMessage id="searchForm"/> | |||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
</CardContent> | </CardContent> | ||||
@@ -77,6 +77,7 @@ const SearchForm = ({ applySearch, searchCriteria }) => { | |||||
fullWidth | fullWidth | ||||
{...register("keyword")} | {...register("keyword")} | ||||
id='keyword' | id='keyword' | ||||
aria-label={intl.formatMessage({id: 'keyword'})} | |||||
label={intl.formatMessage({id: 'keyword'}) + ":"} | label={intl.formatMessage({id: 'keyword'}) + ":"} | ||||
defaultValue={searchCriteria.code} | defaultValue={searchCriteria.code} | ||||
InputLabelProps={{ | InputLabelProps={{ | ||||
@@ -93,6 +94,7 @@ const SearchForm = ({ applySearch, searchCriteria }) => { | |||||
{...register("dateFrom")} | {...register("dateFrom")} | ||||
id="dateFrom" | id="dateFrom" | ||||
type="date" | type="date" | ||||
aria-label={intl.formatMessage({id: 'dateFrom'})} | |||||
label={intl.formatMessage({id: 'dateFrom'})} | label={intl.formatMessage({id: 'dateFrom'})} | ||||
defaultValue={searchCriteria.dateFrom} | defaultValue={searchCriteria.dateFrom} | ||||
InputProps={{ inputProps: { max: maxDate } }} | InputProps={{ inputProps: { max: maxDate } }} | ||||
@@ -120,6 +122,7 @@ const SearchForm = ({ applySearch, searchCriteria }) => { | |||||
onChange={(newValue) => { | onChange={(newValue) => { | ||||
setMaxDate(DateUtils.dateStr(newValue)); | setMaxDate(DateUtils.dateStr(newValue)); | ||||
}} | }} | ||||
aria-label={intl.formatMessage({id: 'dateTo'})} | |||||
id="dateTo" | id="dateTo" | ||||
type="date" | type="date" | ||||
//label="付款日期(到)" | //label="付款日期(到)" | ||||
@@ -138,7 +141,9 @@ const SearchForm = ({ applySearch, searchCriteria }) => { | |||||
<Grid item sx={{mr: 3, mb: 3 }}> | <Grid item sx={{mr: 3, mb: 3 }}> | ||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
color="cancel" | |||||
onClick={resetForm} | onClick={resetForm} | ||||
aria-label={intl.formatMessage({id: 'reset'})} | |||||
> | > | ||||
<FormattedMessage id="reset"/> | <FormattedMessage id="reset"/> | ||||
</Button> | </Button> | ||||
@@ -148,6 +153,7 @@ const SearchForm = ({ applySearch, searchCriteria }) => { | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
aria-label={intl.formatMessage({id: 'submit'})} | |||||
> | > | ||||
<FormattedMessage id="submit"/> | <FormattedMessage id="submit"/> | ||||
</Button> | </Button> | ||||
@@ -69,7 +69,7 @@ const Index = () => { | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | |||||
<FormattedMessage id="paymentHistory"/> | <FormattedMessage id="paymentHistory"/> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
@@ -42,11 +42,7 @@ export default function CreditorHistoryTable({ recordList }) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 100 }, | |||||
}, | |||||
}} | |||||
customPageSize={100} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -4,20 +4,22 @@ import { | |||||
Dialog, DialogTitle, DialogContent, DialogActions, | Dialog, DialogTitle, DialogContent, DialogActions, | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
// import { FormControlLabel } from '@material-ui/core'; | // import { FormControlLabel } from '@material-ui/core'; | ||||
import MainCard from "../../../components/MainCard"; | |||||
import MainCard from "components/MainCard"; | |||||
import * as React from "react"; | import * as React from "react"; | ||||
import { useFormik } from 'formik'; | import { useFormik } from 'formik'; | ||||
import * as yup from 'yup'; | import * as yup from 'yup'; | ||||
import { useEffect, useState } from "react"; | 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'))); | const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
import { notifySaveSuccess } from 'utils/CommonFunction'; | import { notifySaveSuccess } from 'utils/CommonFunction'; | ||||
import { useIntl } from "react-intl"; | import { useIntl } from "react-intl"; | ||||
import {PNSPS_BUTTON_THEME} from "themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -92,8 +94,8 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
faxNumber: vaule.faxNumber | faxNumber: vaule.faxNumber | ||||
}, | }, | ||||
addressTemp: { | addressTemp: { | ||||
country: vaule.country, | |||||
district: vaule.district, | |||||
country: vaule.country.id, | |||||
district: vaule.district.id, | |||||
addressLine1: vaule.addressLine1, | addressLine1: vaule.addressLine1, | ||||
addressLine2: vaule.addressLine2, | addressLine2: vaule.addressLine2, | ||||
addressLine3: vaule.addressLine3, | addressLine3: vaule.addressLine3, | ||||
@@ -170,97 +172,80 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
<> | <> | ||||
{createMode ? | {createMode ? | ||||
<> | <> | ||||
<Grid item sx={{ ml: 0, mr: 3 }}> | |||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
type="submit" | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | |||||
<Typography variant="h5">Create</Typography> | |||||
</Button> | |||||
</Grid> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ ml: 0, mr: 3 }}> | |||||
<Button | |||||
variant="contained" | |||||
type="submit" | |||||
color="success" | |||||
> | |||||
Create | |||||
</Button> | |||||
</Grid> | |||||
</ThemeProvider> | |||||
</> : | </> : | ||||
<> | <> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ ml: 0, mr: 3 }}> | <Grid item sx={{ ml: 0, mr: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={loadDataFun} | onClick={loadDataFun} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
color="cancel" | |||||
> | > | ||||
<Typography variant="h5">Reset & Back</Typography> | |||||
Reset & Back | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
color="success" | color="success" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | > | ||||
<Typography variant="h5">Save</Typography> | |||||
Save | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
</ThemeProvider> | |||||
</> | </> | ||||
} | } | ||||
</> | </> | ||||
: | : | ||||
<> | <> | ||||
<Grid item sx={{ ml: 0, mr: 3 }}> | <Grid item sx={{ ml: 0, mr: 3 }}> | ||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
onClick={onEditClick} | |||||
> | |||||
<Typography variant="h5">Edit</Typography> | |||||
</Button> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | |||||
variant="contained" | |||||
onClick={onEditClick} | |||||
color="success" | |||||
> | |||||
Edit | |||||
</Button> | |||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
{ | { | ||||
currentUserData.creditor ? | currentUserData.creditor ? | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
color="error" | color="error" | ||||
onClick={() => setNonCreditorConfirmPopUp(true)} | onClick={() => setNonCreditorConfirmPopUp(true)} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | > | ||||
<Typography variant="h5">Mark as Non-Creditor</Typography> | |||||
Mark as Non-Creditor | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
: | : | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
color="orange" | |||||
onClick={() => setCreditorConfirmPopUp(true)} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | |||||
<Typography variant="h5">Mark as Creditor</Typography> | |||||
</Button> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | |||||
variant="contained" | |||||
color="orange" | |||||
onClick={() => setCreditorConfirmPopUp(true)} | |||||
> | |||||
Mark as Creditor | |||||
</Button> | |||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
} | } | ||||
</> | </> | ||||
@@ -275,7 +260,7 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
<Grid container spacing={1}> | <Grid container spacing={1}> | ||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<Typography variant="h4" sx={{ mb: 2, mr: 3, borderBottom: "1px solid black" }}> | <Typography variant="h4" sx={{ mb: 2, mr: 3, borderBottom: "1px solid black" }}> | ||||
Organisation Details | |||||
Organization Details | |||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
@@ -400,7 +385,17 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
} | } | ||||
</form> | </form> | ||||
<div> | <div> | ||||
<Dialog open={creditorConfirmPopUp} onClose={() => setCreditorConfirmPopUp(false)} > | |||||
<Dialog | |||||
open={creditorConfirmPopUp} | |||||
onClose={() => setCreditorConfirmPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Creditor?</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Creditor?</Typography> | ||||
@@ -412,7 +407,17 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={nonCreditorConfirmPopUp} onClose={() => setNonCreditorConfirmPopUp(false)} > | |||||
<Dialog | |||||
open={nonCreditorConfirmPopUp} | |||||
onClose={() => setNonCreditorConfirmPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Creditor?</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Creditor?</Typography> | ||||
@@ -1,23 +1,27 @@ | |||||
// material-ui | // material-ui | ||||
import { | import { | ||||
Grid, Button, Checkbox, FormControlLabel, Typography, | |||||
Grid, Button, | |||||
// Checkbox, FormControlLabel, | |||||
Typography, | |||||
Dialog, DialogTitle, DialogContent, DialogActions, | Dialog, DialogTitle, DialogContent, DialogActions, | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
// import { FormControlLabel } from '@material-ui/core'; | // import { FormControlLabel } from '@material-ui/core'; | ||||
import MainCard from "../../../components/MainCard"; | |||||
import MainCard from "components/MainCard"; | |||||
import * as React from "react"; | import * as React from "react"; | ||||
import { useFormik } from 'formik'; | import { useFormik } from 'formik'; | ||||
import * as yup from 'yup'; | import * as yup from 'yup'; | ||||
import { useEffect, useState } from "react"; | 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'))); | const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
import { notifySaveSuccess } from 'utils/CommonFunction'; | 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 ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -48,52 +52,25 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
enableReinitialize: true, | enableReinitialize: true, | ||||
initialValues: currentUserData, | initialValues: currentUserData, | ||||
validationSchema: yup.object().shape({ | 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'}))), | addressLine1: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({id: 'validateAddressLine1'}))), | ||||
addressLine2: yup.string().max(255, displayErrorMsg(intl.formatMessage({id: 'noMoreThen255Words'}))), | addressLine2: yup.string().max(255, displayErrorMsg(intl.formatMessage({id: 'noMoreThen255Words'}))), | ||||
addressLine3: 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'}))), | 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'}))), | 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 => { | onSubmit: vaule => { | ||||
console.log(vaule) | console.log(vaule) | ||||
HttpUtils.post({ | HttpUtils.post({ | ||||
url: UrlUtils.POST_ORG_SAVE_PATH, | |||||
url: UrlUtils.POST_PUB_ORG_SAVE_PATH, | |||||
params: { | 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, | contactPerson: vaule.contactPerson, | ||||
contactTel: { | contactTel: { | ||||
countryCode: vaule.tel_countryCode, | countryCode: vaule.tel_countryCode, | ||||
phoneNumber: vaule.phoneNumber | phoneNumber: vaule.phoneNumber | ||||
}, | }, | ||||
faxNo: { | |||||
countryCode: vaule.fax_countryCode, | |||||
faxNumber: vaule.faxNumber | |||||
}, | |||||
addressTemp: { | addressTemp: { | ||||
country: vaule.country, | |||||
district: vaule.district, | |||||
country: vaule.country.id, | |||||
district: vaule.district.id, | |||||
addressLine1: vaule.addressLine1, | addressLine1: vaule.addressLine1, | ||||
addressLine2: vaule.addressLine2, | addressLine2: vaule.addressLine2, | ||||
addressLine3: vaule.addressLine3, | addressLine3: vaule.addressLine3, | ||||
@@ -134,26 +111,6 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
setEditMode(true); | 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 ( | return ( | ||||
<MainCard elevation={0} | <MainCard elevation={0} | ||||
border={false} | border={false} | ||||
@@ -171,46 +128,39 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
{createMode ? | {createMode ? | ||||
<> | <> | ||||
<Grid item sx={{ ml: 0, mr: 3 }}> | <Grid item sx={{ ml: 0, mr: 3 }}> | ||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
type="submit" | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | |||||
<Typography variant="h5">Create</Typography> | |||||
</Button> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | |||||
variant="contained" | |||||
type="submit" | |||||
color="success" | |||||
> | |||||
<FormattedMessage id="create" /> | |||||
</Button> | |||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</> : | </> : | ||||
<> | <> | ||||
<Grid item sx={{ ml: 0, mr: 3 }}> | <Grid item sx={{ ml: 0, mr: 3 }}> | ||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
onClick={loadDataFun} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | |||||
<Typography variant="h5">Reset & Back</Typography> | |||||
</Button> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | |||||
variant="contained" | |||||
color="cancel" | |||||
onClick={loadDataFun} | |||||
> | |||||
<FormattedMessage id="resetAndBack" /> | |||||
</Button> | |||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
type="submit" | |||||
color="success" | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | |||||
<Typography variant="h5">Save</Typography> | |||||
</Button> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | |||||
variant="contained" | |||||
type="submit" | |||||
color="success" | |||||
> | |||||
<FormattedMessage id="save" /> | |||||
</Button> | |||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</> | </> | ||||
} | } | ||||
@@ -218,45 +168,15 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
: | : | ||||
<> | <> | ||||
<Grid item sx={{ ml: 0, mr: 3 }}> | <Grid item sx={{ ml: 0, mr: 3 }}> | ||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
onClick={onEditClick} | |||||
> | |||||
<Typography variant="h5">Edit</Typography> | |||||
</Button> | |||||
</Grid> | |||||
<Grid item sx={{ ml: 3, mr: 3 }}> | |||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
color="orange" | |||||
onClick={()=>setCreditorConfirmPopUp(true)} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | |||||
<Typography variant="h5">Mark as Creditor</Typography> | |||||
</Button> | |||||
</Grid> | |||||
<Grid item sx={{ ml: 3, mr: 3 }}> | |||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
color="error" | |||||
onClick={()=>setNonCreditorConfirmPopUp(true)} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | |||||
<Typography variant="h5">Mark as Non-Creditor</Typography> | |||||
</Button> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | |||||
variant="contained" | |||||
onClick={onEditClick} | |||||
color="success" | |||||
> | |||||
< FormattedMessage id="edit" /> | |||||
</Button> | |||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</> | </> | ||||
} | } | ||||
@@ -270,20 +190,25 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
<Grid container spacing={1}> | <Grid container spacing={1}> | ||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<Typography variant="h4" sx={{ mb: 2, mr: 3, borderBottom: "1px solid black" }}> | <Typography variant="h4" sx={{ mb: 2, mr: 3, borderBottom: "1px solid black" }}> | ||||
Organisation Details | |||||
<FormattedMessage id="organizationDetails" /> | |||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getTextField({ | {FieldUtils.getTextField({ | ||||
label: FieldUtils.notNullFieldLabel("BR No.:"), | |||||
label: intl.formatMessage({id: 'brNo'}) + ":", | |||||
valueName: "brNo", | valueName: "brNo", | ||||
disabled: (!editMode && !createMode), | |||||
disabled: true, | |||||
form: formik | form: formik | ||||
})} | })} | ||||
</Grid> | </Grid> | ||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
<FormControlLabel | |||||
{FieldUtils.getTextField({ | |||||
label: intl.formatMessage({id: 'creditorAccount'}) + ":", | |||||
valueName: "creditor", | |||||
disabled: true, | |||||
form: formik | |||||
})} | |||||
{/* <FormControlLabel | |||||
control={<Checkbox checked={formik.values.creditor} />} | control={<Checkbox checked={formik.values.creditor} />} | ||||
label="is Creditor" | label="is Creditor" | ||||
name="creditor" | name="creditor" | ||||
@@ -292,41 +217,41 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
}} | }} | ||||
disabled={true} | disabled={true} | ||||
//disabled={!editMode && !createMode} | //disabled={!editMode && !createMode} | ||||
/> | |||||
/> */} | |||||
</Grid> | </Grid> | ||||
<Grid item lg={4} ></Grid> | <Grid item lg={4} ></Grid> | ||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getTextField({ | {FieldUtils.getTextField({ | ||||
label: FieldUtils.notNullFieldLabel("Name (Eng):"), | |||||
label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'nameEng'}) + ":"), | |||||
valueName: "enCompanyName", | valueName: "enCompanyName", | ||||
disabled: (!editMode && !createMode), | |||||
disabled: true, | |||||
form: formik | form: formik | ||||
})} | })} | ||||
</Grid> | </Grid> | ||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getTextField({ | {FieldUtils.getTextField({ | ||||
label: "Name (Ch):", | |||||
label: intl.formatMessage({id: 'nameChi'}) + ":", | |||||
valueName: "chCompanyName", | valueName: "chCompanyName", | ||||
disabled: (!editMode && !createMode), | |||||
disabled: true, | |||||
form: formik | form: formik | ||||
})} | })} | ||||
</Grid> | </Grid> | ||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getDateField({ | {FieldUtils.getDateField({ | ||||
label: FieldUtils.notNullFieldLabel("Expiry Date:"), | |||||
label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'expiryDate'}) + ":"), | |||||
valueName: "brExpiryDate", | valueName: "brExpiryDate", | ||||
disabled: (!editMode && !createMode), | |||||
disabled: true, | |||||
form: formik | form: formik | ||||
})} | })} | ||||
</Grid> | </Grid> | ||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getTextField({ | {FieldUtils.getTextField({ | ||||
label: FieldUtils.notNullFieldLabel("Contact Person:"), | |||||
label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'contactPerson'}) + ":"), | |||||
valueName: "contactPerson", | valueName: "contactPerson", | ||||
disabled: (!editMode && !createMode), | disabled: (!editMode && !createMode), | ||||
form: formik | form: formik | ||||
@@ -335,7 +260,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getPhoneField({ | {FieldUtils.getPhoneField({ | ||||
label: FieldUtils.notNullFieldLabel("Contact Tel:"), | |||||
label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'userContactNumber'}) + ":"), | |||||
valueName: { | valueName: { | ||||
code: "tel_countryCode", | code: "tel_countryCode", | ||||
num: "phoneNumber" | num: "phoneNumber" | ||||
@@ -347,19 +272,19 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getPhoneField({ | {FieldUtils.getPhoneField({ | ||||
label: "Fax No:", | |||||
label: intl.formatMessage({id: 'contactFaxNumber'}) + ":", | |||||
valueName: { | valueName: { | ||||
code: "fax_countryCode", | code: "fax_countryCode", | ||||
num: "faxNumber" | num: "faxNumber" | ||||
}, | }, | ||||
disabled: (!editMode && !createMode), | |||||
disabled: true, | |||||
form: formik | form: formik | ||||
})} | })} | ||||
</Grid> | </Grid> | ||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getComboField({ | {FieldUtils.getComboField({ | ||||
label: FieldUtils.notNullFieldLabel("Country:"), | |||||
label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'country'}) + ":"), | |||||
valueName: "country", | valueName: "country", | ||||
disabled: (!editMode && !createMode), | disabled: (!editMode && !createMode), | ||||
dataList: ComboData.country, | dataList: ComboData.country, | ||||
@@ -370,7 +295,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getComboField({ | {FieldUtils.getComboField({ | ||||
label: FieldUtils.notNullFieldLabel("District:"), | |||||
label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'district'}) + ":"), | |||||
valueName: "district", | valueName: "district", | ||||
disabled: (!editMode && !createMode), | disabled: (!editMode && !createMode), | ||||
dataList: ComboData.district, | dataList: ComboData.district, | ||||
@@ -382,7 +307,7 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
<Grid item lg={4} > | <Grid item lg={4} > | ||||
{FieldUtils.getAddressField({ | {FieldUtils.getAddressField({ | ||||
label: FieldUtils.notNullFieldLabel("Address:"), | |||||
label: FieldUtils.notNullFieldLabel(intl.formatMessage({id: 'formAddress'}) + ":"), | |||||
valueName: ["addressLine1", "addressLine2", "addressLine3"], | valueName: ["addressLine1", "addressLine2", "addressLine3"], | ||||
disabled: (!editMode && !createMode), | disabled: (!editMode && !createMode), | ||||
form: formik | form: formik | ||||
@@ -395,7 +320,17 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
} | } | ||||
</form> | </form> | ||||
<div> | <div> | ||||
<Dialog open={creditorConfirmPopUp} onClose={() => setCreditorConfirmPopUp(false)} > | |||||
<Dialog | |||||
open={creditorConfirmPopUp} | |||||
onClose={() => setCreditorConfirmPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Creditor?</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Creditor?</Typography> | ||||
@@ -407,7 +342,17 @@ const OrganizationPubCard = ({ userData, loadDataFun, id, setEditModeFun }) => { | |||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={nonCreditorConfirmPopUp} onClose={() => setNonCreditorConfirmPopUp(false)} > | |||||
<Dialog | |||||
open={nonCreditorConfirmPopUp} | |||||
onClose={() => setNonCreditorConfirmPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Creditor?</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Creditor?</Typography> | ||||
@@ -32,6 +32,11 @@ const BackgroundHead = { | |||||
backgroundColor: '#0C489E', | backgroundColor: '#0C489E', | ||||
backgroundPosition: 'right' | backgroundPosition: 'right' | ||||
} | } | ||||
import { | |||||
FormattedMessage, | |||||
// FormattedMessage, | |||||
useIntl | |||||
} from "react-intl"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -43,9 +48,14 @@ const OrganizationDetailPage = () => { | |||||
const [isLoading, setLoding] = React.useState(true); | const [isLoading, setLoding] = React.useState(true); | ||||
const [isEditMode, setEditMode] = React.useState(false); | const [isEditMode, setEditMode] = React.useState(false); | ||||
const navigate = useNavigate(); | 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(() => { | React.useEffect(() => { | ||||
console.log(formData); | |||||
// console.log(formData); | |||||
if (isINDLoggedIn()||isORGLoggedIn()&&!isPrimaryLoggedIn()){ | if (isINDLoggedIn()||isORGLoggedIn()&&!isPrimaryLoggedIn()){ | ||||
navigate('/dashboard'); | navigate('/dashboard'); | ||||
}else{ | }else{ | ||||
@@ -61,9 +71,9 @@ const OrganizationDetailPage = () => { | |||||
HttpUtils.get({ | HttpUtils.get({ | ||||
url: UrlUtils.GET_ORG_PATH + "/" + params.id, | url: UrlUtils.GET_ORG_PATH + "/" + params.id, | ||||
onSuccess: function (response) { | 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["addressLine1"] = response.data.addressTemp?.addressLine1; | ||||
response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | ||||
response.data["addressLine3"] = response.data.addressTemp?.addressLine3; | response.data["addressLine3"] = response.data.addressTemp?.addressLine3; | ||||
@@ -85,9 +95,10 @@ const OrganizationDetailPage = () => { | |||||
HttpUtils.get({ | HttpUtils.get({ | ||||
url: UrlUtils.GET_PUB_ORG_PATH, | url: UrlUtils.GET_PUB_ORG_PATH, | ||||
onSuccess: function (response) { | 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["addressLine1"] = response.data.addressTemp?.addressLine1; | ||||
response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | response.data["addressLine2"] = response.data.addressTemp?.addressLine2; | ||||
response.data["addressLine3"] = response.data.addressTemp?.addressLine3; | response.data["addressLine3"] = response.data.addressTemp?.addressLine3; | ||||
@@ -115,16 +126,24 @@ const OrganizationDetailPage = () => { | |||||
isLoading ? | isLoading ? | ||||
<LoadingComponent /> | <LoadingComponent /> | ||||
: | : | ||||
<Grid container sx={{ backgroundColor: "backgroundColor.default" }}> | |||||
<Grid container direction="column" sx={{minHeight: '90vh',backgroundColor:isGLDLoggedIn()?'backgroundColor.default':'#ffffff' }}> | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4">Maintain Organisation</Typography> | |||||
{isGLDLoggedIn()? | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | |||||
Maintain Organization | |||||
</Typography> | |||||
: | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | |||||
<FormattedMessage id="organizationProfile" /> | |||||
</Typography> | |||||
} | |||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<Button title="Back" sx={{ ml: 3.5, mt: 2 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate("/org") }}> | |||||
<Button aria-label={intl.formatMessage({id: 'back'})} title="Back" sx={{ ml: 3.5, mt: 2 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate(-1)}}> | |||||
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | <ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | ||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
@@ -133,7 +152,7 @@ const OrganizationDetailPage = () => { | |||||
<Grid container> | <Grid container> | ||||
<Grid item xs={12} md={12} lg={12}> | <Grid item xs={12} md={12} lg={12}> | ||||
<Box xs={12} ml={0} mt={-1} mr={0} sx={{ p: 1, borderRadius: '10px' }}> | <Box xs={12} ml={0} mt={-1} mr={0} sx={{ p: 1, borderRadius: '10px' }}> | ||||
{isGLDLoggedIn? | |||||
{isGLDLoggedIn()? | |||||
<InfoCard | <InfoCard | ||||
userData={formData} | userData={formData} | ||||
loadDataFun={loadData} | loadDataFun={loadData} | ||||
@@ -256,7 +256,17 @@ const OrganizationCard_loadFromUser = ({ userData, userId }) => { | |||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={isFailPopUp} onClose={() => setIsFailPopUp(false)} > | |||||
<Dialog | |||||
open={isFailPopUp} | |||||
onClose={() => setIsFailPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Action Fail</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Action Fail</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>{failText}</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>{failText}</Typography> | ||||
@@ -24,7 +24,7 @@ const OrganizationDetailPage_FromUser = () => { | |||||
useEffect(()=>{ | useEffect(()=>{ | ||||
console.log(formData); | |||||
// console.log(formData); | |||||
loadData(); | loadData(); | ||||
},[]); | },[]); | ||||
@@ -1,7 +1,6 @@ | |||||
// material-ui | // material-ui | ||||
import { | import { | ||||
Button, | Button, | ||||
CardContent, | |||||
Grid, TextField, | Grid, TextField, | ||||
Typography, | Typography, | ||||
Autocomplete, | Autocomplete, | ||||
@@ -15,6 +14,8 @@ import * as React from "react"; | |||||
import * as UrlUtils from "utils/ApiPathConst"; | import * as UrlUtils from "utils/ApiPathConst"; | ||||
import * as HttpUtils from "utils/HttpUtils"; | import * as HttpUtils from "utils/HttpUtils"; | ||||
import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -62,119 +63,109 @@ const OrganizationSearchForm = ({ applySearch }) => { | |||||
<form onSubmit={handleSubmit(onSubmit)}> | <form onSubmit={handleSubmit(onSubmit)}> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | |||||
<Grid item justifyContent="space-between" alignItems="center"> | |||||
<Typography variant="h4">Search Form</Typography> | |||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1}} width="98%"> | |||||
{/*row 1*/} | |||||
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:2.5}}> | |||||
<Typography variant="pnspsFormHeader" > | |||||
Search Form | |||||
</Typography> | |||||
</Grid> | </Grid> | ||||
</CardContent> | |||||
{/*row 2*/} | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<TextField | |||||
fullWidth | |||||
{...register("brNo")} | |||||
id='brNo' | |||||
label="BR No." | |||||
InputLabelProps={{ | |||||
shrink: true | |||||
}} | |||||
/> | |||||
</Grid> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<TextField | |||||
fullWidth | |||||
{...register("enCompanyName")} | |||||
id="enCompanyName" | |||||
label="Name (English)" | |||||
InputLabelProps={{ | |||||
shrink: true | |||||
}} | |||||
/> | |||||
</Grid> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<TextField | |||||
fullWidth | |||||
{...register("chCompanyName")} | |||||
id="chCompanyName" | |||||
label="Name (Chinese)" | |||||
InputLabelProps={{ | |||||
shrink: true | |||||
}} | |||||
/> | |||||
</Grid> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3}}> | |||||
<Autocomplete | |||||
{...register("searchCreditor")} | |||||
id="searchCreditor" | |||||
size="small" | |||||
options={ComboData.CreditorStatus} | |||||
value={creditorSelected} | |||||
onChange={(event, newValue) => { | |||||
setCreditorSelected(newValue); | |||||
{/*row 2*/} | |||||
<Grid container display="flex" alignItems={"center"}> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<TextField | |||||
fullWidth | |||||
{...register("brNo")} | |||||
id='brNo' | |||||
label="BR No." | |||||
InputLabelProps={{ | |||||
shrink: true | |||||
}} | }} | ||||
getOptionLabel={(option) => option.label} | |||||
renderInput={(params) => ( | |||||
<TextField | |||||
{...params} | |||||
label="Status" | |||||
InputLabelProps={{ | |||||
shrink: true | |||||
}} | |||||
/> | |||||
)} | |||||
/> | /> | ||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<TextField | |||||
fullWidth | |||||
{...register("enCompanyName")} | |||||
id="enCompanyName" | |||||
label="Name (English)" | |||||
InputLabelProps={{ | |||||
shrink: true | |||||
}} | |||||
/> | |||||
</Grid> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<TextField | |||||
fullWidth | |||||
{...register("chCompanyName")} | |||||
id="chCompanyName" | |||||
label="Name (Chinese)" | |||||
InputLabelProps={{ | |||||
shrink: true | |||||
}} | |||||
/> | |||||
</Grid> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3}}> | |||||
<Autocomplete | |||||
{...register("searchCreditor")} | |||||
id="searchCreditor" | |||||
size="small" | |||||
options={ComboData.CreditorStatus} | |||||
value={creditorSelected} | |||||
onChange={(event, newValue) => { | |||||
setCreditorSelected(newValue); | |||||
}} | |||||
getOptionLabel={(option) => option.label} | |||||
renderInput={(params) => ( | |||||
<TextField | |||||
{...params} | |||||
label="Status" | |||||
InputLabelProps={{ | |||||
shrink: true | |||||
}} | |||||
/> | |||||
)} | |||||
/> | |||||
</Grid> | |||||
{/*last row*/} | |||||
<Grid container maxWidth justifyContent="flex-end"> | |||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
onClick={doExport} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Export</Typography> | |||||
</Button> | |||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
onClick={resetForm} | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Clear</Typography> | |||||
</Button> | |||||
</Grid> | |||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<Button | |||||
size="large" | |||||
variant="contained" | |||||
type="submit" | |||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Submit</Typography> | |||||
</Button> | |||||
{/*last row*/} | |||||
<Grid container maxWidth justifyContent="flex-end"> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{mr: 3, mb: 3 }}> | |||||
<Button | |||||
variant="contained" | |||||
onClick={doExport} | |||||
> | |||||
Export | |||||
</Button> | |||||
</Grid> | |||||
<Grid item sx={{ mr: 3, mb: 3}}> | |||||
<Button | |||||
variant="contained" | |||||
onClick={resetForm} | |||||
> | |||||
Clear | |||||
</Button> | |||||
</Grid> | |||||
<Grid item sx={{ mb: 3}}> | |||||
<Button | |||||
variant="contained" | |||||
type="submit" | |||||
> | |||||
Submit | |||||
</Button> | |||||
</Grid> | |||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</form> | </form> | ||||
</MainCard> | </MainCard> | ||||
@@ -102,11 +102,7 @@ export default function OrganizationTable({ recordList }) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -76,7 +76,7 @@ const OrganizationSearchPage = () => { | |||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{mb:-1}}> | |||||
<SearchForm applySearch={applySearch} /> | <SearchForm applySearch={applySearch} /> | ||||
</Grid> | </Grid> | ||||
{/*row 2*/} | {/*row 2*/} | ||||
@@ -69,11 +69,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
rowHeight={150} | rowHeight={150} | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
/> | /> | ||||
<Typography align="right" variant= "h3">Total Amount: <span style={{ color: "blue", fontWeight: "bold", }}> HK$ {FormatUtils.currencyFormat(total)}</span></Typography> | <Typography align="right" variant= "h3">Total Amount: <span style={{ color: "blue", fontWeight: "bold", }}> HK$ {FormatUtils.currencyFormat(total)}</span></Typography> | ||||
@@ -79,11 +79,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
rowHeight={150} | rowHeight={150} | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
/> | /> | ||||
<Typography align="right" variant="h4" sx={{mr:2}}> | <Typography align="right" variant="h4" sx={{mr:2}}> | ||||
<FormattedMessage id="payTotal"/>: | <FormattedMessage id="payTotal"/>: | ||||
@@ -4,7 +4,7 @@ import { | |||||
Typography, | Typography, | ||||
Stack, | Stack, | ||||
Box, | Box, | ||||
// Button | |||||
Button | |||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import * as UrlUtils from "utils/ApiPathConst"; | import * as UrlUtils from "utils/ApiPathConst"; | ||||
import * as React from "react"; | 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 LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | ||||
const PaymentDetails = Loadable(React.lazy(() => import('./PaymentDetails'))); | const PaymentDetails = Loadable(React.lazy(() => import('./PaymentDetails'))); | ||||
const DataGrid = Loadable(React.lazy(() => import('./DataGrid'))); | const DataGrid = Loadable(React.lazy(() => import('./DataGrid'))); | ||||
import ForwardIcon from '@mui/icons-material/Forward'; | |||||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
import {FormattedMessage} from "react-intl"; | |||||
import {FormattedMessage,useIntl} from "react-intl"; | |||||
const BackgroundHead = { | const BackgroundHead = { | ||||
backgroundImage: `url(${titleBackgroundImg})`, | backgroundImage: `url(${titleBackgroundImg})`, | ||||
width: '100%', | width: '100%', | ||||
@@ -34,6 +35,7 @@ const BackgroundHead = { | |||||
const Index = () => { | const Index = () => { | ||||
const params = useParams(); | const params = useParams(); | ||||
const navigate = useNavigate() | const navigate = useNavigate() | ||||
const intl = useIntl(); | |||||
const [record, setRecord] = React.useState(); | const [record, setRecord] = React.useState(); | ||||
const [itemList, setItemList] = React.useState([]); | const [itemList, setItemList] = React.useState([]); | ||||
@@ -99,6 +101,15 @@ const Index = () => { | |||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} width={{xs:"90%", sm:"90%", md:"90%", lg:"80%"}}> | |||||
<Button | |||||
aria-label={intl.formatMessage({id: 'back'})} | |||||
title={intl.formatMessage({id: 'back'})} | |||||
sx={{ ml: 0, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate(-1) }} | |||||
> | |||||
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | |||||
</Button> | |||||
</Grid> | |||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} spacing={2} sx={{ textAlign: "center" }}> | <Grid item xs={12} md={12} spacing={2} sx={{ textAlign: "center" }}> | ||||
<Grid container justifyContent="center" direction="column" spacing={2} sx={{ p: 2 }} alignitems="stretch" > | <Grid container justifyContent="center" direction="column" spacing={2} sx={{ p: 2 }} alignitems="stretch" > | ||||
@@ -89,7 +89,7 @@ const MultiPaymentWindow = (props) => { | |||||
// }, [availableMethodData]); | // }, [availableMethodData]); | ||||
useEffect(() => { | useEffect(() => { | ||||
console.log(paymentMethod) | |||||
// console.log(paymentMethod) | |||||
// const subtype = (paymentMethod === "Visa" || paymentMethod === "MasterCard" || paymentMethod === "JCB" || paymentMethod === "UnionPay") ? "CreditCard" : 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 => obj.subtype === subtype); | ||||
const filteredPaymentMethod = availableMethodData.filter(obj => { | const filteredPaymentMethod = availableMethodData.filter(obj => { | ||||
@@ -98,7 +98,7 @@ const MultiPaymentWindow = (props) => { | |||||
} | } | ||||
return obj.subtype === paymentMethod; | return obj.subtype === paymentMethod; | ||||
}); | }); | ||||
console.log(filteredPaymentMethod) | |||||
// console.log(filteredPaymentMethod) | |||||
setFilteredPaymentMethod(filteredPaymentMethod); | setFilteredPaymentMethod(filteredPaymentMethod); | ||||
setFpsClass(paymentMethod == "FPS" || paymentMethod == "" ? "" : "grayscale") | setFpsClass(paymentMethod == "FPS" || paymentMethod == "" ? "" : "grayscale") | ||||
@@ -237,12 +237,12 @@ const MultiPaymentWindow = (props) => { | |||||
<Grid item xs={12} md={12}> | <Grid item xs={12} md={12}> | ||||
<Grid container > | <Grid container > | ||||
<Grid item> | <Grid item> | ||||
<Typography sx={{fontSize: "20px", color: "#000000", textAlign: "left" }}> | |||||
<Typography variant="pnspsFormParagraphBold" sx={{ color: "#000000", textAlign: "left" }}> | |||||
<FormattedMessage id="payTotal"/>(HK$): | <FormattedMessage id="payTotal"/>(HK$): | ||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
<Grid item> | <Grid item> | ||||
<Typography sx={{fontSize: "20px", color: "#000000", textAlign: "left" }}> | |||||
<Typography variant="pnspsFormParagraphBold" sx={{color: "#000000", textAlign: "left" }}> | |||||
{" HK$ " + FormatUtils.currencyFormat(props.totalAmount)} | {" HK$ " + FormatUtils.currencyFormat(props.totalAmount)} | ||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
@@ -87,18 +87,13 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
]; | ]; | ||||
return ( | return ( | ||||
<div style={{ minHeight:400, width: '100%' }}> | |||||
<div style={{ width: '100%' }}> | |||||
<FiDataGrid | <FiDataGrid | ||||
sx={_sx} | sx={_sx} | ||||
rowHeight={80} | rowHeight={80} | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
onRowDoubleClick={handleEditClick} | onRowDoubleClick={handleEditClick} | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -1,7 +1,6 @@ | |||||
// material-ui | // material-ui | ||||
import { | import { | ||||
Button, | Button, | ||||
CardContent, | |||||
Grid, TextField, | Grid, TextField, | ||||
Autocomplete, | Autocomplete, | ||||
Typography | Typography | ||||
@@ -11,6 +10,8 @@ import { useForm } from "react-hook-form"; | |||||
import * as React from "react"; | import * as React from "react"; | ||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import * as ComboData from "utils/ComboData"; | import * as ComboData from "utils/ComboData"; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -20,22 +21,6 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | const [maxDate, setMaxDate] = React.useState(searchCriteria.dateTo); | ||||
const [status, setStatus] = React.useState(ComboData.paymentStatus[0]); | 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 { reset, register, handleSubmit } = useForm() | ||||
const onSubmit = (data) => { | const onSubmit = (data) => { | ||||
@@ -58,20 +43,19 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
<MainCard xs={12} md={12} lg={12} | <MainCard xs={12} md={12} lg={12} | ||||
border={false} | border={false} | ||||
content={false} | content={false} | ||||
sx={_sx} | |||||
> | > | ||||
<form onSubmit={handleSubmit(onSubmit)}> | |||||
{/*row 1*/} | |||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | |||||
<Grid item justifyContent="space-between" alignItems="center" > | |||||
<Typography variant="h4">Search</Typography> | |||||
<form onSubmit={handleSubmit(onSubmit)} > | |||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1}} width="98%"> | |||||
{/*row 1*/} | |||||
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:2.5}}> | |||||
<Typography variant="pnspsFormHeader" > | |||||
Search Form | |||||
</Typography> | |||||
</Grid> | </Grid> | ||||
</CardContent> | |||||
{/*row 2*/} | |||||
<Grid container alignItems={"center"}> | |||||
{/*row 2*/} | |||||
<Grid container display="flex" alignItems={"center"}> | |||||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | <Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | ||||
<TextField | <TextField | ||||
fullWidth | fullWidth | ||||
@@ -138,6 +122,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
<Autocomplete | <Autocomplete | ||||
{...register("status")} | {...register("status")} | ||||
disablePortal={false} | disablePortal={false} | ||||
size="small" | |||||
id="status" | id="status" | ||||
filterOptions={(options) => options} | filterOptions={(options) => options} | ||||
options={ComboData.paymentStatus} | options={ComboData.paymentStatus} | ||||
@@ -159,39 +144,32 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
}} | }} | ||||
/> | /> | ||||
</Grid> | </Grid> | ||||
</Grid> | |||||
</Grid> | </Grid> | ||||
{/*last row*/} | {/*last row*/} | ||||
<Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ ml: 3, mb: 3}}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
color="cancel" | |||||
onClick={resetForm} | onClick={resetForm} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Reset</Typography> | |||||
> | |||||
Reset | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Submit</Typography> | |||||
> | |||||
Submit | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</form> | </form> | ||||
</MainCard> | </MainCard> | ||||
@@ -64,16 +64,18 @@ const Index = () => { | |||||
!onReady ? | !onReady ? | ||||
<LoadingComponent/> | <LoadingComponent/> | ||||
: | : | ||||
<Grid container sx={{minHeight: '85vh',backgroundColor:'#ffffff'}} direction="column"> | |||||
<Grid container sx={{backgroundColor: 'backgroundColor.default'}} direction="column"> | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4">Online Payment Record</Typography> | |||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
Payment Record | |||||
</Typography> | |||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{mb:-1}}> | |||||
<SearchForm | <SearchForm | ||||
applySearch={applySearch} | applySearch={applySearch} | ||||
searchCriteria={searchCriteria} | searchCriteria={searchCriteria} | ||||
@@ -106,11 +106,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
rowHeight={80} | rowHeight={80} | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
onRowDoubleClick={handleEditClick} | onRowDoubleClick={handleEditClick} | ||||
/> | /> | ||||
</div> | </div> | ||||
@@ -68,8 +68,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
{/*row 1*/} | {/*row 1*/} | ||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | <CardContent sx={{ px: 2.5, pt: 3 }}> | ||||
<Grid item justifyContent="space-between" alignItems="center" > | <Grid item justifyContent="space-between" alignItems="center" > | ||||
<Typography variant="h4"> | |||||
<FormattedMessage id="search"/> | |||||
<Typography variant="pnspsFormHeader"> | |||||
<FormattedMessage id="searchForm"/> | |||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
</CardContent> | </CardContent> | ||||
@@ -182,17 +182,20 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
<Grid item sx={{mr: 3, mb: 3 }}> | <Grid item sx={{mr: 3, mb: 3 }}> | ||||
<Button | <Button | ||||
color="cancel" | |||||
variant="contained" | variant="contained" | ||||
onClick={resetForm} | onClick={resetForm} | ||||
aria-label={intl.formatMessage({id: 'reset'})} | |||||
> | > | ||||
<FormattedMessage id="reset"/> | <FormattedMessage id="reset"/> | ||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<Grid item sx={{mr: 3, mb: 3 }}> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
aria-label={intl.formatMessage({id: 'submit'})} | |||||
> | > | ||||
<FormattedMessage id="submit"/> | <FormattedMessage id="submit"/> | ||||
</Button> | </Button> | ||||
@@ -69,7 +69,7 @@ const Index = () => { | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | |||||
<FormattedMessage id="paymentHistory"/> | <FormattedMessage id="paymentHistory"/> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
@@ -301,7 +301,7 @@ const Index = () => { | |||||
} | } | ||||
useEffect(() => { | useEffect(() => { | ||||
console.log(availableMethods) | |||||
// console.log(availableMethods) | |||||
if (availableMethods.length > 0) { | if (availableMethods.length > 0) { | ||||
availableMethods.forEach((method) => { | availableMethods.forEach((method) => { | ||||
if (method.subtype === "FPS") { | if (method.subtype === "FPS") { | ||||
@@ -433,7 +433,17 @@ const Index = () => { | |||||
</Grid> | </Grid> | ||||
{/*row 2*/} | {/*row 2*/} | ||||
<div> | <div> | ||||
<Dialog open={expiryDateErr} onClose={() => setExpiryDateErr(false)} > | |||||
<Dialog | |||||
open={expiryDateErr} | |||||
onClose={() => setExpiryDateErr(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle></DialogTitle> | <DialogTitle></DialogTitle> | ||||
<Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography> | <Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
@@ -428,7 +428,17 @@ const FormPanel = ({ formData }) => { | |||||
</form> | </form> | ||||
<div> | <div> | ||||
<Dialog open={isWarningPopUp} onClose={() => setIsWarningPopUp(false)} > | |||||
<Dialog | |||||
open={isWarningPopUp} | |||||
onClose={() => setIsWarningPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography> | ||||
@@ -439,7 +449,17 @@ const FormPanel = ({ formData }) => { | |||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={wait} onClose={() => setWait(false)} > | |||||
<Dialog | |||||
open={wait} | |||||
onClose={() => setWait(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Calculating, please wait ...</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Calculating, please wait ...</Typography> | ||||
</DialogContent> | </DialogContent> | ||||
@@ -85,9 +85,9 @@ const Index = () => { | |||||
( | ( | ||||
<Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" > | <Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" > | ||||
<Grid item xs={12} width="100%"> | <Grid item xs={12} width="100%"> | ||||
<div style={BackgroundHead} width="100%"> | |||||
<div style={BackgroundHead} width="100%" > | |||||
<Stack direction="row" height='70px'> | <Stack direction="row" height='70px'> | ||||
<Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }, pt:2}}> | |||||
<FormattedMessage id="proofRecord"/> | <FormattedMessage id="proofRecord"/> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
@@ -166,7 +166,7 @@ const Index = () => { | |||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Stack direction="column" justifyContent="space-between"> | <Stack direction="column" justifyContent="space-between"> | ||||
<Typography variant="h4"> | <Typography variant="h4"> | ||||
<FormattedMessage id="totalAmount"/>(HK$): {FormatUtils.currencyFormat(fee)} | |||||
<FormattedMessage id="totalAmount"/> (HK$): {FormatUtils.currencyFormat(fee)} | |||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
</DialogContent> | </DialogContent> | ||||
@@ -65,9 +65,9 @@ const Index = () => { | |||||
( | ( | ||||
<Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" > | <Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" > | ||||
<Grid item xs={12} width="100%"> | <Grid item xs={12} width="100%"> | ||||
<div style={BackgroundHead} width="100%"> | |||||
<Stack direction="row" height='70px'> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}> | |||||
<div style={BackgroundHead} width="100%" > | |||||
<Stack direction="row" height='70px' > | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }, pt:2}} > | |||||
<FormattedMessage id="proofRecord"/> | <FormattedMessage id="proofRecord"/> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
@@ -294,7 +294,10 @@ const ApplicationDetailCard = ({ | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
<div> | <div> | ||||
<Dialog open={cancelPopUp} onClose={() => setCancelPopUp(false)} > | |||||
<Dialog | |||||
open={cancelPopUp} | |||||
onClose={() => setCancelPopUp(false)} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>Are you sure you want to cancel this proof?</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>Are you sure you want to cancel this proof?</Typography> | ||||
@@ -119,7 +119,9 @@ const Index = () => { | |||||
<Grid item xs={12} width="100%"> | <Grid item xs={12} width="100%"> | ||||
<div style={BackgroundHead} width="100%"> | <div style={BackgroundHead} width="100%"> | ||||
<Stack direction="row" height='70px'> | <Stack direction="row" height='70px'> | ||||
<Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}>Proof Record</Typography> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block', pt:2 }}}> | |||||
Proof Record | |||||
</Typography> | |||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
@@ -79,7 +79,7 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="applicationId"/>: | <FormattedMessage id="applicationId"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -93,7 +93,7 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
<Grid container alignItems={"left"}> | <Grid container alignItems={"left"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="applyStatus"/>: | <FormattedMessage id="applyStatus"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -112,7 +112,7 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="applyPerson"/>: | <FormattedMessage id="applyPerson"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -132,7 +132,7 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="gazetteCount"/>: | <FormattedMessage id="gazetteCount"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -149,7 +149,7 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="contactPerson"/>: | <FormattedMessage id="contactPerson"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -164,7 +164,7 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="applicationPublishDate" />: | <FormattedMessage id="applicationPublishDate" />: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -181,7 +181,7 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
<Grid container alignItems="left"> | <Grid container alignItems="left"> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="myRemarks"/>: | <FormattedMessage id="myRemarks"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -205,7 +205,7 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
<Grid item xs={12} sm={12} md={6} lg={6} sx={{mb: 1}}> | <Grid item xs={12} sm={12} md={6} lg={6} sx={{mb: 1}}> | ||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} sm={12} md={12} lg={12} sx={{ alignItems: 'center',wordBreak: 'break-word' }}> | <Grid item xs={12} sm={12} md={12} lg={12} sx={{ alignItems: 'center',wordBreak: 'break-word' }}> | ||||
<Typography><Typography variant="h5"> | |||||
<Typography><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="pleaseCheckReminder" />: | <FormattedMessage id="pleaseCheckReminder" />: | ||||
</Typography></Typography> | </Typography></Typography> | ||||
</Grid> | </Grid> | ||||
@@ -248,7 +248,7 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
</Grid> | </Grid> | ||||
<Grid item xs={12} sm={3} md={3} lg={3} | <Grid item xs={12} sm={3} md={3} lg={3} | ||||
sx={{ mb: 1, display: 'flex', alignItems: 'center' }}> | sx={{ mb: 1, display: 'flex', alignItems: 'center' }}> | ||||
<Typography variant="h5"> | |||||
<Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="payFeeFor"/>: | <FormattedMessage id="payFeeFor"/>: | ||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
@@ -259,9 +259,9 @@ const ApplicationDetailCard = ({ formData, }) => { | |||||
{ | { | ||||
formik.values.groupType === "Private Bill" | formik.values.groupType === "Private Bill" | ||||
? | ? | ||||
<Typography variant="h5">( {data.noOfPages} {intl.formatMessage({id: 'page'})} x $6,552 )</Typography> | |||||
<Typography variant="pnspsFormParagraph">( {data.noOfPages} {intl.formatMessage({id: 'page'})} x $6,552 )</Typography> | |||||
: | : | ||||
<Typography variant="h5">( {data.length} cm x {data.colCount === 2 ? "$364 二格位" : "$182 一格位"} )</Typography> | |||||
<Typography variant="pnspsFormParagraph">( {data.length} cm x {data.colCount === 2 ? "$364 二格位" : "$182 一格位"} )</Typography> | |||||
} | } | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -251,6 +251,7 @@ const FormPanel = ({ formData }) => { | |||||
color="save" | color="save" | ||||
component="span" | component="span" | ||||
variant="contained" | variant="contained" | ||||
aria-label={intl.formatMessage({id: 'upload'})} | |||||
disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)} | disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)} | ||||
> | > | ||||
<FormattedMessage id="upload" /> | <FormattedMessage id="upload" /> | ||||
@@ -303,6 +304,7 @@ const FormPanel = ({ formData }) => { | |||||
variant="contained" | variant="contained" | ||||
color="success" | color="success" | ||||
type="submit" | type="submit" | ||||
aria-label={intl.formatMessage({id: 'submitReply'})} | |||||
> | > | ||||
<FormattedMessage id="submitReply" /> | <FormattedMessage id="submitReply" /> | ||||
</Button> | </Button> | ||||
@@ -320,7 +322,17 @@ const FormPanel = ({ formData }) => { | |||||
</form> | </form> | ||||
<div> | <div> | ||||
<Dialog open={isWarningPopUp} onClose={() => setIsWarningPopUp(false)} > | |||||
<Dialog | |||||
open={isWarningPopUp} | |||||
onClose={() => setIsWarningPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle> | <DialogTitle> | ||||
<FormattedMessage id="attention"/> | <FormattedMessage id="attention"/> | ||||
</DialogTitle> | </DialogTitle> | ||||
@@ -328,7 +340,12 @@ const FormPanel = ({ formData }) => { | |||||
<Typography variant="h3" style={{ padding: '16px' }}>{warningText}</Typography> | <Typography variant="h3" style={{ padding: '16px' }}>{warningText}</Typography> | ||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button onClick={() => setIsWarningPopUp(false)}>OK</Button> | |||||
<Button | |||||
aria-label={intl.formatMessage({id: 'ok'})} | |||||
onClick={() => setIsWarningPopUp(false)} | |||||
> | |||||
OK | |||||
</Button> | |||||
</DialogActions> | </DialogActions> | ||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
@@ -84,18 +84,22 @@ const Index = () => { | |||||
<LoadingComponent /> | <LoadingComponent /> | ||||
: | : | ||||
( | ( | ||||
<Grid container sx={{ width: '100%', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" > | |||||
<Grid container sx={{ width: '100%', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" > | |||||
<Grid item xs={12} width="100%"> | <Grid item xs={12} width="100%"> | ||||
<div style={BackgroundHead} width="100%"> | <div style={BackgroundHead} width="100%"> | ||||
<Stack direction="row" height='70px'> | <Stack direction="row" height='70px'> | ||||
<Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }, pt:2}}> | |||||
<FormattedMessage id="proofRecord"/> | <FormattedMessage id="proofRecord"/> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} width="100%"> | <Grid item xs={12} width="100%"> | ||||
<Button title={intl.formatMessage({id: 'back'})} sx={{ mt: 2.5, ml: 3 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate("/proof/search") }}> | |||||
<Button | |||||
aria-label={intl.formatMessage({id: 'back'})} | |||||
title={intl.formatMessage({id: 'back'})} | |||||
sx={{ mt: 2.5, ml: 3 }} style={{ border: '2px solid' }} | |||||
variant="outlined" onClick={() => { navigate("/proof/search") }}> | |||||
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | <ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | ||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
@@ -2,7 +2,6 @@ | |||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { | import { | ||||
Button, | Button, | ||||
Box | |||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import * as FormatUtils from "utils/FormatUtils" | import * as FormatUtils from "utils/FormatUtils" | ||||
@@ -130,21 +129,14 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
} | } | ||||
return ( | return ( | ||||
<div style={{ height: '100%', width: '100%' }}> | |||||
<Box sx={{ backgroundColor: "#fff", ml: 2 }} width="98%"> | |||||
<FiDataGrid | |||||
rowHeight={80} | |||||
rows={rows} | |||||
columns={columns} | |||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
onRowDoubleClick={handleRowDoubleClick} | |||||
getRowHeight={() => 'auto'} | |||||
/> | |||||
</Box> | |||||
<div style={{ width: '100%' }}> | |||||
<FiDataGrid | |||||
rows={rows} | |||||
columns={columns} | |||||
customPageSize={10} | |||||
onRowDoubleClick={handleRowDoubleClick} | |||||
getRowHeight={() => 'auto'} | |||||
/> | |||||
</div> | </div> | ||||
); | ); | ||||
} | } |
@@ -1,7 +1,6 @@ | |||||
// material-ui | // material-ui | ||||
import { | import { | ||||
Button, | Button, | ||||
CardContent, | |||||
Grid, TextField, | Grid, TextField, | ||||
Autocomplete | Autocomplete | ||||
} from '@mui/material'; | } from '@mui/material'; | ||||
@@ -12,6 +11,8 @@ import * as ComboData from "utils/ComboData"; | |||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import * as FormatUtils from "utils/FormatUtils"; | import * as FormatUtils from "utils/FormatUtils"; | ||||
import { Typography } from '../../../../node_modules/@mui/material/index'; | import { Typography } from '../../../../node_modules/@mui/material/index'; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -91,14 +92,14 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
> | > | ||||
<form onSubmit={handleSubmit(onSubmit)}> | <form onSubmit={handleSubmit(onSubmit)}> | ||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2 }} width="98%"> | |||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1 }} width="98%"> | |||||
{/*row 1*/} | {/*row 1*/} | ||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | |||||
<Grid item justifyContent="space-between" alignItems="center"> | |||||
<Typography variant="h5">Search Form</Typography> | |||||
</Grid> | |||||
</CardContent> | |||||
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:2.5}}> | |||||
<Typography variant="pnspsFormHeader" > | |||||
Search Form | |||||
</Typography> | |||||
</Grid> | |||||
{/*row 2*/} | {/*row 2*/} | ||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
@@ -132,6 +133,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
<Autocomplete | <Autocomplete | ||||
{...register("issueId")} | {...register("issueId")} | ||||
disablePortal | disablePortal | ||||
size="small" | |||||
id="issueId" | id="issueId" | ||||
options={issueCombo} | options={issueCombo} | ||||
value={issueSelected} | value={issueSelected} | ||||
@@ -155,6 +157,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
<Autocomplete | <Autocomplete | ||||
{...register("gazettGroup")} | {...register("gazettGroup")} | ||||
disablePortal | disablePortal | ||||
size="small" | |||||
id="gazettGroup" | id="gazettGroup" | ||||
options={ComboData.groupTitle} | options={ComboData.groupTitle} | ||||
value={groupSelected} | value={groupSelected} | ||||
@@ -229,6 +232,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
{...register("status")} | {...register("status")} | ||||
disablePortal | disablePortal | ||||
id="status" | id="status" | ||||
size="small" | |||||
filterOptions={(options) => options} | filterOptions={(options) => options} | ||||
options={ComboData.proofStatus} | options={ComboData.proofStatus} | ||||
value={status} | value={status} | ||||
@@ -256,6 +260,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
{...register("orgId")} | {...register("orgId")} | ||||
disablePortal={false} | disablePortal={false} | ||||
id="orgId" | id="orgId" | ||||
size="small" | |||||
options={orgCombo} | options={orgCombo} | ||||
value={orgSelected} | value={orgSelected} | ||||
inputValue={(orgSelected?.label) ? orgSelected?.label : ""} | inputValue={(orgSelected?.label) ? orgSelected?.label : ""} | ||||
@@ -281,32 +286,25 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
{/*last row*/} | {/*last row*/} | ||||
<Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
<Grid item sx={{ ml: 3, mb: 3, mt: 3 }}> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ ml: 3, mb: 3 }}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={resetForm} | onClick={resetForm} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Clear</Typography> | |||||
> | |||||
Clear | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mb: 3, mt: 3 }}> | |||||
<Grid item sx={{ ml: 3, mb: 3 }}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}}> | |||||
<Typography variant="h5">Submit</Typography> | |||||
> | |||||
Submit | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</form> | </form> | ||||
@@ -92,7 +92,7 @@ const UserSearchPage_Individual = () => { | |||||
!onReady ? | !onReady ? | ||||
<LoadingComponent /> | <LoadingComponent /> | ||||
: | : | ||||
<Grid container sx={{ minHeight: '85vh', backgroundColor: 'backgroundColor.default' }} direction="column" | |||||
<Grid container sx={{ backgroundColor: 'backgroundColor.default' }} direction="column" | |||||
> | > | ||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
@@ -102,7 +102,7 @@ const UserSearchPage_Individual = () => { | |||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{mb:-1}}> | |||||
<SearchForm | <SearchForm | ||||
applySearch={applySearch} | applySearch={applySearch} | ||||
orgComboData={orgCombo} | orgComboData={orgCombo} | ||||
@@ -158,11 +158,7 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
sx={_sx} | sx={_sx} | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 10 }, | |||||
}, | |||||
}} | |||||
customPageSize={10} | |||||
getRowHeight={() => "auto"} | getRowHeight={() => "auto"} | ||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
/> | /> | ||||
@@ -102,8 +102,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData | |||||
{/*row 1*/} | {/*row 1*/} | ||||
<CardContent sx={{ px: 2.5, pt: 3 }}> | <CardContent sx={{ px: 2.5, pt: 3 }}> | ||||
<Grid item justifyContent="space-between" alignItems="center"> | <Grid item justifyContent="space-between" alignItems="center"> | ||||
<Typography variant="h4"> | |||||
<FormattedMessage id="search"/> | |||||
<Typography variant="pnspsFormHeader"> | |||||
<FormattedMessage id="searchForm"/> | |||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
</CardContent> | </CardContent> | ||||
@@ -276,16 +276,19 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData | |||||
<Grid item sx={{ mr: 3, mb: 3 }}> | <Grid item sx={{ mr: 3, mb: 3 }}> | ||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
color="cancel" | |||||
onClick={resetForm} | onClick={resetForm} | ||||
aria-label={intl.formatMessage({id: 'reset'})} | |||||
> | > | ||||
<FormattedMessage id="reset"/> | <FormattedMessage id="reset"/> | ||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<Grid item sx={{mr: 3, mb: 3 }}> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
aria-label={intl.formatMessage({id: 'submit'})} | |||||
> | > | ||||
<FormattedMessage id="submit"/> | <FormattedMessage id="submit"/> | ||||
</Button> | </Button> | ||||
@@ -82,9 +82,9 @@ const UserSearchPage_Individual = () => { | |||||
: | : | ||||
<Grid container sx={{minHeight: '85vh',backgroundColor:'#ffffff'}} direction="column"> | <Grid container sx={{minHeight: '85vh',backgroundColor:'#ffffff'}} direction="column"> | ||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | |||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
<div style={BackgroundHead} > | |||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center" > | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | |||||
<FormattedMessage id="proofRecord"/> | <FormattedMessage id="proofRecord"/> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
@@ -132,19 +132,23 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
<Grid item xs={12} md={12} width="100%" > | <Grid item xs={12} md={12} width="100%" > | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | |||||
<FormattedMessage id="applyPublicNotice"/> | <FormattedMessage id="applyPublicNotice"/> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} width={{xs:"90%", sm:"90%", md:"60%", lg:"60%"}}> | <Grid item xs={12} width={{xs:"90%", sm:"90%", md:"60%", lg:"60%"}}> | ||||
<Button title={intl.formatMessage({id: 'back'})} sx={{ ml: 0, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate(-1) }}> | |||||
<Button | |||||
aria-label={intl.formatMessage({id: 'back'})} | |||||
title={intl.formatMessage({id: 'back'})} | |||||
sx={{ ml: 0, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate(-1) }} | |||||
> | |||||
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | <ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | ||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
{/* <Grid item xs={12}> | {/* <Grid item xs={12}> | ||||
<Typography variant="h5">申請公共啟事</Typography> | |||||
<Typography variant="pnspsFormParagraphBold">申請公共啟事</Typography> | |||||
</Grid> */} | </Grid> */} | ||||
<Grid item xs={12} md={12} width={{ md: "60%", xs: "90%" }}> | <Grid item xs={12} md={12} width={{ md: "60%", xs: "90%" }}> | ||||
<Box xs={12} mt={1} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px' }}> | <Box xs={12} mt={1} sx={{ p: 2, border: '3px groove grey', borderRadius: '10px' }}> | ||||
@@ -184,13 +188,13 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<Typography variant="h5"> | |||||
<Typography variant="pnspsFormParagraphBold"> | |||||
<FormattedMessage id="targetVol" />: | <FormattedMessage id="targetVol" />: | ||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={9} lg={6}> | <Grid item xs={12} md={9} lg={6}> | ||||
<RadioGroup | <RadioGroup | ||||
aria-labelledby="demo-radio-buttons-group-label" | |||||
aria-labelledby="radio-buttons-group-label" | |||||
id="issueId" | id="issueId" | ||||
name="issueId" | name="issueId" | ||||
defaultValue={issueId} | defaultValue={issueId} | ||||
@@ -205,12 +209,11 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={12} lg={12}> | <Grid item xs={12} md={12} lg={12}> | ||||
<Grid container direction="row" justifyContent="flex-start" alignItems="center"> | <Grid container direction="row" justifyContent="flex-start" alignItems="center"> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<Typography variant="h5"> | |||||
<Typography variant="pnspsFormParagraphBold"> | |||||
<FormattedMessage id="draftFile"/> ({intl.formatMessage({id: 'fileSizeWarning'})}): | <FormattedMessage id="draftFile"/> ({intl.formatMessage({id: 'fileSizeWarning'})}): | ||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
@@ -227,15 +230,35 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
/> | /> | ||||
{attachment.name} | {attachment.name} | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={3} lg={3}> | |||||
{/* <Grid item xs={12} md={3} lg={3}> | |||||
<label htmlFor="uploadFileBtn"> | |||||
<Button | |||||
aria-label={intl.formatMessage({id: 'uploadFileBtn'})} | |||||
component="span" | |||||
variant="outlined" | |||||
size="large" | |||||
>{attachment ? intl.formatMessage({id: 'uploadFileBtn'}) : intl.formatMessage({id: 'reUpload'})}</Button> | |||||
</label> | |||||
</Grid> */} | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={12} md={12} lg={12}> | |||||
<Grid container direction="row" justifyContent="flex-start" alignItems="center"> | |||||
<Grid item xs={12} md={3} lg={3} | |||||
sx={{ display: 'flex', alignItems: 'center' }}> | |||||
</Grid> | |||||
<Grid item xs={12} md={6} lg={6} > | |||||
<label htmlFor="uploadFileBtn"> | <label htmlFor="uploadFileBtn"> | ||||
<Button | <Button | ||||
aria-label={intl.formatMessage({id: 'uploadFileBtn'})} | |||||
component="span" | component="span" | ||||
variant="outlined" | variant="outlined" | ||||
size="large" | size="large" | ||||
>{attachment ? intl.formatMessage({id: 'uploadFileBtn'}) : intl.formatMessage({id: 'reUpload'})}</Button> | >{attachment ? intl.formatMessage({id: 'uploadFileBtn'}) : intl.formatMessage({id: 'reUpload'})}</Button> | ||||
</label> | </label> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={3} lg={3}> | |||||
</Grid> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
{isORGLoggedIn()? | {isORGLoggedIn()? | ||||
@@ -260,6 +283,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
<center> | <center> | ||||
<ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | ||||
<Button | <Button | ||||
aria-label={intl.formatMessage({id: 'applyPublicNotice'})} | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
> | > | ||||
@@ -273,7 +297,17 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
</Box> | </Box> | ||||
</Grid> | </Grid> | ||||
<div> | <div> | ||||
<Dialog open={isWarningPopUp} onClose={() => setIsWarningPopUp(false)} > | |||||
<Dialog | |||||
open={isWarningPopUp} | |||||
onClose={() => setIsWarningPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle> | <DialogTitle> | ||||
<FormattedMessage id="attention"/> | <FormattedMessage id="attention"/> | ||||
</DialogTitle> | </DialogTitle> | ||||
@@ -281,7 +315,12 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { | |||||
<Typography variant="h3" style={{ padding: '16px' }}>{warningText}</Typography> | <Typography variant="h3" style={{ padding: '16px' }}>{warningText}</Typography> | ||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button onClick={() => setIsWarningPopUp(false)}>OK</Button> | |||||
<Button | |||||
aria-label={intl.formatMessage({id: 'ok'})} | |||||
onClick={() => setIsWarningPopUp(false)} | |||||
> | |||||
<FormattedMessage id="ok" /> | |||||
</Button> | |||||
</DialogActions> | </DialogActions> | ||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
@@ -537,7 +537,17 @@ const ApplicationDetailCard = ( | |||||
</Grid> | </Grid> | ||||
</form> | </form> | ||||
<div> | <div> | ||||
<Dialog open={isWarningPopUp} onClose={() => setIsWarningPopUp(false)} > | |||||
<Dialog | |||||
open={isWarningPopUp} | |||||
onClose={() => setIsWarningPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography> | ||||
@@ -262,7 +262,16 @@ const GazetteDetailCard = ( | |||||
</Grid> | </Grid> | ||||
</form> | </form> | ||||
<div> | <div> | ||||
<Dialog open={isWarningPopUp} onClose={() => setIsWarningPopUp(false)} > | |||||
<Dialog | |||||
open={isWarningPopUp} | |||||
onClose={() => setIsWarningPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}}> | |||||
<DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography> | ||||
@@ -70,11 +70,7 @@ export default function SubmittedTab({ rows }) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
/> | /> | ||||
</div> | </div> | ||||
</> | </> | ||||
@@ -109,11 +109,7 @@ export default function ProofTab({rows}) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: {page: 0, pageSize: 5}, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -52,11 +52,7 @@ export default function StatusHistoryTab({rows}) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: {page: 0, pageSize: 5}, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -157,6 +157,7 @@ const ApplicationDetailCard = ( | |||||
|| currentApplicationDetailData.status == "paid" | || currentApplicationDetailData.status == "paid" | ||||
|| currentApplicationDetailData.creditor} | || currentApplicationDetailData.creditor} | ||||
startIcon={<EditNoteIcon />} | startIcon={<EditNoteIcon />} | ||||
aria-label={intl.formatMessage({id: 'payFor'})} | |||||
> | > | ||||
<FormattedMessage id="payFor"/> | <FormattedMessage id="payFor"/> | ||||
</Button> | </Button> | ||||
@@ -169,6 +170,7 @@ const ApplicationDetailCard = ( | |||||
disabled={currentApplicationDetailData.status !== "submitted"} | disabled={currentApplicationDetailData.status !== "submitted"} | ||||
title={intl.formatMessage({id: 'cancel'})} | title={intl.formatMessage({id: 'cancel'})} | ||||
startIcon={<CloseIcon />} | startIcon={<CloseIcon />} | ||||
aria-label={intl.formatMessage({id: 'cancel'})} | |||||
> | > | ||||
<FormattedMessage id="cancel"/> | <FormattedMessage id="cancel"/> | ||||
</Button> | </Button> | ||||
@@ -188,7 +190,7 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="applicationId"/>: | <FormattedMessage id="applicationId"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -218,7 +220,7 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="applyStatus"/>: | <FormattedMessage id="applyStatus"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -234,11 +236,11 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Stack direction="row" justifyContent="flex-start" alignItems="center"> | <Stack direction="row" justifyContent="flex-start" alignItems="center"> | ||||
<Grid item xs={12} md={7} lg={7}> | <Grid item xs={12} md={7} lg={7}> | ||||
<FormLabel><Typography variant="h5">原因:</Typography></FormLabel> | |||||
<FormLabel><Typography variant="pnspsFormParagraph">原因:</Typography></FormLabel> | |||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={5} lg={5}> | <Grid item xs={12} md={5} lg={5}> | ||||
<FormControl variant="outlined" fullWidth disabled> | <FormControl variant="outlined" fullWidth disabled> | ||||
<Typography id='reason' variant="h5"> | |||||
<Typography id='reason' variant="pnspsFormParagraph"> | |||||
{currentApplicationDetailData.reason} | {currentApplicationDetailData.reason} | ||||
</Typography> | </Typography> | ||||
</FormControl> | </FormControl> | ||||
@@ -257,7 +259,7 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="applyPerson"/>: | <FormattedMessage id="applyPerson"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -304,7 +306,7 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="gazetteCount"/>: | <FormattedMessage id="gazetteCount"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -338,7 +340,7 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="contactPerson"/>: | <FormattedMessage id="contactPerson"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -368,7 +370,7 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="publishDate"/>: | <FormattedMessage id="publishDate"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -403,7 +405,7 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="userContactNumber"/>: | <FormattedMessage id="userContactNumber"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -452,13 +454,13 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="currencyPrice"/>(HK$): | <FormattedMessage id="currencyPrice"/>(HK$): | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={9} lg={9}> | <Grid item xs={12} md={9} lg={9}> | ||||
<FormLabel><Typography variant="h5">{FormatUtils.currencyFormat(fee)}</Typography></FormLabel> | |||||
<FormLabel><Typography variant="pnspsFormParagraph">{FormatUtils.currencyFormat(fee)}</Typography></FormLabel> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -471,7 +473,7 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="userFaxNumber"/>: | <FormattedMessage id="userFaxNumber"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -522,34 +524,32 @@ const ApplicationDetailCard = ( | |||||
<Grid container direction="row"> | <Grid container direction="row"> | ||||
<Grid item xs={12} sm={12} md={2.5} lg={1.6} | <Grid item xs={12} sm={12} md={2.5} lg={1.6} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="draftFile"/>: | <FormattedMessage id="draftFile"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} sm={12} md={9} lg={9} > | <Grid item xs={12} sm={12} md={9} lg={9} > | ||||
<Grid container direction="row" alignItems="center" justifyContent="flex-start"> | <Grid container direction="row" alignItems="center" justifyContent="flex-start"> | ||||
<Grid item xs={12} sm={12} md={9} lg={9} sx={{ wordBreak: 'break-word' , }}> | |||||
<FormControl variant="outlined" fullWidth > | |||||
<Typography | |||||
fullWidth | |||||
id='fileName' | |||||
variant="h5" | |||||
> | |||||
{fileDetail.filename} | |||||
</Typography> | |||||
</FormControl> | |||||
</Grid> | |||||
<Grid item xs={12} sm={12} md={3} lg={3} > | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | |||||
variant="contained" | |||||
onClick={onDownloadClick()} | |||||
title={intl.formatMessage({id: 'download'})} | |||||
color="save" | |||||
startIcon={<DownloadIcon sx={{alignItems:"center"}}/>} | |||||
<Grid item xs={12} sm={12} md={12} lg={12} sx={{ wordBreak: 'break-word' , }}> | |||||
<Typography | |||||
fullWidth | |||||
id='fileName' | |||||
variant="pnspsFormParagraph" | |||||
> | > | ||||
<FormattedMessage id="download"/> | |||||
</Button> | |||||
{fileDetail.filename} | |||||
</Typography> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | |||||
sx={{ml:3}} | |||||
variant="contained" | |||||
onClick={onDownloadClick()} | |||||
aria-label={intl.formatMessage({id: 'download'})} | |||||
title={intl.formatMessage({id: 'download'})} | |||||
color="save" | |||||
startIcon={<DownloadIcon sx={{alignItems:"center"}}/>} | |||||
> | |||||
<FormattedMessage id="download"/> | |||||
</Button> | |||||
</ThemeProvider> | </ThemeProvider> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -564,10 +564,10 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5">Care Of:</Typography></FormLabel> | |||||
<FormLabel><Typography variant="pnspsFormParagraph">Care Of:</Typography></FormLabel> | |||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={9} lg={9}> | <Grid item xs={12} md={9} lg={9}> | ||||
<Typography variant="h5">{currentApplicationDetailData.careOf}</Typography> | |||||
<Typography variant="pnspsFormParagraph">{currentApplicationDetailData.careOf}</Typography> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</Grid> : null | </Grid> : null | ||||
@@ -576,12 +576,12 @@ const ApplicationDetailCard = ( | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
<Grid item xs={12} md={3} lg={3} | <Grid item xs={12} md={3} lg={3} | ||||
sx={{ display: 'flex', alignItems: 'center' }}> | sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<FormLabel><Typography variant="h5"> | |||||
<FormLabel><Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="extraMark"/>: | <FormattedMessage id="extraMark"/>: | ||||
</Typography></FormLabel> | </Typography></FormLabel> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={9} lg={9}> | <Grid item xs={12} md={9} lg={9}> | ||||
<Typography variant="h5">{currentApplicationDetailData.remarks}</Typography> | |||||
<Typography variant="pnspsFormParagraph">{currentApplicationDetailData.remarks}</Typography> | |||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
</Grid> | </Grid> | ||||
@@ -607,22 +607,40 @@ const ApplicationDetailCard = ( | |||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Stack direction="column" justifyContent="space-between"> | <Stack direction="column" justifyContent="space-between"> | ||||
<Typography variant="h4"> | <Typography variant="h4"> | ||||
<FormattedMessage id="totalAmount"/>(HK$): {FormatUtils.currencyFormat(fee)} | |||||
<FormattedMessage id="totalAmount"/> (HK$): {FormatUtils.currencyFormat(fee)} | |||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button onClick={() => setIsPopUp(false)}><Typography variant="h5"> | |||||
<Button | |||||
onClick={() => setIsPopUp(false)} | |||||
aria-label={intl.formatMessage({id: 'close'})} | |||||
> | |||||
<Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="close"/> | <FormattedMessage id="close"/> | ||||
</Typography></Button> | </Typography></Button> | ||||
<Button onClick={() => doPayment()}><Typography variant="h5"> | |||||
<Button | |||||
onClick={() => doPayment()} | |||||
aria-label={intl.formatMessage({id: 'confirm'})} | |||||
> | |||||
<Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="confirm"/> | <FormattedMessage id="confirm"/> | ||||
</Typography></Button> | </Typography></Button> | ||||
</DialogActions> | </DialogActions> | ||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={errorPopUp} onClose={() => setErrorPopUp(false)} > | |||||
<Dialog | |||||
open={errorPopUp} | |||||
onClose={() => setErrorPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle></DialogTitle> | <DialogTitle></DialogTitle> | ||||
<Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography> | <Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
@@ -633,8 +651,11 @@ const ApplicationDetailCard = ( | |||||
</Stack> | </Stack> | ||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button onClick={() => setErrorPopUp(false)}> | |||||
<Typography variant="h5"> | |||||
<Button | |||||
onClick={() => setErrorPopUp(false)} | |||||
aria-label={intl.formatMessage({id: 'close'})} | |||||
> | |||||
<Typography variant="pnspsFormParagraph"> | |||||
<FormattedMessage id="close"/> | <FormattedMessage id="close"/> | ||||
</Typography></Button> | </Typography></Button> | ||||
</DialogActions> | </DialogActions> | ||||
@@ -21,15 +21,16 @@ import * as yup from 'yup'; | |||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | ||||
import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
import {FormattedMessage} from "react-intl"; | import {FormattedMessage} from "react-intl"; | ||||
import {useIntl} from "react-intl"; | |||||
const StatusChangeDialog = (props) => { | const StatusChangeDialog = (props) => { | ||||
const [status, setStatus] = useState(""); | const [status, setStatus] = useState(""); | ||||
const intl = useIntl(); | |||||
useEffect(() => { | useEffect(() => { | ||||
console.log(Object.keys(!props.selectedGazetteGroup).length) | console.log(Object.keys(!props.selectedGazetteGroup).length) | ||||
if(props.getStatus === "cancel"){ | if(props.getStatus === "cancel"){ | ||||
setStatus("取消") | |||||
setStatus(intl.formatMessage({id: 'cancel'})) | |||||
} | } | ||||
}, [props.getStatus]); | }, [props.getStatus]); | ||||
@@ -60,8 +61,8 @@ const StatusChangeDialog = (props) => { | |||||
maxWidth={'xs'} | maxWidth={'xs'} | ||||
> | > | ||||
<DialogTitle > | <DialogTitle > | ||||
<Typography variant="h4" color="error"> | |||||
{status}公共啟事 | |||||
<Typography variant="h4"> | |||||
{status} {intl.formatMessage({id: 'publicNotice'})} | |||||
</Typography> | </Typography> | ||||
</DialogTitle> | </DialogTitle> | ||||
<FormikProvider value={formik}> | <FormikProvider value={formik}> | ||||
@@ -69,7 +70,8 @@ const StatusChangeDialog = (props) => { | |||||
<DialogContent> | <DialogContent> | ||||
<DialogContentText> | <DialogContentText> | ||||
<FormLabel sx={{fontSize: "18px", color:"#000000",textAlign:"center"}}> | <FormLabel sx={{fontSize: "18px", color:"#000000",textAlign:"center"}}> | ||||
<Typography variant="h5">確定{status}公共啟事?</Typography> | |||||
<Typography variant="h5"> | |||||
{intl.formatMessage({id: 'confirmTo'})}{status} {intl.formatMessage({id: 'publicNotice'})}?</Typography> | |||||
</FormLabel> | </FormLabel> | ||||
</DialogContentText> | </DialogContentText> | ||||
</DialogContent> | </DialogContent> | ||||
@@ -82,7 +84,7 @@ const StatusChangeDialog = (props) => { | |||||
variant="contained" | variant="contained" | ||||
onClick={props.handleClose} | onClick={props.handleClose} | ||||
autoFocus | autoFocus | ||||
color="delete" | |||||
color="cancel" | |||||
> | > | ||||
<FormattedMessage id="cancel"/> | <FormattedMessage id="cancel"/> | ||||
</Button> | </Button> | ||||
@@ -154,7 +154,7 @@ const DashboardDefault = () => { | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | |||||
<FormattedMessage id="myPublicNotice"/> | <FormattedMessage id="myPublicNotice"/> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
@@ -164,7 +164,12 @@ const DashboardDefault = () => { | |||||
<Grid container direction="column" justifyContent="flex-start" alignItems="center"> | <Grid container direction="column" justifyContent="flex-start" alignItems="center"> | ||||
<Grid item xs={12} width="75%"> | <Grid item xs={12} width="75%"> | ||||
<Stack direction="row"> | <Stack direction="row"> | ||||
<Button title={intl.formatMessage({id: 'back'})} sx={{ ml: 0, mt: 2.5 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate("/publicNotice") }}> | |||||
<Button | |||||
aria-label={intl.formatMessage({id: 'back'})} | |||||
title={intl.formatMessage({id: 'back'})} | |||||
sx={{ ml: 0, mt: 2.5 }} style={{ border: '2px solid' }} | |||||
variant="outlined" onClick={() => { navigate("/publicNotice") }} | |||||
> | |||||
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | <ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | ||||
</Button> | </Button> | ||||
<Typography ml={3} mt={3} variant="h4">{title}</Typography> | <Typography ml={3} mt={3} variant="h4">{title}</Typography> | ||||
@@ -72,11 +72,7 @@ export default function SubmittedTab({ rows }) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 5 }, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
/> | /> | ||||
</div> | </div> | ||||
</> | </> | ||||
@@ -80,11 +80,7 @@ export default function ProofTab({rows}) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: {page: 0, pageSize: 5}, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -44,11 +44,7 @@ export default function StatusHistoryTab({rows}) { | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: {page: 0, pageSize: 5}, | |||||
}, | |||||
}} | |||||
customPageSize={5} | |||||
/> | /> | ||||
</div> | </div> | ||||
); | ); | ||||
@@ -56,11 +56,15 @@ const PublicNotice = ({ proofList, paymentList }) => { | |||||
<TabContext value={selectedTab}> | <TabContext value={selectedTab}> | ||||
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}> | <Box sx={{ borderBottom: 1, borderColor: 'divider' }}> | ||||
<TabList onChange={handleChange} aria-label="lab API tabs example"> | <TabList onChange={handleChange} aria-label="lab API tabs example"> | ||||
<Tab label={ | |||||
<Tab | |||||
aria-label={intl.formatMessage({id: 'proofRecord'})} | |||||
label={ | |||||
intl.formatMessage({id: 'proofRecord'}) + "(" + _proofList.length + ") "} value="1" | intl.formatMessage({id: 'proofRecord'}) + "(" + _proofList.length + ") "} value="1" | ||||
/> | /> | ||||
<Tab label={ intl.formatMessage({id: 'paymentHistory'}) +"(" + _paymentList.length + ") "} value="2" /> | |||||
<Tab | |||||
aria-label={intl.formatMessage({id: 'paymentHistory'})} | |||||
label={ intl.formatMessage({id: 'paymentHistory'}) +"(" + _paymentList.length + ") "} value="2" | |||||
/> | |||||
</TabList> | </TabList> | ||||
</Box> | </Box> | ||||
<TabPanel value="1"> | <TabPanel value="1"> | ||||
@@ -80,13 +80,13 @@ export default function BaseGrid({rows}) { | |||||
renderCell: (params) => ( | renderCell: (params) => ( | ||||
isORGLoggedIn()? | isORGLoggedIn()? | ||||
<div> | <div> | ||||
<Typography>Care Of: {params.row.careOf}</Typography> | |||||
<Typography variant="pnspsNormalText">Care Of: {params.row.careOf}</Typography> | |||||
<Typography> | <Typography> | ||||
<FormattedMessage id="myRemarks"/>: {params.row.remarks} | |||||
<FormattedMessage variant="pnspsNormalText" id="myRemarks"/>: {params.row.remarks} | |||||
</Typography> | </Typography> | ||||
</div>: | </div>: | ||||
<div> | <div> | ||||
<Typography>{params.row.remarks}</Typography> | |||||
<Typography variant="pnspsNormalText">{params.row.remarks}</Typography> | |||||
</div> | </div> | ||||
) | ) | ||||
}, | }, | ||||
@@ -106,7 +106,7 @@ export default function BaseGrid({rows}) { | |||||
width: 160, | width: 160, | ||||
cellClassName: 'actions', | cellClassName: 'actions', | ||||
renderCell: (params) => { | renderCell: (params) => { | ||||
return <Button onClick={handleDetailClick(params)}> | |||||
return <Button aria-label={intl.formatMessage({id: 'viewDetail'})} onClick={handleDetailClick(params)}> | |||||
<FormattedMessage id="viewDetail"/> | <FormattedMessage id="viewDetail"/> | ||||
</Button>; | </Button>; | ||||
}, | }, | ||||
@@ -118,15 +118,11 @@ export default function BaseGrid({rows}) { | |||||
} | } | ||||
return ( | return ( | ||||
<div style={{minHeight: 400, width: '100%', padding: 4}}> | |||||
<div style={{minHeight: 400, height:"100%", width: '100%', padding: 4}}> | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: {page: 0, pageSize: 10}, | |||||
}, | |||||
}} | |||||
customPageSize={10} | |||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
getRowHeight={() => 'auto'} | getRowHeight={() => 'auto'} | ||||
/> | /> | ||||
@@ -166,12 +166,12 @@ export default function SubmittedTab({ rows }) { | |||||
renderCell: (params) => ( | renderCell: (params) => ( | ||||
isORGLoggedIn() ? | isORGLoggedIn() ? | ||||
<div> | <div> | ||||
<Typography>Care Of: {params.row.careOf}</Typography> | |||||
<Typography> | |||||
<Typography variant="pnspsNormalText">Care Of: {params.row.careOf}</Typography> | |||||
<Typography variant="pnspsNormalText"> | |||||
<FormattedMessage id="myRemarks"/>: {params.row.remarks}</Typography> | <FormattedMessage id="myRemarks"/>: {params.row.remarks}</Typography> | ||||
</div> : | </div> : | ||||
<div> | <div> | ||||
<Typography>{params.row.remarks}</Typography> | |||||
<Typography variant="pnspsNormalText">{params.row.remarks}</Typography> | |||||
</div> | </div> | ||||
) | ) | ||||
}, | }, | ||||
@@ -202,7 +202,7 @@ export default function SubmittedTab({ rows }) { | |||||
width: 150, | width: 150, | ||||
cellClassName: 'actions', | cellClassName: 'actions', | ||||
renderCell: (params) => { | renderCell: (params) => { | ||||
return <Button onClick={handleDetailClick(params)}> | |||||
return <Button aria-label={intl.formatMessage({id: 'viewDetail'})} onClick={handleDetailClick(params)}> | |||||
<FormattedMessage id="viewDetail"/> | <FormattedMessage id="viewDetail"/> | ||||
</Button>; | </Button>; | ||||
}, | }, | ||||
@@ -230,7 +230,7 @@ export default function SubmittedTab({ rows }) { | |||||
totalAmount += datas[i].fee; | totalAmount += datas[i].fee; | ||||
} | } | ||||
content.push(<Typography variant="h5"> | content.push(<Typography variant="h5"> | ||||
<FormattedMessage id="totalAmount"/>(HK$): {FormatUtils.currencyFormat(totalAmount)} | |||||
<FormattedMessage id="totalAmount"/> (HK$): {FormatUtils.currencyFormat(totalAmount)} | |||||
<br /><br /> | <br /><br /> | ||||
</Typography>); | </Typography>); | ||||
//setAmount(totalAmount); | //setAmount(totalAmount); | ||||
@@ -307,11 +307,7 @@ export default function SubmittedTab({ rows }) { | |||||
disableRowSelectionOnClick | disableRowSelectionOnClick | ||||
rows={rowList} | rows={rowList} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 20 }, | |||||
}, | |||||
}} | |||||
customPageSize={20} | |||||
onRowSelectionModelChange={(newSelection) => { | onRowSelectionModelChange={(newSelection) => { | ||||
setSelectedRowItems(newSelection); | setSelectedRowItems(newSelection); | ||||
}} | }} | ||||
@@ -323,6 +319,7 @@ export default function SubmittedTab({ rows }) { | |||||
<Button | <Button | ||||
color="create" | color="create" | ||||
variant="contained" | variant="contained" | ||||
aria-label={intl.formatMessage({id: 'pay'})} | |||||
onClick={() => { handlePaymentBtn() }} | onClick={() => { handlePaymentBtn() }} | ||||
sx={{mt:2, ml:1}} | sx={{mt:2, ml:1}} | ||||
> | > | ||||
@@ -354,11 +351,13 @@ export default function SubmittedTab({ rows }) { | |||||
</Stack> | </Stack> | ||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button onClick={() => setIsPopUp(false)}> | |||||
<Button onClick={() => setIsPopUp(false)} aria-label={intl.formatMessage({id: 'close'})}> | |||||
<Typography variant="h5"> | <Typography variant="h5"> | ||||
<FormattedMessage id="close"/> | <FormattedMessage id="close"/> | ||||
</Typography></Button> | </Typography></Button> | ||||
<Button onClick={() => doPayment()}><Typography variant="h5"> | |||||
<Button onClick={() => doPayment()} aria-label={intl.formatMessage({id: 'confirm'})}> | |||||
<Typography variant="h5"> | |||||
<FormattedMessage id="confirm"/> | <FormattedMessage id="confirm"/> | ||||
</Typography></Button> | </Typography></Button> | ||||
</DialogActions> | </DialogActions> | ||||
@@ -366,7 +365,17 @@ export default function SubmittedTab({ rows }) { | |||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={checkCareOf} onClose={() => setCheckCareOf(false)} > | |||||
<Dialog | |||||
open={checkCareOf} | |||||
onClose={() => setCheckCareOf(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle></DialogTitle> | <DialogTitle></DialogTitle> | ||||
<Typography variant="h2" style={{ padding: '16px' }}>Warning</Typography> | <Typography variant="h2" style={{ padding: '16px' }}>Warning</Typography> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
@@ -377,11 +386,13 @@ export default function SubmittedTab({ rows }) { | |||||
</Stack> | </Stack> | ||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button onClick={() => setCheckCareOf(false)}> | |||||
<Button onClick={() => setCheckCareOf(false)} aria-label={intl.formatMessage({id: 'close'})}> | |||||
<Typography variant="h5"> | <Typography variant="h5"> | ||||
<FormattedMessage id="close"/> | <FormattedMessage id="close"/> | ||||
</Typography></Button> | </Typography></Button> | ||||
<Button onClick={() => afterWarningPayment()}><Typography variant="h5"> | |||||
<Button onClick={() => afterWarningPayment()} aria-label={intl.formatMessage({id: 'confirm'})}> | |||||
<Typography variant="h5"> | |||||
<FormattedMessage id="confirm"/> | <FormattedMessage id="confirm"/> | ||||
</Typography></Button> | </Typography></Button> | ||||
</DialogActions> | </DialogActions> | ||||
@@ -389,7 +400,17 @@ export default function SubmittedTab({ rows }) { | |||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={expiryDateErr} onClose={() => setExpiryDateErr(false)} > | |||||
<Dialog | |||||
open={expiryDateErr} | |||||
onClose={() => setExpiryDateErr(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle></DialogTitle> | <DialogTitle></DialogTitle> | ||||
<Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography> | <Typography variant="h2" style={{ padding: '16px' }}>行動失敗</Typography> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
@@ -400,7 +421,7 @@ export default function SubmittedTab({ rows }) { | |||||
</Stack> | </Stack> | ||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button onClick={() => setExpiryDateErr(false)}> | |||||
<Button onClick={() => setExpiryDateErr(false)} aria-label={intl.formatMessage({id: 'close'})}> | |||||
<Typography variant="h5"> | <Typography variant="h5"> | ||||
<FormattedMessage id="close"/> | <FormattedMessage id="close"/> | ||||
</Typography></Button> | </Typography></Button> | ||||
@@ -64,8 +64,8 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
<form onSubmit={handleSubmit(onSubmit)}> | <form onSubmit={handleSubmit(onSubmit)}> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:marginBottom}}> | <Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:marginBottom}}> | ||||
<Typography variant="pnspsFormTitle" > | |||||
<FormattedMessage id="search"/> | |||||
<Typography variant="pnspsFormHeader" > | |||||
<FormattedMessage id="searchForm"/> | |||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
{/*row 2*/} | {/*row 2*/} | ||||
@@ -75,6 +75,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
fullWidth | fullWidth | ||||
{...register("appNo")} | {...register("appNo")} | ||||
id='appNo' | id='appNo' | ||||
aria-label={intl.formatMessage({id: 'applicationId'})} | |||||
label={intl.formatMessage({id: 'applicationId'})} | label={intl.formatMessage({id: 'applicationId'})} | ||||
defaultValue={searchCriteria.appNo} | defaultValue={searchCriteria.appNo} | ||||
InputLabelProps={{ | InputLabelProps={{ | ||||
@@ -89,6 +90,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
{...register("dateFrom")} | {...register("dateFrom")} | ||||
id="dateFrom" | id="dateFrom" | ||||
type="date" | type="date" | ||||
aria-label={intl.formatMessage({id: 'submitDateFrom'})} | |||||
label={intl.formatMessage({id: 'submitDateFrom'})} | label={intl.formatMessage({id: 'submitDateFrom'})} | ||||
defaultValue={searchCriteria.dateFrom} | defaultValue={searchCriteria.dateFrom} | ||||
InputProps={{ inputProps: { max: maxDate } }} | InputProps={{ inputProps: { max: maxDate } }} | ||||
@@ -110,6 +112,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
{...register("dateTo")} | {...register("dateTo")} | ||||
id="dateTo" | id="dateTo" | ||||
type="date" | type="date" | ||||
aria-label={intl.formatMessage({id: 'submitDateTo'})} | |||||
label={intl.formatMessage({id: 'submitDateTo'})} | label={intl.formatMessage({id: 'submitDateTo'})} | ||||
defaultValue={searchCriteria.dateTo} | defaultValue={searchCriteria.dateTo} | ||||
InputProps={{ inputProps: { min: minDate } }} | InputProps={{ inputProps: { min: minDate } }} | ||||
@@ -125,6 +128,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
{...register("careOf")} | {...register("careOf")} | ||||
id="careOf" | id="careOf" | ||||
label="Care Of" | label="Care Of" | ||||
aria-label={"Care Of"} | |||||
defaultValue={searchCriteria.careOf} | defaultValue={searchCriteria.careOf} | ||||
InputLabelProps={{ | InputLabelProps={{ | ||||
shrink: true | shrink: true | ||||
@@ -139,6 +143,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
{...register("contact")} | {...register("contact")} | ||||
id="contact" | id="contact" | ||||
label={intl.formatMessage({id: 'contactPerson'})} | label={intl.formatMessage({id: 'contactPerson'})} | ||||
aria-label={intl.formatMessage({id: 'contactPerson'})} | |||||
defaultValue={searchCriteria.contact} | defaultValue={searchCriteria.contact} | ||||
InputLabelProps={{ | InputLabelProps={{ | ||||
shrink: true | shrink: true | ||||
@@ -183,6 +188,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
renderInput={(params) => ( | renderInput={(params) => ( | ||||
<TextField {...params} | <TextField {...params} | ||||
label={intl.formatMessage({id: 'status'})} | label={intl.formatMessage({id: 'status'})} | ||||
aria-label={intl.formatMessage({id: 'status'})} | |||||
InputLabelProps={{ | InputLabelProps={{ | ||||
shrink: true | shrink: true | ||||
}} | }} | ||||
@@ -211,7 +217,9 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
color="cancel" | |||||
onClick={resetForm} | onClick={resetForm} | ||||
aria-label={intl.formatMessage({id: 'reset'})} | |||||
> | > | ||||
<Typography variant="pnspsButtonText"> | <Typography variant="pnspsButtonText"> | ||||
<FormattedMessage id="reset"/> | <FormattedMessage id="reset"/> | ||||
@@ -219,10 +227,11 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3}}> | |||||
<Grid item> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
aria-label={intl.formatMessage({id: 'search'})} | |||||
> | > | ||||
<Typography variant="pnspsButtonText"> | <Typography variant="pnspsButtonText"> | ||||
<FormattedMessage id="search"/> | <FormattedMessage id="search"/> | ||||
@@ -45,7 +45,7 @@ const UserSearchPage_Individual = () => { | |||||
} | } | ||||
return ( | return ( | ||||
<Grid container> | |||||
<Grid container sx={{ display: 'flex', flexDirection: 'column', height: '100%' }}> | |||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12} sx={{mb:-3}}> | <Grid item xs={12} md={12} lg={12} sx={{mb:-3}}> | ||||
<SearchForm | <SearchForm | ||||
@@ -58,11 +58,14 @@ const UserSearchPage_Individual = () => { | |||||
<MainCard elevation={0} | <MainCard elevation={0} | ||||
border={false} | border={false} | ||||
content={false} | content={false} | ||||
sx={{width: "-webkit-fill-available"}} | |||||
sx={{width: "-webkit-fill-available",height: "100%", minHeight:'100%'}} | |||||
> | > | ||||
<EventTable | |||||
recordList={record} | |||||
/> | |||||
<div style={{height: '100%', width: '100%' }}> | |||||
<EventTable | |||||
autoHeight | |||||
recordList={record} | |||||
/> | |||||
</div> | |||||
</MainCard> | </MainCard> | ||||
</Grid> | </Grid> | ||||
@@ -83,13 +83,13 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
renderCell: (params) => ( | renderCell: (params) => ( | ||||
isORGLoggedIn()? | isORGLoggedIn()? | ||||
<div> | <div> | ||||
<Typography>Care Of: {params.row.careOf}</Typography> | |||||
<Typography> | |||||
<Typography variant="pnspsNormalText">Care Of: {params.row.careOf}</Typography> | |||||
<Typography variant="pnspsNormalText"> | |||||
<FormattedMessage id="myRemarks"/>: {params.row.remarks} | <FormattedMessage id="myRemarks"/>: {params.row.remarks} | ||||
</Typography> | </Typography> | ||||
</div>: | </div>: | ||||
<div> | <div> | ||||
<Typography>{params.row.remarks}</Typography> | |||||
<Typography variant="pnspsNormalText">{params.row.remarks}</Typography> | |||||
</div> | </div> | ||||
) | ) | ||||
}, | }, | ||||
@@ -109,7 +109,9 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
width: 150, | width: 150, | ||||
cellClassName: 'actions', | cellClassName: 'actions', | ||||
renderCell: (params) => { | renderCell: (params) => { | ||||
return <Button onClick={handleDetailClick(params)}> | |||||
return <Button onClick={handleDetailClick(params)} | |||||
aria-label={intl.formatMessage({id: 'viewDetail'})} | |||||
> | |||||
<FormattedMessage id="viewDetail"/> | <FormattedMessage id="viewDetail"/> | ||||
</Button>; | </Button>; | ||||
}, | }, | ||||
@@ -121,15 +123,11 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
} | } | ||||
return ( | return ( | ||||
<div style={{ minHeight: 400, width: '100%' }}> | |||||
<div style={{ minHeight: 400, height: "100%", width: '100%' }}> | |||||
<FiDataGrid | <FiDataGrid | ||||
rows={rows} | rows={rows} | ||||
columns={columns} | columns={columns} | ||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 20 }, | |||||
}, | |||||
}} | |||||
customPageSize={20} | |||||
onRowDoubleClick={handleRowDoubleClick} | onRowDoubleClick={handleRowDoubleClick} | ||||
getRowHeight={() => 'auto'} | getRowHeight={() => 'auto'} | ||||
/> | /> | ||||
@@ -108,7 +108,7 @@ const PublicNotice = () => { | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block' }}}> | |||||
<FormattedMessage id="myPublicNotice"/> | <FormattedMessage id="myPublicNotice"/> | ||||
</Typography> | </Typography> | ||||
</Stack> | </Stack> | ||||
@@ -118,7 +118,7 @@ const PublicNotice = () => { | |||||
<Stack direction="row" justifyContent="flex-end" alignItems="center"> | <Stack direction="row" justifyContent="flex-end" alignItems="center"> | ||||
<ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | ||||
<Box sx={{ mr: { md: "47px" } }}> | <Box sx={{ mr: { md: "47px" } }}> | ||||
<Button variant="contained" onClick={() => { onBtnClick() }}> | |||||
<Button aria-label={intl.formatMessage({id: 'applyPublicNotice'})} variant="contained" onClick={() => { onBtnClick() }}> | |||||
<FormattedMessage id="applyPublicNotice"/> | <FormattedMessage id="applyPublicNotice"/> | ||||
</Button> | </Button> | ||||
</Box> | </Box> | ||||
@@ -129,14 +129,14 @@ const PublicNotice = () => { | |||||
{ | { | ||||
JSON.parse(localStorage.getItem('userData')).creditor ? ( | JSON.parse(localStorage.getItem('userData')).creditor ? ( | ||||
<Grid item xs={12} sm={12} md={12} lg={12} sx={{ minHeight: '75vh', maxWidth: '1%',width: "-webkit-fill-available", backgroundColor: "#fff", mt: 3, mr: 3, ml: 3, mb: 3, ..._sx }}> | |||||
<Grid item xs={12} sm={12} md={12} lg={12} sx={{ height:'100%', maxWidth: '100%',width: "-webkit-fill-available", backgroundColor: "#fff", mt: 3, mr: 3, ml: 3, mb: 3, ..._sx }}> | |||||
<TabContext value={selectedTab}> | <TabContext value={selectedTab}> | ||||
<Box sx={{ borderBottom: 1, borderColor: 'divider', overflowX: 'auto', }}> | |||||
<Box sx={{ borderBottom: 1, borderColor: 'divider', overflowX: 'auto', overflowY:'auto' }}> | |||||
<TabList onChange={handleChange} aria-label="lab API tabs example" sx={{ display: 'flex', flexDirection: 'row' }}> | <TabList onChange={handleChange} aria-label="lab API tabs example" sx={{ display: 'flex', flexDirection: 'row' }}> | ||||
<Tab label={intl.formatMessage({id: 'processing'}) + " (" + submittedList?.length + ")"} value="1" /> | |||||
<Tab label={intl.formatMessage({id: 'pendingPublish'}) + " (" + pendingPublishList?.length + ")"} value="3" /> | |||||
<Tab label={intl.formatMessage({id: 'pendingPayment'}) + " (" + pendingPaymentList?.length + ")"} value="4" /> | |||||
<Tab label={intl.formatMessage({id: 'searchApplyRecord'})} value="5" /> | |||||
<Tab aria-label={intl.formatMessage({id: 'processing'})} label={intl.formatMessage({id: 'processing'}) + " (" + submittedList?.length + ")"} value="1" /> | |||||
<Tab aria-label={intl.formatMessage({id: 'pendingPublish'})} label={intl.formatMessage({id: 'pendingPublish'}) + " (" + pendingPublishList?.length + ")"} value="3" /> | |||||
<Tab aria-label={intl.formatMessage({id: 'pendingPayment'})} label={intl.formatMessage({id: 'pendingPayment'}) + " (" + pendingPaymentList?.length + ")"} value="4" /> | |||||
<Tab aria-label={intl.formatMessage({id: 'searchApplyRecord'})} label={intl.formatMessage({id: 'searchApplyRecord'})} value="5" /> | |||||
</TabList> | </TabList> | ||||
</Box> | </Box> | ||||
<TabPanel value="1"> | <TabPanel value="1"> | ||||
@@ -166,14 +166,14 @@ const PublicNotice = () => { | |||||
</TabContext> | </TabContext> | ||||
</Grid> | </Grid> | ||||
) : ( | ) : ( | ||||
<Grid item xs={12} sx={{ minHeight: '75vh', maxWidth: '95%', width: "-webkit-fill-available", backgroundColor: "#fff", mt: 3, mr: 3, ml: 3, mb: 3, ..._sx }}> | |||||
<Grid item xs={12} sx={{ minHeight: '80vh',height:"100%", maxHeight:'300vh', maxWidth: '95%', width: "-webkit-fill-available", backgroundColor: "#fff", mt: 3, mr: 3, ml: 3, mb: 3, ..._sx }}> | |||||
<TabContext value={selectedTab}> | <TabContext value={selectedTab}> | ||||
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}> | <Box sx={{ borderBottom: 1, borderColor: 'divider' }}> | ||||
<TabList onChange={handleChange} aria-label="lab API tabs example"> | <TabList onChange={handleChange} aria-label="lab API tabs example"> | ||||
<Tab label={intl.formatMessage({id: 'processing'}) + " (" + submittedList.length + ")"} value="1" /> | |||||
<Tab label={intl.formatMessage({id: 'pendingPayment'}) + " (" + pendingPaymentList.length + ")"} value="3" /> | |||||
<Tab label={intl.formatMessage({id: 'pendingPublish'}) + " (" + pendingPublishList.length + ")"} value="4" /> | |||||
<Tab label={intl.formatMessage({id: 'searchApplyRecord'})} value="5" /> | |||||
<Tab aria-label={intl.formatMessage({id: 'processing'})} label={intl.formatMessage({id: 'processing'}) + " (" + submittedList.length + ")"} value="1" /> | |||||
<Tab aria-label={intl.formatMessage({id: 'pendingPayment'})} label={intl.formatMessage({id: 'pendingPayment'}) + " (" + pendingPaymentList.length + ")"} value="3" /> | |||||
<Tab aria-label={intl.formatMessage({id: 'pendingPublish'})} label={intl.formatMessage({id: 'pendingPublish'}) + " (" + pendingPublishList.length + ")"} value="4" /> | |||||
<Tab aria-label={intl.formatMessage({id: 'searchApplyRecord'})} label={intl.formatMessage({id: 'searchApplyRecord'})} value="5" /> | |||||
</TabList> | </TabList> | ||||
</Box> | </Box> | ||||
<TabPanel value="1"> | <TabPanel value="1"> | ||||
@@ -1,8 +1,7 @@ | |||||
// material-ui | // material-ui | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import { | import { | ||||
Button, | |||||
Box | |||||
Button | |||||
} from '@mui/material'; | } from '@mui/material'; | ||||
import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
import * as FormatUtils from "utils/FormatUtils"; | import * as FormatUtils from "utils/FormatUtils"; | ||||
@@ -111,20 +110,14 @@ export default function SearchPublicNoticeTable({ recordList }) { | |||||
} | } | ||||
return ( | return ( | ||||
<div style={{ height: '100%', width: '100%' }}> | |||||
<Box sx={{ backgroundColor: "#fff", ml: 2 }} width="98%"> | |||||
<FiDataGrid | |||||
rows={rows} | |||||
columns={columns} | |||||
initialState={{ | |||||
pagination: { | |||||
paginationModel: { page: 0, pageSize: 10 }, | |||||
}, | |||||
}} | |||||
getRowHeight={() => 'auto'} | |||||
onRowDoubleClick={handleRowDoubleClick} | |||||
/> | |||||
</Box> | |||||
<div style={{width: '100%' }}> | |||||
<FiDataGrid | |||||
rows={rows} | |||||
columns={columns} | |||||
customPageSize={10} | |||||
getRowHeight={() => 'auto'} | |||||
onRowDoubleClick={handleRowDoubleClick} | |||||
/> | |||||
</div> | </div> | ||||
); | ); | ||||
} | } |
@@ -94,7 +94,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1, mb: marginBottom}} width="98%"> | <Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1, mb: marginBottom}} width="98%"> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:marginBottom}}> | <Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:marginBottom}}> | ||||
<Typography variant="pnspsFormTitle" > | |||||
<Typography variant="pnspsFormHeader" > | |||||
Search Form | Search Form | ||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
@@ -237,6 +237,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
disablePortal | disablePortal | ||||
id="orgId" | id="orgId" | ||||
options={orgCombo} | options={orgCombo} | ||||
size="small" | |||||
value={orgSelected} | value={orgSelected} | ||||
inputValue={(orgSelected?.label) ? orgSelected?.label : ""} | inputValue={(orgSelected?.label) ? orgSelected?.label : ""} | ||||
onChange={(event, newValue) => { | onChange={(event, newValue) => { | ||||
@@ -261,8 +262,8 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
<Autocomplete | <Autocomplete | ||||
{...register("issueId")} | {...register("issueId")} | ||||
disablePortal | disablePortal | ||||
id="issueId" | |||||
size="small" | size="small" | ||||
id="issueId" | |||||
options={issueCombo} | options={issueCombo} | ||||
value={issueSelected} | value={issueSelected} | ||||
inputValue={(issueSelected?.id) ? getIssueLabel(issueSelected) : ""} | inputValue={(issueSelected?.id) ? getIssueLabel(issueSelected) : ""} | ||||
@@ -300,7 +301,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
{/*last row*/} | {/*last row*/} | ||||
<Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | |||||
<Grid item sx={{ ml: 3 }}> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
onClick={resetForm} | onClick={resetForm} | ||||
@@ -309,7 +310,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | |||||
<Grid item sx={{ ml: 3 }}> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
@@ -92,7 +92,7 @@ const UserSearchPage_Individual = () => { | |||||
!onReady ? | !onReady ? | ||||
<LoadingComponent /> | <LoadingComponent /> | ||||
: | : | ||||
<Grid container sx={{ minHeight: '85vh', backgroundColor: 'backgroundColor.default' }} direction="column"> | |||||
<Grid container sx={{ backgroundColor: 'backgroundColor.default' }}> | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
@@ -101,7 +101,7 @@ const UserSearchPage_Individual = () => { | |||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
{/*row 1*/} | {/*row 1*/} | ||||
<Grid item xs={12} md={12} lg={12} sx={{mb: -4}}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{mb: -1}}> | |||||
<SearchForm | <SearchForm | ||||
applySearch={applySearch} | applySearch={applySearch} | ||||
orgComboData={orgCombo} | orgComboData={orgCombo} | ||||
@@ -0,0 +1,125 @@ | |||||
// material-ui | |||||
import { | |||||
FormControl, | |||||
Button, | |||||
Grid, | |||||
// InputAdornment, | |||||
Typography, FormLabel, | |||||
OutlinedInput, | |||||
} from '@mui/material'; | |||||
import MainCard from "components/MainCard"; | |||||
import * as React from "react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | |||||
const Form = ({ selectedItem, onSave }) => { | |||||
const [data, setData] = React.useState({}); | |||||
const [value, setValue] = React.useState(""); | |||||
React.useEffect(() => { | |||||
//if user data from parent are not null | |||||
if (selectedItem !== undefined && Object.keys(selectedItem).length > 0) { | |||||
setData(selectedItem); | |||||
setValue(selectedItem.value) | |||||
} | |||||
}, [selectedItem]); | |||||
return ( | |||||
<MainCard elevation={0} | |||||
border={false} | |||||
content={false} | |||||
> | |||||
{ | |||||
data?.name ? | |||||
<> | |||||
<Typography variant="h5" sx={{ mt: 3, ml: 3, mr: 3, borderBottom: "1px solid black" }}> | |||||
Update | |||||
</Typography> | |||||
<form> | |||||
<Grid container> | |||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={2} | |||||
sx={{ ml: 3, mr: 3, display: 'flex', alignItems: 'center' }}> | |||||
<FormLabel>Name:</FormLabel> | |||||
</Grid> | |||||
<Grid item xs={8} > | |||||
<Typography> | |||||
{data?.name} | |||||
</Typography> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={2} | |||||
sx={{ ml: 3, mr: 3, display: 'flex', alignItems: 'center' }}> | |||||
<FormLabel >Type:</FormLabel> | |||||
</Grid> | |||||
<Grid item xs={8}> | |||||
<Typography> | |||||
{data?.type} | |||||
</Typography> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={2} | |||||
sx={{ ml: 3, mr: 3, display: 'flex', alignItems: 'center' }}> | |||||
<FormLabel>Category:</FormLabel> | |||||
</Grid> | |||||
<Grid item xs={8}> | |||||
<Typography> | |||||
{data?.category} | |||||
</Typography> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={2} | |||||
sx={{ ml: 3, mr: 3, display: 'flex', alignItems: 'center' }}> | |||||
<FormLabel>Value:</FormLabel> | |||||
</Grid> | |||||
<Grid item xs={8}> | |||||
<FormControl variant="outlined" fullWidth required> | |||||
<OutlinedInput | |||||
fullWidth | |||||
size="small" | |||||
value={value} | |||||
onChange={(event)=>{ | |||||
setValue(event.target.value); | |||||
}} | |||||
/> | |||||
</FormControl> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Button onClick={()=>{onSave({ name: data.name, value:value})}}>Save</Button> | |||||
</form> | |||||
</> | |||||
: | |||||
<Typography variant="h5" sx={{ mt: 3, ml: 3, mr: 3, borderBottom: "1px solid black" }}> | |||||
Please select system params. | |||||
</Typography> | |||||
} | |||||
</MainCard> | |||||
); | |||||
}; | |||||
export default Form; |
@@ -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 ( | |||||
<MainCard elevation={0} | |||||
border={false} | |||||
content={false} | |||||
height='100%' | |||||
> | |||||
<Typography variant="h5" sx={{mt: 3, ml: 3, mr: 3, borderBottom: "1px solid black"}}> | |||||
System Params | |||||
</Typography> | |||||
<div style={{ width: '100%' }}> | |||||
<Box sx={{ backgroundColor: "#fff", ml: 2 }} height='100%'> | |||||
<FiDataGrid | |||||
rows={rows} | |||||
columns={columns} | |||||
customPageSize={10} | |||||
getRowHeight={() => 'auto'} | |||||
onRowClick={onRowClick} | |||||
/> | |||||
</Box> | |||||
</div> | |||||
</MainCard> | |||||
); | |||||
}; | |||||
export default Table; |
@@ -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 ( | |||||
<Grid container sx={{ minHeight: '90vh', backgroundColor: 'backgroundColor.default' }} direction="column" | |||||
justifyContent="flex-start"> | |||||
<> | |||||
<Grid item xs={12}> | |||||
<div style={BackgroundHead}> | |||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||||
<Typography ml={15} color='#FFF' variant="h4">System Setting</Typography> | |||||
</Stack> | |||||
</div> | |||||
</Grid> | |||||
{/*col 1*/} | |||||
<Grid item xs={12} > | |||||
<Grid container direction="row" sx={{ p: 2 }} spacing={2} > | |||||
<Grid item xs={12} md={8} lg={8} > | |||||
<Box xs={12} sx={{ borderRadius: '10px', backgroundColor: '#fff' }} > | |||||
<Table | |||||
dataList={dataList} | |||||
onRowClick={onRowClick} | |||||
/> | |||||
</Box> | |||||
</Grid> | |||||
<Grid item xs={12} md={4} lg={4}> | |||||
<Box xs={12} sx={{ borderRadius: '10px', backgroundColor: '#fff' }}> | |||||
<Form | |||||
selectedItem={selectedItem} | |||||
onSave={onSave} | |||||
/> | |||||
</Box> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
{/*col 2*/} | |||||
</> | |||||
</Grid> | |||||
); | |||||
}; | |||||
export default SystemSetting; |
@@ -4,10 +4,10 @@ import { | |||||
} from "@mui/x-data-grid"; | } from "@mui/x-data-grid"; | ||||
import {useEffect, useState} from "react"; | import {useEffect, useState} from "react"; | ||||
import axios from "axios"; | import axios from "axios"; | ||||
import {apiPath} from "../../../auth/utils"; | |||||
import {apiPath} from "auth/utils"; | |||||
//import LoadingComponent from "../extra-pages/LoadingComponent"; | //import LoadingComponent from "../extra-pages/LoadingComponent"; | ||||
import * as React from "react"; | 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 Loadable from 'components/Loadable'; | ||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
@@ -20,22 +20,18 @@ export default function UserAuthTable({setSelectedRow, userAuth,isNewRecord}) { | |||||
const [onReady, setOnReady] = useState(false); | const [onReady, setOnReady] = useState(false); | ||||
const [currentSelectedRow, setCurrentSelectedRow] = useState(userAuth); | const [currentSelectedRow, setCurrentSelectedRow] = useState(userAuth); | ||||
const _sx = { | const _sx = { | ||||
ml: 3, | |||||
mb: 3, | |||||
mr: 3, | |||||
padding: "4 2 4 2", | |||||
boxShadow: 1, | boxShadow: 1, | ||||
border: 1, | border: 1, | ||||
borderColor: '#DDD', | borderColor: '#DDD', | ||||
'& .MuiDataGrid-cell': { | '& .MuiDataGrid-cell': { | ||||
borderTop: 1, | borderTop: 1, | ||||
borderBottom: 1, | |||||
//borderBottom: 1, | |||||
borderColor: "#EEE" | borderColor: "#EEE" | ||||
}, | }, | ||||
'& .MuiDataGrid-footerContainer': { | |||||
border: 1, | |||||
borderColor: "#EEE" | |||||
} | |||||
// '& .MuiDataGrid-footerContainer': { | |||||
// border: 1, | |||||
// borderColor: "#EEE" | |||||
// } | |||||
} | } | ||||
useEffect(() => { | useEffect(() => { | ||||
axios.get(`${apiPath}${GET_AUTH_LIST}`) | axios.get(`${apiPath}${GET_AUTH_LIST}`) | ||||
@@ -49,8 +49,9 @@ const UserAuthorityCard = ({ isCollectData, updateUserAuthList, userData, isNewR | |||||
<MainCard elevation={0} | <MainCard elevation={0} | ||||
border={false} | border={false} | ||||
content={false} | content={false} | ||||
sx={{margin: 0}} | |||||
> | > | ||||
<Typography variant="h6" sx={{ mt: 3, ml: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}> | |||||
<Typography variant="h6" sx={{ mt: 2, ml: 3, mr: 1, borderBottom: "1px solid black" }}> | |||||
User Authority | User Authority | ||||
</Typography> | </Typography> | ||||
@@ -23,6 +23,7 @@ const UserGroupCard = ({isCollectData, updateUserGroupList,userData,isNewRecord} | |||||
useEffect(() => { | useEffect(() => { | ||||
//if user data from parent are not null | //if user data from parent are not null | ||||
if (Object.keys(userData).length > 0 && userData !== undefined) { | if (Object.keys(userData).length > 0 && userData !== undefined) { | ||||
// console.log(userData.groupIds) | |||||
setCurrentUserData(userData.data); | setCurrentUserData(userData.data); | ||||
setSelectedRow(userData.groupIds); | setSelectedRow(userData.groupIds); | ||||
} | } | ||||
@@ -48,8 +49,9 @@ const UserGroupCard = ({isCollectData, updateUserGroupList,userData,isNewRecord} | |||||
<MainCard elevation={0} | <MainCard elevation={0} | ||||
border={false} | border={false} | ||||
content={false} | content={false} | ||||
sx={{margin: 0}} | |||||
> | > | ||||
<Typography variant="h5" sx={{mt: 3, ml: 3, mb: 2, mr: 3, borderBottom: "1px solid black"}}> | |||||
<Typography variant="h6" sx={{mt: 2, ml: 3, mr: 1, borderBottom: "1px solid black"}}> | |||||
Group(s) | Group(s) | ||||
</Typography> | </Typography> | ||||
<UserGroupTable | <UserGroupTable | ||||
@@ -4,9 +4,9 @@ import { | |||||
} from "@mui/x-data-grid"; | } from "@mui/x-data-grid"; | ||||
import {useEffect, useState} from "react"; | import {useEffect, useState} from "react"; | ||||
import axios from "axios"; | import axios from "axios"; | ||||
import {apiPath} from "../../../auth/utils"; | |||||
import {apiPath} from "auth/utils"; | |||||
import * as React from "react"; | import * as React from "react"; | ||||
import {GET_GROUP_COMBO_PATH} from "../../../utils/ApiPathConst"; | |||||
import {GET_GROUP_COMBO_PATH} from "utils/ApiPathConst"; | |||||
import Loadable from 'components/Loadable'; | import Loadable from 'components/Loadable'; | ||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
@@ -19,9 +19,6 @@ export default function UserGroupTable({setSelectedRow, userGroup,isNewRecord}) | |||||
const [currentSelectedRow, setCurrentSelectedRow] = useState(userGroup); | const [currentSelectedRow, setCurrentSelectedRow] = useState(userGroup); | ||||
const _sx = { | const _sx = { | ||||
ml: 3, | |||||
mb: 3, | |||||
mr: 3, | |||||
padding: "4 2 4 2", | padding: "4 2 4 2", | ||||
boxShadow: 1, | boxShadow: 1, | ||||
border: 1, | border: 1, | ||||
@@ -41,7 +38,9 @@ export default function UserGroupTable({setSelectedRow, userGroup,isNewRecord}) | |||||
axios.get(`${apiPath}${GET_GROUP_COMBO_PATH}`) | axios.get(`${apiPath}${GET_GROUP_COMBO_PATH}`) | ||||
.then((response) => { | .then((response) => { | ||||
if (response.status === 200) { | if (response.status === 200) { | ||||
// console.log(userGroup) | |||||
setGroupData(response.data.records); | setGroupData(response.data.records); | ||||
setCurrentSelectedRow(userGroup); | |||||
} | } | ||||
}) | }) | ||||
.catch(error => { | .catch(error => { | ||||
@@ -85,7 +84,7 @@ export default function UserGroupTable({setSelectedRow, userGroup,isNewRecord}) | |||||
checkboxSelection | checkboxSelection | ||||
rowSelectionModel={currentSelectedRow} | rowSelectionModel={currentSelectedRow} | ||||
onRowSelectionModelChange={(ids) => { | onRowSelectionModelChange={(ids) => { | ||||
console.log(ids); | |||||
// console.log(ids); | |||||
setSelectedRow(ids); | setSelectedRow(ids); | ||||
setCurrentSelectedRow(ids); | setCurrentSelectedRow(ids); | ||||
}} | }} | ||||
@@ -67,8 +67,9 @@ const UserInformationCard = ({isCollectData, updateUserObject,userData,isNewReco | |||||
<MainCard elevation={0} | <MainCard elevation={0} | ||||
border={false} | border={false} | ||||
content={false} | content={false} | ||||
sx={{margin: 0}} | |||||
> | > | ||||
<Typography variant="h5" sx={{mt: 3, ml: 3, mr: 3, borderBottom: "1px solid black"}}> | |||||
<Typography variant="h6" sx={{ mt: 2, ml: 3, mr: 1, borderBottom: "1px solid black"}}> | |||||
Information | Information | ||||
</Typography> | </Typography> | ||||
@@ -236,10 +237,10 @@ const UserInformationCard = ({isCollectData, updateUserObject,userData,isNewReco | |||||
</Grid> | </Grid> | ||||
</Grid> */} | </Grid> */} | ||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> | |||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3}}> | |||||
<Grid container> | <Grid container> | ||||
<Grid item xs={4} s={4} md={4} lg={4} | <Grid item xs={4} s={4} md={4} lg={4} | ||||
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> | |||||
sx={{ml: 3, mr: 3, mb:3, display: 'flex', alignItems: 'center'}}> | |||||
<FormLabel required>Locked:</FormLabel> | <FormLabel required>Locked:</FormLabel> | ||||
</Grid> | </Grid> | ||||
@@ -10,7 +10,7 @@ import { useEffect, useState } from "react"; | |||||
import * as React from "react"; | import * as React from "react"; | ||||
import axios from "axios"; | import axios from "axios"; | ||||
import { useNavigate, useParams } from "react-router-dom"; | 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 Loadable from 'components/Loadable'; | ||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
@@ -23,7 +23,7 @@ import { | |||||
getDeletedRecordWithRefList, | getDeletedRecordWithRefList, | ||||
notifyDeleteSuccess, | notifyDeleteSuccess, | ||||
notifySaveSuccess, | notifySaveSuccess, | ||||
} from "../../../utils/CommonFunction"; | |||||
} from "utils/CommonFunction"; | |||||
import ForwardIcon from '@mui/icons-material/Forward'; | import ForwardIcon from '@mui/icons-material/Forward'; | ||||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
@@ -221,7 +221,7 @@ const UserMaintainPage = () => { | |||||
<Grid item xs={12} md={5} lg={5}> | <Grid item xs={12} md={5} lg={5}> | ||||
<Grid container> | <Grid container> | ||||
<Grid item xs={12} md={12} lg={12}> | <Grid item xs={12} md={12} lg={12}> | ||||
<Box xs={12} ml={4} mt={3} sx={{ p: 1, borderRadius: '10px', backgroundColor: '#fff' }}> | |||||
<Box xs={12} ml={4} mt={2} sx={{ borderRadius: '10px', backgroundColor: '#fff' }}> | |||||
<UserInformationCard | <UserInformationCard | ||||
updateUserObject={updateUserObject} | updateUserObject={updateUserObject} | ||||
userData={userData} | userData={userData} | ||||
@@ -231,8 +231,8 @@ const UserMaintainPage = () => { | |||||
</Box> | </Box> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12} md={12} lg={12} sx={{ mt: 3 }}> | |||||
<Box xs={12} ml={4} mt={2} sx={{ p: 1, borderRadius: '10px', backgroundColor: '#fff' }}> | |||||
<Grid item xs={12} md={12} lg={12} sx={{ mt: 0.5 }}> | |||||
<Box xs={12} ml={4} mt={2} sx={{borderRadius: '10px', backgroundColor: '#fff' }}> | |||||
<UserGroupCard | <UserGroupCard | ||||
updateUserGroupList={updateUserGroupList} | updateUserGroupList={updateUserGroupList} | ||||
userData={userData} | userData={userData} | ||||
@@ -245,7 +245,7 @@ const UserMaintainPage = () => { | |||||
</Grid> | </Grid> | ||||
{/*col 2*/} | {/*col 2*/} | ||||
<Grid item xs={12} md={7} lg={7}> | <Grid item xs={12} md={7} lg={7}> | ||||
<Box xs={12} ml={4} mt={3} mr={3} sx={{ p: 1, borderRadius: '10px', backgroundColor: '#fff' }}> | |||||
<Box xs={12} ml={2} mt={2} mr={3} sx={{ borderRadius: '10px', backgroundColor: '#fff' }}> | |||||
<UserAuthorityCard | <UserAuthorityCard | ||||
updateUserAuthList={updateUserAuthList} | updateUserAuthList={updateUserAuthList} | ||||
userData={userData} | userData={userData} | ||||
@@ -256,7 +256,7 @@ const UserMaintainPage = () => { | |||||
</Grid> | </Grid> | ||||
{/*bottom button*/} | {/*bottom button*/} | ||||
<Grid item s={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"end"} justifyContent="center"> | |||||
<Grid item s={12} md={12} lg={12} sx={{ mt:1, mb:2 }} alignItems={"end"} justifyContent="center"> | |||||
<Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | <Button | ||||
@@ -17,6 +17,8 @@ import Loadable from 'components/Loadable'; | |||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction'; | import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction'; | ||||
import {useIntl} from "react-intl"; | import {useIntl} from "react-intl"; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -150,49 +152,39 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
<Grid container maxWidth justifyContent="flex-start"> | <Grid container maxWidth justifyContent="flex-start"> | ||||
{editMode ? | {editMode ? | ||||
<> | <> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ mr: 3 }}> | <Grid item sx={{ mr: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={loadDataFun} | onClick={loadDataFun} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
color="cancel" | |||||
> | > | ||||
<Typography variant="h5">Reset & Back</Typography> | |||||
Reset & Back | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
color="success" | color="success" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | > | ||||
<Typography variant="h5">Save</Typography> | |||||
Save | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
</ThemeProvider> | |||||
</> | </> | ||||
: | : | ||||
<> | <> | ||||
<Grid item sx={{ mr: 3 }}> | <Grid item sx={{ mr: 3 }}> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
onClick={onEditClick} | onClick={onEditClick} | ||||
> | > | ||||
<Typography variant="h5">Edit</Typography> | |||||
Edit | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</> | </> | ||||
} | } | ||||
@@ -321,16 +313,14 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
})} | })} | ||||
</Grid> | </Grid> | ||||
<Grid item xs={2} sm={2} md={2} lg={2} sx={{ml:2 ,mb:2}}> | <Grid item xs={2} sm={2} md={2} lg={2} sx={{ml:2 ,mb:2}}> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
}} | |||||
onClick={onVerifiedClick} | onClick={onVerifiedClick} | ||||
> | > | ||||
<Typography variant="h5">Verify</Typography> | |||||
Verify | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</> | </> | ||||
} | } | ||||
@@ -454,31 +444,27 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
</Grid> | </Grid> | ||||
{locked ? | {locked ? | ||||
<Grid item xs={2} sm={2} md={2} lg={2} sx={{ml:2}}> | <Grid item xs={2} sm={2} md={2} lg={2} sx={{ml:2}}> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
color="success" | color="success" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
onClick={doUnlock} | onClick={doUnlock} | ||||
> | > | ||||
<Typography variant="h5">Active</Typography> | |||||
Active | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
: | : | ||||
<Grid item xs={2} sm={2} md={2} lg={2} sx={{ml:2}}> | <Grid item xs={2} sm={2} md={2} lg={2} sx={{ml:2}}> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
color="error" | color="error" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
onClick={doLock} | onClick={doLock} | ||||
> | > | ||||
<Typography variant="h5">Lock</Typography> | |||||
Lock | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
} | } | ||||
</> | </> | ||||
@@ -116,7 +116,9 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
<Grid item sx={{ mr: 3 }}> | <Grid item sx={{ mr: 3 }}> | ||||
<Button | <Button | ||||
aria-label={intl.formatMessage({id: 'back'})} | |||||
variant="contained" | variant="contained" | ||||
color="cancel" | |||||
onClick={loadDataFun} | onClick={loadDataFun} | ||||
> | > | ||||
<FormattedMessage id="resetAndBack" /> | <FormattedMessage id="resetAndBack" /> | ||||
@@ -125,6 +127,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | <Button | ||||
aria-label={intl.formatMessage({id: 'save'})} | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
color="success" | color="success" | ||||
@@ -139,6 +142,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
<Grid item sx={{ mr: 3 }}> | <Grid item sx={{ mr: 3 }}> | ||||
<Button | <Button | ||||
aria-label={intl.formatMessage({id: 'edit'})} | |||||
variant="contained" | variant="contained" | ||||
onClick={onEditClick} | onClick={onEditClick} | ||||
> | > | ||||
@@ -214,7 +218,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
<Grid xs={12} sm={12} md={12} lg={4}> | <Grid xs={12} sm={12} md={12} lg={4}> | ||||
<Grid container alignItems={"center"} sx={{mb:2}}> | <Grid container alignItems={"center"} sx={{mb:2}}> | ||||
<Grid item xs={12} sm={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}> | <Grid item xs={12} sm={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}> | ||||
<Typography variant="h5"> | |||||
<Typography variant="pnspsFormParagraphBold"> | |||||
<FormattedMessage id="idNo" />: | <FormattedMessage id="idNo" />: | ||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
@@ -120,14 +120,16 @@ const UserMaintainPage_Individual = () => { | |||||
isLoading ? | isLoading ? | ||||
<LoadingComponent /> | <LoadingComponent /> | ||||
: | : | ||||
<Grid container sx={{ backgroundColor: 'backgroundColor.default', maxWidth:'100%' }}> | |||||
<Grid container direction="column" sx={{minHeight: '90vh', backgroundColor: isGLDLoggedIn()?'backgroundColor.default':'#ffffff', maxWidth:'100%' }}> | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
{isGLDLoggedIn()? | {isGLDLoggedIn()? | ||||
<Typography ml={15} color='#FFF' variant="h4">Maintain Individual User</Typography> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block', pt:2 }}}> | |||||
Maintain Individual User | |||||
</Typography> | |||||
: | : | ||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block', pt:2 }}}> | |||||
<FormattedMessage id="userProfile" /> | <FormattedMessage id="userProfile" /> | ||||
</Typography> | </Typography> | ||||
} | } | ||||
@@ -135,7 +137,10 @@ const UserMaintainPage_Individual = () => { | |||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<Button title="Back" sx={{ ml: 3.5, mt: 2 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate("/indUser") }}> | |||||
<Button title="Back" | |||||
sx={{ ml: 3.5, mt: 2 }} style={{ border: '2px solid' }} | |||||
variant="outlined" onClick={() => { navigate(-1) }} | |||||
> | |||||
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | <ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | ||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
@@ -18,6 +18,8 @@ import Loadable from 'components/Loadable'; | |||||
import { lazy } from 'react'; | import { lazy } from 'react'; | ||||
import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction'; | import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction'; | ||||
import {useIntl} from "react-intl"; | import {useIntl} from "react-intl"; | ||||
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | |||||
import {ThemeProvider} from "@emotion/react"; | |||||
// ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
@@ -196,50 +198,39 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
<Grid container maxWidth justifyContent="flex-start"> | <Grid container maxWidth justifyContent="flex-start"> | ||||
{editMode ? | {editMode ? | ||||
<> | <> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
onClick={loadDataFun} | onClick={loadDataFun} | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
color="cancel" | |||||
> | > | ||||
<Typography variant="h5">Reset & Back</Typography> | |||||
Reset & Back | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
type="submit" | type="submit" | ||||
color="success" | color="success" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
> | > | ||||
<Typography variant="h5">Save</Typography> | |||||
Save | |||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
</ThemeProvider> | |||||
</> | </> | ||||
: | : | ||||
<> | <> | ||||
<Grid item sx={{ ml: 3, mr: 3 }}> | <Grid item sx={{ ml: 3, mr: 3 }}> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
onClick={onEditClick} | onClick={onEditClick} | ||||
> | > | ||||
<Typography variant="h5">Edit</Typography> | |||||
Edit | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</> | </> | ||||
} | } | ||||
@@ -380,17 +371,14 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
})} | })} | ||||
</Grid> | </Grid> | ||||
<Grid item xs={1} md={1} lg={1}> | <Grid item xs={1} md={1} lg={1}> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
onClick={() => { onVerifiedClick() }} | onClick={() => { onVerifiedClick() }} | ||||
> | > | ||||
<Typography variant="h5">Verify</Typography> | |||||
Verify | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
</> | </> | ||||
} | } | ||||
@@ -436,33 +424,27 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
{formik.values.locked ? | {formik.values.locked ? | ||||
<Grid item xs={1} md={1} lg={1} sx={{ ml: 1 }}> | <Grid item xs={1} md={1} lg={1} sx={{ ml: 1 }}> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
color="success" | color="success" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end' | |||||
}} | |||||
onClick={doUnlock} | onClick={doUnlock} | ||||
> | > | ||||
<Typography variant="h5">Active</Typography> | |||||
Active | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
: | : | ||||
<Grid item xs={1} md={1} lg={1} sx={{ ml: 1 }}> | <Grid item xs={1} md={1} lg={1} sx={{ ml: 1 }}> | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button | <Button | ||||
size="large" | |||||
variant="contained" | variant="contained" | ||||
color="error" | color="error" | ||||
sx={{ | |||||
textTransform: 'capitalize', | |||||
alignItems: 'end', | |||||
}} | |||||
onClick={doLock} | onClick={doLock} | ||||
> | > | ||||
<Typography variant="h5">Lock</Typography> | |||||
Lock | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
} | } | ||||
</> | </> | ||||
@@ -478,11 +460,13 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
<Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
{currentUserData.orgId == null ? | {currentUserData.orgId == null ? | ||||
<Grid item lg={2} > | <Grid item lg={2} > | ||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button variant="contained" | <Button variant="contained" | ||||
onClick={createOrgClick} | onClick={createOrgClick} | ||||
> | > | ||||
<Typography variant="h5">Create Organisation</Typography> | |||||
Create Organisation | |||||
</Button> | </Button> | ||||
</ThemeProvider> | |||||
</Grid> | </Grid> | ||||
: null | : null | ||||
} | } | ||||
@@ -577,25 +561,55 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
</form> | </form> | ||||
} | } | ||||
<div> | <div> | ||||
<Dialog open={isWarningPopUp} onClose={() => setIsWarningPopUp(false)} > | |||||
<Dialog | |||||
open={isWarningPopUp} | |||||
onClose={() => setIsWarningPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography> | ||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button onClick={() => setIsWarningPopUp(false)}><Typography variant="h5">Close</Typography></Button> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button onClick={() => setIsWarningPopUp(false)}> | |||||
Close | |||||
</Button> | |||||
</ThemeProvider> | |||||
</DialogActions> | </DialogActions> | ||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<Dialog open={isConfirmPopUp} onClose={() => setIsConfirmPopUp(false)} > | |||||
<Dialog | |||||
open={isConfirmPopUp} | |||||
onClose={() => setIsConfirmPopUp(false)} | |||||
PaperProps={{ | |||||
sx: { | |||||
minWidth: '40vw', | |||||
maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, | |||||
maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } | |||||
} | |||||
}} | |||||
> | |||||
<DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle> | ||||
<DialogContent style={{ display: 'flex', }}> | <DialogContent style={{ display: 'flex', }}> | ||||
<Typography variant="h4" style={{ padding: '16px' }}>{confirmText}</Typography> | <Typography variant="h4" style={{ padding: '16px' }}>{confirmText}</Typography> | ||||
</DialogContent> | </DialogContent> | ||||
<DialogActions> | <DialogActions> | ||||
<Button onClick={() => { setIsConfirmPopUp(false) }}><Typography variant="h5">Close</Typography></Button> | |||||
<Button onClick={() => { confirmAction?.function(); }}><Typography variant="h5">Confirm</Typography></Button> | |||||
<ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
<Button onClick={() => { setIsConfirmPopUp(false) }}> | |||||
Close | |||||
</Button> | |||||
<Button onClick={() => { confirmAction?.function(); }}> | |||||
Confirm | |||||
</Button> | |||||
</ThemeProvider> | |||||
</DialogActions> | </DialogActions> | ||||
</Dialog> | </Dialog> | ||||
</div> | </div> | ||||
@@ -114,6 +114,7 @@ const UserInformationCard_Organization_Pub = ({ userData, loadDataFun,}) => { | |||||
<Button | <Button | ||||
variant="contained" | variant="contained" | ||||
onClick={loadDataFun} | onClick={loadDataFun} | ||||
color="cancel" | |||||
> | > | ||||
<FormattedMessage id="resetAndBack" /> | <FormattedMessage id="resetAndBack" /> | ||||
@@ -181,14 +181,16 @@ const UserMaintainPage_Organization = () => { | |||||
isLoading ? | isLoading ? | ||||
<LoadingComponent /> | <LoadingComponent /> | ||||
: | : | ||||
<Grid container sx={{ backgroundColor: "backgroundColor.default" }}> | |||||
<Grid container sx={{ backgroundColor: isGLDLoggedIn()?'backgroundColor.default':'#ffffff' }}> | |||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<div style={BackgroundHead}> | <div style={BackgroundHead}> | ||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | <Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | ||||
{isGLDLoggedIn()? | {isGLDLoggedIn()? | ||||
<Typography ml={15} color='#FFF' variant="h4">Maintain Organisation User</Typography> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block', pt:2 }}}> | |||||
Maintain Organisation User | |||||
</Typography> | |||||
: | : | ||||
<Typography ml={15} color='#FFF' variant="h4"> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{display: { xs: 'none', sm: 'none', md: 'block', pt:2 }}}> | |||||
<FormattedMessage id="userProfile" /> | <FormattedMessage id="userProfile" /> | ||||
</Typography> | </Typography> | ||||
} | } | ||||
@@ -196,7 +198,7 @@ const UserMaintainPage_Organization = () => { | |||||
</div> | </div> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12}> | <Grid item xs={12}> | ||||
<Button title="Back" sx={{ ml: 3.5, mt: 2 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate("/orgUser") }}> | |||||
<Button title="Back" sx={{ ml: 3.5, mt: 2 }} style={{ border: '2px solid' }} variant="outlined" onClick={() => { navigate(-1) }}> | |||||
<ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | <ForwardIcon style={{ height: 30, width: 50, transform: "rotate(180deg)" }} /> | ||||
</Button> | </Button> | ||||
</Grid> | </Grid> | ||||
@@ -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 ? | |||||
<LoadingComponent/> | |||||
: | |||||
<MainCard elevation={0} | |||||
border={false} | |||||
content={false} | |||||
> | |||||
<Typography variant="h5" sx={{mt: 3, ml: 3, mr: 3, borderBottom: "1px solid black"}}> | |||||
Information | |||||
</Typography> | |||||
<form> | |||||
<Grid container> | |||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3, mt:3}}> | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={4} s={4} md={4} lg={4} | |||||
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> | |||||
<FormLabel required>Username:</FormLabel> | |||||
</Grid> | |||||
<Grid item xs={7} s={7} md={7} lg={6}> | |||||
<FormControl variant="outlined" fullWidth required> | |||||
<OutlinedInput | |||||
required | |||||
fullWidth | |||||
size="small" | |||||
// {...register("username", | |||||
// { | |||||
// })} | |||||
id='username' | |||||
disabled={true} | |||||
value={currentUserData.username} | |||||
/> | |||||
</FormControl> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={4} s={4} md={4} lg={4} | |||||
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> | |||||
<FormLabel required >Full Name:</FormLabel> | |||||
</Grid> | |||||
<Grid item xs={7} s={7} md={7} lg={6}> | |||||
<FormControl variant="outlined" fullWidth required> | |||||
<OutlinedInput | |||||
required | |||||
fullWidth | |||||
size="small" | |||||
value= {currentUserData.enName} | |||||
disabled={true} | |||||
// {...register("enName", | |||||
// { | |||||
// })} | |||||
id='enName' | |||||
/> | |||||
</FormControl> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={4} s={4} md={4} lg={4} | |||||
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> | |||||
<FormLabel>Post:</FormLabel> | |||||
</Grid> | |||||
<Grid item xs={7} s={7} md={7} lg={6}> | |||||
<FormControl variant="outlined" fullWidth required> | |||||
<OutlinedInput | |||||
fullWidth | |||||
size="small" | |||||
value= {currentUserData.post} | |||||
disabled={true} | |||||
// {...register("post", | |||||
// { | |||||
// })} | |||||
id='post' | |||||
/> | |||||
</FormControl> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
<Grid item xs={12} s={12} md={12} lg={12} sx={{ml: 3, mr: 3, mb: 3}}> | |||||
<Grid container alignItems={"center"}> | |||||
<Grid item xs={4} s={4} md={4} lg={4} | |||||
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> | |||||
<FormLabel required>Email:</FormLabel> | |||||
</Grid> | |||||
<Grid item xs={7} s={7} md={7} lg={6}> | |||||
<FormControl variant="outlined" fullWidth required> | |||||
<OutlinedInput | |||||
fullWidth | |||||
size="small" | |||||
value={currentUserData.emailAddress} | |||||
disabled={true} | |||||
// {...register("emailAddress", | |||||
// { | |||||
// })} | |||||
id='emailAddress' | |||||
/> | |||||
</FormControl> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
</Grid> | |||||
</form> | |||||
</MainCard> | |||||
); | |||||
}; | |||||
export default UserInformationCard; |