From 3fa9497e3c2d88a10893d9d096eba012ea1ac717 Mon Sep 17 00:00:00 2001 From: mabashian Date: Tue, 20 Aug 2019 15:53:17 -0400 Subject: [PATCH] Various bug fixes and minor ux enhancements --- .../features/templates/templates.strings.js | 5 +- .../approvalsDrawer.partial.html | 4 +- .../lib/components/components.strings.js | 1 + .../client/lib/components/layout/_index.less | 1 - .../workflow-chart/workflow-chart.block.less | 9 +- .../workflow-chart.directive.js | 26 ++- .../forms/workflow-node-form.partial.html | 199 +++++++++--------- 7 files changed, 136 insertions(+), 109 deletions(-) diff --git a/awx/ui/client/features/templates/templates.strings.js b/awx/ui/client/features/templates/templates.strings.js index 38ab92750e..13e3ce6639 100644 --- a/awx/ui/client/features/templates/templates.strings.js +++ b/awx/ui/client/features/templates/templates.strings.js @@ -150,7 +150,10 @@ function TemplatesStrings (BaseString) { SAVE_AND_EXIT: t.s('SAVE & EXIT'), APPROVAL: t.s('Approval'), TIMEOUT_POPOVER: t.s('The amount of time to wait before this approval step is automatically denied. Defaults to 0 for no timeout.'), - TIMED_OUT: t.s('APPROVAL TIMED OUT') + TIMED_OUT: t.s('APPROVAL TIMED OUT'), + TIMEOUT: t.s('Timeout'), + APPROVED: t.s('APPROVED'), + DENIED: t.s('DENIED') }; } diff --git a/awx/ui/client/lib/components/approvalsDrawer/approvalsDrawer.partial.html b/awx/ui/client/lib/components/approvalsDrawer/approvalsDrawer.partial.html index c57ddca622..b9132e79cd 100644 --- a/awx/ui/client/lib/components/approvalsDrawer/approvalsDrawer.partial.html +++ b/awx/ui/client/lib/components/approvalsDrawer/approvalsDrawer.partial.html @@ -30,13 +30,13 @@
+ header-state="workflowResults({id: {{approval.summary_fields.source_workflow_job.id}}})">
+ value-bind-html="{{:: vm.strings.get('approvals.APPROVAL') }}"> diff --git a/awx/ui/client/lib/components/components.strings.js b/awx/ui/client/lib/components/components.strings.js index 8c36b86d18..436e0b3dda 100644 --- a/awx/ui/client/lib/components/components.strings.js +++ b/awx/ui/client/lib/components/components.strings.js @@ -121,6 +121,7 @@ function ComponentsStrings (BaseString) { }; ns.approvals = { + APPROVAL: t.s('APPROVAL'), NONE: t.s('There are no jobs awaiting approval'), APPROVE: t.s('APPROVE'), DENY: t.s('DENY'), diff --git a/awx/ui/client/lib/components/layout/_index.less b/awx/ui/client/lib/components/layout/_index.less index 4457e69640..4491118bef 100644 --- a/awx/ui/client/lib/components/layout/_index.less +++ b/awx/ui/client/lib/components/layout/_index.less @@ -97,7 +97,6 @@ color: @at-white; height: 16px; font-size: 11px; - font-weight: bold; cursor: default; display: flex; align-items: center; diff --git a/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.block.less b/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.block.less index 8519f28f95..6f2e0584e6 100644 --- a/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.block.less +++ b/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.block.less @@ -170,13 +170,20 @@ text-align: center; } -.WorkflowChart-timedOutText { +.WorkflowChart-timedOutText, .WorkflowChart-deniedText { width: 180px; height: 14px; color: @default-err; text-align: center; } +.WorkflowChart-approvedText { + width: 180px; + height: 14px; + color: @default-succ; + text-align: center; +} + .WorkflowChart-tooltip { pointer-events: none; text-align: center; diff --git a/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.directive.js b/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.directive.js index ae1da75a35..8963ad9e2b 100644 --- a/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.directive.js +++ b/awx/ui/client/src/templates/workflows/workflow-chart/workflow-chart.directive.js @@ -835,6 +835,12 @@ export default ['moment', '$timeout', '$window', '$filter', 'TemplatesStrings', baseSvg.selectAll(".WorkflowChart-timedOutText") .style("display", (d) => { return d.job && d.job.timed_out ? null : "none"; }); + baseSvg.selectAll(".WorkflowChart-deniedText") + .style("display", (d) => { return d.job && d.job.type === "workflow_approval" && d.job.status === "failed" && !d.job.timed_out ? null : "none"; }); + + baseSvg.selectAll(".WorkflowChart-approvedText") + .style("display", (d) => { return d.job && d.job.type === "workflow_approval" && d.job.status === "successful" && !d.job.timed_out ? null : "none"; }); + baseSvg.selectAll(".WorkflowChart-activeNode") .style("display", (d) => { return d.id === scope.graphState.nodeBeingEdited ? null : "none"; }); @@ -950,7 +956,25 @@ export default ['moment', '$timeout', '$window', '$filter', 'TemplatesStrings', .attr("text-anchor", "middle") .attr("class", "WorkflowChart-defaultText WorkflowChart-timedOutText") .html(`${TemplatesStrings.get('workflow_maker.TIMED_OUT')}`) - .style("display", (d) => { return d.job && d.job.timed_out ? null : "none"; }); + .style("display", (d) => { return d.job && d.job.type === "workflow_approval" && d.job.timed_out ? null : "none"; }); + + thisNode.append("foreignObject") + .attr("x", 0) + .attr("y", 22) + .attr("dy", ".35em") + .attr("text-anchor", "middle") + .attr("class", "WorkflowChart-defaultText WorkflowChart-deniedText") + .html(`${TemplatesStrings.get('workflow_maker.DENIED')}`) + .style("display", (d) => { return d.job && d.job.type === "workflow_approval" && d.job.status === "failed" && !d.job.timed_out ? null : "none"; }); + + thisNode.append("foreignObject") + .attr("x", 0) + .attr("y", 22) + .attr("dy", ".35em") + .attr("text-anchor", "middle") + .attr("class", "WorkflowChart-defaultText WorkflowChart-approvedText") + .html(`${TemplatesStrings.get('workflow_maker.APPROVED')}`) + .style("display", (d) => { return d.job && d.job.type === "workflow_approval" && d.job.status === "successful" && !d.job.timed_out ? null : "none"; }); thisNode.append("circle") .attr("cy", nodeH) diff --git a/awx/ui/client/src/templates/workflows/workflow-maker/forms/workflow-node-form.partial.html b/awx/ui/client/src/templates/workflows/workflow-maker/forms/workflow-node-form.partial.html index d2d8cbeb7d..b79ca9e79b 100644 --- a/awx/ui/client/src/templates/workflows/workflow-maker/forms/workflow-node-form.partial.html +++ b/awx/ui/client/src/templates/workflows/workflow-maker/forms/workflow-node-form.partial.html @@ -159,110 +159,104 @@ {{:: strings.get('workflows.INVALID_JOB_TEMPLATE') }}
-
+
{{:: strings.get('workflows.CREDENTIAL_WITH_PASS') }}
-
-
- - {{:: strings.get('workflows.CREDENTIAL_WITH_PASS') }} +
+
+ +
+ +
+
+
+
+ {{:: strings.get('workflow_maker.READ_ONLY_PROMPT_VALUES')}} +
+
+ {{:: strings.get('workflow_maker.READ_ONLY_NO_PROMPT_VALUES')}} +
+
+
{{:: strings.get('prompt.JOB_TYPE') }}
+
+ {{:: strings.get('prompt.PLAYBOOK_RUN') }} + {{:: strings.get('prompt.CHECK') }}
-
- -
- -
+
+
{{:: strings.get('prompt.INVENTORY') }}
+
-
-
- {{:: strings.get('workflow_maker.READ_ONLY_PROMPT_VALUES')}} +
+
{{:: strings.get('prompt.LIMIT') }}
+
+
+
+
{{:: strings.get('prompt.VERBOSITY') }}
+
+
+
+
+ {{:: strings.get('prompt.JOB_TAGS') }}  + + + +
-
- {{:: strings.get('workflow_maker.READ_ONLY_NO_PROMPT_VALUES')}} -
-
-
{{:: strings.get('prompt.JOB_TYPE') }}
-
- {{:: strings.get('prompt.PLAYBOOK_RUN') }} - {{:: strings.get('prompt.CHECK') }} -
-
-
-
{{:: strings.get('prompt.INVENTORY') }}
-
-
-
-
{{:: strings.get('prompt.LIMIT') }}
-
-
-
-
{{:: strings.get('prompt.VERBOSITY') }}
-
-
-
-
- {{:: strings.get('prompt.JOB_TAGS') }}  - - - - -
-
-
-
- {{tag}} -
+
+
+
+ {{tag}}
-
-
- {{:: strings.get('prompt.SKIP_TAGS') }}  - - - - -
-
-
-
- {{tag}} -
+
+
+
+ {{:: strings.get('prompt.SKIP_TAGS') }}  + + + + +
+
+
+
+ {{tag}}
@@ -283,16 +277,15 @@
-
-
-
-
- - - - -
-
+
+
+
+ + + + +
+
\ No newline at end of file