mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
Fix worfklow node info
Fix workflow node info. See: https://github.com/ansible/awx/issues/11061 Also: https://github.com/ansible/awx/issues/10628
This commit is contained in:
@@ -190,16 +190,19 @@ function NodeViewModal({ readOnly }) {
|
|||||||
let nodeUpdatedConvergence = {};
|
let nodeUpdatedConvergence = {};
|
||||||
|
|
||||||
if (
|
if (
|
||||||
nodeToView.all_parents_must_converge !== undefined &&
|
nodeToView?.all_parents_must_converge !== undefined &&
|
||||||
nodeToView.all_parents_must_converge !==
|
nodeToView?.all_parents_must_converge !==
|
||||||
nodeToView.originalNodeObject.all_parents_must_converge
|
nodeToView?.originalNodeObject?.all_parents_must_converge
|
||||||
) {
|
) {
|
||||||
nodeUpdatedConvergence = {
|
nodeUpdatedConvergence = {
|
||||||
...nodeToView.originalNodeObject,
|
...nodeToView.originalNodeObject,
|
||||||
all_parents_must_converge: nodeToView.all_parents_must_converge,
|
all_parents_must_converge: nodeToView.all_parents_must_converge,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
nodeUpdatedConvergence = nodeToView.originalNodeObject;
|
nodeUpdatedConvergence = {
|
||||||
|
...nodeToView.originalNodeObject,
|
||||||
|
all_parents_must_converge: nodeToView?.all_parents_must_converge,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Content = (
|
Content = (
|
||||||
|
|||||||
@@ -300,4 +300,35 @@ describe('NodeViewModal', () => {
|
|||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Convergence label', () => {
|
||||||
|
const workflowContext = {
|
||||||
|
nodeToView: {
|
||||||
|
fullUnifiedJobTemplate: {
|
||||||
|
id: 1,
|
||||||
|
name: 'Mock Node',
|
||||||
|
description: '',
|
||||||
|
type: 'workflow_approval_template',
|
||||||
|
timeout: 0,
|
||||||
|
all_parents_must_converge: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
test('should display "Any" Convergence label', async () => {
|
||||||
|
let wrapper;
|
||||||
|
await act(async () => {
|
||||||
|
wrapper = mountWithContexts(
|
||||||
|
<WorkflowDispatchContext.Provider value={dispatch}>
|
||||||
|
<WorkflowStateContext.Provider value={workflowContext}>
|
||||||
|
<NodeViewModal />
|
||||||
|
</WorkflowStateContext.Provider>
|
||||||
|
</WorkflowDispatchContext.Provider>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
waitForLoaded(wrapper);
|
||||||
|
expect(wrapper.find('Detail[label="Convergence"] dd').text()).toBe('Any');
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user