| @@ -95,7 +95,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight, | |||||
| if (customPageSize) { | if (customPageSize) { | ||||
| setPageSize(customPageSize); | setPageSize(customPageSize); | ||||
| } | } | ||||
| console.log(_doLoad) | |||||
| // console.log(_doLoad) | |||||
| if (_doLoad !== undefined && Object.keys(_doLoad).length==0 ){ | if (_doLoad !== undefined && Object.keys(_doLoad).length==0 ){ | ||||
| setLoading(false) | setLoading(false) | ||||
| if (applyGridOnReady !== undefined){ | if (applyGridOnReady !== undefined){ | ||||
| @@ -109,9 +109,13 @@ function Header(props) { | |||||
| </Typography> | </Typography> | ||||
| </Link> | </Link> | ||||
| </li> | </li> | ||||
| <li> | |||||
| <Link className="application" to='/application/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Application</Typography></Link> | |||||
| </li> | |||||
| { | |||||
| isGrantedAny(["VIEW_APPLICATION", "MAINTAIN_APPLICATION"]) ? | |||||
| <li> | |||||
| <Link className="application" to='/application/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Application</Typography></Link> | |||||
| </li> | |||||
| : <></> | |||||
| } | |||||
| { | { | ||||
| isGrantedAny(["VIEW_PROOF", "MAINTAIN_PROOF"]) ? | isGrantedAny(["VIEW_PROOF", "MAINTAIN_PROOF"]) ? | ||||
| <li> | <li> | ||||
| @@ -198,12 +202,12 @@ function Header(props) { | |||||
| } | } | ||||
| { | { | ||||
| isGrantedAny(["VIEW_USER", "MAINTAIN_USER", "VIEW_ORG", "MAINTAIN_ORG", "VIEW_GROUP", "MAINTAIN_GROUP"]) ? | |||||
| isGrantedAny(["VIEW_USER", "MAINTAIN_USER", "VIEW_ORG", "MAINTAIN_ORG", "VIEW_GROUP", "MAINTAIN_GROUP", "VIEW_GLD_USER", "VIEW_IND_USER", "VIEW_ORG_USER", "MAINTAIN_GLD_USER", "MAINTAIN_IND_USER", "MAINTAIN_ORG_USER"]) ? | |||||
| <li> | <li> | ||||
| <Link className="client" ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Client</Typography><KeyboardArrowDownIcon sx={{ fontSize: '1vw' }} /></Link> | <Link className="client" ><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}>Client</Typography><KeyboardArrowDownIcon sx={{ fontSize: '1vw' }} /></Link> | ||||
| <ul className='dropdown'> | <ul className='dropdown'> | ||||
| { | { | ||||
| isGrantedAny(["VIEW_USER", "MAINTAIN_USER"]) ? | |||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER"]) ? | |||||
| <> | <> | ||||
| <li> | <li> | ||||
| <Link className="userSearchview" to='/userSearchview'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (GLD)</Typography></Link> | <Link className="userSearchview" to='/userSearchview'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (GLD)</Typography></Link> | ||||
| @@ -216,9 +220,27 @@ function Header(props) { | |||||
| </li> | </li> | ||||
| </> | </> | ||||
| : | : | ||||
| <></> | |||||
| <> | |||||
| { | |||||
| isGrantedAny(["VIEW_GLD_USER" ,"MAINTAIN_GLD_USER"]) ? | |||||
| <li> | |||||
| <Link className="userSearchview" to='/userSearchview'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (GLD)</Typography></Link> | |||||
| </li> : <></> | |||||
| } | |||||
| { | |||||
| isGrantedAny(["VIEW_IND_USER", "MAINTAIN_IND_USER"]) ? | |||||
| <li> | |||||
| <Link className="indUser" to='/indUser'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (Individual)</Typography></Link> | |||||
| </li> : <></> | |||||
| } | |||||
| { | |||||
| isGrantedAny(["VIEW_ORG_USER", "MAINTAIN_ORG_USER"]) ? | |||||
| <li> | |||||
| <Link className="orgUser" to='/orgUser'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Users (Organisation)</Typography></Link> | |||||
| </li> : <></> | |||||
| } | |||||
| </> | |||||
| } | } | ||||
| { | { | ||||
| isGrantedAny(["VIEW_ORG", "MAINTAIN_ORG"]) ? | isGrantedAny(["VIEW_ORG", "MAINTAIN_ORG"]) ? | ||||
| <li> | <li> | ||||
| @@ -227,7 +249,6 @@ function Header(props) { | |||||
| : | : | ||||
| <></> | <></> | ||||
| } | } | ||||
| { | { | ||||
| isGrantedAny(["VIEW_GROUP", "MAINTAIN_GROUP"]) ? | isGrantedAny(["VIEW_GROUP", "MAINTAIN_GROUP"]) ? | ||||
| <li> | <li> | ||||
| @@ -256,7 +277,7 @@ function Header(props) { | |||||
| </Link> | </Link> | ||||
| </li> | </li> | ||||
| { | { | ||||
| isGranted("MAINTAIN_GAZETTE_ISSUE") ? | |||||
| isGranted("VIEW_GAZETTE_ISSUE", "MAINTAIN_GAZETTE_ISSUE") ? | |||||
| <> | <> | ||||
| <li> | <li> | ||||
| <Link className="holidaySetting" to='/setting/holiday'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Holiday Settings</Typography></Link> | <Link className="holidaySetting" to='/setting/holiday'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 2, mt: 1, mb: 1 }}>Holiday Settings</Typography></Link> | ||||
| @@ -31,6 +31,7 @@ import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; | |||||
| import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
| import { dateStr_Year } from "utils/DateUtils"; | import { dateStr_Year } from "utils/DateUtils"; | ||||
| import { notifySaveSuccess } from 'utils/CommonFunction'; | import { notifySaveSuccess } from 'utils/CommonFunction'; | ||||
| import { isGrantedAny } from "auth/utils"; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -192,35 +193,37 @@ const Index = () => { | |||||
| /> | /> | ||||
| </Grid> | </Grid> | ||||
| } | } | ||||
| <Grid item xs={12} md={12} lg={6} width="100%"> | |||||
| <Stack direction="row" justifyContent="flex-start" alignItems="center" spacing={2} sx={{ml:2,mt:1}} > | |||||
| <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | |||||
| <input | |||||
| id="uploadFileBtn" | |||||
| name="file" | |||||
| type="file" | |||||
| accept=".xlsx" | |||||
| style={{ display: 'none' }} | |||||
| disabled={waitImport} | |||||
| onChange={(event) => { | |||||
| readFile(event) | |||||
| }} | |||||
| /> | |||||
| <label htmlFor="uploadFileBtn"> | |||||
| <Button | |||||
| component="span" | |||||
| variant="contained" | |||||
| size="large" | |||||
| {isGrantedAny(["MAINTAIN_GAZETTE_ISSUE"]) ? | |||||
| <Grid item xs={12} md={12} lg={6} width="100%"> | |||||
| <Stack direction="row" justifyContent="flex-start" alignItems="center" spacing={2} sx={{ml:2,mt:1}} > | |||||
| <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | |||||
| <input | |||||
| id="uploadFileBtn" | |||||
| name="file" | |||||
| type="file" | |||||
| accept=".xlsx" | |||||
| style={{ display: 'none' }} | |||||
| disabled={waitImport} | disabled={waitImport} | ||||
| > | |||||
| <Typography variant="h5">Upload Files</Typography> | |||||
| </Button> | |||||
| </label> | |||||
| </ThemeProvider> | |||||
| </Stack> | |||||
| </Grid> | |||||
| onChange={(event) => { | |||||
| readFile(event) | |||||
| }} | |||||
| /> | |||||
| <label htmlFor="uploadFileBtn"> | |||||
| <Button | |||||
| component="span" | |||||
| variant="contained" | |||||
| size="large" | |||||
| disabled={waitImport} | |||||
| > | |||||
| <Typography variant="h5">Upload Files</Typography> | |||||
| </Button> | |||||
| </label> | |||||
| </ThemeProvider> | |||||
| </Stack> | |||||
| </Grid> | |||||
| :null | |||||
| } | |||||
| {/*row 1*/} | {/*row 1*/} | ||||
| <Grid item xs={12} md={12} lg={12} width="100%"> | <Grid item xs={12} md={12} lg={12} width="100%"> | ||||
| <SearchForm | <SearchForm | ||||
| @@ -32,6 +32,7 @@ import {PNSPS_LONG_BUTTON_THEME} from "themes/buttonConst"; | |||||
| import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
| import { dateStr_Year } from "utils/DateUtils"; | import { dateStr_Year } from "utils/DateUtils"; | ||||
| import { notifySaveSuccess } from 'utils/CommonFunction'; | import { notifySaveSuccess } from 'utils/CommonFunction'; | ||||
| import { isGrantedAny } from "auth/utils"; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -194,31 +195,32 @@ const Index = () => { | |||||
| </Button> | </Button> | ||||
| </label> | </label> | ||||
| </ThemeProvider> | </ThemeProvider> | ||||
| <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | |||||
| <input | |||||
| id="uploadFileBtn" | |||||
| name="file" | |||||
| type="file" | |||||
| accept=".xlsx" | |||||
| style={{ display: 'none' }} | |||||
| disabled={waitImport} | |||||
| onChange={(event) => { | |||||
| readFile(event) | |||||
| }} | |||||
| /> | |||||
| <label htmlFor="uploadFileBtn"> | |||||
| <Button | |||||
| component="span" | |||||
| variant="contained" | |||||
| size="large" | |||||
| {isGrantedAny(["MAINTAIN_GAZETTE_ISSUE"]) ? | |||||
| <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | |||||
| <input | |||||
| id="uploadFileBtn" | |||||
| name="file" | |||||
| type="file" | |||||
| accept=".xlsx" | |||||
| style={{ display: 'none' }} | |||||
| disabled={waitImport} | disabled={waitImport} | ||||
| > | |||||
| <Typography variant="h5">Upload Files</Typography> | |||||
| </Button> | |||||
| </label> | |||||
| </ThemeProvider> | |||||
| onChange={(event) => { | |||||
| readFile(event) | |||||
| }} | |||||
| /> | |||||
| <label htmlFor="uploadFileBtn"> | |||||
| <Button | |||||
| component="span" | |||||
| variant="contained" | |||||
| size="large" | |||||
| disabled={waitImport} | |||||
| > | |||||
| <Typography variant="h5">Upload Files</Typography> | |||||
| </Button> | |||||
| </label> | |||||
| </ThemeProvider> | |||||
| :null | |||||
| } | |||||
| </Stack> | </Stack> | ||||
| </Grid> | </Grid> | ||||
| @@ -32,6 +32,7 @@ import EditNoteIcon from '@mui/icons-material/EditNote'; | |||||
| import DownloadIcon from '@mui/icons-material/Download'; | import DownloadIcon from '@mui/icons-material/Download'; | ||||
| import ReplayIcon from '@mui/icons-material/Replay'; | import ReplayIcon from '@mui/icons-material/Replay'; | ||||
| import { notifyDownloadSuccess } from 'utils/CommonFunction'; | import { notifyDownloadSuccess } from 'utils/CommonFunction'; | ||||
| import { isGrantedAny } from "auth/utils"; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| const ApplicationDetailCard = ( | const ApplicationDetailCard = ( | ||||
| @@ -196,116 +197,101 @@ const ApplicationDetailCard = ( | |||||
| content={false} | content={false} | ||||
| > | > | ||||
| {verified && currentApplicationDetailData.status !== "notAccepted" ? | {verified && currentApplicationDetailData.status !== "notAccepted" ? | ||||
| <Grid container spacing={4} direction="row"> | |||||
| <Grid item xs={12} md={4} > | |||||
| <Stack | |||||
| direction="row" | |||||
| justifyContent="flex-start" | |||||
| alignItems="center" | |||||
| spacing={2} | |||||
| mb={2} | |||||
| > | |||||
| {currentApplicationDetailData.status === "reviewed" && isGranted("MAINTAIN_PROOF") ? | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={() => { onProofClick() }} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end' | |||||
| }}> | |||||
| <EditNoteIcon /> | |||||
| <Typography ml={1} variant="h5"> Create Proof</Typography> | |||||
| </Button> : | |||||
| null | |||||
| } | |||||
| </Stack> | |||||
| </Grid> | |||||
| <Grid item xs={12} md={8} > | |||||
| <Stack | |||||
| direction="row" | |||||
| justifyContent="flex-start" | |||||
| alignItems="center" | |||||
| spacing={2} | |||||
| mb={2} | |||||
| > | |||||
| { | |||||
| !(orgDetail?.creditor) && currentApplicationDetailData.creditor && currentApplicationDetailData.status === "published" ? | |||||
| <> | |||||
| <Button | |||||
| variant="contained" | |||||
| onClick={paidClick()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| }}> | |||||
| <DoneIcon /> | |||||
| <Typography ml={1} variant="h5">Paid</Typography> | |||||
| </Button> | |||||
| </> | |||||
| : | |||||
| <></> | |||||
| } | |||||
| {currentApplicationDetailData.status === "submitted" || currentApplicationDetailData.status == "reviewed" ? | |||||
| <> | |||||
| isGrantedAny("MAINTAIN_APPLICATION") ? | |||||
| <Grid container spacing={4} direction="row"> | |||||
| <Grid item xs={12} md={4} > | |||||
| <Stack | |||||
| direction="row" | |||||
| justifyContent="flex-start" | |||||
| alignItems="center" | |||||
| spacing={2} | |||||
| mb={2} | |||||
| > | |||||
| {currentApplicationDetailData.status === "reviewed" && isGranted("MAINTAIN_PROOF") ? | |||||
| <Button | <Button | ||||
| // size="large" | // size="large" | ||||
| variant="contained" | variant="contained" | ||||
| onClick={reSubmitClick()} | |||||
| color="orange" | |||||
| > | |||||
| <ReplayIcon /> | |||||
| <Typography ml={1} variant="h5"> Re-Submit</Typography> | |||||
| </Button> | |||||
| { | |||||
| proofId == null || proofId == 0? | |||||
| onClick={() => { onProofClick() }} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end' | |||||
| }}> | |||||
| <EditNoteIcon /> | |||||
| <Typography ml={1} variant="h5"> Create Proof</Typography> | |||||
| </Button> : | |||||
| null | |||||
| } | |||||
| </Stack> | |||||
| </Grid> | |||||
| <Grid item xs={12} md={8} > | |||||
| <Stack | |||||
| direction="row" | |||||
| justifyContent="flex-start" | |||||
| alignItems="center" | |||||
| spacing={2} | |||||
| mb={2} | |||||
| > | |||||
| { | |||||
| !(orgDetail?.creditor) && currentApplicationDetailData.creditor && currentApplicationDetailData.status === "published" ? | |||||
| <> | |||||
| <Button | <Button | ||||
| // size="large" | |||||
| variant="contained" | variant="contained" | ||||
| onClick={notAcceptedClick()} | |||||
| color="error" | |||||
| onClick={paidClick()} | |||||
| sx={{ | sx={{ | ||||
| textTransform: 'capitalize', | textTransform: 'capitalize', | ||||
| alignItems: 'end', | alignItems: 'end', | ||||
| }}> | }}> | ||||
| <CloseIcon /> | |||||
| <Typography ml={1} variant="h5">Not Accept</Typography> | |||||
| <DoneIcon /> | |||||
| <Typography ml={1} variant="h5">Paid</Typography> | |||||
| </Button> | </Button> | ||||
| : | |||||
| null | |||||
| } | |||||
| </> : | |||||
| (currentApplicationDetailData.status == "confirmed" && currentApplicationDetailData.creditor == 1) ? | |||||
| </> | |||||
| : | |||||
| <></> | |||||
| } | |||||
| {currentApplicationDetailData.status === "submitted" || currentApplicationDetailData.status == "reviewed" ? | |||||
| <> | <> | ||||
| <Button | <Button | ||||
| // size="large" | // size="large" | ||||
| variant="contained" | variant="contained" | ||||
| onClick={doPublish()} | |||||
| disabled={setCompleteDisable()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#52b202' | |||||
| }}> | |||||
| <DoneIcon /> | |||||
| <Typography ml={1} variant="h5">Publish</Typography> | |||||
| </Button> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={withdrawnClick()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#ffa733' | |||||
| }}> | |||||
| <CloseIcon /> | |||||
| <Typography ml={1} variant="h5">Withdraw</Typography> | |||||
| onClick={reSubmitClick()} | |||||
| color="orange" | |||||
| > | |||||
| <ReplayIcon /> | |||||
| <Typography ml={1} variant="h5"> Re-Submit</Typography> | |||||
| </Button> | </Button> | ||||
| </> | |||||
| : | |||||
| (currentApplicationDetailData.status == "confirmed" && currentApplicationDetailData.creditor == 0) ? | |||||
| { | |||||
| proofId == null || proofId == 0? | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={notAcceptedClick()} | |||||
| color="error" | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| }}> | |||||
| <CloseIcon /> | |||||
| <Typography ml={1} variant="h5">Not Accept</Typography> | |||||
| </Button> | |||||
| : | |||||
| null | |||||
| } | |||||
| </> : | |||||
| (currentApplicationDetailData.status == "confirmed" && currentApplicationDetailData.creditor == 1) ? | |||||
| <> | <> | ||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={doPublish()} | |||||
| disabled={setCompleteDisable()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#52b202' | |||||
| }}> | |||||
| <DoneIcon /> | |||||
| <Typography ml={1} variant="h5">Publish</Typography> | |||||
| </Button> | |||||
| <Button | <Button | ||||
| // size="large" | // size="large" | ||||
| variant="contained" | variant="contained" | ||||
| @@ -320,56 +306,74 @@ const ApplicationDetailCard = ( | |||||
| </Button> | </Button> | ||||
| </> | </> | ||||
| : | : | ||||
| ( | |||||
| (currentApplicationDetailData.status == "paid" && currentApplicationDetailData.creditor == 0) ? | |||||
| <> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={revokeClick()} | |||||
| disabled={currentApplicationDetailData.paymentMethod == "online" || currentApplicationDetailData.paymentMethod == null} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#ffa733' | |||||
| }}> | |||||
| <ReplayIcon /> | |||||
| <Typography ml={1} variant="h5">Revoke Payment</Typography> | |||||
| </Button> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={complatedClick()} | |||||
| disabled={setCompleteDisable()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#52b202' | |||||
| }}> | |||||
| <DoneIcon /> | |||||
| <Typography ml={1} variant="h5">Publish</Typography> | |||||
| </Button> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={withdrawnClick()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#ffa733' | |||||
| }}> | |||||
| <CloseIcon /> | |||||
| <Typography ml={1} variant="h5">Withdraw</Typography> | |||||
| </Button> | |||||
| </> : null | |||||
| ) | |||||
| } | |||||
| </Stack> | |||||
| </Grid> | |||||
| </Grid> : null | |||||
| (currentApplicationDetailData.status == "confirmed" && currentApplicationDetailData.creditor == 0) ? | |||||
| <> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={withdrawnClick()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#ffa733' | |||||
| }}> | |||||
| <CloseIcon /> | |||||
| <Typography ml={1} variant="h5">Withdraw</Typography> | |||||
| </Button> | |||||
| </> | |||||
| : | |||||
| ( | |||||
| (currentApplicationDetailData.status == "paid" && currentApplicationDetailData.creditor == 0) ? | |||||
| <> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={revokeClick()} | |||||
| disabled={currentApplicationDetailData.paymentMethod == "online" || currentApplicationDetailData.paymentMethod == null} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#ffa733' | |||||
| }}> | |||||
| <ReplayIcon /> | |||||
| <Typography ml={1} variant="h5">Revoke Payment</Typography> | |||||
| </Button> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={complatedClick()} | |||||
| disabled={setCompleteDisable()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#52b202' | |||||
| }}> | |||||
| <DoneIcon /> | |||||
| <Typography ml={1} variant="h5">Publish</Typography> | |||||
| </Button> | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={withdrawnClick()} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end', | |||||
| backgroundColor: '#ffa733' | |||||
| }}> | |||||
| <CloseIcon /> | |||||
| <Typography ml={1} variant="h5">Withdraw</Typography> | |||||
| </Button> | |||||
| </> : null | |||||
| ) | |||||
| } | |||||
| </Stack> | |||||
| </Grid> | |||||
| </Grid> | |||||
| : null | |||||
| : null | |||||
| } | } | ||||
| <Typography variant="h4" xs={12} md={12} sx={{ mb: 2, borderBottom: "1px solid black" }}> | <Typography variant="h4" xs={12} md={12} sx={{ mb: 2, borderBottom: "1px solid black" }}> | ||||
| Application Details | Application Details | ||||
| @@ -145,7 +145,7 @@ const ClientDetailCard = ( | |||||
| content={false} | content={false} | ||||
| sx={{ xs: "12", md: "7" }}> | sx={{ xs: "12", md: "7" }}> | ||||
| {isGrantedAny(["VIEW_USER", "MAINTAIN_USER"]) ? | |||||
| {isGrantedAny(["VIEW_USER", "MAINTAIN_USER", "VIEW_IND_USER", "VIEW_ORG_USER", "MAINTAIN_IND_USER", "MAINTAIN_ORG_USER"]) ? | |||||
| <Grid container spacing={1} direction="row"> | <Grid container spacing={1} direction="row"> | ||||
| <Grid item xs={12} md={7} > | <Grid item xs={12} md={7} > | ||||
| <Stack | <Stack | ||||
| @@ -19,7 +19,7 @@ import Loadable from 'components/Loadable'; | |||||
| const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); | ||||
| import * as DateUtils from "utils/DateUtils"; | import * as DateUtils from "utils/DateUtils"; | ||||
| import EditNoteIcon from '@mui/icons-material/EditNote'; | import EditNoteIcon from '@mui/icons-material/EditNote'; | ||||
| import { isGrantedAny } from "auth/utils"; | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| const GazetteDetailCard = ( | const GazetteDetailCard = ( | ||||
| { applicationDetailData, | { applicationDetailData, | ||||
| @@ -89,31 +89,34 @@ const GazetteDetailCard = ( | |||||
| content={false} | content={false} | ||||
| > | > | ||||
| {verified && currentStatus != "notAccepted" ? | {verified && currentStatus != "notAccepted" ? | ||||
| <Grid container spacing={4} direction="row"> | |||||
| <Grid item xs={12} md={4} > | |||||
| <Stack | |||||
| direction="row" | |||||
| justifyContent="space-between" | |||||
| alignItems="center" | |||||
| spacing={2} | |||||
| mb={2} | |||||
| > | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={groupDetailClick()} | |||||
| disabled={applicationDetailData.data.status != "submitted" && applicationDetailData.data.status != "reviewed"} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end' | |||||
| }}> | |||||
| <EditNoteIcon /> | |||||
| <Typography variant="h5" ml={1}> Gen Gazette Code</Typography> | |||||
| </Button> | |||||
| </Stack> | |||||
| isGrantedAny("MAINTAIN_APPLICATION") ? | |||||
| <Grid container spacing={4} direction="row"> | |||||
| <Grid item xs={12} md={4} > | |||||
| <Stack | |||||
| direction="row" | |||||
| justifyContent="space-between" | |||||
| alignItems="center" | |||||
| spacing={2} | |||||
| mb={2} | |||||
| > | |||||
| <Button | |||||
| // size="large" | |||||
| variant="contained" | |||||
| onClick={groupDetailClick()} | |||||
| disabled={applicationDetailData.data.status != "submitted" && applicationDetailData.data.status != "reviewed"} | |||||
| sx={{ | |||||
| textTransform: 'capitalize', | |||||
| alignItems: 'end' | |||||
| }}> | |||||
| <EditNoteIcon /> | |||||
| <Typography variant="h5" ml={1}> Gen Gazette Code</Typography> | |||||
| </Button> | |||||
| </Stack> | |||||
| </Grid> | |||||
| </Grid> | </Grid> | ||||
| </Grid> | |||||
| : null} | |||||
| : null | |||||
| : null | |||||
| } | |||||
| <Typography variant="h5" sx={{ mb: 2, borderBottom: "1px solid black" }}> | <Typography variant="h5" sx={{ mb: 2, borderBottom: "1px solid black" }}> | ||||
| Gazette Details | Gazette Details | ||||
| </Typography> | </Typography> | ||||
| @@ -18,6 +18,8 @@ import { FiDataGrid } from "components/FiDataGrid"; | |||||
| import { notifyActionSuccess, clickableLink } from 'utils/CommonFunction'; | import { notifyActionSuccess, clickableLink } from 'utils/CommonFunction'; | ||||
| import { FormattedMessage, useIntl } from "react-intl"; | import { FormattedMessage, useIntl } from "react-intl"; | ||||
| import * as utils from "auth/utils" | import * as utils from "auth/utils" | ||||
| import { isGrantedAny } from "auth/utils"; | |||||
| // ==============================|| EVENT TABLE ||============================== // | // ==============================|| EVENT TABLE ||============================== // | ||||
| export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnReady }) { | export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnReady }) { | ||||
| @@ -161,14 +163,17 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea | |||||
| return (<> | return (<> | ||||
| <div style={{ width: '100%' }}> | <div style={{ width: '100%' }}> | ||||
| <Grid container direction="row" justifyContent="flex-start" alignItems="center" sx={{ p: 1 }} > | |||||
| <Button | |||||
| variant="contained" | |||||
| onClick={() => setIsConfirmPopUp(true)} | |||||
| > | |||||
| Published | |||||
| </Button> | |||||
| </Grid> | |||||
| {isGrantedAny(["MAINTAIN_APPLICATION"]) ? | |||||
| <Grid container direction="row" justifyContent="flex-start" alignItems="center" sx={{ p: 1 }} > | |||||
| <Button | |||||
| variant="contained" | |||||
| onClick={() => setIsConfirmPopUp(true)} | |||||
| > | |||||
| Published | |||||
| </Button> | |||||
| </Grid> | |||||
| :null | |||||
| } | |||||
| <FiDataGrid | <FiDataGrid | ||||
| checkboxSelection | checkboxSelection | ||||
| @@ -77,10 +77,10 @@ export default function UserGroupTable({setSelectedRow, userGroup,isNewRecord,ed | |||||
| editMode="row" | editMode="row" | ||||
| initialState={{ | initialState={{ | ||||
| pagination: { | pagination: { | ||||
| paginationModel: {page: 0, pageSize: 3}, | |||||
| paginationModel: {page: 0, pageSize: 4}, | |||||
| }, | }, | ||||
| }} | }} | ||||
| pageSizeOptions={[3, 5]} | |||||
| pageSizeOptions={[4, 8, 16]} | |||||
| checkboxSelection | checkboxSelection | ||||
| rowSelectionModel={currentSelectedRow} | rowSelectionModel={currentSelectedRow} | ||||
| onRowSelectionModelChange={(ids) => { | onRowSelectionModelChange={(ids) => { | ||||
| @@ -268,7 +268,7 @@ const UserMaintainPage = () => { | |||||
| {/*bottom button*/} | {/*bottom button*/} | ||||
| { | { | ||||
| isGrantedAny(["MAINTAIN_USER"]) ? | |||||
| isGrantedAny(["MAINTAIN_USER", "MAINTAIN_GLD_USER"]) ? | |||||
| <Grid item s={12} md={12} lg={12} sx={{ mt: 2, mb: 2 }} alignItems={"start"} justifyContent="center"> | <Grid item s={12} md={12} lg={12} sx={{ mt: 2, mb: 2 }} alignItems={"start"} justifyContent="center"> | ||||
| <Grid container maxWidth justifyContent="flex-start"> | <Grid container maxWidth justifyContent="flex-start"> | ||||
| { | { | ||||
| @@ -268,7 +268,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| <form onSubmit={formik.handleSubmit} style={{ padding: 12 }}> | <form onSubmit={formik.handleSubmit} style={{ padding: 12 }}> | ||||
| {/*top button*/} | {/*top button*/} | ||||
| { | { | ||||
| isGrantedAny("MAINTAIN_USER") ? | |||||
| isGrantedAny(["MAINTAIN_USER", "MAINTAIN_IND_USER"]) ? | |||||
| <Grid item xs={12} sm={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"start"} justifyContent="center"> | <Grid item xs={12} sm={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"start"} justifyContent="center"> | ||||
| <Grid container maxWidth justifyContent="flex-start"> | <Grid container maxWidth justifyContent="flex-start"> | ||||
| {editMode ? | {editMode ? | ||||
| @@ -430,7 +430,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| <Typography variant="h5">Verified:</Typography> | <Typography variant="h5">Verified:</Typography> | ||||
| </Grid> | </Grid> | ||||
| { | { | ||||
| !isGrantedAny("MAINTAIN_USER") || currentUserData.verifiedBy || editMode ? | |||||
| !isGrantedAny(["MAINTAIN_USER", "MAINTAIN_IND_USER"]) || currentUserData.verifiedBy || editMode ? | |||||
| <Grid item xs={12} sm={12} md={6} lg={6} sx={{ mb: 2 }}> | <Grid item xs={12} sm={12} md={6} lg={6} sx={{ mb: 2 }}> | ||||
| {FieldUtils.initField({ | {FieldUtils.initField({ | ||||
| valueName: "verifiedStatus", | valueName: "verifiedStatus", | ||||
| @@ -601,7 +601,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
| </Grid> | </Grid> | ||||
| { | { | ||||
| !isGrantedAny("MAINTAIN_USER") || editMode ? | |||||
| !isGrantedAny(["MAINTAIN_USER", "MAINTAIN_IND_USER"]) || editMode ? | |||||
| <Grid item xs={8} sm={8} md={6} lg={6}> | <Grid item xs={8} sm={8} md={6} lg={6}> | ||||
| {FieldUtils.initField({ | {FieldUtils.initField({ | ||||
| valueName: "status", | valueName: "status", | ||||
| @@ -179,7 +179,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| {/*top button*/} | {/*top button*/} | ||||
| {isGrantedAny("MAINTAIN_USER") ? | |||||
| {isGrantedAny(["MAINTAIN_USER", "MAINTAIN_ORG_USER"]) ? | |||||
| <Grid item s={12} md={12} lg={12} sx={{ mb: 3, mt: 2 }} alignItems={"start"} justifyContent="center"> | <Grid item s={12} md={12} lg={12} sx={{ mb: 3, mt: 2 }} alignItems={"start"} justifyContent="center"> | ||||
| <Grid container maxWidth justifyContent="flex-start"> | <Grid container maxWidth justifyContent="flex-start"> | ||||
| {editMode ? | {editMode ? | ||||
| @@ -352,7 +352,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| </Grid> | </Grid> | ||||
| { | { | ||||
| !isGrantedAny("MAINTAIN_USER") || currentUserData.verifiedBy || editMode ? | |||||
| !isGrantedAny(["MAINTAIN_USER", "MAINTAIN_ORG_USER"]) || currentUserData.verifiedBy || editMode ? | |||||
| <Grid item xs={12} md={6} lg={6}> | <Grid item xs={12} md={6} lg={6}> | ||||
| {FieldUtils.initField({ | {FieldUtils.initField({ | ||||
| valueName: "verifiedStatus", | valueName: "verifiedStatus", | ||||
| @@ -411,7 +411,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| <Typography variant="h5">Status:</Typography> | <Typography variant="h5">Status:</Typography> | ||||
| </Grid> | </Grid> | ||||
| { | { | ||||
| !isGrantedAny("MAINTAIN_USER") || editMode ? | |||||
| !isGrantedAny(["MAINTAIN_USER", "MAINTAIN_ORG_USER"]) || editMode ? | |||||
| <Grid item xs={12} md={6} lg={6}> | <Grid item xs={12} md={6} lg={6}> | ||||
| {FieldUtils.initField({ | {FieldUtils.initField({ | ||||
| valueName: "status", | valueName: "status", | ||||
| @@ -467,6 +467,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| <Grid item lg={12}> | <Grid item lg={12}> | ||||
| <Grid container alignItems={"center"}> | <Grid container alignItems={"center"}> | ||||
| {currentUserData.orgId == null ? | {currentUserData.orgId == null ? | ||||
| isGrantedAny("MAINTAIN_ORG")? | |||||
| <Grid item lg={2} > | <Grid item lg={2} > | ||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
| <Button variant="contained" | <Button variant="contained" | ||||
| @@ -477,6 +478,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => | |||||
| </ThemeProvider> | </ThemeProvider> | ||||
| </Grid> | </Grid> | ||||
| : null | : null | ||||
| : null | |||||
| } | } | ||||
| </Grid> | </Grid> | ||||
| </Grid> | </Grid> | ||||
| @@ -12,7 +12,7 @@ import axios from "axios"; | |||||
| // import { useNavigate, | // import { useNavigate, | ||||
| // useParams | // useParams | ||||
| // } from "react-router-dom"; | // } from "react-router-dom"; | ||||
| import { GLD_USER_PATH, | |||||
| import { GLD_USER_PROFILE_PATH, | |||||
| // DELETE_USER, | // DELETE_USER, | ||||
| // POST_ADMIN_USER_REGISTER | // POST_ADMIN_USER_REGISTER | ||||
| } from "utils/ApiPathConst"; | } from "utils/ApiPathConst"; | ||||
| @@ -55,7 +55,7 @@ const UserMaintainPage = () => { | |||||
| const [onReady, setOnReady] = useState(false); | const [onReady, setOnReady] = useState(false); | ||||
| useEffect(() => { | useEffect(() => { | ||||
| axios.get(`${GLD_USER_PATH}/${getUserId()}`) | |||||
| axios.get(`${GLD_USER_PROFILE_PATH}/${getUserId()}`) | |||||
| .then((response) => { | .then((response) => { | ||||
| if (response.status === 200) { | if (response.status === 200) { | ||||
| setUserData(response.data); | setUserData(response.data); | ||||
| @@ -153,7 +153,7 @@ const UserSearchForm = ({ applySearch, onGridReady }) => { | |||||
| alignItems="center"> | alignItems="center"> | ||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
| {isGrantedAny(["MAINTAIN_USER"]) ? | |||||
| {isGrantedAny(["MAINTAIN_USER", "MAINTAIN_GLD_USER"]) ? | |||||
| <Grid item xs={3} md={3} sx={{ ml: 3, mb: 3 }}> | <Grid item xs={3} md={3} sx={{ ml: 3, mb: 3 }}> | ||||
| <Button | <Button | ||||
| variant="contained" | variant="contained" | ||||
| @@ -28,7 +28,7 @@ export default function UserTable({searchCriteria, applyGridOnReady}) { | |||||
| }, [reloadTime]); | }, [reloadTime]); | ||||
| const handleLock = (params) => () => { | const handleLock = (params) => () => { | ||||
| if(!isGrantedAny(["MAINTAIN_USER"])) return; | |||||
| if(!isGrantedAny(["MAINTAIN_USER", "MAINTAIN_GLD_USER"])) return; | |||||
| if (params.row.locked==true){ | if (params.row.locked==true){ | ||||
| doUnlock(params.id) | doUnlock(params.id) | ||||
| }else{ | }else{ | ||||
| @@ -51,15 +51,19 @@ const GLDUserRoutes = { | |||||
| path: '/dashboard', | path: '/dashboard', | ||||
| element: <DashboardDefault /> | element: <DashboardDefault /> | ||||
| }, | }, | ||||
| isGrantedAny(["VIEW_APPLICATION","MAINTAIN_APPLICATION"])? | |||||
| { | { | ||||
| path: '/application/:id', | path: '/application/:id', | ||||
| element: <ApplicationDetail/> | element: <ApplicationDetail/> | ||||
| }, | |||||
| }:{}, | |||||
| isGrantedAny(["VIEW_APPLICATION","MAINTAIN_APPLICATION"])? | |||||
| { | { | ||||
| path: '/application/search', | path: '/application/search', | ||||
| element: <ApplicationSearch/> | element: <ApplicationSearch/> | ||||
| }, | |||||
| }:{}, | |||||
| isGranted(["MAINTAIN_PAYMENT"])? | isGranted(["MAINTAIN_PAYMENT"])? | ||||
| { | { | ||||
| path: '/application/markAsPaid/search', | path: '/application/markAsPaid/search', | ||||
| @@ -130,7 +134,6 @@ const GLDUserRoutes = { | |||||
| element: <GFMIS_Search/> | element: <GFMIS_Search/> | ||||
| }:{}, | }:{}, | ||||
| { | { | ||||
| path: '/user/profile', | path: '/user/profile', | ||||
| element: <UserMaintainPage /> | element: <UserMaintainPage /> | ||||
| @@ -166,13 +169,13 @@ const GLDUserRoutes = { | |||||
| element: <EmailTemplateDetailPage/> | element: <EmailTemplateDetailPage/> | ||||
| }:{}, | }:{}, | ||||
| isGranted("MAINTAIN_GAZETTE_ISSUE")? | |||||
| isGrantedAny(["VIEW_GAZETTE_ISSUE","MAINTAIN_GAZETTE_ISSUE"])? | |||||
| { | { | ||||
| path: '/setting/holiday', | path: '/setting/holiday', | ||||
| element: <HolidayPage/> | element: <HolidayPage/> | ||||
| }:{}, | }:{}, | ||||
| isGranted("MAINTAIN_GAZETTE_ISSUE")? | |||||
| isGrantedAny(["VIEW_GAZETTE_ISSUE","MAINTAIN_GAZETTE_ISSUE"])? | |||||
| { | { | ||||
| path: '/setting/gazetteissuepage', | path: '/setting/gazetteissuepage', | ||||
| element: <GazetteIssuePage/> | element: <GazetteIssuePage/> | ||||
| @@ -183,10 +186,12 @@ const GLDUserRoutes = { | |||||
| path: '/setting/drImport', | path: '/setting/drImport', | ||||
| element: <DrImport /> | element: <DrImport /> | ||||
| }:{}, | }:{}, | ||||
| { | { | ||||
| path: '/setting/auditLog', | path: '/setting/auditLog', | ||||
| element: <AuditLogPage /> | element: <AuditLogPage /> | ||||
| }, | }, | ||||
| { | { | ||||
| path: '/user/changePassword', | path: '/user/changePassword', | ||||
| element: <ChangePasswordPage /> | element: <ChangePasswordPage /> | ||||
| @@ -39,37 +39,37 @@ const SettingRoutes = { | |||||
| element: <UserGroupDetailPage /> | element: <UserGroupDetailPage /> | ||||
| }:{}, | }:{}, | ||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER"])? | |||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER","VIEW_GLD_USER" ,"MAINTAIN_GLD_USER"])? | |||||
| { | { | ||||
| path: 'userSearchview', | path: 'userSearchview', | ||||
| element: <UserSearchPage /> | element: <UserSearchPage /> | ||||
| }:{}, | }:{}, | ||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER"])? | |||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER","VIEW_GLD_USER" ,"MAINTAIN_GLD_USER"])? | |||||
| { | { | ||||
| path: '/user/:id', | path: '/user/:id', | ||||
| element: <UserMaintainPage /> | element: <UserMaintainPage /> | ||||
| }:{}, | }:{}, | ||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER"])? | |||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER","VIEW_IND_USER", "MAINTAIN_IND_USER"])? | |||||
| { | { | ||||
| path: 'indUser', | path: 'indUser', | ||||
| element: <UserSearchPage_Individual /> | element: <UserSearchPage_Individual /> | ||||
| }:{}, | }:{}, | ||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER"])? | |||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER","VIEW_IND_USER", "MAINTAIN_IND_USER"])? | |||||
| { | { | ||||
| path: '/indUser/:id', | path: '/indUser/:id', | ||||
| element: <UserMaintainPage_Individual /> | element: <UserMaintainPage_Individual /> | ||||
| }:{}, | }:{}, | ||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER"])? | |||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER","VIEW_ORG_USER", "MAINTAIN_ORG_USER"])? | |||||
| { | { | ||||
| path: 'orgUser', | path: 'orgUser', | ||||
| element: <UserSearchPage_Organization /> | element: <UserSearchPage_Organization /> | ||||
| }:{}, | }:{}, | ||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER"])? | |||||
| isGrantedAny(["VIEW_USER","MAINTAIN_USER","VIEW_ORG_USER", "MAINTAIN_ORG_USER"])? | |||||
| { | { | ||||
| path: '/orgUser/:id', | path: '/orgUser/:id', | ||||
| element: <UserMaintainPage_Organization /> | element: <UserMaintainPage_Organization /> | ||||
| @@ -21,6 +21,7 @@ export const GET_GROUP_MEMBER_LIST_PATH = '/group/member'; | |||||
| export const GET_GROUP_AUTH_LIST = '/group/auth/combo'; | export const GET_GROUP_AUTH_LIST = '/group/auth/combo'; | ||||
| export const GLD_USER_PATH = apiPath+'/user/gld'; | export const GLD_USER_PATH = apiPath+'/user/gld'; | ||||
| export const GLD_USER_PROFILE_PATH = apiPath+'/user/gldProfile'; | |||||
| export const GET_AUTH_LIST = '/user/auth/combo'; | export const GET_AUTH_LIST = '/user/auth/combo'; | ||||
| export const GET_USER_COMBO_LIST = '/user/combo'; | export const GET_USER_COMBO_LIST = '/user/combo'; | ||||
| export const GET_USER_GLD_COMBO_LIST = '/user/combo/gld'; | export const GET_USER_GLD_COMBO_LIST = '/user/combo/gld'; | ||||