organize and translate workflow results strings

This commit is contained in:
Jake McDermott
2018-05-24 15:01:17 -04:00
parent 930ecaec3e
commit 62fa6dadb0
2 changed files with 74 additions and 36 deletions

View File

@@ -31,9 +31,49 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
$scope.scheduled_by_link = getLink('schedule'); $scope.scheduled_by_link = getLink('schedule');
$scope.cloud_credential_link = getLink('cloud_credential'); $scope.cloud_credential_link = getLink('cloud_credential');
$scope.network_credential_link = getLink('network_credential'); $scope.network_credential_link = getLink('network_credential');
$scope.strings = {
tooltips: {
RELAUNCH: i18n._('Relaunch using the same parameters'),
CANCEL: i18n._('Cancel'),
DELETE: i18n._('Delete'),
EDIT_USER: i18n._('Edit the user'),
EDIT_WORKFLOW: i18n._('Edit the workflow job template'),
EDIT_SCHEDULE: i18n._('Edit the schedule'),
TOGGLE_STDOUT_FULLSCREEN: i18n._('Expand Output'),
STATUS: '' // re-assigned elsewhere
},
labels: {
TEMPLATE: i18n._('Template'),
LAUNCHED_BY: i18n._('Launched By'),
STARTED: i18n._('Started'),
FINISHED: i18n._('Finished'),
LABELS: i18n._('Labels'),
STATUS: '', // re-assigned elsewhere
JOB_TYPE: '', // re-assigned elsewhere
VERBOSITY: '', // re-assigned elsewhere
},
details: {
HEADER: i18n._('DETAILS'),
NOT_FINISHED: i18n._('Not Finished'),
NOT_STARTED: i18n._('Not Started'),
},
results: {
TOTAL_JOBS: i18n._('Total Jobs'),
ELAPSED: i18n._('Elapsed'),
},
legend: {
ON_SUCCESS: i18n._('On Success'),
ON_FAIL: i18n._('On Fail'),
ALWAYS: i18n._('Always'),
PROJECT_SYNC: i18n._('Project Sync'),
INVENTORY_SYNC: i18n._('Inventory Sync'),
KEY: i18n._('KEY'),
}
};
}; };
var getLabels = function() { var getLabelsAndTooltips = function() {
var getLabel = function(key) { var getLabel = function(key) {
if ($scope.workflowOptions && $scope.workflowOptions[key]) { if ($scope.workflowOptions && $scope.workflowOptions[key]) {
return $scope.workflowOptions[key].choices return $scope.workflowOptions[key].choices
@@ -44,9 +84,10 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
} }
}; };
$scope.status_label = getLabel('status'); $scope.strings.labels.STATUS = getLabel('status');
$scope.type_label = getLabel('job_type'); $scope.strings.tooltips.STATUS = `Job ${$scope.strings.labels.STATUS}`;
$scope.verbosity_label = getLabel('verbosity'); $scope.strings.labels.JOB_TYPE = getLabel('job_type');
$scope.strings.labels.VERBOSITY = getLabel('verbosity');
}; };
var updateWorkflowJobElapsedTimer = function(time) { var updateWorkflowJobElapsedTimer = function(time) {
@@ -72,14 +113,11 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
$scope.workflow_job_template_link = `/#/templates/workflow_job_template/${$scope.workflow.summary_fields.workflow_job_template.id}`; $scope.workflow_job_template_link = `/#/templates/workflow_job_template/${$scope.workflow.summary_fields.workflow_job_template.id}`;
} }
// stdout full screen toggle tooltip text
$scope.toggleStdoutFullscreenTooltip = i18n._("Expand Output");
// turn related api browser routes into front end routes // turn related api browser routes into front end routes
getLinks(); getLinks();
// use options labels to manipulate display of details // use options labels to manipulate display of details
getLabels(); getLabelsAndTooltips();
// set up a read only code mirror for extra vars // set up a read only code mirror for extra vars
$scope.variables = ParseVariableString($scope.workflow.extra_vars); $scope.variables = ParseVariableString($scope.workflow.extra_vars);

