mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 03:17:39 -02:30
Fixes convergence data value on node edit mode
This commit is contained in:
@@ -54,14 +54,21 @@ const getNodeToEditDefaultValues = (
|
|||||||
identifier = nodeToEdit?.originalNodeObject?.identifier;
|
identifier = nodeToEdit?.originalNodeObject?.identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getConvergence = () => {
|
||||||
|
// There is a case where the nodeToEdit convergence value will not align with the
|
||||||
|
// original node object value. This allows the nodeToEdit value to take precedence over the
|
||||||
|
// original node object.
|
||||||
|
if (nodeToEdit) {
|
||||||
|
return nodeToEdit.all_parents_must_converge ? 'all' : 'any';
|
||||||
|
}
|
||||||
|
return nodeToEdit?.originalNodeObject?.all_parents_must_converge
|
||||||
|
? 'all'
|
||||||
|
: 'any';
|
||||||
|
};
|
||||||
const initialValues = {
|
const initialValues = {
|
||||||
nodeResource: nodeToEdit?.fullUnifiedJobTemplate || null,
|
nodeResource: nodeToEdit?.fullUnifiedJobTemplate || null,
|
||||||
nodeType: nodeToEdit?.fullUnifiedJobTemplate?.type || 'job_template',
|
nodeType: nodeToEdit?.fullUnifiedJobTemplate?.type || 'job_template',
|
||||||
convergence:
|
convergence: getConvergence(),
|
||||||
nodeToEdit?.all_parents_must_converge ||
|
|
||||||
nodeToEdit?.originalNodeObject?.all_parents_must_converge
|
|
||||||
? 'all'
|
|
||||||
: 'any',
|
|
||||||
identifier,
|
identifier,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -322,7 +329,6 @@ export default function useWorkflowNodeSteps(
|
|||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [launchConfig, surveyConfig, isReady]);
|
}, [launchConfig, surveyConfig, isReady]);
|
||||||
|
|
||||||
const stepWithError = steps.find((s) => s.contentError);
|
const stepWithError = steps.find((s) => s.contentError);
|
||||||
const contentError = stepWithError ? stepWithError.contentError : null;
|
const contentError = stepWithError ? stepWithError.contentError : null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user