- update to contract functionality;
This commit is contained in:
@@ -15,7 +15,6 @@ import { storeGet, storeSet, useStoreValue } from '../../store';
|
||||
import ApplicationEvaluationService from '../../service/application-evaluation-service';
|
||||
import AmendmentsService from '../../service/amendments-service';
|
||||
import AppointmentService from '../../service/appointment-service';
|
||||
import ApplicationContractService from '../../service/application-contract-service';
|
||||
|
||||
// tools
|
||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
@@ -34,6 +33,7 @@ import getTokens from '../../helpers/getTokens';
|
||||
import parseCommaDecimal from '../../helpers/parseCommaDecimal';
|
||||
import renderWithDataVars from '../../helpers/renderWithDataVars';
|
||||
import renderHtmlContent from '../../helpers/renderHtmlContent';
|
||||
import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
|
||||
|
||||
// components
|
||||
import { Skeleton } from 'primereact/skeleton';
|
||||
@@ -60,7 +60,6 @@ import EvaluationReAdmit from './components/EvaluationReAdmit';
|
||||
import { SplitButton } from 'primereact/splitbutton';
|
||||
import { FileUpload } from 'primereact/fileupload';
|
||||
import { defaultMaxFileSize, mimeTypes, rejectionReasons } from '../../configData';
|
||||
import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
|
||||
import ArchiveDocument from './components/ArchiveDocument';
|
||||
|
||||
const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
|
||||
@@ -100,12 +99,12 @@ const DomandaEditPreInstructor = () => {
|
||||
duration: 0,
|
||||
amount: 0
|
||||
});
|
||||
const [isVisibleContractForm, setIsVisibleContractForm] = useState(false);
|
||||
/*const [isVisibleContractForm, setIsVisibleContractForm] = useState(false);
|
||||
const [contractFormData, setContractFormData] = useState({
|
||||
subject: '',
|
||||
text: ''
|
||||
});
|
||||
const contractFormFilesRef = useRef(null);
|
||||
const contractFormFilesRef = useRef(null);*/
|
||||
const [formData, setFormData] = useState([]);
|
||||
const [formId, setFormId] = useState(0);
|
||||
const [formInitialData, setFormInitialData] = useState(null);
|
||||
@@ -1008,14 +1007,12 @@ const DomandaEditPreInstructor = () => {
|
||||
setData(newData);
|
||||
}, [data]);
|
||||
|
||||
const openSendContractForm = () => {
|
||||
/*const openSendContractForm = () => {
|
||||
setIsVisibleContractForm(true);
|
||||
}
|
||||
|
||||
const headerContractDialog = () => {
|
||||
return <span>{__('Invia il contratto', 'gepafin')}</span>;
|
||||
}
|
||||
|
||||
const hideContractDialog = () => {
|
||||
setIsVisibleContractForm(false);
|
||||
setContractFormData({
|
||||
@@ -1023,7 +1020,6 @@ const DomandaEditPreInstructor = () => {
|
||||
text: ''
|
||||
});
|
||||
}
|
||||
|
||||
const footerContractDialog = useCallback(() => {
|
||||
let isDisabled = !contractFormData.subject || isEmpty(contractFormData.subject)
|
||||
|| !contractFormData.text || isEmpty(contractFormData.text)
|
||||
@@ -1037,12 +1033,10 @@ const DomandaEditPreInstructor = () => {
|
||||
label={__('Invia', 'gepafin')} onClick={doSendContract}/>
|
||||
</div>
|
||||
}, [contractFormData]);
|
||||
|
||||
const updateContractFormData = (value, path) => {
|
||||
const newData = wrap(contractFormData).set(path.split('.'), value).value();
|
||||
setContractFormData(newData);
|
||||
};
|
||||
|
||||
const doSendContract = useCallback(() => {
|
||||
if (
|
||||
contractFormData.subject && !isEmpty(contractFormData.subject)
|
||||
@@ -1075,7 +1069,6 @@ const DomandaEditPreInstructor = () => {
|
||||
);
|
||||
}
|
||||
}, [contractFormData]);
|
||||
|
||||
const getUploadApplicationContractCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
setData((prev) => ({
|
||||
@@ -1094,7 +1087,6 @@ const DomandaEditPreInstructor = () => {
|
||||
hideContractDialog();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errGetUploadApplicationContractCallback = (data) => {
|
||||
if (toast.current && data.message) {
|
||||
toast.current.show({
|
||||
@@ -1106,7 +1098,7 @@ const DomandaEditPreInstructor = () => {
|
||||
hideContractDialog();
|
||||
set404FromErrorResponse(data);
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
}*/
|
||||
|
||||
const actionBtns = () => {
|
||||
return <div className="appPageSection__actions">
|
||||
@@ -1243,13 +1235,16 @@ const DomandaEditPreInstructor = () => {
|
||||
onClick={initiateRejecting}
|
||||
label={__('Respingi domanda', 'gepafin')}
|
||||
icon="pi pi-times" iconPos="right"/> : null}
|
||||
{APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE' && data.applicationStatus === 'APPROVED'
|
||||
{/*
|
||||
This functionality has been moved
|
||||
*/}
|
||||
{/*{APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE' && data.applicationStatus === 'APPROVED'
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={!data.id}
|
||||
onClick={openSendContractForm}
|
||||
label={__('Invia il contratto', 'gepafin')}
|
||||
/> : null}
|
||||
/> : null}*/}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -2035,7 +2030,10 @@ const DomandaEditPreInstructor = () => {
|
||||
</div>
|
||||
</Dialog>
|
||||
|
||||
<Dialog
|
||||
{/*
|
||||
This functionality has been moved
|
||||
*/}
|
||||
{/*<Dialog
|
||||
visible={isVisibleContractForm}
|
||||
modal
|
||||
header={headerContractDialog}
|
||||
@@ -2130,7 +2128,7 @@ const DomandaEditPreInstructor = () => {
|
||||
emptyTemplate={<p className="m-0">{__('Trascina i file qua')}</p>}
|
||||
/>
|
||||
</div>
|
||||
</Dialog>
|
||||
</Dialog>*/}
|
||||
</div>
|
||||
: <>
|
||||
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
||||
|
||||
Reference in New Issue
Block a user