- env url changed to https;
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
REACT_APP_TAB_TITLE=Gepafin
|
REACT_APP_TAB_TITLE=Gepafin
|
||||||
REACT_APP_API_EXECUTION_ADDRESS=http://bandi-api.gepafin.it/v1
|
REACT_APP_API_EXECUTION_ADDRESS=https://bandi-api.gepafin.it/v1
|
||||||
REACT_APP_LOGO_FILENAME=logo.svg
|
REACT_APP_LOGO_FILENAME=logo.svg
|
||||||
@@ -256,3 +256,27 @@
|
|||||||
list-style: disc;
|
list-style: disc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.appForm__delegaForm {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 30px;
|
||||||
|
gap: 40px;
|
||||||
|
|
||||||
|
legend {
|
||||||
|
font-size: 21px;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.appForm__cols {
|
||||||
|
gap: 2em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.appForm__delegaFormHeader {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@ import BlockingOverlay from '../../components/BlockingOverlay';
|
|||||||
import CompanyService from '../../service/company-service';
|
import CompanyService from '../../service/company-service';
|
||||||
|
|
||||||
// tools
|
// tools
|
||||||
import { isPIVA } from '../../helpers/validators';
|
import { isPIVA, isCodiceFiscale } from '../../helpers/validators';
|
||||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||||
|
|
||||||
const ProfileCompany = () => {
|
const ProfileCompany = () => {
|
||||||
@@ -31,7 +31,9 @@ const ProfileCompany = () => {
|
|||||||
handleSubmit,
|
handleSubmit,
|
||||||
formState: { errors },
|
formState: { errors },
|
||||||
setValue,
|
setValue,
|
||||||
getValues
|
getValues,
|
||||||
|
watch,
|
||||||
|
register
|
||||||
} = useForm({
|
} = useForm({
|
||||||
defaultValues: useMemo(() => {
|
defaultValues: useMemo(() => {
|
||||||
return formInitialData;
|
return formInitialData;
|
||||||
@@ -40,6 +42,7 @@ const ProfileCompany = () => {
|
|||||||
});
|
});
|
||||||
const values = getValues();
|
const values = getValues();
|
||||||
const emptyValues = Object.values(values).filter(v => isEmpty(v) || isNil(v)).length;
|
const emptyValues = Object.values(values).filter(v => isEmpty(v) || isNil(v)).length;
|
||||||
|
const isLegalRepresentant = watch('isLegalRepresentant')
|
||||||
|
|
||||||
const setEmptyValues = () => {
|
const setEmptyValues = () => {
|
||||||
const formData = {
|
const formData = {
|
||||||
@@ -153,7 +156,7 @@ const ProfileCompany = () => {
|
|||||||
<div className="appPage__spacer"></div>
|
<div className="appPage__spacer"></div>
|
||||||
<Messages ref={infoMsgs}/>
|
<Messages ref={infoMsgs}/>
|
||||||
|
|
||||||
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
<form id="companyForm" className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
||||||
<BlockingOverlay shouldDisplay={isAsyncRequest}/>
|
<BlockingOverlay shouldDisplay={isAsyncRequest}/>
|
||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
<h2>{__('Informazioni aziendali', 'gepafin')}</h2>
|
<h2>{__('Informazioni aziendali', 'gepafin')}</h2>
|
||||||
@@ -174,6 +177,7 @@ const ProfileCompany = () => {
|
|||||||
<FormField
|
<FormField
|
||||||
type="textinput"
|
type="textinput"
|
||||||
fieldName="vatNumber"
|
fieldName="vatNumber"
|
||||||
|
disabled={!isNil(formInitialData.id)}
|
||||||
label={__('P.IVA', 'gepafin')}
|
label={__('P.IVA', 'gepafin')}
|
||||||
onBlurFn={checkVatNumber}
|
onBlurFn={checkVatNumber}
|
||||||
control={control}
|
control={control}
|
||||||
@@ -195,7 +199,7 @@ const ProfileCompany = () => {
|
|||||||
<div className="appForm__cols">
|
<div className="appForm__cols">
|
||||||
<FormField
|
<FormField
|
||||||
type="textinput"
|
type="textinput"
|
||||||
disabled={true}
|
disabled={isNil(formInitialData.id)}
|
||||||
fieldName="pec"
|
fieldName="pec"
|
||||||
label={__('Email PEC', 'gepafin')}
|
label={__('Email PEC', 'gepafin')}
|
||||||
control={control}
|
control={control}
|
||||||
@@ -256,7 +260,100 @@ const ProfileCompany = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="appPage__spacer"></div>
|
<div className="appPageSection">
|
||||||
|
<FormField
|
||||||
|
type="switch"
|
||||||
|
fieldName="isLegalRepresentant"
|
||||||
|
label={__('Sei il Rapprentante Legale dell’azienda?', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
onLabel={__('Si', 'gepafin')}
|
||||||
|
offLabel={__('No', 'gepafin')}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{!isLegalRepresentant
|
||||||
|
? <div className="appForm__delegaForm">
|
||||||
|
<div className="appForm__delegaFormHeader">
|
||||||
|
<legend>{__('Compilazione Delega', 'gepafin')}</legend>
|
||||||
|
<p className="appForm__delegaFormText">{__('Per procedere come delegato, compila il form seguente, scarica il documento della delega, fallo firmare dal rappresentante legale e ricaricalo.', 'gepafin')}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="appForm__cols">
|
||||||
|
<FormField
|
||||||
|
type="textinput"
|
||||||
|
fieldName="delegaFirstName"
|
||||||
|
label={__('Nome del rappresentante legale', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
type="textinput"
|
||||||
|
fieldName="delegaLastName"
|
||||||
|
label={__('Cognome del rappresentante legale', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
type="textinput"
|
||||||
|
fieldName="delegaCodiceFiscale"
|
||||||
|
label={__('Codice fiscale del rappresentante legale', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
config={{
|
||||||
|
required: __('È obbligatorio', 'gepafin'),
|
||||||
|
isCodiceFiscale
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
label={__('Genera documento Delega', 'gepafin')}
|
||||||
|
icon="pi pi-check" iconPos="right"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
type="fileuploadasync"
|
||||||
|
setDataFn={setValue}
|
||||||
|
fieldName="docs"
|
||||||
|
label={__('Carica documento Delega Firmato', 'gepafin')}
|
||||||
|
control={control}
|
||||||
|
errors={errors}
|
||||||
|
defaultValue={values['docs']}
|
||||||
|
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||||
|
accept={['application/pkcs7-mime']}
|
||||||
|
chooseLabel={__('Aggiungi documento', 'gepafin')}
|
||||||
|
multiple={true}
|
||||||
|
doctype="document"
|
||||||
|
register={register}
|
||||||
|
sourceId={values.id}
|
||||||
|
source="call"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<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> : null}
|
||||||
|
|
||||||
<div className="appPageSection__hr">
|
<div className="appPageSection__hr">
|
||||||
<span>{__('Azioni rapide', 'gepafin')}</span>
|
<span>{__('Azioni rapide', 'gepafin')}</span>
|
||||||
@@ -265,12 +362,12 @@ const ProfileCompany = () => {
|
|||||||
<div className="appPageSection">
|
<div className="appPageSection">
|
||||||
<div className="appPageSection__actions">
|
<div className="appPageSection__actions">
|
||||||
<Button
|
<Button
|
||||||
disabled={isAsyncRequest || emptyValues || values.id}
|
form="companyForm"
|
||||||
|
/*disabled={isAsyncRequest || emptyValues || values.id}*/
|
||||||
label={__('Salva modifiche', 'gepafin')}
|
label={__('Salva modifiche', 'gepafin')}
|
||||||
icon="pi pi-check" iconPos="right"/>
|
icon="pi pi-check" iconPos="right"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user