@@ -39,7 +39,6 @@ build/Release | |||
# Dependency directories | |||
node_modules/ | |||
/public/sdk | |||
jspm_packages/ | |||
# TypeScript v1 declaration files | |||
@@ -31,15 +31,15 @@ const client = { | |||
breadcrumbs: false, | |||
ability:['VIEW','DASHBOARD'] | |||
}, | |||
// { | |||
// id: 'template', | |||
// title: 'Template', | |||
// type: 'item', | |||
// url: '/template', | |||
// icon: icons.AssignmentIcon, | |||
// breadcrumbs: false, | |||
// ability:['VIEW','DASHBOARD'] | |||
// }, | |||
{ | |||
id: 'template', | |||
title: 'Template', | |||
type: 'item', | |||
url: '/template', | |||
icon: icons.AssignmentIcon, | |||
breadcrumbs: false, | |||
ability:['VIEW','DASHBOARD'] | |||
}, | |||
] | |||
}; | |||
@@ -32,8 +32,7 @@ const dashboard = { | |||
id: 'lionerdashboard', | |||
title: <FormattedMessage id="Dashboard"/>, | |||
type: 'item', | |||
url: '/client', | |||
// url: '/lionerDashboard', | |||
url: '/lionerDashboard', | |||
icon: icons.SpeedIcon, | |||
breadcrumbs: false, | |||
ability:['VIEW','DASHBOARD'] | |||
@@ -96,7 +96,8 @@ const AuthLogin = () => { | |||
//ability.update(abilities) | |||
const lastPath = localStorage.getItem('lastVisitedPath'); | |||
await navigate(lastPath === null ? '/lionerDashboard' : lastPath); | |||
await navigate(lastPath === null ? '/client' : lastPath); | |||
// await navigate(lastPath === null ? '/lionerDashboard' : lastPath); | |||
await window.location.reload(); | |||
await localStorage.removeItem('lastVisitedPath'); | |||
@@ -67,7 +67,7 @@ const ClientForm = ({ refClientDetail, | |||
//form data | |||
const {register, getValues, setValue} = useForm(); | |||
const [joinDate, setJoinDate] = useState(null); | |||
const [createDate, setCreateDate] = useState(null); | |||
// const [awardDate, setAwardDate] = useState(null); | |||
// const [deadlineDate, setDeadlineDate] = useState(null); | |||
// const [announceDate, setAnnounceDate] = useState(null); | |||
@@ -86,7 +86,7 @@ const ClientForm = ({ refClientDetail, | |||
// //combo list | |||
// const [subDivisionList, setSubDivisionList] = useState([]); | |||
const [joinDateError, setJoinDateError] = React.useState(null); | |||
const [createDateError, setCreateDateError] = React.useState(null); | |||
const [awardDateError, setAwardDateError] = React.useState(null); | |||
const [deadlineDateError, setDeadlineDateError] = React.useState(null); | |||
const [announceDateError, setAnnounceDateError] = React.useState(null); | |||
@@ -94,13 +94,13 @@ const ClientForm = ({ refClientDetail, | |||
const [toError, setToError] = React.useState(null); | |||
// const [nextApplicationDateError, setNextApplicationDateError] = React.useState(null); | |||
const joinDateErrorMessage = React.useMemo(() => { | |||
switch (joinDateError) { | |||
const createDateErrorMessage = React.useMemo(() => { | |||
switch (createDateError) { | |||
case 'invalidDate': { | |||
return "Invalid date"; | |||
} | |||
} | |||
}, [joinDateError]); | |||
}, [createDateError]); | |||
const awardDateErrorMessage = React.useMemo(() => { | |||
switch (awardDateError) { | |||
@@ -168,13 +168,13 @@ const ClientForm = ({ refClientDetail, | |||
// if(applicationList.length===0){ | |||
// validateReminder(); | |||
// } | |||
// },[joinDate, nextApplicationDate, deadlineDate]); | |||
// },[createDate, nextApplicationDate, deadlineDate]); | |||
// const validateReminder = () =>{ | |||
// const values = getValues(); | |||
// let firstIssueDate = null; | |||
// let reminderDates = []; | |||
// if (joinDate !== null && | |||
// if (createDate !== null && | |||
// nextApplicationDate !== null && | |||
// values.reminderThreshold !== null && | |||
// values.reminderInterval !== null && | |||
@@ -182,7 +182,7 @@ const ClientForm = ({ refClientDetail, | |||
// ) { | |||
// //have value | |||
// if(applicationList.length <=0){ | |||
// firstIssueDate = joinDate.add(-values.reminderThreshold,'days'); | |||
// firstIssueDate = createDate.add(-values.reminderThreshold,'days'); | |||
// } | |||
// else{ | |||
// firstIssueDate = nextApplicationDate.add(-values.reminderThreshold, 'days'); | |||
@@ -318,7 +318,7 @@ const ClientForm = ({ refClientDetail, | |||
setValue("caseManagerId", 1); | |||
setValue("consultantId", 1); | |||
} | |||
setJoinDate(dayjs(getDateString(refClient.joinDate))); | |||
setCreateDate(dayjs(getDateString(refClient.created))); | |||
} | |||
},[refClient]); | |||
@@ -331,7 +331,7 @@ const ClientForm = ({ refClientDetail, | |||
setIsEditing(true); | |||
} | |||
},[refClient]); | |||
// },[refClient,selectedSubDivision,selectedRegion,selectedType, joinDate, deadlineDate]); | |||
// },[refClient,selectedSubDivision,selectedRegion,selectedType, createDate, deadlineDate]); | |||
// useEffect(()=>{ | |||
// if(selectedFrequency !== null){ | |||
@@ -344,19 +344,19 @@ const ClientForm = ({ refClientDetail, | |||
// } | |||
// if (isEditing){ | |||
// if (joinDate !== null){ | |||
// if (createDate !== null){ | |||
// switch(selectedFrequency.key){ | |||
// case 1: | |||
// setNextApplicationDate(joinDate.add(1,'month')); | |||
// setNextApplicationDate(createDate.add(1,'month')); | |||
// break; | |||
// case 2: | |||
// setNextApplicationDate(joinDate.add(3,'month')); | |||
// setNextApplicationDate(createDate.add(3,'month')); | |||
// break; | |||
// case 3: | |||
// setNextApplicationDate(joinDate.add(1,'year')); | |||
// setNextApplicationDate(createDate.add(1,'year')); | |||
// break; | |||
// case 4: | |||
// setNextApplicationDate(joinDate.add(6,'month')); | |||
// setNextApplicationDate(createDate.add(6,'month')); | |||
// break; | |||
// default: | |||
// setNextApplicationDate(nextApplicationDate); | |||
@@ -365,7 +365,7 @@ const ClientForm = ({ refClientDetail, | |||
// } | |||
// } | |||
// } | |||
// },[selectedFrequency,joinDate]); | |||
// },[selectedFrequency,createDate]); | |||
// useEffect(() => { | |||
// //if state data are ready and assign to different field | |||
@@ -404,8 +404,8 @@ const ClientForm = ({ refClientDetail, | |||
// formErrors.type = 'Client Type is required'; | |||
// } | |||
if (joinDate === null) { | |||
formErrors.joinDate = 'Join Date is required'; | |||
if (createDate === null) { | |||
formErrors.createDate = 'Create Date is required'; | |||
} | |||
// if (deadlineDate === null) { | |||
@@ -448,7 +448,7 @@ const ClientForm = ({ refClientDetail, | |||
setErrors(formErrors); | |||
// if (Object.keys(formErrors).length === 0 //&& | |||
// !joinDateError && !awardDateError && | |||
// !createDateError && !awardDateError && | |||
// !deadlineDateError && !announceDateError && | |||
// !fromError && !toError && !nextApplicationDateError | |||
// ) { | |||
@@ -480,7 +480,7 @@ const ClientForm = ({ refClientDetail, | |||
// data["phone1"] = values.phone1; | |||
// data["phone2"] = values.phone2; | |||
// data["remarks"] = values.remarks; | |||
// data["joinDate"] = joinDate === null ? null : dayjs(joinDate).format('YYYY-MM-DD'); | |||
// data["createDate"] = createDate === null ? null : dayjs(createDate).format('YYYY-MM-DD'); | |||
// setClientDetail(data); | |||
// } | |||
// } | |||
@@ -503,7 +503,7 @@ const ClientForm = ({ refClientDetail, | |||
data["remarks"] = values.remarks; | |||
data["caseManagerId"] = 1; | |||
data["consultantId"] = 1; | |||
data["joinDate"] = joinDate === null ? null : dayjs(joinDate).format('YYYY-MM-DD'); | |||
data["createDate"] = createDate === null ? null : dayjs(createDate).format('YYYY-MM-DD'); | |||
setClientDetail(data); | |||
} | |||
else if(isCollectData){ | |||
@@ -725,7 +725,7 @@ const ClientForm = ({ refClientDetail, | |||
<Grid item xs={4} s={4} md={4} lg={4} | |||
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> | |||
<Typography variant="lionerSize" component="span"> | |||
Join Date: <Typography sx={{ color: GENERAL_RED_COLOR }} component="span">*</Typography> | |||
Create Date: <Typography sx={{ color: GENERAL_RED_COLOR }} component="span">*</Typography> | |||
</Typography> | |||
</Grid> | |||
@@ -733,18 +733,18 @@ const ClientForm = ({ refClientDetail, | |||
<LocalizationProvider dateAdapter={AdapterDayjs}> | |||
<DemoItem components={['DatePicker']}> | |||
<DatePicker | |||
id="joinDate" | |||
id="createDate" | |||
size="small" | |||
required='true' | |||
value={joinDate === null ? null : dayjs(joinDate)} | |||
onChange={(newValue) => setJoinDate(newValue)} | |||
value={createDate === null ? null : dayjs(createDate)} | |||
onChange={(newValue) => setCreateDate(newValue)} | |||
format="DD/MM/YYYY" | |||
onError={(newError) => setJoinDateError(newError)} | |||
onError={(newError) => setCreateDateError(newError)} | |||
slotProps={{ | |||
field: { clearable: true }, | |||
textField: { | |||
error: !!errors.joinDate || joinDateError, | |||
helperText: joinDateError ? joinDateErrorMessage : errors.joinDate, | |||
error: !!errors.createDate || createDateError, | |||
helperText: createDateError ? createDateErrorMessage : errors.createDate, | |||
}, | |||
}} | |||
disabled={!isEditing} | |||
@@ -58,8 +58,8 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { | |||
// const [selectedType, setSelectedType] = useState(null); | |||
// const [selectedCaseManager, setSelectedCaseManager] = useState([]); | |||
// const [selectedConsultants, setSelectedConsultants] = useState([]); | |||
const [joinDateFrom, setJoinDateFrom] = useState(null); | |||
const [joinDateTo, setJoinDateTo] = useState(null); | |||
const [createDateFrom, setCreateDateFrom] = useState(null); | |||
const [createDateTo, setCreateDateTo] = useState(null); | |||
// const [caseManagerList, setCaseManagerList] = useState([]); | |||
// const [consultantList, setConsultantList] = useState([]); | |||
@@ -69,24 +69,24 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { | |||
setExpanded(!expanded); | |||
}; | |||
const [joinDateFromError, setJoinDateFromError] = React.useState(null); | |||
const [joinDateToError, setJoinDateToError] = React.useState(null); | |||
const [createDateFromError, setCreateDateFromError] = React.useState(null); | |||
const [createDateToError, setCreateDateToError] = React.useState(null); | |||
const joinDateFromErrorMessage = React.useMemo(() => { | |||
switch (joinDateFromError) { | |||
const createDateFromErrorMessage = React.useMemo(() => { | |||
switch (createDateFromError) { | |||
case 'invalidDate': { | |||
return "Invalid date"; | |||
} | |||
} | |||
}, [joinDateFromError]); | |||
}, [createDateFromError]); | |||
const joinDateToErrorMessage = React.useMemo(() => { | |||
switch (joinDateToError) { | |||
const createDateToErrorMessage = React.useMemo(() => { | |||
switch (createDateToError) { | |||
case 'invalidDate': { | |||
return "Invalid date"; | |||
} | |||
} | |||
}, [joinDateToError]); | |||
}, [createDateToError]); | |||
const createNewClient = () => { | |||
navigate(`/client/maintain/-1`); | |||
@@ -95,8 +95,8 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { | |||
const onSubmit = (data) => { | |||
const criteria = { | |||
...data, | |||
joinDateFrom: joinDateFrom === null ? null : dayjs(joinDateFrom).format('YYYY-MM-DD'), | |||
joinDateTo: joinDateTo === null ? null : dayjs(joinDateTo).format('YYYY-MM-DD'), | |||
createDateFrom: createDateFrom === null ? null : dayjs(createDateFrom).format('YYYY-MM-DD'), | |||
createDateTo: createDateTo === null ? null : dayjs(createDateTo).format('YYYY-MM-DD'), | |||
// region: selectedRegion === null ? null : selectedRegion.label, | |||
// type: selectedType === null ? null :selectedType.label, | |||
// consultantIdList: getIdList(selectedConsultants), | |||
@@ -110,7 +110,7 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { | |||
// const temp = { | |||
// ...data, | |||
// fromDate: fromDate === null ? null : dayjs(fromDate).format('YYYY-MM-DD'), | |||
// joinDateTo: joinDateTo === null ? null : dayjs(joinDateTo).format('YYYY-MM-DD'), | |||
// createDateTo: createDateTo === null ? null : dayjs(createDateTo).format('YYYY-MM-DD'), | |||
// region: selectedRegion === null ? null : selectedRegion.label, | |||
// type: selectedType === null ? null :selectedType.label, | |||
// consultantIdList: getIdList(selectedConsultants), | |||
@@ -207,8 +207,8 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { | |||
// setSelectedConsultants([]); | |||
// setSelectedRegion(null); | |||
// setSelectedType(null); | |||
setJoinDateFrom(null); | |||
setJoinDateTo(null); | |||
setCreateDateFrom(null); | |||
setCreateDateTo(null); | |||
// setToDate(null); | |||
reset(); | |||
} | |||
@@ -357,24 +357,24 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { | |||
</Grid> */} | |||
<Grid item xs={9} s={6} md={5} lg={3} sx={{ml:3, mr:3, mb:0.5}}> | |||
<InputLabel htmlFor="joinDateFrom">Join Date</InputLabel> | |||
<InputLabel htmlFor="createDateFrom">Create Date</InputLabel> | |||
<Grid container> | |||
<Grid item xs={5.25} s={5.25} md={5.25} lg={5.5}> | |||
<LocalizationProvider dateAdapter={AdapterDayjs}> | |||
<DemoItem> | |||
<DatePicker | |||
id="joinDateFrom" | |||
onError={(newError) => setJoinDateFromError(newError)} | |||
id="createDateFrom" | |||
onError={(newError) => setCreateDateFromError(newError)} | |||
slotProps={{ | |||
field: { clearable: true }, | |||
textField: { | |||
helperText: joinDateFromErrorMessage, | |||
helperText: createDateFromErrorMessage, | |||
}, | |||
}} | |||
format="DD/MM/YYYY" | |||
value={joinDateFrom === null ? null : dayjs(joinDateFrom)} | |||
onChange={(newValue) => setJoinDateFrom(newValue)} | |||
value={createDateFrom === null ? null : dayjs(createDateFrom)} | |||
onChange={(newValue) => setCreateDateFrom(newValue)} | |||
// label="From" | |||
/> | |||
</DemoItem > | |||
@@ -390,17 +390,17 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { | |||
<DemoItem components={['DatePicker']}> | |||
<DatePicker | |||
format="DD/MM/YYYY" | |||
onError={(newError) => setJoinDateToError(newError)} | |||
onError={(newError) => setCreateDateToError(newError)} | |||
slotProps={{ | |||
field: { clearable: true }, | |||
textField: { | |||
helperText: joinDateToErrorMessage, | |||
helperText: createDateToErrorMessage, | |||
}, | |||
}} | |||
id="joinDateTo" | |||
id="createDateTo" | |||
//label="To Date" | |||
value={joinDateTo === null ? null : dayjs(joinDateTo)} | |||
onChange={(newValue) => setJoinDateTo(newValue)} | |||
value={createDateTo === null ? null : dayjs(createDateTo)} | |||
onChange={(newValue) => setCreateDateTo(newValue)} | |||
/> | |||
</DemoItem > | |||
</LocalizationProvider> | |||
@@ -432,7 +432,7 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { | |||
variant="contained" | |||
type="submit" | |||
color="save" | |||
disabled={joinDateFromError || joinDateToError} | |||
disabled={createDateFromError || createDateToError} | |||
> | |||
Search | |||
</Button> | |||
@@ -443,7 +443,7 @@ const ClientSearchForm = ({applySearch, setExpanded,expanded}) => { | |||
variant="contained" | |||
color="export" | |||
// onClick={onExport} | |||
// disabled={joinDateFromError || joinDateToError} | |||
// disabled={createDateFromError || createDateToError} | |||
> | |||
Export | |||
</Button> | |||
@@ -15,7 +15,7 @@ import {ThemeProvider} from "@emotion/react"; | |||
// ==============================|| CLIENT TABLE ||============================== // | |||
export default function ClientTable({recordList}) { | |||
export default function ClientTable({recordList, pageSize}) { | |||
const [rows, setRows] = React.useState(recordList); | |||
const [rowModesModel] = React.useState({}); | |||
const navigate = useNavigate() | |||
@@ -23,11 +23,11 @@ export default function ClientTable({recordList}) { | |||
const [paginationModel, setPaginationModel] = React.useState({ | |||
page: 0, | |||
pageSize:10 | |||
pageSize: 10 | |||
}); | |||
useEffect(() => { | |||
setPaginationModel({page:0,pageSize:10}); | |||
setPaginationModel({page:0,pageSize:pageSize}); | |||
setRows(recordList); | |||
}, [recordList]); | |||
@@ -108,14 +108,14 @@ export default function ClientTable({recordList}) { | |||
flex: 1.5, | |||
}, | |||
{ | |||
id: 'joinDate', | |||
field: 'joinDate', | |||
headerName: 'Join Date', | |||
id: 'created', | |||
field: 'created', | |||
headerName: 'Create Date', | |||
flex: 1, | |||
sortComparator: dateComparator, | |||
renderCell: (params) => ( | |||
<div> | |||
{getDateString(params.row.joinDate, 'dd/MM/yyyy')} | |||
{getDateString(params.row.created, 'dd/MM/yyyy')} | |||
</div> | |||
), | |||
}, | |||
@@ -53,9 +53,9 @@ const ClientSearchPage = () => { | |||
) | |||
.then((response) => { | |||
if (response.status === 200) { | |||
if (!isFormEmpty(searchCriteria) && !isObjEmpty(response.data.records)) { | |||
setExpanded(false); | |||
} | |||
// if (!isFormEmpty(searchCriteria) && !isObjEmpty(response.data.records)) { //Auto Collapse after Search | |||
// setExpanded(false); | |||
// } | |||
setRecord(response.data.records); | |||
setOnReady(true); | |||
} | |||
@@ -90,7 +90,7 @@ const ClientSearchPage = () => { | |||
<Grid container maxWidth justifyContent="space-between" sx={{mt:-2, width:CARD_MAX_WIDTH}} > | |||
<Grid item xs={4} s={4} md={4} lg={4} | |||
sx={{ mb: -2.25, display: 'flex', alignItems: 'center'}}> | |||
<Typography variant="h4">Search Client</Typography> | |||
<Typography variant="h4">Manage Client</Typography> | |||
</Grid> | |||
</Grid> | |||
</Grid> | |||
@@ -117,7 +117,7 @@ const ClientSearchPage = () => { | |||
sx={{mt:{lg:-1.5}, width: CARD_MAX_WIDTH}} | |||
> | |||
<div style={{/*height: expanded? '46vh' : '75vh',*/ width: '100%'}}> | |||
<div style={{/* height: expanded? '43vh' : '75vh',*/ width: '100%'}}> | |||
<ClientTable | |||
recordList={record} | |||
pageSize={10} | |||
@@ -14,10 +14,6 @@ import {useNavigate} from "react-router-dom"; | |||
import {useForm} from "react-hook-form"; | |||
import {useLocation, useParams} from "react-router-dom"; | |||
// Import your chosen commercial PDF SDK (e.g., PSPDFKit) | |||
import PSPDFKit from 'pspdfkit'; | |||
import WebViewer from '@compdfkit_pdf_sdk/webviewer'; | |||
import Nutrient from "@nutrient-sdk/viewer"; | |||
import { CollectionsBookmarkRounded } from '../../../../node_modules/@mui/icons-material/index'; | |||
import LoadingComponent from "../../extra-pages/LoadingComponent"; | |||
import { fill } from 'lodash'; | |||
@@ -124,7 +120,7 @@ function PDF() { | |||
})); | |||
setAdobeDCView(DCViewer); | |||
await DCViewer.previewFile( | |||
{ | |||
content: { | |||
@@ -157,6 +153,7 @@ function PDF() { | |||
handleSavePdf, | |||
{ autoSaveFrequency: 0, enableFormFilling: true } | |||
); | |||
console.log("viewer: ", DCViewer); | |||
} else { | |||
console.error('AdobeDC not available'); | |||
setError('Adobe SDK not loaded'); | |||
@@ -247,23 +244,9 @@ function PDF() { | |||
}; | |||
const handleBack = async () => { | |||
if (viewerLoaded) { | |||
await Nutrient.unload(viewerRef.current); | |||
} | |||
navigate(`/pdf/${record.clientId}`); | |||
}; | |||
const handleTest = () => { | |||
// const element = document.getElementById('pdfViewer'); | |||
// const inputFields = element.querySelectorAll('iframe')[0]; | |||
// console.log(element); | |||
// console.log(inputFields.contentDocument); | |||
// inputFields.forEach(input => { | |||
// console.log('Name:', input.name, 'Value:', input.value); | |||
// }); | |||
}; | |||
return ( | |||
<ThemeProvider theme={LIONER_BUTTON_THEME}> | |||
<div className="pdf-form-page"> {/* This is your 'pdfForm' page */} | |||
@@ -113,7 +113,7 @@ export default function PdfTable({recordList}) { | |||
sortComparator: dateComparator, | |||
renderCell: (params) => ( | |||
<div> | |||
{getDateString(params.row.created, 'dd/MM/yyyy')} | |||
{getDateString(params.row.created, 'dd/MM/yyyy HH:mm:ss')} | |||
</div> | |||
), | |||
}, | |||
@@ -125,7 +125,7 @@ export default function PdfTable({recordList}) { | |||
sortComparator: dateComparator, | |||
renderCell: (params) => ( | |||
<div> | |||
{getDateString(params.row.modified, 'dd/MM/yyyy')} | |||
{getDateString(params.row.modified, 'dd/MM/yyyy HH:mm:ss')} | |||
</div> | |||
), | |||
}, | |||
@@ -65,7 +65,7 @@ const PdfSearchPage = () => { | |||
useEffect(() => { | |||
if (params.id) { | |||
if (params.id > 0) {console.log("loggg"); | |||
if (params.id > 0) { | |||
axios.get(`${apiPath}${GET_CLIENT_PATH}/${params.id}` | |||
) | |||
.then((response) => { | |||