@@ -4,7 +4,7 @@ import { | |||
DataGrid, GridOverlay, | |||
} from "@mui/x-data-grid"; | |||
import {FormattedMessage, useIntl} from "react-intl"; | |||
import {Typography} from '@mui/material'; | |||
import {TablePagination, Typography} from '@mui/material'; | |||
// ==============================|| EVENT TABLE ||============================== // | |||
@@ -124,27 +124,12 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||
return ( | |||
<GridOverlay> | |||
<Typography variant="body1"> | |||
<FormattedMessage id="rowsPerPage" /> | |||
<FormattedMessage id="noRecordFound" /> | |||
</Typography> | |||
</GridOverlay> | |||
); | |||
} | |||
const CustomPagination = (props) => { | |||
const { pagination } = props; | |||
const { page, pageSize, rowCount } = pagination; | |||
const startIndex = page * pageSize + 1; | |||
const endIndex = Math.min((page + 1) * pageSize, rowCount); | |||
return ( | |||
<div> | |||
<div>{`${startIndex}-${endIndex} YES ${rowCount}`}</div> | |||
{/* Render other pagination controls */} | |||
</div> | |||
); | |||
}; | |||
return ( | |||
<DataGrid | |||
{...props} | |||
@@ -164,11 +149,19 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||
) | |||
}} | |||
components={{ | |||
Pagination: CustomPagination, | |||
Pagination: () => ( | |||
<TablePagination | |||
labelDisplayedRows={ | |||
({ from, to, count }) => { | |||
return '' + from + '-' + to + ' ' + count | |||
} | |||
} | |||
/> | |||
), | |||
}} | |||
componentsProps={{ | |||
pagination: { | |||
labelRowsPerPage: intl.formatMessage({id: 'rowsPerPage'}), | |||
labelRowsPerPage: intl.formatMessage({id: 'rowsPerPage'}) + ":", | |||
} | |||
}} | |||
/> | |||
@@ -144,6 +144,7 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p | |||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 1 }}> | |||
<Autocomplete | |||
disablePortal | |||
size="small" | |||
id="issueId" | |||
options={issueCombo} | |||
value={issueSelected} | |||
@@ -105,6 +105,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||
{...register("issueId")} | |||
disablePortal | |||
id="issueId" | |||
size="small" | |||
options={issueCombo} | |||
value={issueSelected} | |||
inputValue={(issueSelected?.id) ? getIssueLabel(issueSelected) : ""} | |||
@@ -145,6 +146,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||
{...register("orgId")} | |||
disablePortal | |||
id="orgId" | |||
size="small" | |||
options={orgCombo} | |||
value={orgSelected} | |||
inputValue={(orgSelected?.label) ? orgSelected?.label : ""} | |||
@@ -220,6 +222,7 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||
<Autocomplete | |||
multiple | |||
size="small" | |||
{...register("status")} | |||
id="status" | |||
options={ComboData.denmandNoteStatus} | |||
@@ -258,20 +261,17 @@ const SearchDemandNoteForm = ({ applySearch, orgComboData, searchCriteria, issue | |||
{/*last row*/} | |||
<Grid container maxWidth justifyContent="flex-end"> | |||
<Grid item sx={{ ml: 3, mr: 3, mb: 3, mt: 3 }}> | |||
<Grid item sx={{ ml: 3, mr: 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 }}> | |||
<Grid item sx={{ ml: 3, mr: 3}}> | |||
<Button | |||
size="large" | |||
variant="contained" | |||
@@ -79,7 +79,7 @@ const Index = () => { | |||
<Grid container justifyContent="flex-start" alignItems="center" > | |||
<center> | |||
<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} | |||
</Typography> | |||
<Typography sx={{p:1}} align="justify">{DateUtils.datetimeStr(record?.sentDate)}</Typography> | |||
@@ -87,7 +87,7 @@ const Index = () => { | |||
<div dangerouslySetInnerHTML={{__html: record?.content}}></div> | |||
</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 | |||
component="span" | |||
variant="contained" | |||
@@ -138,6 +138,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria }) => { | |||
<Autocomplete | |||
{...register("status")} | |||
disablePortal={false} | |||
size="small" | |||
id="status" | |||
filterOptions={(options) => options} | |||
options={ComboData.paymentStatus} | |||
@@ -132,6 +132,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||
<Autocomplete | |||
{...register("issueId")} | |||
disablePortal | |||
size="small" | |||
id="issueId" | |||
options={issueCombo} | |||
value={issueSelected} | |||
@@ -155,6 +156,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||
<Autocomplete | |||
{...register("gazettGroup")} | |||
disablePortal | |||
size="small" | |||
id="gazettGroup" | |||
options={ComboData.groupTitle} | |||
value={groupSelected} | |||
@@ -229,6 +231,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||
{...register("status")} | |||
disablePortal | |||
id="status" | |||
size="small" | |||
filterOptions={(options) => options} | |||
options={ComboData.proofStatus} | |||
value={status} | |||
@@ -256,6 +259,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||
{...register("orgId")} | |||
disablePortal={false} | |||
id="orgId" | |||
size="small" | |||
options={orgCombo} | |||
value={orgSelected} | |||
inputValue={(orgSelected?.label) ? orgSelected?.label : ""} | |||
@@ -237,6 +237,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||
disablePortal | |||
id="orgId" | |||
options={orgCombo} | |||
size="small" | |||
value={orgSelected} | |||
inputValue={(orgSelected?.label) ? orgSelected?.label : ""} | |||
onChange={(event, newValue) => { | |||
@@ -261,6 +262,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria, iss | |||
<Autocomplete | |||
{...register("issueId")} | |||
disablePortal | |||
size="small" | |||
id="issueId" | |||
size="small" | |||
options={issueCombo} | |||
@@ -20,22 +20,18 @@ export default function UserAuthTable({setSelectedRow, userAuth,isNewRecord}) { | |||
const [onReady, setOnReady] = useState(false); | |||
const [currentSelectedRow, setCurrentSelectedRow] = useState(userAuth); | |||
const _sx = { | |||
ml: 3, | |||
mb: 3, | |||
mr: 3, | |||
padding: "4 2 4 2", | |||
boxShadow: 1, | |||
border: 1, | |||
borderColor: '#DDD', | |||
'& .MuiDataGrid-cell': { | |||
borderTop: 1, | |||
borderBottom: 1, | |||
//borderBottom: 1, | |||
borderColor: "#EEE" | |||
}, | |||
'& .MuiDataGrid-footerContainer': { | |||
border: 1, | |||
borderColor: "#EEE" | |||
} | |||
// '& .MuiDataGrid-footerContainer': { | |||
// border: 1, | |||
// borderColor: "#EEE" | |||
// } | |||
} | |||
useEffect(() => { | |||
axios.get(`${apiPath}${GET_AUTH_LIST}`) | |||
@@ -49,8 +49,9 @@ const UserAuthorityCard = ({ isCollectData, updateUserAuthList, userData, isNewR | |||
<MainCard elevation={0} | |||
border={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 | |||
</Typography> | |||
@@ -49,8 +49,9 @@ const UserGroupCard = ({isCollectData, updateUserGroupList,userData,isNewRecord} | |||
<MainCard elevation={0} | |||
border={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) | |||
</Typography> | |||
<UserGroupTable | |||
@@ -19,9 +19,6 @@ export default function UserGroupTable({setSelectedRow, userGroup,isNewRecord}) | |||
const [currentSelectedRow, setCurrentSelectedRow] = useState(userGroup); | |||
const _sx = { | |||
ml: 3, | |||
mb: 3, | |||
mr: 3, | |||
padding: "4 2 4 2", | |||
boxShadow: 1, | |||
border: 1, | |||
@@ -67,8 +67,9 @@ const UserInformationCard = ({isCollectData, updateUserObject,userData,isNewReco | |||
<MainCard elevation={0} | |||
border={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 | |||
</Typography> | |||
@@ -236,10 +237,10 @@ const UserInformationCard = ({isCollectData, updateUserObject,userData,isNewReco | |||
</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 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> | |||
</Grid> | |||
@@ -221,7 +221,7 @@ const UserMaintainPage = () => { | |||
<Grid item xs={12} md={5} lg={5}> | |||
<Grid container> | |||
<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 | |||
updateUserObject={updateUserObject} | |||
userData={userData} | |||
@@ -231,8 +231,8 @@ const UserMaintainPage = () => { | |||
</Box> | |||
</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 | |||
updateUserGroupList={updateUserGroupList} | |||
userData={userData} | |||
@@ -245,7 +245,7 @@ const UserMaintainPage = () => { | |||
</Grid> | |||
{/*col 2*/} | |||
<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 | |||
updateUserAuthList={updateUserAuthList} | |||
userData={userData} | |||
@@ -256,7 +256,7 @@ const UserMaintainPage = () => { | |||
</Grid> | |||
{/*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 item sx={{ ml: 3, mr: 3 }}> | |||
<Button | |||
@@ -110,6 +110,7 @@ const UserSearchForm_Individual = ({ applySearch }) => { | |||
{...register("accountFilter")} | |||
disablePortal | |||
id="accountFilter" | |||
size="small" | |||
options={["Active", "Locked", "Not verified"]} | |||
value={accountFilter} | |||
onChange={(event, newValue) => { | |||
@@ -139,6 +139,7 @@ const UserSearchForm_Organization = ({applySearch}) => { | |||
{...register("accountFilter")} | |||
disablePortal | |||
id="accountFilter" | |||
size="small" | |||
options={["All", "Active","Locked","Not verified"]} | |||
value={accountFilter} | |||
onChange={(event, newValue) => { | |||
@@ -1,4 +1,4 @@ | |||
import React, {useEffect, useState} from 'react'; | |||
import React, {useContext, useEffect, useState} from 'react'; | |||
import {useNavigate} from 'react-router-dom'; | |||
// material-ui | |||
@@ -36,6 +36,7 @@ import {useDispatch} from "react-redux"; | |||
import {handleLogin} from "auth/index"; | |||
import { notifyActionSuccess } from 'utils/CommonFunction'; | |||
import {FormattedMessage} from "react-intl"; | |||
import LocaleContext from "../../../components/I18nProvider"; | |||
// ============================|| FIREBASE - LOGIN ||============================ // | |||
const AuthLogin = () => { | |||
@@ -69,6 +70,7 @@ const AuthLogin = () => { | |||
}) | |||
.then((response) => { | |||
//setPosts("12354") | |||
console.log(response.data); | |||
setPosts(response.data); | |||
const userData = { | |||
id: response.data.id, | |||
@@ -1,7 +1,7 @@ | |||
import React, { | |||
useEffect, | |||
useState, | |||
lazy | |||
lazy, useContext | |||
} from 'react'; | |||
import { Link as RouterLink } from 'react-router-dom'; | |||
import { useNavigate } from 'react-router-dom'; | |||
@@ -45,12 +45,14 @@ import { handleLogin } from "auth/index"; | |||
import useJwt from "../../../auth/jwt/useJwt"; | |||
import { handleLogoutFunction } from 'auth/index'; | |||
import {FormattedMessage, useIntl} from "react-intl"; | |||
import LocaleContext from "../../../components/I18nProvider"; | |||
// ============================|| FIREBASE - LOGIN ||============================ // | |||
const AuthLoginCustom = () => { | |||
const dispatch = useDispatch() | |||
const navigate = useNavigate() | |||
const intl = useIntl(); | |||
const { setLocale } = useContext(LocaleContext); | |||
const [showPassword, setShowPassword] = useState(false); | |||
const handleClickShowPassword = () => { | |||
@@ -88,6 +90,11 @@ const AuthLoginCustom = () => { | |||
} | |||
const data = { ...userData, accessToken: response.data.accessToken, refreshToken: response.data.refreshToken } | |||
// setSuccess(true) | |||
console.log(response.data.role); | |||
if(response.data.type === "GLD"){ | |||
setLocale("en"); | |||
localStorage.setItem('locale','en'); | |||
} | |||
dispatch(handleLogin(data)) | |||
navigate('/dashboard'); | |||
location.reload() | |||
@@ -79,14 +79,10 @@ const UserGroupSearchForm = ({ applySearch }) => { | |||
> | |||
<Grid item xs={3} md={3} sx={{ ml: 3, mr: 1 }}> | |||
<Button | |||
size="large" | |||
variant="contained" | |||
onClick={handleNewGroupClick} | |||
sx={{ | |||
textTransform: 'capitalize', | |||
alignItems: 'end', | |||
}}> | |||
<AddCircleOutlineIcon sx={{ mr: 1, mb: 0.5 }} /> | |||
startIcon={<AddCircleOutlineIcon sx={{alignItems:"center"}}/>} | |||
> | |||
<Typography variant="h5">New Group</Typography> | |||
</Button> | |||
</Grid> | |||
@@ -77,7 +77,7 @@ export const PNSPS_THEME = createTheme({ | |||
}, | |||
'&.MuiButton-root':{ | |||
fontSize: '1.2rem', | |||
alignItems: 'normal', | |||
alignItems: 'center', | |||
}, | |||
} | |||
} | |||
@@ -355,6 +355,10 @@ | |||
"district": "District", | |||
"noRecordFound": "No record found", | |||
"rowsPerPage": "Rows Per Page", | |||
"date" : "Date", | |||
"keyword": "Key word", | |||
"dateFrom": "Date(From)", | |||
"dateTo": "Date(To)", | |||
"Dashboard": "Dashboard", | |||
"event": "Event" |
@@ -355,6 +355,10 @@ | |||
"district": "区", | |||
"noRecordFound": "找不到記錄", | |||
"rowsPerPage": "每页项数", | |||
"date" : "日期", | |||
"keyword": "关键字", | |||
"dateFrom": "日期(从)", | |||
"dateTo": "日期(到)", | |||
"Dashboard": "仪表板", | |||
"event": "活动" |
@@ -355,6 +355,10 @@ | |||
"district": "區", | |||
"noRecordFound": "找不到記錄", | |||
"rowsPerPage": "每頁項數", | |||
"date" : "日期", | |||
"keyword": "關鍵字", | |||
"dateFrom": "日期(從)", | |||
"dateTo": "日期(到)", | |||
"Dashboard": "儀表板", | |||
"event": "活動" |