- env url changed to https;
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
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
|
||||
@@ -255,4 +255,28 @@
|
||||
li[data-list="bullet"] {
|
||||
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';
|
||||
|
||||
// tools
|
||||
import { isPIVA } from '../../helpers/validators';
|
||||
import { isPIVA, isCodiceFiscale } from '../../helpers/validators';
|
||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
|
||||
const ProfileCompany = () => {
|
||||
@@ -31,7 +31,9 @@ const ProfileCompany = () => {
|
||||
handleSubmit,
|
||||
formState: { errors },
|
||||
setValue,
|
||||
getValues
|
||||
getValues,
|
||||
watch,
|
||||
register
|
||||
} = useForm({
|
||||
defaultValues: useMemo(() => {
|
||||
return formInitialData;
|
||||
@@ -40,6 +42,7 @@ const ProfileCompany = () => {
|
||||
});
|
||||
const values = getValues();
|
||||
const emptyValues = Object.values(values).filter(v => isEmpty(v) || isNil(v)).length;
|
||||
const isLegalRepresentant = watch('isLegalRepresentant')
|
||||
|
||||
const setEmptyValues = () => {
|
||||
const formData = {
|
||||
@@ -153,7 +156,7 @@ const ProfileCompany = () => {
|
||||
<div className="appPage__spacer"></div>
|
||||
<Messages ref={infoMsgs}/>
|
||||
|
||||
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
||||
<form id="companyForm" className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
||||
<BlockingOverlay shouldDisplay={isAsyncRequest}/>
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Informazioni aziendali', 'gepafin')}</h2>
|
||||
@@ -174,6 +177,7 @@ const ProfileCompany = () => {
|
||||
<FormField
|
||||
type="textinput"
|
||||
fieldName="vatNumber"
|
||||
disabled={!isNil(formInitialData.id)}
|
||||
label={__('P.IVA', 'gepafin')}
|
||||
onBlurFn={checkVatNumber}
|
||||
control={control}
|
||||
@@ -195,7 +199,7 @@ const ProfileCompany = () => {
|
||||
<div className="appForm__cols">
|
||||
<FormField
|
||||
type="textinput"
|
||||
disabled={true}
|
||||
disabled={isNil(formInitialData.id)}
|
||||
fieldName="pec"
|
||||
label={__('Email PEC', 'gepafin')}
|
||||
control={control}
|
||||
@@ -256,7 +260,100 @@ const ProfileCompany = () => {
|
||||
</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">
|
||||
<span>{__('Azioni rapide', 'gepafin')}</span>
|
||||
@@ -265,12 +362,12 @@ const ProfileCompany = () => {
|
||||
<div className="appPageSection">
|
||||
<div className="appPageSection__actions">
|
||||
<Button
|
||||
disabled={isAsyncRequest || emptyValues || values.id}
|
||||
form="companyForm"
|
||||
/*disabled={isAsyncRequest || emptyValues || values.id}*/
|
||||
label={__('Salva modifiche', 'gepafin')}
|
||||
icon="pi pi-check" iconPos="right"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user