mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Fixes convergence data value on node edit mode
This commit is contained in:
parent
51b45c4fac
commit
a7ed9c5ff6
@ -54,14 +54,21 @@ const getNodeToEditDefaultValues = (
|
||||
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 = {
|
||||
nodeResource: nodeToEdit?.fullUnifiedJobTemplate || null,
|
||||
nodeType: nodeToEdit?.fullUnifiedJobTemplate?.type || 'job_template',
|
||||
convergence:
|
||||
nodeToEdit?.all_parents_must_converge ||
|
||||
nodeToEdit?.originalNodeObject?.all_parents_must_converge
|
||||
? 'all'
|
||||
: 'any',
|
||||
convergence: getConvergence(),
|
||||
identifier,
|
||||
};
|
||||
|
||||
@ -322,7 +329,6 @@ export default function useWorkflowNodeSteps(
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [launchConfig, surveyConfig, isReady]);
|
||||
|
||||
const stepWithError = steps.find((s) => s.contentError);
|
||||
const contentError = stepWithError ? stepWithError.contentError : null;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user