| @@ -67,8 +67,8 @@ const SearchGazetteIssueForm = ({ applyExport, comboData, waitDownload}) => { | |||||
| </Grid> | </Grid> | ||||
| {/*row 2*/} | {/*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 container display="flex" alignItems={"center"} sx={{ mb: 1 }}> | |||||
| <Grid item xs={9} s={6} md={4} lg={4} sx={{ ml: 3, mr: 3 }}> | |||||
| <Autocomplete | <Autocomplete | ||||
| disablePortal | disablePortal | ||||
| id="year-combo" | id="year-combo" | ||||
| @@ -93,34 +93,11 @@ const SearchGazetteIssueForm = ({ applyExport, comboData, waitDownload}) => { | |||||
| /> | /> | ||||
| </Grid> | </Grid> | ||||
| <Grid item xs={9} s={6} md={4} lg={4} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
| {/* <TextField | |||||
| fullWidth | |||||
| InputLabelProps={{ | |||||
| shrink: true | |||||
| }} | |||||
| {...register("dateTo")} | |||||
| InputProps={{ inputProps: { min: minDate } }} | |||||
| onChange={(newValue) => { | |||||
| setMaxDate(DateUtils.dateValue(newValue)); | |||||
| }} | |||||
| id="dateTo" | |||||
| type="date" | |||||
| label="To" | |||||
| defaultValue={searchCriteria.dateTo} | |||||
| /> */} | |||||
| </Grid> | |||||
| {/* <Grid item xs={9} s={6} md={4} lg={3}> | |||||
| </Grid> */} | |||||
| </Grid> | |||||
| <Grid container justifyContent="center" direction="row" alignItems="center" spacing={3}> | |||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
| <Grid item sx={{ ml: 3, mb: 3, }} > | |||||
| <Grid item sx={{ mr: 3 }}> | |||||
| <Button | <Button | ||||
| variant="contained" | variant="contained" | ||||
| type="submit" | type="submit" | ||||
| size="large" | |||||
| disabled={waitDownload} | disabled={waitDownload} | ||||
| > | > | ||||
| Export | Export | ||||
| @@ -12,14 +12,17 @@ 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 {PNSPS_BUTTON_THEME} from "themes/buttonConst"; | ||||
| import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
| import { GeneralConfirmWindow } from "utils/CommonFunction"; | |||||
| import { isGrantedAny } from "auth/utils"; | |||||
| // import * as ComboData from "utils/ComboData"; | // import * as ComboData from "utils/ComboData"; | ||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| const SearchGazetteIssueForm = ({ applySearch, comboData, onGridReady}) => { | |||||
| const [selectedYear, setSelectedYear] = React.useState([]); | |||||
| const SearchGazetteIssueForm = ({ applySearch, comboData, searchCriteria, onGridReady, onDeleteYear, waitDelete }) => { | |||||
| const [selectedYear, setSelectedYear] = React.useState(null); | |||||
| // const [defaultYear, setDefaultYear] = React.useState(searchCriteria.year); | // const [defaultYear, setDefaultYear] = React.useState(searchCriteria.year); | ||||
| const [comboList, setComboList] = React.useState([]); | const [comboList, setComboList] = React.useState([]); | ||||
| const [isConfirmOpen, setIsConfirmOpen] = React.useState(false); | |||||
| // const [onReady, setOnReady] = React.useState(false); | // const [onReady, setOnReady] = React.useState(false); | ||||
| const { | const { | ||||
| @@ -27,7 +30,7 @@ const SearchGazetteIssueForm = ({ applySearch, comboData, onGridReady}) => { | |||||
| handleSubmit } = useForm() | handleSubmit } = useForm() | ||||
| const onSubmit = () => { | const onSubmit = () => { | ||||
| if (selectedYear !=null){ | |||||
| if (selectedYear != null) { | |||||
| const temp = { | const temp = { | ||||
| year: selectedYear.label, | year: selectedYear.label, | ||||
| }; | }; | ||||
| @@ -36,17 +39,28 @@ const SearchGazetteIssueForm = ({ applySearch, comboData, onGridReady}) => { | |||||
| }; | }; | ||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| if (comboData && comboData.length > 0) { | |||||
| // console.log(comboData) | |||||
| // const labelValue = comboData.find(obj => obj.label === searchCriteria.year); | |||||
| // console.log(labelValue) | |||||
| if(selectedYear.length == 0){ | |||||
| setSelectedYear(comboData[0]) | |||||
| } | |||||
| setComboList(comboData) | |||||
| // setSelectedYear(searchCriteria.dateFrom) | |||||
| const nextCombo = Array.isArray(comboData) ? [...comboData] : []; | |||||
| setComboList(nextCombo); | |||||
| if (nextCombo.length === 0) { | |||||
| setSelectedYear(null); | |||||
| return; | |||||
| } | |||||
| const criteriaYear = searchCriteria?.year; | |||||
| const matchedByCriteria = criteriaYear != null | |||||
| ? nextCombo.find((obj) => String(obj.label) === String(criteriaYear)) | |||||
| : null; | |||||
| if (matchedByCriteria) { | |||||
| setSelectedYear(matchedByCriteria); | |||||
| return; | |||||
| } | } | ||||
| }, [comboData]); | |||||
| const matchedBySelected = selectedYear | |||||
| ? nextCombo.find((obj) => String(obj.label) === String(selectedYear.label)) | |||||
| : null; | |||||
| setSelectedYear(matchedBySelected || nextCombo[0]); | |||||
| }, [comboData, searchCriteria]); | |||||
| return ( | return ( | ||||
| @@ -65,8 +79,8 @@ const SearchGazetteIssueForm = ({ applySearch, comboData, onGridReady}) => { | |||||
| </Grid> | </Grid> | ||||
| {/*row 2*/} | {/*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 container display="flex" alignItems={"center"} sx={{ mb: 1 }}> | |||||
| <Grid item xs={9} s={6} md={4} lg={4} sx={{ ml: 3, mr: 3 }}> | |||||
| <Autocomplete | <Autocomplete | ||||
| disablePortal | disablePortal | ||||
| id="year-combo" | id="year-combo" | ||||
| @@ -79,6 +93,9 @@ const SearchGazetteIssueForm = ({ applySearch, comboData, onGridReady}) => { | |||||
| ? String(option.label) | ? String(option.label) | ||||
| : "" | : "" | ||||
| } | } | ||||
| isOptionEqualToValue={(option, value) => | |||||
| String(option?.label) === String(value?.label) | |||||
| } | |||||
| onChange={(event, newValue) => { | onChange={(event, newValue) => { | ||||
| setSelectedYear(newValue); | setSelectedYear(newValue); | ||||
| }} | }} | ||||
| @@ -91,30 +108,8 @@ const SearchGazetteIssueForm = ({ applySearch, comboData, onGridReady}) => { | |||||
| /> | /> | ||||
| </Grid> | </Grid> | ||||
| <Grid item xs={9} s={6} md={4} lg={4} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
| {/* <TextField | |||||
| fullWidth | |||||
| InputLabelProps={{ | |||||
| shrink: true | |||||
| }} | |||||
| {...register("dateTo")} | |||||
| InputProps={{ inputProps: { min: minDate } }} | |||||
| onChange={(newValue) => { | |||||
| setMaxDate(DateUtils.dateValue(newValue)); | |||||
| }} | |||||
| id="dateTo" | |||||
| type="date" | |||||
| label="To" | |||||
| defaultValue={searchCriteria.dateTo} | |||||
| /> */} | |||||
| </Grid> | |||||
| {/* <Grid item xs={9} s={6} md={4} lg={3}> | |||||
| </Grid> */} | |||||
| </Grid> | |||||
| <Grid container justifyContent="flex-end" direction="row" alignItems="center" spacing={3}> | |||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
| <Grid item sx={{ ml: 3, mb: 3, }} > | |||||
| <Grid item sx={{ mr: 3 }}> | |||||
| <Button | <Button | ||||
| variant="contained" | variant="contained" | ||||
| type="submit" | type="submit" | ||||
| @@ -124,9 +119,40 @@ const SearchGazetteIssueForm = ({ applySearch, comboData, onGridReady}) => { | |||||
| </Button> | </Button> | ||||
| </Grid> | </Grid> | ||||
| </ThemeProvider> | </ThemeProvider> | ||||
| {isGrantedAny(["MAINTAIN_GAZETTE_ISSUE"]) ? | |||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
| <Grid item sx={{ mr: 3 }}> | |||||
| <Button | |||||
| color="delete" | |||||
| variant="contained" | |||||
| disabled={!selectedYear || waitDelete || onGridReady} | |||||
| onClick={() => setIsConfirmOpen(true)} | |||||
| > | |||||
| Delete | |||||
| </Button> | |||||
| </Grid> | |||||
| </ThemeProvider> | |||||
| : null | |||||
| } | |||||
| </Grid> | </Grid> | ||||
| </Grid> | </Grid> | ||||
| </form> | </form> | ||||
| <GeneralConfirmWindow | |||||
| isWindowOpen={isConfirmOpen} | |||||
| title="Confirm Delete" | |||||
| content={selectedYear | |||||
| ? `Confirm to delete all gazette issues of year ${selectedYear.label}?` | |||||
| : "Confirm to delete all gazette issues of the selected year?"} | |||||
| onNormalClose={() => setIsConfirmOpen(false)} | |||||
| onConfirmClose={() => { | |||||
| setIsConfirmOpen(false); | |||||
| if (selectedYear != null && onDeleteYear) { | |||||
| onDeleteYear(selectedYear.label); | |||||
| } | |||||
| }} | |||||
| /> | |||||
| </MainCard> | </MainCard> | ||||
| ); | ); | ||||
| }; | }; | ||||
| @@ -8,6 +8,7 @@ import { | |||||
| import * as UrlUtils from "utils/ApiPathConst"; | import * as UrlUtils from "utils/ApiPathConst"; | ||||
| import * as React from "react"; | import * as React from "react"; | ||||
| import * as HttpUtils from "utils/HttpUtils"; | import * as HttpUtils from "utils/HttpUtils"; | ||||
| import axios from "axios"; | |||||
| import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | ||||
| import Loadable from 'components/Loadable'; | 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'))); | ||||
| @@ -26,10 +27,10 @@ const BackgroundHead = { | |||||
| backgroundColor: '#0C489E', | backgroundColor: '#0C489E', | ||||
| backgroundPosition: 'right' | backgroundPosition: 'right' | ||||
| }; | }; | ||||
| import { PNSPS_LONG_BUTTON_THEME } from "themes/buttonConst"; | |||||
| import { PNSPS_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 { notifyDeleteSuccess, notifySaveSuccess } from 'utils/CommonFunction'; | |||||
| import { isGrantedAny } from "auth/utils"; | import { isGrantedAny } from "auth/utils"; | ||||
| import { useIntl } from 'react-intl'; | import { useIntl } from 'react-intl'; | ||||
| @@ -50,6 +51,7 @@ const Index = () => { | |||||
| const [attachments, setAttachments] = React.useState([]); | const [attachments, setAttachments] = React.useState([]); | ||||
| const [waitImport, setWaitImport] = React.useState(false); | const [waitImport, setWaitImport] = React.useState(false); | ||||
| const [waitDownload, setWaitDownload] = React.useState(false); | const [waitDownload, setWaitDownload] = React.useState(false); | ||||
| const [waitDelete, setWaitDelete] = React.useState(false); | |||||
| const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); | const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); | ||||
| const [warningText, setWarningText] = React.useState(""); | const [warningText, setWarningText] = React.useState(""); | ||||
| const fileInputRef = React.useRef(null); | const fileInputRef = React.useRef(null); | ||||
| @@ -96,6 +98,43 @@ const Index = () => { | |||||
| setGridOnReady(input); | setGridOnReady(input); | ||||
| } | } | ||||
| function deleteYear(year) { | |||||
| if (year == null || year === "") { | |||||
| setWarningText("Please select a year."); | |||||
| setIsWarningPopUp(true); | |||||
| return; | |||||
| } | |||||
| setWaitDelete(true); | |||||
| setOnSearchReady(false); | |||||
| axios.delete(`${UrlUtils.DELETE_ISSUE_YEAR}/${year}`) | |||||
| .then(() => { | |||||
| notifyDeleteSuccess(); | |||||
| HttpUtils.get({ | |||||
| url: UrlUtils.GET_ISSUE_YEAR_COMBO, | |||||
| onSuccess: (responseData) => { | |||||
| const combo = Array.isArray(responseData) ? [...responseData] : []; | |||||
| setComboData(combo); | |||||
| setWaitDelete(false); | |||||
| const nextYear = combo.length > 0 ? combo[0].label : year; | |||||
| applySearch({ year: nextYear }); | |||||
| }, | |||||
| onError: () => { | |||||
| setComboData([]); | |||||
| setWaitDelete(false); | |||||
| applySearch({ year }); | |||||
| } | |||||
| }); | |||||
| }) | |||||
| .catch((error) => { | |||||
| const msg = error?.response?.data?.error | |||||
| || "Delete failed. Please try again."; | |||||
| setWarningText(msg); | |||||
| setIsWarningPopUp(true); | |||||
| setWaitDelete(false); | |||||
| setOnSearchReady(true); | |||||
| }); | |||||
| } | |||||
| React.useEffect(() => { | React.useEffect(() => { | ||||
| if (Object.keys(exportCriteria).length > 0) { | if (Object.keys(exportCriteria).length > 0) { | ||||
| doExport(); | doExport(); | ||||
| @@ -138,6 +177,7 @@ const Index = () => { | |||||
| setWaitImport(true); | setWaitImport(true); | ||||
| if (!attachments || attachments.length <= 0) { | if (!attachments || attachments.length <= 0) { | ||||
| setWarningText("Please upload file."); | setWarningText("Please upload file."); | ||||
| setIsWarningPopUp(true); | |||||
| setWaitImport(false); | setWaitImport(false); | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -149,6 +189,14 @@ const Index = () => { | |||||
| setWaitImport(false); | setWaitImport(false); | ||||
| setAttachments([]); | setAttachments([]); | ||||
| loadCombo(); | loadCombo(); | ||||
| }, | |||||
| onError: (error) => { | |||||
| const msg = error?.response?.data?.error | |||||
| || "Import failed. Please try again."; | |||||
| setWarningText(msg); | |||||
| setIsWarningPopUp(true); | |||||
| setWaitImport(false); | |||||
| setAttachments([]); | |||||
| } | } | ||||
| }); | }); | ||||
| }; | }; | ||||
| @@ -185,10 +233,9 @@ const Index = () => { | |||||
| {isGrantedAny(["MAINTAIN_GAZETTE_ISSUE"]) && | {isGrantedAny(["MAINTAIN_GAZETTE_ISSUE"]) && | ||||
| <Grid item xs={12} md={12} lg={6} width="100%"> | <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 }}> | <Stack direction="row" justifyContent="flex-start" alignItems="center" spacing={2} sx={{ ml: 2, mt: 1 }}> | ||||
| <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | |||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
| <Button | <Button | ||||
| variant="contained" | variant="contained" | ||||
| size="large" | |||||
| disabled={waitImport} | disabled={waitImport} | ||||
| type="button" | type="button" | ||||
| onClick={() => { | onClick={() => { | ||||
| @@ -205,7 +252,7 @@ const Index = () => { | |||||
| } | } | ||||
| }} | }} | ||||
| > | > | ||||
| <Typography variant="h5">Upload Files</Typography> | |||||
| Upload Gazette Issue | |||||
| </Button> | </Button> | ||||
| <input | <input | ||||
| id="uploadFileBtn" | id="uploadFileBtn" | ||||
| @@ -227,8 +274,11 @@ const Index = () => { | |||||
| <Grid item xs={12} md={12} lg={12} width="100%"> | <Grid item xs={12} md={12} lg={12} width="100%"> | ||||
| <SearchForm | <SearchForm | ||||
| applySearch={applySearch} | applySearch={applySearch} | ||||
| searchCriteria={searchCriteria} | |||||
| comboData={comboData} | comboData={comboData} | ||||
| onGridReady={onGridReady} | onGridReady={onGridReady} | ||||
| onDeleteYear={deleteYear} | |||||
| waitDelete={waitDelete} | |||||
| /> | /> | ||||
| </Grid> | </Grid> | ||||
| @@ -260,7 +310,7 @@ const Index = () => { | |||||
| <Typography variant="h3">Warning</Typography> | <Typography variant="h3">Warning</Typography> | ||||
| </DialogTitle> | </DialogTitle> | ||||
| <DialogContent style={{ display: 'flex' }}> | <DialogContent style={{ display: 'flex' }}> | ||||
| <Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography> | |||||
| <Typography variant="h4" style={{ padding: '16px', whiteSpace: 'pre-line' }}>{warningText}</Typography> | |||||
| </DialogContent> | </DialogContent> | ||||
| <DialogActions> | <DialogActions> | ||||
| <Button onClick={() => setIsWarningPopUp(false)}> | <Button onClick={() => setIsWarningPopUp(false)}> | ||||
| @@ -79,8 +79,8 @@ const SearchHolidayForm = ({ applySearch, comboData, searchCriteria, onGridReady | |||||
| </Grid> | </Grid> | ||||
| {/*row 2*/} | {/*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 container display="flex" alignItems={"center"} sx={{ mb: 1 }}> | |||||
| <Grid item xs={9} s={6} md={4} lg={4} sx={{ ml: 3, mr: 3 }}> | |||||
| <Autocomplete | <Autocomplete | ||||
| disablePortal | disablePortal | ||||
| id="year-combo" | id="year-combo" | ||||
| @@ -108,9 +108,21 @@ const SearchHolidayForm = ({ applySearch, comboData, searchCriteria, onGridReady | |||||
| /> | /> | ||||
| </Grid> | </Grid> | ||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
| <Grid item sx={{ mr: 3 }}> | |||||
| <Button | |||||
| variant="contained" | |||||
| type="submit" | |||||
| disabled={onGridReady} | |||||
| > | |||||
| Search | |||||
| </Button> | |||||
| </Grid> | |||||
| </ThemeProvider> | |||||
| {isGrantedAny(["MAINTAIN_GAZETTE_ISSUE"]) ? | {isGrantedAny(["MAINTAIN_GAZETTE_ISSUE"]) ? | ||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
| <Grid item sx={{ mb: 3, mr: 3 }}> | |||||
| <Grid item sx={{ mr: 3 }}> | |||||
| <Button | <Button | ||||
| color="delete" | color="delete" | ||||
| variant="contained" | variant="contained" | ||||
| @@ -123,40 +135,6 @@ const SearchHolidayForm = ({ applySearch, comboData, searchCriteria, onGridReady | |||||
| </ThemeProvider> | </ThemeProvider> | ||||
| : null | : null | ||||
| } | } | ||||
| <Grid item xs={9} s={6} md={4} lg={4} sx={{ ml: 3, mr: 3, mb: 3 }}> | |||||
| {/* <TextField | |||||
| fullWidth | |||||
| InputLabelProps={{ | |||||
| shrink: true | |||||
| }} | |||||
| {...register("dateTo")} | |||||
| InputProps={{ inputProps: { min: minDate } }} | |||||
| onChange={(newValue) => { | |||||
| setMaxDate(DateUtils.dateValue(newValue)); | |||||
| }} | |||||
| id="dateTo" | |||||
| type="date" | |||||
| label="To" | |||||
| defaultValue={searchCriteria.dateTo} | |||||
| /> */} | |||||
| </Grid> | |||||
| {/* <Grid item xs={9} s={6} md={4} lg={3}> | |||||
| </Grid> */} | |||||
| </Grid> | |||||
| <Grid container justifyContent="flex-end" direction="row" alignItems="center" spacing={3}> | |||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
| <Grid item sx={{ ml: 3, mb: 3, }} > | |||||
| <Button | |||||
| variant="contained" | |||||
| type="submit" | |||||
| disabled={onGridReady} | |||||
| > | |||||
| Search | |||||
| </Button> | |||||
| </Grid> | |||||
| </ThemeProvider> | |||||
| </Grid> | </Grid> | ||||
| </Grid> | </Grid> | ||||
| </form> | </form> | ||||
| @@ -27,7 +27,7 @@ const BackgroundHead = { | |||||
| backgroundPosition: 'right' | backgroundPosition: 'right' | ||||
| }; | }; | ||||
| import { PNSPS_LONG_BUTTON_THEME } from "themes/buttonConst"; | |||||
| import { PNSPS_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 { notifyDeleteSuccess, notifySaveSuccess } from 'utils/CommonFunction'; | import { notifyDeleteSuccess, notifySaveSuccess } from 'utils/CommonFunction'; | ||||
| @@ -221,22 +221,20 @@ const Index = () => { | |||||
| <Grid item xs={12} md={12} lg={6} width="100%"> | <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 }} > | <Stack direction="row" justifyContent="flex-start" alignItems="center" spacing={2} sx={{ ml: 2, mt: 1 }} > | ||||
| <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | |||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
| <Button | <Button | ||||
| variant="contained" | variant="contained" | ||||
| size="large" | |||||
| disabled={waitDownload} | disabled={waitDownload} | ||||
| onClick={doExport} | onClick={doExport} | ||||
| aria-label={intl.formatMessage({ id: 'ariaExportHolidayTemplate' })} | aria-label={intl.formatMessage({ id: 'ariaExportHolidayTemplate' })} | ||||
| > | > | ||||
| <Typography variant="h5">Export</Typography> | |||||
| Export | |||||
| </Button> | </Button> | ||||
| </ThemeProvider> | </ThemeProvider> | ||||
| {isGrantedAny(["MAINTAIN_GAZETTE_ISSUE"]) ? | {isGrantedAny(["MAINTAIN_GAZETTE_ISSUE"]) ? | ||||
| <ThemeProvider theme={PNSPS_LONG_BUTTON_THEME}> | |||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | |||||
| <Button | <Button | ||||
| variant="contained" | variant="contained" | ||||
| size="large" | |||||
| disabled={waitImport} | disabled={waitImport} | ||||
| type="button" | type="button" | ||||
| onClick={() => { | onClick={() => { | ||||
| @@ -253,7 +251,7 @@ const Index = () => { | |||||
| } | } | ||||
| }} | }} | ||||
| > | > | ||||
| <Typography variant="h5">Upload Files</Typography> | |||||
| Upload Holiday | |||||
| </Button> | </Button> | ||||
| <input | <input | ||||
| id="uploadFileBtn" | id="uploadFileBtn" | ||||
| @@ -307,7 +307,7 @@ const FormPanel = ({ formData }) => { | |||||
| } | } | ||||
| }} | }} | ||||
| > | > | ||||
| <Typography variant="h5">Upload Files</Typography> | |||||
| <Typography variant="h5">Upload File</Typography> | |||||
| </Button> | </Button> | ||||
| <input | <input | ||||
| id="uploadFileBtn" | id="uploadFileBtn" | ||||
| @@ -164,6 +164,7 @@ export const GET_ISSUE_LIST = apiPath+'/gazette-issue/export';//GET | |||||
| export const POST_ISSUE_FILE = apiPath+'/gazette-issue/import';//POST | export const POST_ISSUE_FILE = apiPath+'/gazette-issue/import';//POST | ||||
| export const GET_ISSUE = apiPath+'/gazette-issue/list'; //GET | export const GET_ISSUE = apiPath+'/gazette-issue/list'; //GET | ||||
| export const GET_ISSUE_YEAR_COMBO = apiPath+'/gazette-issue/combo-year'; //GET | export const GET_ISSUE_YEAR_COMBO = apiPath+'/gazette-issue/combo-year'; //GET | ||||
| export const DELETE_ISSUE_YEAR = apiPath+'/gazette-issue/year'; //DELETE /{year} | |||||
| export const CHECK_CREATE_PROOF = apiPath+'/proof/check-create';//GET | export const CHECK_CREATE_PROOF = apiPath+'/proof/check-create';//GET | ||||
| export const LIST_PROOF = apiPath+'/proof/list';//GET | export const LIST_PROOF = apiPath+'/proof/list';//GET | ||||