1
0
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:
softwarefactory-project-zuul[bot] 2020-03-26 14:00:50 +00:00 committed by GitHub
commit ca82f48c18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -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>

View File

@ -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' });