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