mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 01:17:35 -02:30
Changes "Key" references to "Legend"
This commit is contained in:
@@ -23,7 +23,7 @@ const Header = styled.div`
|
|||||||
position: relative;
|
position: relative;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Key = styled.ul`
|
const Legend = styled.ul`
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
@@ -77,14 +77,14 @@ const Close = styled(TimesIcon)`
|
|||||||
top: 15px;
|
top: 15px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function WorkflowKey({ i18n, onClose }) {
|
function WorkflowLegend({ i18n, onClose }) {
|
||||||
return (
|
return (
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<Header>
|
<Header>
|
||||||
<b>{i18n._(t`Key`)}</b>
|
<b>{i18n._(t`Legend`)}</b>
|
||||||
<Close onClick={onClose} />
|
<Close onClick={onClose} />
|
||||||
</Header>
|
</Header>
|
||||||
<Key>
|
<Legend>
|
||||||
<li>
|
<li>
|
||||||
<NodeTypeLetter>JT</NodeTypeLetter>
|
<NodeTypeLetter>JT</NodeTypeLetter>
|
||||||
<span>{i18n._(t`Job Template`)}</span>
|
<span>{i18n._(t`Job Template`)}</span>
|
||||||
@@ -123,13 +123,13 @@ function WorkflowKey({ i18n, onClose }) {
|
|||||||
<AlwaysLink />
|
<AlwaysLink />
|
||||||
<span>{i18n._(t`Always`)}</span>
|
<span>{i18n._(t`Always`)}</span>
|
||||||
</li>
|
</li>
|
||||||
</Key>
|
</Legend>
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkflowKey.propTypes = {
|
WorkflowLegend.propTypes = {
|
||||||
onClose: func.isRequired,
|
onClose: func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withI18n()(WorkflowKey);
|
export default withI18n()(WorkflowLegend);
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||||
import WorkflowKey from './WorkflowKey';
|
import WorkflowLegend from './WorkflowLegend';
|
||||||
|
|
||||||
describe('WorkflowKey', () => {
|
describe('WorkflowLegend', () => {
|
||||||
test('renders the expected content', () => {
|
test('renders the expected content', () => {
|
||||||
const wrapper = mountWithContexts(<WorkflowKey onClose={() => {}} />);
|
const wrapper = mountWithContexts(<WorkflowLegend onClose={() => {}} />);
|
||||||
expect(wrapper).toHaveLength(1);
|
expect(wrapper).toHaveLength(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -3,7 +3,7 @@ export {
|
|||||||
default as WorkflowActionTooltipItem,
|
default as WorkflowActionTooltipItem,
|
||||||
} from './WorkflowActionTooltipItem';
|
} from './WorkflowActionTooltipItem';
|
||||||
export { default as WorkflowHelp } from './WorkflowHelp';
|
export { default as WorkflowHelp } from './WorkflowHelp';
|
||||||
export { default as WorkflowKey } from './WorkflowKey';
|
export { default as WorkflowLegend } from './WorkflowLegend';
|
||||||
export { default as WorkflowLinkHelp } from './WorkflowLinkHelp';
|
export { default as WorkflowLinkHelp } from './WorkflowLinkHelp';
|
||||||
export { default as WorkflowNodeHelp } from './WorkflowNodeHelp';
|
export { default as WorkflowNodeHelp } from './WorkflowNodeHelp';
|
||||||
export { default as WorkflowNodeTypeLetter } from './WorkflowNodeTypeLetter';
|
export { default as WorkflowNodeTypeLetter } from './WorkflowNodeTypeLetter';
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ function WorkflowOutput({ job, i18n }) {
|
|||||||
const [graphNodes, setGraphNodes] = useState([]);
|
const [graphNodes, setGraphNodes] = useState([]);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [nodePositions, setNodePositions] = useState(null);
|
const [nodePositions, setNodePositions] = useState(null);
|
||||||
const [showKey, setShowKey] = useState(false);
|
const [showLegend, setShowLegend] = useState(false);
|
||||||
const [showTools, setShowTools] = useState(false);
|
const [showTools, setShowTools] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -200,9 +200,9 @@ function WorkflowOutput({ job, i18n }) {
|
|||||||
<Wrapper>
|
<Wrapper>
|
||||||
<WorkflowOutputToolbar
|
<WorkflowOutputToolbar
|
||||||
job={job}
|
job={job}
|
||||||
keyShown={showKey}
|
legendShown={showLegend}
|
||||||
nodes={graphNodes}
|
nodes={graphNodes}
|
||||||
onKeyToggle={() => setShowKey(!showKey)}
|
onLegendToggle={() => setShowLegend(!showLegend)}
|
||||||
onToolsToggle={() => setShowTools(!showTools)}
|
onToolsToggle={() => setShowTools(!showTools)}
|
||||||
toolsShown={showTools}
|
toolsShown={showTools}
|
||||||
/>
|
/>
|
||||||
@@ -211,9 +211,9 @@ function WorkflowOutput({ job, i18n }) {
|
|||||||
links={graphLinks}
|
links={graphLinks}
|
||||||
nodePositions={nodePositions}
|
nodePositions={nodePositions}
|
||||||
nodes={graphNodes}
|
nodes={graphNodes}
|
||||||
onUpdateShowKey={setShowKey}
|
onUpdateShowLegend={setShowLegend}
|
||||||
onUpdateShowTools={setShowTools}
|
onUpdateShowTools={setShowTools}
|
||||||
showKey={showKey}
|
showLegend={showLegend}
|
||||||
showTools={showTools}
|
showTools={showTools}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
} from '@screens/Job/WorkflowOutput';
|
} from '@screens/Job/WorkflowOutput';
|
||||||
import {
|
import {
|
||||||
WorkflowHelp,
|
WorkflowHelp,
|
||||||
WorkflowKey,
|
WorkflowLegend,
|
||||||
WorkflowLinkHelp,
|
WorkflowLinkHelp,
|
||||||
WorkflowNodeHelp,
|
WorkflowNodeHelp,
|
||||||
WorkflowStartNode,
|
WorkflowStartNode,
|
||||||
@@ -22,9 +22,9 @@ function WorkflowOutputGraph({
|
|||||||
links,
|
links,
|
||||||
nodePositions,
|
nodePositions,
|
||||||
nodes,
|
nodes,
|
||||||
onUpdateShowKey,
|
onUpdateShowLegend,
|
||||||
onUpdateShowTools,
|
onUpdateShowTools,
|
||||||
showKey,
|
showLegend,
|
||||||
showTools,
|
showTools,
|
||||||
}) {
|
}) {
|
||||||
const [linkHelp, setLinkHelp] = useState();
|
const [linkHelp, setLinkHelp] = useState();
|
||||||
@@ -213,7 +213,7 @@ function WorkflowOutputGraph({
|
|||||||
zoomPercentage={zoomPercentage}
|
zoomPercentage={zoomPercentage}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showKey && <WorkflowKey onClose={() => onUpdateShowKey(false)} />}
|
{showLegend && <WorkflowLegend onClose={() => onUpdateShowLegend(false)} />}
|
||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
@@ -223,9 +223,9 @@ WorkflowOutputGraph.propTypes = {
|
|||||||
links: arrayOf(shape()).isRequired,
|
links: arrayOf(shape()).isRequired,
|
||||||
nodePositions: shape().isRequired,
|
nodePositions: shape().isRequired,
|
||||||
nodes: arrayOf(shape()).isRequired,
|
nodes: arrayOf(shape()).isRequired,
|
||||||
onUpdateShowKey: func.isRequired,
|
onUpdateShowLegend: func.isRequired,
|
||||||
onUpdateShowTools: func.isRequired,
|
onUpdateShowTools: func.isRequired,
|
||||||
showKey: bool.isRequired,
|
showLegend: bool.isRequired,
|
||||||
showTools: bool.isRequired,
|
showTools: bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -56,9 +56,9 @@ const StatusIconWithMargin = styled(StatusIcon)`
|
|||||||
function WorkflowOutputToolbar({
|
function WorkflowOutputToolbar({
|
||||||
i18n,
|
i18n,
|
||||||
job,
|
job,
|
||||||
keyShown,
|
legendShown,
|
||||||
nodes,
|
nodes,
|
||||||
onKeyToggle,
|
onLegendToggle,
|
||||||
onToolsToggle,
|
onToolsToggle,
|
||||||
toolsShown,
|
toolsShown,
|
||||||
}) {
|
}) {
|
||||||
@@ -74,10 +74,10 @@ function WorkflowOutputToolbar({
|
|||||||
<div>{i18n._(t`Total Nodes`)}</div>
|
<div>{i18n._(t`Total Nodes`)}</div>
|
||||||
<Badge isRead>{totalNodes}</Badge>
|
<Badge isRead>{totalNodes}</Badge>
|
||||||
<VerticalSeparator />
|
<VerticalSeparator />
|
||||||
<Tooltip content={i18n._(t`Toggle Key`)} position="bottom">
|
<Tooltip content={i18n._(t`Toggle Legend`)} position="bottom">
|
||||||
<ActionButton
|
<ActionButton
|
||||||
isActive={keyShown}
|
isActive={legendShown}
|
||||||
onClick={onKeyToggle}
|
onClick={onLegendToggle}
|
||||||
variant="plain"
|
variant="plain"
|
||||||
>
|
>
|
||||||
<CompassIcon />
|
<CompassIcon />
|
||||||
@@ -99,9 +99,9 @@ function WorkflowOutputToolbar({
|
|||||||
|
|
||||||
WorkflowOutputToolbar.propTypes = {
|
WorkflowOutputToolbar.propTypes = {
|
||||||
job: shape().isRequired,
|
job: shape().isRequired,
|
||||||
keyShown: bool.isRequired,
|
legendShown: bool.isRequired,
|
||||||
nodes: arrayOf(shape()),
|
nodes: arrayOf(shape()),
|
||||||
onKeyToggle: func.isRequired,
|
onLegendToggle: func.isRequired,
|
||||||
onToolsToggle: func.isRequired,
|
onToolsToggle: func.isRequired,
|
||||||
toolsShown: bool.isRequired,
|
toolsShown: bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ describe('WorkflowOutputToolbar', () => {
|
|||||||
const wrapper = mountWithContexts(
|
const wrapper = mountWithContexts(
|
||||||
<WorkflowOutputToolbar
|
<WorkflowOutputToolbar
|
||||||
job={job}
|
job={job}
|
||||||
keyShown={false}
|
legendShown={false}
|
||||||
nodes={[]}
|
nodes={[]}
|
||||||
onKeyToggle={() => {}}
|
onLegendToggle={() => {}}
|
||||||
onToolsToggle={() => {}}
|
onToolsToggle={() => {}}
|
||||||
toolsShown={false}
|
toolsShown={false}
|
||||||
/>
|
/>
|
||||||
@@ -38,9 +38,9 @@ describe('WorkflowOutputToolbar', () => {
|
|||||||
const wrapper = mountWithContexts(
|
const wrapper = mountWithContexts(
|
||||||
<WorkflowOutputToolbar
|
<WorkflowOutputToolbar
|
||||||
job={job}
|
job={job}
|
||||||
keyShown={false}
|
legendShown={false}
|
||||||
nodes={nodes}
|
nodes={nodes}
|
||||||
onKeyToggle={() => {}}
|
onLegendToggle={() => {}}
|
||||||
onToolsToggle={() => {}}
|
onToolsToggle={() => {}}
|
||||||
toolsShown={false}
|
toolsShown={false}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ function Visualizer({ history, template, i18n }) {
|
|||||||
const [nodeToView, setNodeToView] = useState(null);
|
const [nodeToView, setNodeToView] = useState(null);
|
||||||
const [nodes, setNodes] = useState([]);
|
const [nodes, setNodes] = useState([]);
|
||||||
const [showDeleteAllNodesModal, setShowDeleteAllNodesModal] = useState(false);
|
const [showDeleteAllNodesModal, setShowDeleteAllNodesModal] = useState(false);
|
||||||
const [showKey, setShowKey] = useState(false);
|
const [showLegend, setShowLegend] = useState(false);
|
||||||
const [showTools, setShowTools] = useState(false);
|
const [showTools, setShowTools] = useState(false);
|
||||||
const [showUnsavedChangesModal, setShowUnsavedChangesModal] = useState(false);
|
const [showUnsavedChangesModal, setShowUnsavedChangesModal] = useState(false);
|
||||||
const [unsavedChanges, setUnsavedChanges] = useState(false);
|
const [unsavedChanges, setUnsavedChanges] = useState(false);
|
||||||
@@ -800,11 +800,11 @@ function Visualizer({ history, template, i18n }) {
|
|||||||
<Fragment>
|
<Fragment>
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<VisualizerToolbar
|
<VisualizerToolbar
|
||||||
keyShown={showKey}
|
legendShown={showLegend}
|
||||||
nodes={nodes}
|
nodes={nodes}
|
||||||
onClose={handleVisualizerClose}
|
onClose={handleVisualizerClose}
|
||||||
onDeleteAllClick={() => setShowDeleteAllNodesModal(true)}
|
onDeleteAllClick={() => setShowDeleteAllNodesModal(true)}
|
||||||
onKeyToggle={() => setShowKey(!showKey)}
|
onLegendToggle={() => setShowLegend(!showLegend)}
|
||||||
onSave={handleVisualizerSave}
|
onSave={handleVisualizerSave}
|
||||||
onToolsToggle={() => setShowTools(!showTools)}
|
onToolsToggle={() => setShowTools(!showTools)}
|
||||||
template={template}
|
template={template}
|
||||||
@@ -825,11 +825,11 @@ function Visualizer({ history, template, i18n }) {
|
|||||||
onEditNodeClick={startEditNode}
|
onEditNodeClick={startEditNode}
|
||||||
onLinkEditClick={setLinkToEdit}
|
onLinkEditClick={setLinkToEdit}
|
||||||
onStartAddLinkClick={selectSourceNodeForLinking}
|
onStartAddLinkClick={selectSourceNodeForLinking}
|
||||||
onUpdateShowKey={setShowKey}
|
onUpdateShowLegend={setShowLegend}
|
||||||
onUpdateShowTools={setShowTools}
|
onUpdateShowTools={setShowTools}
|
||||||
onViewNodeClick={setNodeToView}
|
onViewNodeClick={setNodeToView}
|
||||||
readOnly={!template.summary_fields.user_capabilities.edit}
|
readOnly={!template.summary_fields.user_capabilities.edit}
|
||||||
showKey={showKey}
|
showLegend={showLegend}
|
||||||
showTools={showTools}
|
showTools={showTools}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
} from '@components/Workflow/WorkflowUtils';
|
} from '@components/Workflow/WorkflowUtils';
|
||||||
import {
|
import {
|
||||||
WorkflowHelp,
|
WorkflowHelp,
|
||||||
WorkflowKey,
|
WorkflowLegend,
|
||||||
WorkflowLinkHelp,
|
WorkflowLinkHelp,
|
||||||
WorkflowNodeHelp,
|
WorkflowNodeHelp,
|
||||||
WorkflowStartNode,
|
WorkflowStartNode,
|
||||||
@@ -47,11 +47,11 @@ function VisualizerGraph({
|
|||||||
onEditNodeClick,
|
onEditNodeClick,
|
||||||
onLinkEditClick,
|
onLinkEditClick,
|
||||||
onStartAddLinkClick,
|
onStartAddLinkClick,
|
||||||
onUpdateShowKey,
|
onUpdateShowLegend,
|
||||||
onUpdateShowTools,
|
onUpdateShowTools,
|
||||||
onViewNodeClick,
|
onViewNodeClick,
|
||||||
readOnly,
|
readOnly,
|
||||||
showKey,
|
showLegend,
|
||||||
showTools,
|
showTools,
|
||||||
}) {
|
}) {
|
||||||
const [helpText, setHelpText] = useState(null);
|
const [helpText, setHelpText] = useState(null);
|
||||||
@@ -354,7 +354,7 @@ function VisualizerGraph({
|
|||||||
zoomPercentage={zoomPercentage}
|
zoomPercentage={zoomPercentage}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showKey && <WorkflowKey onClose={() => onUpdateShowKey(false)} />}
|
{showLegend && <WorkflowLegend onClose={() => onUpdateShowLegend(false)} />}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -374,11 +374,11 @@ VisualizerGraph.propTypes = {
|
|||||||
onEditNodeClick: func.isRequired,
|
onEditNodeClick: func.isRequired,
|
||||||
onLinkEditClick: func.isRequired,
|
onLinkEditClick: func.isRequired,
|
||||||
onStartAddLinkClick: func.isRequired,
|
onStartAddLinkClick: func.isRequired,
|
||||||
onUpdateShowKey: func.isRequired,
|
onUpdateShowLegend: func.isRequired,
|
||||||
onUpdateShowTools: func.isRequired,
|
onUpdateShowTools: func.isRequired,
|
||||||
onViewNodeClick: func.isRequired,
|
onViewNodeClick: func.isRequired,
|
||||||
readOnly: bool.isRequired,
|
readOnly: bool.isRequired,
|
||||||
showKey: bool.isRequired,
|
showLegend: bool.isRequired,
|
||||||
showTools: bool.isRequired,
|
showTools: bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -38,11 +38,11 @@ const ActionButton = styled(Button)`
|
|||||||
|
|
||||||
function VisualizerToolbar({
|
function VisualizerToolbar({
|
||||||
i18n,
|
i18n,
|
||||||
keyShown,
|
legendShown,
|
||||||
nodes,
|
nodes,
|
||||||
onClose,
|
onClose,
|
||||||
onDeleteAllClick,
|
onDeleteAllClick,
|
||||||
onKeyToggle,
|
onLegendToggle,
|
||||||
onSave,
|
onSave,
|
||||||
onToolsToggle,
|
onToolsToggle,
|
||||||
template,
|
template,
|
||||||
@@ -62,10 +62,10 @@ function VisualizerToolbar({
|
|||||||
<div>{i18n._(t`Total Nodes`)}</div>
|
<div>{i18n._(t`Total Nodes`)}</div>
|
||||||
<Badge isRead>{totalNodes}</Badge>
|
<Badge isRead>{totalNodes}</Badge>
|
||||||
<VerticalSeparator />
|
<VerticalSeparator />
|
||||||
<Tooltip content={i18n._(t`Toggle Key`)} position="bottom">
|
<Tooltip content={i18n._(t`Toggle Legend`)} position="bottom">
|
||||||
<ActionButton
|
<ActionButton
|
||||||
isActive={keyShown}
|
isActive={legendShown}
|
||||||
onClick={onKeyToggle}
|
onClick={onLegendToggle}
|
||||||
variant="plain"
|
variant="plain"
|
||||||
>
|
>
|
||||||
<CompassIcon />
|
<CompassIcon />
|
||||||
@@ -115,11 +115,11 @@ function VisualizerToolbar({
|
|||||||
}
|
}
|
||||||
|
|
||||||
VisualizerToolbar.propTypes = {
|
VisualizerToolbar.propTypes = {
|
||||||
keyShown: bool.isRequired,
|
legendShown: bool.isRequired,
|
||||||
nodes: arrayOf(shape()),
|
nodes: arrayOf(shape()),
|
||||||
onClose: func.isRequired,
|
onClose: func.isRequired,
|
||||||
onDeleteAllClick: func.isRequired,
|
onDeleteAllClick: func.isRequired,
|
||||||
onKeyToggle: func.isRequired,
|
onLegendToggle: func.isRequired,
|
||||||
onSave: func.isRequired,
|
onSave: func.isRequired,
|
||||||
onToolsToggle: func.isRequired,
|
onToolsToggle: func.isRequired,
|
||||||
template: shape().isRequired,
|
template: shape().isRequired,
|
||||||
|
|||||||
Reference in New Issue
Block a user