Merge branch 'develop' into feature/93-user-details-page
This commit is contained in:
@@ -155,31 +155,6 @@ const BandoApplicationPreview = () => {
|
||||
user: {}
|
||||
};
|
||||
|
||||
/*if (company) {
|
||||
dynamicData = Object.keys(company).reduce((acc, cur) => {
|
||||
if ([
|
||||
'companyName', 'vatNumber', 'codiceFiscale', 'address', 'phoneNumber',
|
||||
'city', 'province', 'cap', 'country', 'pec', 'email', 'contactName', 'contactEmail'
|
||||
].includes(cur)) {
|
||||
acc.company[cur] = company[cur];
|
||||
}
|
||||
return acc;
|
||||
}, dynamicData);
|
||||
}
|
||||
|
||||
const userData = storeGet.main.userData();
|
||||
Object.keys(userData).reduce((acc, cur) => {
|
||||
if ([
|
||||
'email', 'firstName', 'lastName', 'phoneNumber', 'codiceFiscale'
|
||||
].includes(cur)) {
|
||||
acc.user[cur] = userData[cur];
|
||||
}
|
||||
if (['dateOfBirth'].includes(cur)) {
|
||||
acc.user[cur] = new Date(userData[cur]);
|
||||
}
|
||||
return acc;
|
||||
}, dynamicData);*/
|
||||
|
||||
if (data.data.applicationFormResponse.content) {
|
||||
// eslint-disable-next-line array-callback-return
|
||||
data.data.applicationFormResponse.content.map((o) => {
|
||||
@@ -252,14 +227,13 @@ const BandoApplicationPreview = () => {
|
||||
{activeStep > 1 && activeStep <= totalSteps
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={'SUBMIT' === applicationStatus}
|
||||
onClick={goBackward}
|
||||
label={__('Vai indietro', 'gepafin')}
|
||||
icon="pi pi-arrow-left"
|
||||
iconPos="left"/> : null}
|
||||
<Button
|
||||
type="button"
|
||||
disabled={isAsyncRequest || 'SUBMIT' === applicationStatus}
|
||||
disabled={isAsyncRequest}
|
||||
onClick={saveDraft}
|
||||
outlined
|
||||
label={__('Controlla', 'gepafin')} icon="pi pi-verified" iconPos="right"/>
|
||||
@@ -270,14 +244,8 @@ const BandoApplicationPreview = () => {
|
||||
label={__('Vai avanti', 'gepafin')}
|
||||
icon="pi pi-arrow-right"
|
||||
iconPos="right"/> : null}
|
||||
{/*<Button
|
||||
disabled={'SUBMIT' === applicationStatus}
|
||||
label={__('Convalidare', 'gepafin')}
|
||||
icon="pi pi-check"
|
||||
iconPos="right"/>*/}
|
||||
<Button
|
||||
type="button"
|
||||
disabled={'SUBMIT' === applicationStatus}
|
||||
onClick={onDownloadApplicationPdf}
|
||||
label={__('Scarica PDF', 'gepafin')}
|
||||
icon="pi pi-download"
|
||||
@@ -372,7 +340,7 @@ const BandoApplicationPreview = () => {
|
||||
: <FormField
|
||||
key={o.id}
|
||||
type={o.name}
|
||||
disabled={o.name === 'fileupload'}
|
||||
disabled={o.name === 'fileupload' || 'DRAFT' !== applicationStatus}
|
||||
fieldName={o.id}
|
||||
label={label ? label.value : ''}
|
||||
placeholder={placeholder ? placeholder.value : ''}
|
||||
|
||||
@@ -104,7 +104,7 @@ const BuilderElement = ({ id, name, label, index, bandoStatus }) => {
|
||||
</div>
|
||||
: <div ref={ref} className="formBuilder__element" style={{ opacity }} data-handler-id={handlerId}>
|
||||
<div className="meta">
|
||||
<Tag value={name} severity="info"/>
|
||||
<Tag value={label} severity="info"/>
|
||||
<BuilderElementProperLabel id={id} defaultLabel={label}/>
|
||||
</div>
|
||||
<div className="actions">
|
||||
|
||||
@@ -10,6 +10,7 @@ import { Editor } from 'primereact/editor';
|
||||
|
||||
import { mimeTypes } from '../../../../../../configData';
|
||||
import ElementSettingTableColumns from '../ElementSettingTableColumns';
|
||||
import { InputSwitch } from 'primereact/inputswitch';
|
||||
|
||||
const ElementSetting = ({ setting, changeFn, updateDataFn, bandoStatus }) => {
|
||||
|
||||
@@ -17,6 +18,7 @@ const ElementSetting = ({ setting, changeFn, updateDataFn, bandoStatus }) => {
|
||||
label: __('Label', 'gepafin'),
|
||||
placeholder: __('Segnaposto', 'gepafin'),
|
||||
step: __('Numero Decimali', 'gepafin'),
|
||||
isRequestedAmount: __('Importo richiesto', 'gepafin'),
|
||||
options: __('Opzioni', 'gepafin'),
|
||||
mime: __('Tipo di file', 'gepafin'),
|
||||
text: __('Testo formattato', 'gepafin'),
|
||||
@@ -78,6 +80,10 @@ const ElementSetting = ({ setting, changeFn, updateDataFn, bandoStatus }) => {
|
||||
name={setting.name}
|
||||
bandoStatus={bandoStatus}
|
||||
setDataFn={updateDataFn}/>
|
||||
} else if (setting.name === 'isRequestedAmount') {
|
||||
return <InputSwitch
|
||||
checked={setting.value}
|
||||
onChange={(e) => changeFn(e.value, setting.name)}/>
|
||||
} else {
|
||||
return <InputText id={setting.name} aria-describedby={`${setting.name}-help`}
|
||||
value={setting.value}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { klona } from 'klona';
|
||||
import { wrap } from 'object-path-immutable';
|
||||
|
||||
// store
|
||||
import { storeSet, useStore } from '../../../../store';
|
||||
import { storeGet, storeSet, useStore } from '../../../../store';
|
||||
|
||||
// components
|
||||
import { InputText } from 'primereact/inputtext';
|
||||
@@ -128,10 +128,20 @@ const BuilderElementSettings = ({ closeSettingsFn, bandoStatus }) => {
|
||||
|
||||
useEffect(() => {
|
||||
const chosen = head(elements.filter(o => o.id === activeElement));
|
||||
const elementItems = storeGet.main.elementItems();
|
||||
const chosenElementItemCfg = head(elementItems.filter(o => o.name === chosen.name));
|
||||
let settings = [];
|
||||
|
||||
if (chosenElementItemCfg) {
|
||||
settings = chosenElementItemCfg.settings.map((o) => {
|
||||
const setting = head(chosen.settings.filter(s => s.name === o.name));
|
||||
return setting ? klona(setting) : klona(o)
|
||||
});
|
||||
}
|
||||
|
||||
if (chosen) {
|
||||
setActiveElementData(klona(chosen));
|
||||
setSettings(klona(chosen.settings));
|
||||
setSettings(settings);
|
||||
setValidators(klona(chosen.validators));
|
||||
setDynamicData(chosen.dynamicData ? chosen.dynamicData : '');
|
||||
setCriteria(chosen.criteria ? chosen.criteria : []);
|
||||
|
||||
@@ -126,7 +126,8 @@ const BeneficiarioDomandeTable = () => {
|
||||
const statusFilterTemplate = (options) => {
|
||||
return <Dropdown value={options.value} options={statuses}
|
||||
onChange={(e) => options.filterCallback(e.value, options.index)}
|
||||
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel} className="p-column-filter"
|
||||
itemTemplate={statusItemTemplate} placeholder={translationStrings.selectOneLabel}
|
||||
className="p-column-filter"
|
||||
showClear/>;
|
||||
};
|
||||
|
||||
@@ -139,11 +140,17 @@ const BeneficiarioDomandeTable = () => {
|
||||
};
|
||||
|
||||
const actionsBodyTemplate = (rowData) => {
|
||||
return rowData.status === 'SOCCORSO'
|
||||
? <Link to={`/domande/${rowData.id}`}>
|
||||
<Button severity="info" label={__('Dettagli', 'gepafin')} icon="pi pi-eye" size="small"
|
||||
return <>
|
||||
{rowData.status === 'SOCCORSO'
|
||||
? <Link to={`/domande/${rowData.id}`}>
|
||||
<Button severity="info" label={__('Dettagli', 'gepafin')} icon="pi pi-eye" size="small"
|
||||
iconPos="right"/>
|
||||
</Link> : null}
|
||||
<Link to={`/domande/${rowData.id}/preview`}>
|
||||
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
||||
iconPos="right"/>
|
||||
</Link> : null;
|
||||
</Link>
|
||||
</>
|
||||
}
|
||||
|
||||
const header = renderHeader();
|
||||
|
||||
Reference in New Issue
Block a user