diff --git a/awx/ui/static/js/helpers/Schedules.js b/awx/ui/static/js/helpers/Schedules.js index e7228e841c..8d7efceb60 100644 --- a/awx/ui/static/js/helpers/Schedules.js +++ b/awx/ui/static/js/helpers/Schedules.js @@ -505,8 +505,11 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe list = params.list, choices = params.choices; scope[list.name].forEach(function(item, item_idx) { - var fld, field, - itm = scope[list.name][item_idx]; + var fld, + field, + itm = scope[list.name][item_idx], + job = item.summary_fields.unified_job_template; + itm.enabled = (itm.enabled) ? true : false; if (itm.enabled) { itm.play_tip = 'Schedule is active. Click to stop.'; @@ -518,7 +521,17 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe itm.status = 'stopped'; itm.status_tip = 'Schedule is stopped. Click to activate.'; } - itm.nameTip = item.name + " schedule. Click to edit."; + itm.nameTip = item.name; + // include the word schedule if the schedule name does not include the word schedule + if (item.name.indexOf("schedule") == -1 && item.name.indexOf("Schedule") == -1) { + itm.nameTip += " schedule"; + } + itm.nameTip += " for " + if (job.name.indexOf("job") == -1 && job.name.indexOf("Job") == -1) { + itm.nameTip += "job "; + } + itm.nameTip += job.name; + itm.nameTip += ". Click to edit schedule."; // Copy summary_field values for (field in list.fields) { fld = list.fields[field]; diff --git a/awx/ui/static/js/lists/CompletedJobs.js b/awx/ui/static/js/lists/CompletedJobs.js index 136a0e3af3..8fdf2669d0 100644 --- a/awx/ui/static/js/lists/CompletedJobs.js +++ b/awx/ui/static/js/lists/CompletedJobs.js @@ -69,7 +69,8 @@ angular.module('CompletedJobsDefinition', []) label: 'Name', columnClass: 'col-md-3 col-sm-4 col-xs-4', ngClick: "viewJobLog(completed_job.id, completed_job.nameHref)", - defaultSearchField: true + defaultSearchField: true, + awToolTipEllipses: "{{ completed_job.name }}" }, failed: { label: 'Job failed?', diff --git a/awx/ui/static/js/lists/QueuedJobs.js b/awx/ui/static/js/lists/QueuedJobs.js index 2970ccca0e..fe2ebd868e 100644 --- a/awx/ui/static/js/lists/QueuedJobs.js +++ b/awx/ui/static/js/lists/QueuedJobs.js @@ -61,7 +61,8 @@ angular.module('QueuedJobsDefinition', []) label: 'Name', columnClass: 'col-md-3 col-sm-4 col-xs-4', ngClick: "viewJobLog(queued_job.id, queued_job.nameHref)", - defaultSearchField: true + defaultSearchField: true, + awToolTipEllipses: "{{ queued_job.name }}" } }, diff --git a/awx/ui/static/js/lists/RunningJobs.js b/awx/ui/static/js/lists/RunningJobs.js index c558a86e06..ccb8f3e283 100644 --- a/awx/ui/static/js/lists/RunningJobs.js +++ b/awx/ui/static/js/lists/RunningJobs.js @@ -62,7 +62,8 @@ angular.module('RunningJobsDefinition', []) label: 'Name', columnClass: 'col-md-3 col-sm-4 col-xs-4', ngClick: "viewJobLog(running_job.id, running_job.nameHref)", - defaultSearchField: true + defaultSearchField: true, + awToolTipEllipses: "{{ running_job.name }}" } }, diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index 1cef146fd8..25d66279eb 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -435,6 +435,45 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job }; }) + /* + * This is a copy of awToolTip currently. + * TODO: only display these tool tips if the length of the anchor *as interpolated* to be larger than the table cell + */ + .directive('awToolTipEllipses', [ function() { + return { + link: function(scope, element, attrs) { + + var delay = (attrs.delay !== undefined && attrs.delay !== null) ? attrs.delay : ($AnsibleConfig) ? $AnsibleConfig.tooltip_delay : {show: 500, hide: 100}, + placement; + + if (attrs.awTipPlacement) { + placement = attrs.awTipPlacement; + } + else { + placement = (attrs.placement !== undefined && attrs.placement !== null) ? attrs.placement : 'left'; + } + + $(element).on('hidden.bs.tooltip', function( ) { + // TB3RC1 is leaving behind tooltip
elements. This will remove them + // after a tooltip fades away. If not, they lay overtop of other elements and + // honk up the page. + $('.tooltip').each(function() { + $(this).remove(); + }); + }); + + $(element).tooltip({ + placement: placement, + delay: delay, + html: true, + title: attrs.awToolTipEllipses, + container: 'body', + trigger: 'hover focus' + }); + } + } + }]) + /* * Enable TB pop-overs. To add a pop-over to an element, include the following directive in * the element's attributes: diff --git a/awx/ui/static/lib/ansible/generator-helpers.js b/awx/ui/static/lib/ansible/generator-helpers.js index 42985f96eb..47d13cff5e 100644 --- a/awx/ui/static/lib/ansible/generator-helpers.js +++ b/awx/ui/static/lib/ansible/generator-helpers.js @@ -504,6 +504,12 @@ angular.module('GeneratorHelpers', []) html += (field.dataTipWatch) ? Attr(field, 'dataTipWatch') : ""; html += (field.awTipPlacement) ? Attr(field, 'awTipPlacement') : ""; } + if (field.awToolTipEllipses) { + html += Attr(field, 'awToolTipEllipses'); + html += (field.dataPlacement && !field.awPopOver) ? Attr(field, 'dataPlacement') : ""; + html += (field.dataTipWatch) ? Attr(field, 'dataTipWatch') : ""; + html += (field.awTipPlacement) ? Attr(field, 'awTipPlacement') : ""; + } if (field.awPopOver) { html += "aw-pop-over=\"" + field.awPopOver + "\" "; html += (field.dataPlacement) ? "data-placement=\"" + field.dataPlacement + "\" " : "";