- added confirmation for amendment;
- fixed amendment creation; - added configrmation for appl deletion; - re added delega related fieldss on company profile page for non gepafin hubs;
This commit is contained in:
@@ -24,6 +24,7 @@ import { Tag } from 'primereact/tag';
|
|||||||
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import translationStrings from '../../../../translationStringsForComponents';
|
import translationStrings from '../../../../translationStringsForComponents';
|
||||||
|
import { ConfirmPopup, confirmPopup } from 'primereact/confirmpopup';
|
||||||
|
|
||||||
const MyLatestSubmissionsTable = () => {
|
const MyLatestSubmissionsTable = () => {
|
||||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||||
@@ -167,8 +168,10 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
<Button severity="info" label={__('Modifica', 'gepafin')} icon="pi pi-pencil" size="small"
|
<Button severity="info" label={__('Modifica', 'gepafin')} icon="pi pi-pencil" size="small"
|
||||||
iconPos="right"/>
|
iconPos="right"/>
|
||||||
</Link>
|
</Link>
|
||||||
|
<ConfirmPopup/>
|
||||||
<Button severity="danger"
|
<Button severity="danger"
|
||||||
onClick={() => handleDeleteApplication(rowData.id)}
|
/*onClick={() => handleDeleteApplication(rowData.id)}*/
|
||||||
|
onClick={(event) => confirmDelete(event, rowData.id)}
|
||||||
label={__('Cancella', 'gepafin')}
|
label={__('Cancella', 'gepafin')}
|
||||||
icon="pi pi-trash"
|
icon="pi pi-trash"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -183,6 +186,22 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
|
|
||||||
const header = renderHeader();
|
const header = renderHeader();
|
||||||
|
|
||||||
|
const confirmDelete = (event, id) => {
|
||||||
|
confirmPopup({
|
||||||
|
target: event.currentTarget,
|
||||||
|
message: __('Sei sicuro di voler rimuovere la domanda?', 'gepafin'),
|
||||||
|
acceptLabel: __('Si', 'gepafin'),
|
||||||
|
icon: 'pi pi-info-circle',
|
||||||
|
defaultFocus: 'reject',
|
||||||
|
acceptClassName: 'p-button-danger',
|
||||||
|
accept: () => {
|
||||||
|
handleDeleteApplication(id);
|
||||||
|
},
|
||||||
|
reject: () => {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="appPageSection__table">
|
<div className="appPageSection__table">
|
||||||
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
<DataTable value={items} paginator showGridlines rows={10} loading={localAsyncRequest} dataKey="id"
|
||||||
|
|||||||
@@ -23,12 +23,15 @@ import FormField from '../../components/FormField';
|
|||||||
import { Button } from 'primereact/button';
|
import { Button } from 'primereact/button';
|
||||||
import BlockingOverlay from '../../components/BlockingOverlay';
|
import BlockingOverlay from '../../components/BlockingOverlay';
|
||||||
import { InputText } from 'primereact/inputtext';
|
import { InputText } from 'primereact/inputtext';
|
||||||
//import FileuploadDelega from '../../components/FileuploadDelega';
|
import FileuploadDelega from '../../components/FileuploadDelega';
|
||||||
import { Toast } from 'primereact/toast';
|
import { Toast } from 'primereact/toast';
|
||||||
//import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
|
import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText';
|
||||||
//import { defaultMaxFileSize } from '../../configData';
|
import { defaultMaxFileSize } from '../../configData';
|
||||||
//import { Dialog } from 'primereact/dialog';
|
//import { Dialog } from 'primereact/dialog';
|
||||||
import { confirmPopup, ConfirmPopup } from 'primereact/confirmpopup';
|
import { confirmPopup, ConfirmPopup } from 'primereact/confirmpopup';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
|
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||||
|
|
||||||
const ProfileCompany = () => {
|
const ProfileCompany = () => {
|
||||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
@@ -37,7 +40,8 @@ const ProfileCompany = () => {
|
|||||||
const infoMsgs = useRef(null);
|
const infoMsgs = useRef(null);
|
||||||
const [formInitialData, setFormInitialData] = useState({});
|
const [formInitialData, setFormInitialData] = useState({});
|
||||||
const [delegaData, setDelegaData] = useState({});
|
const [delegaData, setDelegaData] = useState({});
|
||||||
//const [delega, setDelega] = useState([]);
|
const navigate = useNavigate();
|
||||||
|
const [delega, setDelega] = useState([]);
|
||||||
//const [isVisibleRemoveDialog, setIsVisibleRemoveDialog] = useState(false);
|
//const [isVisibleRemoveDialog, setIsVisibleRemoveDialog] = useState(false);
|
||||||
const { delegaFirstName = '', delegaLastName = '', delegaCodiceFiscale = '' } = delegaData;
|
const { delegaFirstName = '', delegaLastName = '', delegaCodiceFiscale = '' } = delegaData;
|
||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
@@ -90,7 +94,6 @@ const ProfileCompany = () => {
|
|||||||
} else {
|
} else {
|
||||||
newCompanies = [...companies, company];
|
newCompanies = [...companies, company];
|
||||||
storeSet.main.chosenCompanyId(company.id);
|
storeSet.main.chosenCompanyId(company.id);
|
||||||
console.log('set company 3', company.id)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
storeSet.main.companies(newCompanies);
|
storeSet.main.companies(newCompanies);
|
||||||
@@ -161,11 +164,11 @@ const ProfileCompany = () => {
|
|||||||
setDelegaData(newDelegaData)
|
setDelegaData(newDelegaData)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*const setDelegaFile = (name, value) => {
|
const setDelegaFile = (name, value) => {
|
||||||
setDelega(value);
|
setDelega(value);
|
||||||
}*/
|
}
|
||||||
|
|
||||||
/*const getDellegaCallback = (data) => {
|
const getDellegaCallback = (data) => {
|
||||||
if (data.data) {
|
if (data.data) {
|
||||||
setDelega([data.data]);
|
setDelega([data.data]);
|
||||||
}
|
}
|
||||||
@@ -175,7 +178,7 @@ const ProfileCompany = () => {
|
|||||||
const errDellegaCallback = () => {
|
const errDellegaCallback = () => {
|
||||||
setDelega([]);
|
setDelega([]);
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}*/
|
}
|
||||||
|
|
||||||
const downloadDelega = () => {
|
const downloadDelega = () => {
|
||||||
storeSet.main.setAsyncRequest();
|
storeSet.main.setAsyncRequest();
|
||||||
@@ -206,7 +209,7 @@ const ProfileCompany = () => {
|
|||||||
const confirmDelete = (event) => {
|
const confirmDelete = (event) => {
|
||||||
confirmPopup({
|
confirmPopup({
|
||||||
target: event.currentTarget,
|
target: event.currentTarget,
|
||||||
message: __('Sei sicuro di rimuovere la azienda?', 'gepafin'),
|
message: __('Sei sicuro di voler rimuovere l\'azienda?', 'gepafin'),
|
||||||
acceptLabel: __('Si', 'gepafin'),
|
acceptLabel: __('Si', 'gepafin'),
|
||||||
icon: 'pi pi-info-circle',
|
icon: 'pi pi-info-circle',
|
||||||
defaultFocus: 'reject',
|
defaultFocus: 'reject',
|
||||||
@@ -281,8 +284,8 @@ const ProfileCompany = () => {
|
|||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
const userData = storeGet.main.userData();
|
const userData = storeGet.main.userData();
|
||||||
const newCompanies = companies.filter(o => o.id !== chosenCompanyId);
|
const newCompanies = companies.filter(o => o.id !== chosenCompanyId);
|
||||||
const newUserData = wrap(userData).set('company', newCompanies).value();
|
storeSet.main.companies(newCompanies);
|
||||||
storeSet.main.companies(newUserData.companies);
|
const newUserData = wrap(userData).set('companies', newCompanies).value();
|
||||||
storeSet.main.userData(newUserData);
|
storeSet.main.userData(newUserData);
|
||||||
|
|
||||||
if (!isEmpty(newCompanies)) {
|
if (!isEmpty(newCompanies)) {
|
||||||
@@ -290,6 +293,7 @@ const ProfileCompany = () => {
|
|||||||
storeSet.main.chosenCompanyId(newChosenCompanyId);
|
storeSet.main.chosenCompanyId(newChosenCompanyId);
|
||||||
} else {
|
} else {
|
||||||
storeSet.main.chosenCompanyId(0);
|
storeSet.main.chosenCompanyId(0);
|
||||||
|
navigate(`/`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
@@ -339,14 +343,14 @@ const ProfileCompany = () => {
|
|||||||
setFormInitialData(companyData);
|
setFormInitialData(companyData);
|
||||||
}, [chosenCompanyId, companies]);
|
}, [chosenCompanyId, companies]);
|
||||||
|
|
||||||
/*useEffect(() => {
|
useEffect(() => {
|
||||||
if (formInitialData.id) {
|
if (formInitialData.id) {
|
||||||
storeSet.main.setAsyncRequest();
|
storeSet.main.setAsyncRequest();
|
||||||
CompanyService.getCompanyDelega(getDellegaCallback, errDellegaCallback, [
|
CompanyService.getCompanyDelega(getDellegaCallback, errDellegaCallback, [
|
||||||
['companyId', formInitialData.id]
|
['companyId', formInitialData.id]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, [formInitialData])*/
|
}, [formInitialData])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="appPage">
|
<div className="appPage">
|
||||||
@@ -555,16 +559,18 @@ const ProfileCompany = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
{APP_HUB_ID !== 'p4lk3bcx1RStqTaIVVbXs'
|
||||||
|
? <div>
|
||||||
<Button
|
<Button
|
||||||
disabled={isEmpty(delegaCodiceFiscale) || isEmpty(delegaFirstName) || isEmpty(delegaLastName)}
|
disabled={isEmpty(delegaCodiceFiscale) || isEmpty(delegaFirstName) || isEmpty(delegaLastName)}
|
||||||
onClick={downloadDelega}
|
onClick={downloadDelega}
|
||||||
type="button"
|
type="button"
|
||||||
label={__('Genera documento Delega', 'gepafin')}
|
label={__('Genera documento Delega', 'gepafin')}
|
||||||
icon="pi pi-check" iconPos="right"/>
|
icon="pi pi-check" iconPos="right"/>
|
||||||
</div>
|
</div> : null}
|
||||||
|
|
||||||
{/*<div className="appForm__field">
|
{APP_HUB_ID !== 'p4lk3bcx1RStqTaIVVbXs'
|
||||||
|
? <div className="appForm__field">
|
||||||
<label htmlFor="delega">
|
<label htmlFor="delega">
|
||||||
{__('Carica documento Delega Firmato', 'gepafin')}
|
{__('Carica documento Delega Firmato', 'gepafin')}
|
||||||
<span className="appForm__field--required">*</span>
|
<span className="appForm__field--required">*</span>
|
||||||
@@ -581,24 +587,7 @@ const ProfileCompany = () => {
|
|||||||
doctype="document"
|
doctype="document"
|
||||||
companyId={formInitialData.id}
|
companyId={formInitialData.id}
|
||||||
/>
|
/>
|
||||||
</div>*/}
|
</div> : null}
|
||||||
|
|
||||||
{/*<div className="appForm__delegaFormActions">
|
|
||||||
<Button
|
|
||||||
type="button"
|
|
||||||
disabled={true}
|
|
||||||
outlined
|
|
||||||
onClick={() => {
|
|
||||||
}}
|
|
||||||
label={__('Visualizza delega', 'gepafin')} icon="pi pi-eye" iconPos="right"/>
|
|
||||||
<Button
|
|
||||||
type="button"
|
|
||||||
disabled={true}
|
|
||||||
outlined
|
|
||||||
onClick={() => {
|
|
||||||
}}
|
|
||||||
label={__('Sostituisci delega', 'gepafin')} icon="pi pi-sync" iconPos="right"/>
|
|
||||||
</div>*/}
|
|
||||||
|
|
||||||
</div> : <div className="appPage__spacer"></div>}
|
</div> : <div className="appPage__spacer"></div>}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import BlockingOverlay from '../../components/BlockingOverlay';
|
|||||||
import { Toast } from 'primereact/toast';
|
import { Toast } from 'primereact/toast';
|
||||||
import { InputSwitch } from 'primereact/inputswitch';
|
import { InputSwitch } from 'primereact/inputswitch';
|
||||||
import ApplicationEvaluationService from '../../service/application-evaluation-service';
|
import ApplicationEvaluationService from '../../service/application-evaluation-service';
|
||||||
|
import { Dialog } from 'primereact/dialog';
|
||||||
|
|
||||||
const SoccorsoAddPreInstructor = () => {
|
const SoccorsoAddPreInstructor = () => {
|
||||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
@@ -31,6 +32,7 @@ const SoccorsoAddPreInstructor = () => {
|
|||||||
const [data, setData] = useState({});
|
const [data, setData] = useState({});
|
||||||
const [evaluationId, setEvaluationId] = useState(0);
|
const [evaluationId, setEvaluationId] = useState(0);
|
||||||
const [formData, setFormData] = useState({});
|
const [formData, setFormData] = useState({});
|
||||||
|
const [isVisibleConfirmDialog, setIsVisibleConfirmDialog] = useState(false)
|
||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
|
|
||||||
const goToEvaluationPage = () => {
|
const goToEvaluationPage = () => {
|
||||||
@@ -49,8 +51,8 @@ const SoccorsoAddPreInstructor = () => {
|
|||||||
|
|
||||||
const getCallbackEvaluation = (data) => {
|
const getCallbackEvaluation = (data) => {
|
||||||
if (data.status === 'SUCCESS') {
|
if (data.status === 'SUCCESS') {
|
||||||
setEvaluationId(data.data.assignedApplicationId);
|
setEvaluationId(data.data.id);
|
||||||
AmendmentsService.getSoccorsoByApplEvalId(data.data.assignedApplicationId, getCallback, errGetCallback)
|
AmendmentsService.getSoccorsoByApplEvalId(data.data.id, getCallback, errGetCallback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,6 +154,32 @@ const SoccorsoAddPreInstructor = () => {
|
|||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const initCreationProcess = () => {
|
||||||
|
setIsVisibleConfirmDialog(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const headerConfirmDialog = () => {
|
||||||
|
return <span>{__('Richiesta di conferma', 'gepafin')}</span>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const hideConfirmDialog = () => {
|
||||||
|
setIsVisibleConfirmDialog(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const footerConfirmDialog = () => {
|
||||||
|
return <div>
|
||||||
|
<Button type="button" label={__('No', 'gepafin')} onClick={goToEvaluationPage} outlined/>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
label={__('Si', 'gepafin')} onClick={doConfirm}/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
const doConfirm = () => {
|
||||||
|
setIsVisibleConfirmDialog(false);
|
||||||
|
doCreate();
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="appPage">
|
<div className="appPage">
|
||||||
<div className="appPage__pageHeader">
|
<div className="appPage__pageHeader">
|
||||||
@@ -286,12 +314,24 @@ const SoccorsoAddPreInstructor = () => {
|
|||||||
icon="pi pi-times" iconPos="right"/>
|
icon="pi pi-times" iconPos="right"/>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={doCreate}
|
onClick={initCreationProcess}
|
||||||
label={__('Invia richiesta', 'gepafin')}
|
label={__('Invia richiesta', 'gepafin')}
|
||||||
icon="pi pi-check" iconPos="right"/>
|
icon="pi pi-check" iconPos="right"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
visible={isVisibleConfirmDialog}
|
||||||
|
modal
|
||||||
|
header={headerConfirmDialog}
|
||||||
|
footer={footerConfirmDialog}
|
||||||
|
style={{ maxWidth: '600px', width: '100%' }}
|
||||||
|
onHide={hideConfirmDialog}>
|
||||||
|
<div className="appForm__field">
|
||||||
|
<p>{__('Soccorso istruttorio autorizzato dal direttore e autorizzazione caricata su portale a seguito del quale parte l\'email?', 'gepafin')}</p>
|
||||||
|
</div>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
: <>
|
: <>
|
||||||
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
<Skeleton width="20%" height="1rem" className="mb-2"></Skeleton>
|
||||||
|
|||||||
Reference in New Issue
Block a user