- fixed issue with number form field;
- fixed issue with datepicker form field; - updated tables displaying submitted calls;
This commit is contained in:
@@ -375,6 +375,10 @@
|
|||||||
gap: 24px;
|
gap: 24px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
&.lessGap {
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.appPageSection__addToFavourites {
|
.appPageSection__addToFavourites {
|
||||||
|
|||||||
@@ -28,18 +28,17 @@ const Datepicker = ({
|
|||||||
control={control}
|
control={control}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
rules={config}
|
rules={config}
|
||||||
render={({ field, fieldState }) => (
|
render={({ field, fieldState }) => (<Calendar id={field.name}
|
||||||
<Calendar id={field.name}
|
disabled={disabled}
|
||||||
disabled={disabled}
|
value={is(String, field.value) ? new Date(field.value) : field.value}
|
||||||
value={is(Date, field.value) ? field.value : null}
|
onChange={(e) => field.onChange(e.value)}
|
||||||
onChange={(e) => field.onChange(e.value)}
|
dateFormat="dd/mm/yy"
|
||||||
dateFormat="dd/mm/yy"
|
hourFormat="24"
|
||||||
hourFormat="24"
|
timeOnly={timeOnly}
|
||||||
timeOnly={timeOnly}
|
showIcon
|
||||||
showIcon
|
minDate={minDate}
|
||||||
minDate={minDate}
|
maxDate={maxDate}
|
||||||
maxDate={maxDate}
|
className={classNames({ 'p-invalid': fieldState.invalid })}/>
|
||||||
className={classNames({ 'p-invalid': fieldState.invalid })}/>
|
|
||||||
)}/>
|
)}/>
|
||||||
{infoText ? <small>{infoText}</small> : null}
|
{infoText ? <small>{infoText}</small> : null}
|
||||||
</>)
|
</>)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { classNames } from 'primereact/utils';
|
import { classNames } from 'primereact/utils';
|
||||||
import { Controller } from 'react-hook-form';
|
import { Controller } from 'react-hook-form';
|
||||||
import { is } from 'ramda';
|
import { is, isEmpty } from 'ramda';
|
||||||
|
|
||||||
import { InputNumber } from 'primereact/inputnumber';
|
import { InputNumber } from 'primereact/inputnumber';
|
||||||
|
|
||||||
@@ -23,6 +23,8 @@ const NumberInput = ({
|
|||||||
disabled = false,
|
disabled = false,
|
||||||
useGrouping = true
|
useGrouping = true
|
||||||
}) => {
|
}) => {
|
||||||
|
const minAttr = config.min ? config.min : min;
|
||||||
|
const maxAttr = config.max ? config.max : max;
|
||||||
const input = <Controller
|
const input = <Controller
|
||||||
name={fieldName}
|
name={fieldName}
|
||||||
control={control}
|
control={control}
|
||||||
@@ -33,8 +35,8 @@ const NumberInput = ({
|
|||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={(e) => field.onChange(e.value)}
|
onValueChange={(e) => field.onChange(e.value)}
|
||||||
min={min}
|
min={minAttr}
|
||||||
max={max}
|
max={maxAttr}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
useGrouping={useGrouping}
|
useGrouping={useGrouping}
|
||||||
maxFractionDigits={!isNaN(parseInt(maxFractionDigits)) ? parseInt(maxFractionDigits) : 0}
|
maxFractionDigits={!isNaN(parseInt(maxFractionDigits)) ? parseInt(maxFractionDigits) : 0}
|
||||||
@@ -45,6 +47,8 @@ const NumberInput = ({
|
|||||||
<>
|
<>
|
||||||
<label htmlFor={fieldName} className={classNames({ 'p-error': errors[fieldName] })}>
|
<label htmlFor={fieldName} className={classNames({ 'p-error': errors[fieldName] })}>
|
||||||
{label}{config.required || config.isRequired ? <span className="appForm__field--required">*</span> : null}
|
{label}{config.required || config.isRequired ? <span className="appForm__field--required">*</span> : null}
|
||||||
|
{!isEmpty(minAttr) ? <span>(min. {minAttr})</span> : null}
|
||||||
|
{!isEmpty(maxAttr) ? <span>(max. {maxAttr})</span> : null}
|
||||||
</label>
|
</label>
|
||||||
{inputgroup
|
{inputgroup
|
||||||
? <div className="p-inputgroup">
|
? <div className="p-inputgroup">
|
||||||
|
|||||||
@@ -202,7 +202,6 @@ const BandoEditFormStep1 = forwardRef(function ({ initialData, setInitialData, g
|
|||||||
}, [errors, isValid]);
|
}, [errors, isValid]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('here1')
|
|
||||||
storeSet.main.formInitialData(initialData);
|
storeSet.main.formInitialData(initialData);
|
||||||
setFormInitialData(initialData);
|
setFormInitialData(initialData);
|
||||||
}, [initialData]);
|
}, [initialData]);
|
||||||
|
|||||||
@@ -174,7 +174,6 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, setInitialData, g
|
|||||||
}, [errors, isValid]);
|
}, [errors, isValid]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('here2')
|
|
||||||
storeSet.main.formInitialData(initialData);
|
storeSet.main.formInitialData(initialData);
|
||||||
setFormInitialData(initialData);
|
setFormInitialData(initialData);
|
||||||
}, [initialData]);
|
}, [initialData]);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const MyLatestSubmissionsTable = () => {
|
|||||||
setLocalAsyncRequest(true);
|
setLocalAsyncRequest(true);
|
||||||
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
||||||
['companyId', chosenCompanyId],
|
['companyId', chosenCompanyId],
|
||||||
['statuses', ['DRAFT', 'AWAITING', 'READY']]
|
['statuses', ['DRAFT', 'AWAITING', 'READY', 'SUBMIT']]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}, [chosenCompanyId]);
|
}, [chosenCompanyId]);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLocalAsyncRequest(true);
|
setLocalAsyncRequest(true);
|
||||||
ApplicationService.getApplications(getCallback, errGetCallbacks, [
|
ApplicationService.getApplications(getCallback, errGetCallbacks, [
|
||||||
['statuses', 'SUBMIT']
|
['statuses', ['SUBMIT', 'EVALUATION', 'SOCCORSO']]
|
||||||
]);
|
]);
|
||||||
}, [updaterString]);
|
}, [updaterString]);
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const actionsBodyTemplate = (rowData) => {
|
const actionsBodyTemplate = (rowData) => {
|
||||||
return <>
|
return <div className="appPageSection__tableActions lessGap">
|
||||||
{openDialogFn
|
{openDialogFn
|
||||||
? <Button severity="info"
|
? <Button severity="info"
|
||||||
onClick={() => openDialogFn(rowData.id)}
|
onClick={() => openDialogFn(rowData.id)}
|
||||||
@@ -143,7 +143,7 @@ const AllDomandeTable = ({ openDialogFn, updaterString = '' }) => {
|
|||||||
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
<Button severity="info" label={__('Anteprima', 'gepafin')} icon="pi pi-eye" size="small"
|
||||||
iconPos="right"/>
|
iconPos="right"/>
|
||||||
</Link>
|
</Link>
|
||||||
</>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
const header = renderHeader();
|
const header = renderHeader();
|
||||||
|
|||||||
Reference in New Issue
Block a user