View File

@@ -15,7 +15,7 @@
<div class="WorkflowResults-panelHeader"> <div class="WorkflowResults-panelHeader">
<div <div
class="WorkflowResults-panelHeaderText"> class="WorkflowResults-panelHeaderText">
DETAILS {{ strings.details.HEADER }}
</div> </div>
<!-- LEFT PANE HEADER ACTIONS --> <!-- LEFT PANE HEADER ACTIONS -->
@@ -26,7 +26,7 @@
data-placement="top" data-placement="top"
mode="all" mode="all"
ng-click="relaunchJob()" ng-click="relaunchJob()"
aw-tool-tip="{{'Relaunch using the same parameters'|translate}}" aw-tool-tip="{{ strings.tooltips.RELAUNCH }}"
data-original-title="" data-original-title=""
title=""> title="">
<i class="icon-launch"></i> <i class="icon-launch"></i>
@@ -39,7 +39,7 @@
ng-click="cancelJob()" ng-click="cancelJob()"
ng-show="workflow.status == 'running' || ng-show="workflow.status == 'running' ||
workflow.status=='pending' " workflow.status=='pending' "
aw-tool-tip="{{'Cancel'|translate}}" aw-tool-tip="{{ strings.tooltips.CANCEL }}"
data-original-title="" title=""> data-original-title="" title="">
<i class="fa fa-minus-circle"></i> <i class="fa fa-minus-circle"></i>
</button> </button>
@@ -51,7 +51,7 @@
ng-click="deleteJob()" ng-click="deleteJob()"
ng-hide="workflow.status == 'running' || ng-hide="workflow.status == 'running' ||
workflow.status == 'pending' " workflow.status == 'pending' "
aw-tool-tip="{{'Delete'|translate}}" aw-tool-tip="{{ strings.tooltips.DELETE }}"
data-original-title="" data-original-title=""
title=""> title="">
<i class="fa fa-trash-o"></i> <i class="fa fa-trash-o"></i>
@@ -71,7 +71,7 @@
<i class="WorkflowResults-statusResultIcon <i class="WorkflowResults-statusResultIcon
fa fa
icon-job-{{ workflow.status }}"> icon-job-{{ workflow.status }}">
</i> {{ status_label }} </i> {{ strings.labels.STATUS }}
</div> </div>
</div> </div>
@@ -79,10 +79,10 @@
<div class="WorkflowResults-resultRow" <div class="WorkflowResults-resultRow"
ng-show="workflow.started"> ng-show="workflow.started">
<label class="WorkflowResults-resultRowLabel"> <label class="WorkflowResults-resultRowLabel">
Started {{ strings.labels.STARTED }}
</label> </label>
<div class="WorkflowResults-resultRowText"> <div class="WorkflowResults-resultRowText">
{{ workflow.started | longDate }} {{ (workflow.started | longDate) || strings.details.NOT_STARTED }}
</div> </div>
</div> </div>
@@ -90,11 +90,11 @@
<div class="WorkflowResults-resultRow" <div class="WorkflowResults-resultRow"
ng-show="workflow.started"> ng-show="workflow.started">
<label class="WorkflowResults-resultRowLabel"> <label class="WorkflowResults-resultRowLabel">
Finished {{ strings.labels.FINISHED }}
</label> </label>
<div class="WorkflowResults-resultRowText"> <div class="WorkflowResults-resultRowText">
{{ (workflow.finished | {{ (workflow.finished |
longDate) || "Not Finished" }} longDate) || strings.details.NOT_FINISHED }}
</div> </div>
</div> </div>
@@ -102,11 +102,11 @@
<div class="WorkflowResults-resultRow" <div class="WorkflowResults-resultRow"
ng-show="workflow.summary_fields.workflow_job_template.name"> ng-show="workflow.summary_fields.workflow_job_template.name">
<label class="WorkflowResults-resultRowLabel"> <label class="WorkflowResults-resultRowLabel">
Template {{ strings.labels.TEMPLATE }}
</label> </label>
<div class="WorkflowResults-resultRowText"> <div class="WorkflowResults-resultRowText">
<a href="{{ workflow_job_template_link }}" <a href="{{ workflow_job_template_link }}"
aw-tool-tip="Edit the workflow job template" aw-tool-tip="{{ strings.tooltips.EDIT_WORKFLOW }}"
data-placement="top"> data-placement="top">
{{ workflow.summary_fields.workflow_job_template.name }} {{ workflow.summary_fields.workflow_job_template.name }}
</a> </a>
@@ -117,11 +117,11 @@
<div class="WorkflowResults-resultRow" <div class="WorkflowResults-resultRow"
ng-show="workflow.summary_fields.created_by.username"> ng-show="workflow.summary_fields.created_by.username">
<label class="WorkflowResults-resultRowLabel"> <label class="WorkflowResults-resultRowLabel">
Launched By {{ strings.labels.LAUNCHED_BY }}
</label> </label>
<div class="WorkflowResults-resultRowText"> <div class="WorkflowResults-resultRowText">
<a href="{{ created_by_link }}" <a href="{{ created_by_link }}"
aw-tool-tip="{{'Edit the User'|translate}}" aw-tool-tip="{{ strings.tooltips.EDIT_USER }}"
data-placement="top"> data-placement="top">
{{ workflow.summary_fields.created_by.username }} {{ workflow.summary_fields.created_by.username }}
</a> </a>
@@ -133,11 +133,11 @@
ng-show="workflow.summary_fields.schedule.name"> ng-show="workflow.summary_fields.schedule.name">
<label <label
class="WorkflowResults-resultRowLabel"> class="WorkflowResults-resultRowLabel">
Launched By {{ strings.labels.LAUNCHED_BY }}
</label> </label>
<div class="WorkflowResults-resultRowText"> <div class="WorkflowResults-resultRowText">
<a href="{{ scheduled_by_link }}" <a href="{{ scheduled_by_link }}"
aw-tool-tip="Edit the Schedule" aw-tool-tip="{{ strings.tooltips.EDIT_SCHEDULE }}"
data-placement="top"> data-placement="top">
{{ workflow.summary_fields.schedule.name }} {{ workflow.summary_fields.schedule.name }}
</a> </a>
@@ -163,7 +163,7 @@
ng-show="lessLabels" ng-show="lessLabels"
href="" href=""
ng-click="toggleLessLabels()"> ng-click="toggleLessLabels()">
Labels {{ strings.labels.LABELS }}
<i class="WorkflowResults-expandArrow <i class="WorkflowResults-expandArrow
fa fa-caret-right"></i> fa fa-caret-right"></i>
</a> </a>
@@ -172,7 +172,7 @@
ng-show="!lessLabels" ng-show="!lessLabels"
href="" href=""
ng-click="toggleLessLabels()"> ng-click="toggleLessLabels()">
Labels {{ strings.labels.LABELS }}
<i class="WorkflowResults-expandArrow <i class="WorkflowResults-expandArrow
fa fa-caret-down"></i> fa fa-caret-down"></i>
</a> </a>
@@ -207,7 +207,7 @@
<i class="WorkflowResults-statusResultIcon <i class="WorkflowResults-statusResultIcon
fa icon-job-{{ workflow.status }}" fa icon-job-{{ workflow.status }}"
ng-show="stdoutFullScreen" ng-show="stdoutFullScreen"
aw-tool-tip="Job {{status_label}}" aw-tool-tip="{{ strings.tooltips.STATUS }}"
aw-tip-placement="top" aw-tip-placement="top"
data-original-title> data-original-title>
</i> </i>
@@ -218,7 +218,7 @@
<div class="WorkflowResults-badgeRow"> <div class="WorkflowResults-badgeRow">
<!-- PLAYS COUNT --> <!-- PLAYS COUNT -->
<div class="WorkflowResults-badgeTitle"> <div class="WorkflowResults-badgeTitle">
Total Jobs {{ strings.results.TOTAL_JOBS }}
</div> </div>
<span class="badge List-titleBadge"> <span class="badge List-titleBadge">
{{ workflow_nodes.length || 0}} {{ workflow_nodes.length || 0}}
@@ -226,7 +226,7 @@
<!-- ELAPSED TIME --> <!-- ELAPSED TIME -->
<div class="WorkflowResults-badgeTitle"> <div class="WorkflowResults-badgeTitle">
Elapsed {{ strings.results.ELAPSED }}
</div> </div>
<span class="badge List-titleBadge"> <span class="badge List-titleBadge">
{{ workflow.elapsed * 1000 | duration: "hh:mm:ss"}} {{ workflow.elapsed * 1000 | duration: "hh:mm:ss"}}
@@ -238,8 +238,8 @@
<!-- FULL-SCREEN TOGGLE ACTION --> <!-- FULL-SCREEN TOGGLE ACTION -->
<button class="StandardOut-actionButton" <button class="StandardOut-actionButton"
aw-tool-tip="{{ toggleStdoutFullscreenTooltip }}" aw-tool-tip="{{ strings.tooltips.TOGGLE_STDOUT_FULLSCREEN }}"
data-tip-watch="toggleStdoutFullscreenTooltip" data-tip-watch="strings.tooltips.TOGGLE_STDOUT_FULLSCREEN"
data-placement="top" data-placement="top"
ng-class="{'StandardOut-actionButton--active': stdoutFullScreen}" ng-class="{'StandardOut-actionButton--active': stdoutFullScreen}"
ng-click="toggleStdoutFullscreen()"> ng-click="toggleStdoutFullscreen()">
@@ -252,26 +252,26 @@
<workflow-status-bar></workflow-status-bar> <workflow-status-bar></workflow-status-bar>
<div class="WorkflowLegend-details"> <div class="WorkflowLegend-details">
<div class="WorkflowLegend-details--left"> <div class="WorkflowLegend-details--left">
<div class="WorkflowLegend-legendItem">KEY:</div> <div class="WorkflowLegend-legendItem">{{ strings.legend.KEY }}:</div>
<div class="WorkflowLegend-legendItem"> <div class="WorkflowLegend-legendItem">
<div class="WorkflowLegend-onSuccessLegend"></div> <div class="WorkflowLegend-onSuccessLegend"></div>
<div>On Success</div> <div>{{ strings.legend.ON_SUCCESS }}</div>
</div> </div>
<div class="WorkflowLegend-legendItem"> <div class="WorkflowLegend-legendItem">
<div class="WorkflowLegend-onFailLegend"></div> <div class="WorkflowLegend-onFailLegend"></div>
<div>On Fail</div> <div>{{ strings.legend.ON_FAIL }}</div>
</div> </div>
<div class="WorkflowLegend-legendItem"> <div class="WorkflowLegend-legendItem">
<div class="WorkflowLegend-alwaysLegend"></div> <div class="WorkflowLegend-alwaysLegend"></div>
<div>Always</div> <div>{{ strings.legend.ALWAYS }}</div>
</div> </div>
<div class="WorkflowLegend-legendItem"> <div class="WorkflowLegend-legendItem">
<div class="WorkflowLegend-letterCircle">P</div> <div class="WorkflowLegend-letterCircle">P</div>
<div>Project Sync</div> <div>{{ strings.legend.PROJECT_SYNC }}</div>
</div> </div>
<div class="WorkflowLegend-legendItem"> <div class="WorkflowLegend-legendItem">
<div class="WorkflowLegend-letterCircle">I</div> <div class="WorkflowLegend-letterCircle">I</div>
<div>Inventory Sync</div> <div>{{ strings.legend.INVENTORY_SYNC }}</div>
</div> </div>
</div> </div>
<div class="WorkflowLegend-details--right"> <div class="WorkflowLegend-details--right">