- added new role;
- added logic of statuses for amendment;
This commit is contained in:
@@ -19,6 +19,7 @@ const RepeaterFields = ({
|
||||
updateCallbackFn = () => {
|
||||
},
|
||||
defaultValue = [],
|
||||
shouldDisable = false
|
||||
}) => {
|
||||
const [chosen, setChosen] = useState('');
|
||||
const {
|
||||
@@ -92,6 +93,7 @@ const RepeaterFields = ({
|
||||
<div className="fieldsRepeater__heading p-panel p-panel-header">
|
||||
<span onClick={() => setNewChosen(o.fieldId)}>{o.nameValue}</span>
|
||||
<Button icon="pi pi-times"
|
||||
disabled={shouldDisable}
|
||||
outlined
|
||||
severity="danger"
|
||||
className="actionBtn"
|
||||
@@ -102,6 +104,7 @@ const RepeaterFields = ({
|
||||
<div className="fieldsRepeater__fields p-panel-content" data-hide={chosen !== o.fieldId}>
|
||||
<FormField
|
||||
type="textinput"
|
||||
disabled={shouldDisable}
|
||||
fieldName={`items.${index}.nameValue`}
|
||||
label={__('Titolo del file', 'gepafin')}
|
||||
control={control}
|
||||
@@ -111,7 +114,7 @@ const RepeaterFields = ({
|
||||
/>
|
||||
<FormField
|
||||
type="fileupload"
|
||||
disabled={isEmpty(o.nameValue)}
|
||||
disabled={isEmpty(o.nameValue) || shouldDisable}
|
||||
setDataFn={setValue}
|
||||
saveFormCallback={doUpdateAfterFileUploaded}
|
||||
fieldName={`items.${index}.fileValue`}
|
||||
@@ -135,7 +138,7 @@ const RepeaterFields = ({
|
||||
className="fieldsRepeater__addNew"
|
||||
outlined
|
||||
type="button"
|
||||
disabled={watchFields && watchFields.filter(o => isEmpty(o.nameValue) || isEmpty(o.fileValue)).length > 0}
|
||||
disabled={watchFields && watchFields.filter(o => isEmpty(o.nameValue) || isEmpty(o.fileValue)).length > 0 || shouldDisable}
|
||||
onClick={addNew}
|
||||
label={__('Aggiungi nuovo file', 'gepafin')}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user