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
No known key found for this signature in database
GPG Key ID: 3B02CAD476EECB35
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.cloud_credential_link = getLink('cloud_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) {
if ($scope.workflowOptions && $scope.workflowOptions[key]) {
return $scope.workflowOptions[key].choices
@ -44,9 +84,10 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
}
};
$scope.status_label = getLabel('status');
$scope.type_label = getLabel('job_type');
$scope.verbosity_label = getLabel('verbosity');
$scope.strings.labels.STATUS = getLabel('status');
$scope.strings.tooltips.STATUS = `Job ${$scope.strings.labels.STATUS}`;
$scope.strings.labels.JOB_TYPE = getLabel('job_type');
$scope.strings.labels.VERBOSITY = getLabel('verbosity');
};
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}`;
}
// stdout full screen toggle tooltip text
$scope.toggleStdoutFullscreenTooltip = i18n._("Expand Output");
// turn related api browser routes into front end routes
getLinks();
// use options labels to manipulate display of details
getLabels();
getLabelsAndTooltips();
// set up a read only code mirror for extra vars
$scope.variables = ParseVariableString($scope.workflow.extra_vars);

View File

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