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