mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Merge pull request #6429 from marshmalien/5992-wf-doc-btn
Hookup WF documentation button to visualizer toolbar Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
ca82f48c18
@ -46,6 +46,9 @@ const ActionButton = styled(Button)`
|
|||||||
`;
|
`;
|
||||||
ActionButton.displayName = 'ActionButton';
|
ActionButton.displayName = 'ActionButton';
|
||||||
|
|
||||||
|
const DOCLINK =
|
||||||
|
'https://docs.ansible.com/ansible-tower/latest/html/userguide/workflow_templates.html#ug-wf-editor';
|
||||||
|
|
||||||
function VisualizerToolbar({
|
function VisualizerToolbar({
|
||||||
i18n,
|
i18n,
|
||||||
onClose,
|
onClose,
|
||||||
@ -95,9 +98,12 @@ function VisualizerToolbar({
|
|||||||
</ActionButton>
|
</ActionButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<ActionButton
|
<ActionButton
|
||||||
|
aria-label={i18n._(t`Workflow Documentation`)}
|
||||||
id="visualizer-documentation"
|
id="visualizer-documentation"
|
||||||
variant="plain"
|
variant="plain"
|
||||||
isDisabled
|
component="a"
|
||||||
|
target="_blank"
|
||||||
|
href={DOCLINK}
|
||||||
>
|
>
|
||||||
<BookIcon />
|
<BookIcon />
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
|
@ -62,6 +62,14 @@ describe('VisualizerToolbar', () => {
|
|||||||
expect(wrapper.find('Badge').text()).toBe('1');
|
expect(wrapper.find('Badge').text()).toBe('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Should display action buttons', () => {
|
||||||
|
expect(wrapper.find('CompassIcon')).toHaveLength(1);
|
||||||
|
expect(wrapper.find('WrenchIcon')).toHaveLength(1);
|
||||||
|
expect(wrapper.find('BookIcon')).toHaveLength(1);
|
||||||
|
expect(wrapper.find('RocketIcon')).toHaveLength(1);
|
||||||
|
expect(wrapper.find('TrashAltIcon')).toHaveLength(1);
|
||||||
|
});
|
||||||
|
|
||||||
test('Toggle Legend button dispatches as expected', () => {
|
test('Toggle Legend button dispatches as expected', () => {
|
||||||
wrapper.find('CompassIcon').simulate('click');
|
wrapper.find('CompassIcon').simulate('click');
|
||||||
expect(dispatch).toHaveBeenCalledWith({ type: 'TOGGLE_LEGEND' });
|
expect(dispatch).toHaveBeenCalledWith({ type: 'TOGGLE_LEGEND' });
|
||||||
|
Loading…
Reference in New Issue
Block a user