- saving progress;
This commit is contained in:
@@ -35,7 +35,6 @@ const BandoFlowEdit = () => {
|
||||
const [forms, setForms] = useState([]);
|
||||
const [formOptions, setFormOptions] = useState([]);
|
||||
const [chosenMainFieldOptions, setChosenMainFieldOptions] = useState([]);
|
||||
//const [chosenMainField, setChosenMainField] = useState('');
|
||||
const [mainFieldSuboptions, setMainFieldSubOptions] = useState([]);
|
||||
const [bandoStatus, setBandoStatus] = useState('');
|
||||
const [isFlowAllowed, setIsFlowAllowed] = useState(true);
|
||||
@@ -162,18 +161,18 @@ const BandoFlowEdit = () => {
|
||||
const shoudDisableSaving = useCallback(() => {
|
||||
const nonEmptyFlowItems = flowStructure.flowData.filter(o => isEmpty(o.chosenField)).filter(o => !isEmpty(o.chosenValue));
|
||||
|
||||
/*if (flowForms.length > 2) {
|
||||
console.log('disable BTN:', nonEmptyFlowItems.length !== flowForms.length - 2, isEmpty(flowEdges), 'PUBLISH' === bandoStatus,
|
||||
isEmpty(initialForm), isEmpty(finalForm));
|
||||
/*if (forms.length > 2) {
|
||||
console.log('disable BTN:', nonEmptyFlowItems.length !== forms.length - 2, isEmpty(flowStructure.flowEdges), 'PUBLISH' === bandoStatus,
|
||||
isEmpty(flowStructure.initialForm), isEmpty(flowStructure.finalForm));
|
||||
} else {
|
||||
console.log('disable BTN:', nonEmptyFlowItems.length !== 1, isEmpty(flowEdges), 'PUBLISH' === bandoStatus,
|
||||
isEmpty(initialForm), isEmpty(finalForm));
|
||||
console.log('disable BTN (2 forms):', isEmpty(flowStructure.flowEdges), 'PUBLISH' === bandoStatus,
|
||||
isEmpty(flowStructure.initialForm), isEmpty(flowStructure.finalForm));
|
||||
}*/
|
||||
|
||||
return forms.length > 2
|
||||
? nonEmptyFlowItems.length !== forms.length - 2 || isEmpty(flowStructure.flowEdges) || 'PUBLISH' === bandoStatus
|
||||
|| isEmpty(flowStructure.initialForm) || isEmpty(flowStructure.finalForm)
|
||||
: nonEmptyFlowItems.length !== 1 || isEmpty(flowStructure.flowEdges) || 'PUBLISH' === bandoStatus
|
||||
: isEmpty(flowStructure.flowEdges) || 'PUBLISH' === bandoStatus
|
||||
|| isEmpty(flowStructure.initialForm) || isEmpty(flowStructure.finalForm);
|
||||
}, [flowStructure, forms]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user