mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 19:10:07 -03:30
Merge pull request #6112 from marshmalien/fix/addTooltipToJobsPanel
Add tooltip to Job Panel status dots
This commit is contained in:
commit
25fae0eafd
@ -24,7 +24,10 @@ export default ['i18n', function(i18n) {
|
||||
dataTitle: "{{ job.status_popover_title }}",
|
||||
icon: 'icon-job-{{ job.status }}',
|
||||
iconOnly: true,
|
||||
nosort: true
|
||||
nosort: true,
|
||||
awTipPlacement: "top",
|
||||
awToolTip: "{{ job.status_tip }}",
|
||||
dataTipWatch: 'job.status_tip',
|
||||
},
|
||||
name: {
|
||||
label: i18n._('Name'),
|
||||
|
||||
@ -36,6 +36,46 @@ export function PortalModeJobsController($scope, $state, qs, GetBasePath, Portal
|
||||
$scope.refresh = function() {
|
||||
$state.go('.', null, {reload: true});
|
||||
};
|
||||
|
||||
$scope.$on(`${list.iterator}_options`, function(event, data){
|
||||
$scope.options = data.data.actions.GET;
|
||||
optionsRequestDataProcessing();
|
||||
});
|
||||
|
||||
$scope.$watchCollection(`${$scope.list.name}`, function() {
|
||||
optionsRequestDataProcessing();
|
||||
}
|
||||
);
|
||||
|
||||
// iterate over the list and add fields like type label, after the
|
||||
// OPTIONS request returns, or the list is sorted/paginated/searched
|
||||
function optionsRequestDataProcessing(){
|
||||
|
||||
if($scope[list.name] && $scope[list.name].length > 0) {
|
||||
$scope[list.name].forEach(function(item, item_idx) {
|
||||
var itm = $scope[list.name][item_idx];
|
||||
|
||||
if(item.summary_fields && item.summary_fields.source_workflow_job &&
|
||||
item.summary_fields.source_workflow_job.id){
|
||||
item.workflow_result_link = `/#/workflows/${item.summary_fields.source_workflow_job.id}`;
|
||||
}
|
||||
|
||||
// Set the item type label
|
||||
if (list.fields.type && $scope.options &&
|
||||
$scope.options.hasOwnProperty('type')) {
|
||||
$scope.options.type.choices.forEach(function(choice) {
|
||||
if (choice[0] === item.type) {
|
||||
itm.type_label = choice[1];
|
||||
}
|
||||
});
|
||||
}
|
||||
buildTooltips(itm);
|
||||
});
|
||||
}
|
||||
}
|
||||
function buildTooltips(job) {
|
||||
job.status_tip = `Job ${job.status}. Click for details.`;
|
||||
}
|
||||
}
|
||||
|
||||
PortalModeJobsController.$inject = ['$scope', '$state', 'QuerySet', 'GetBasePath', 'PortalJobsList', 'jobsDataset'];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user