diff --git a/awx/ui/client/features/output/details.component.js b/awx/ui/client/features/output/details.component.js index 6e5353f3b6..47cad34468 100644 --- a/awx/ui/client/features/output/details.component.js +++ b/awx/ui/client/features/output/details.component.js @@ -251,10 +251,12 @@ function getHostLimitErrorDetails () { function getLaunchedByDetails () { const createdBy = resource.model.get('summary_fields.created_by'); const jobTemplate = resource.model.get('summary_fields.job_template'); + const workflowJobTemplate = resource.model.get('summary_fields.workflow_job_template'); const relatedSchedule = resource.model.get('related.schedule'); const schedule = resource.model.get('summary_fields.schedule'); + const webhookGUID = resource.model.get('webhook_guid'); - if (!createdBy && !schedule) { + if (!createdBy && !schedule && !webhookGUID) { return null; } @@ -272,6 +274,14 @@ function getLaunchedByDetails () { tooltip = strings.get('tooltips.SCHEDULE'); link = `/#/templates/job_template/${jobTemplate.id}/schedules/${schedule.id}`; value = $filter('sanitize')(schedule.name); + } else if (webhookGUID && jobTemplate) { + tooltip = strings.get('tooltips.WEBHOOK_JOB_TEMPLATE'); + link = `/#/templates/job_template/${jobTemplate.id}`; + value = strings.get('details.WEBHOOK'); + } else if (webhookGUID && workflowJobTemplate) { + tooltip = strings.get('tooltips.WEBHOOK_WORKFLOW_JOB_TEMPLATE'); + link = `/#/templates/workflow_job_template/${workflowJobTemplate.id}`; + value = strings.get('details.WEBHOOK'); } else { tooltip = null; link = null; diff --git a/awx/ui/client/features/output/output.strings.js b/awx/ui/client/features/output/output.strings.js index d50788a141..dd4ddaaa0b 100644 --- a/awx/ui/client/features/output/output.strings.js +++ b/awx/ui/client/features/output/output.strings.js @@ -38,6 +38,8 @@ function OutputStrings (BaseString) { MENU_UP: t.s('Get previous page'), MENU_LAST: t.s('Go to last page of available output'), MENU_FOLLOWING: t.s('Currently following output as it arrives. Click to unfollow'), + WEBHOOK_JOB_TEMPLATE: t.s('View the webhook configuration on the job template.'), + WEBHOOK_WORKFLOW_JOB_TEMPLATE: t.s('View the webhook configuration on the workflow job template.'), }; ns.details = { @@ -48,6 +50,7 @@ function OutputStrings (BaseString) { SHOW_LESS: t.s('Show Less'), SHOW_MORE: t.s('Show More'), UNKNOWN: t.s('Finished'), + WEBHOOK: t.s('Webhook'), }; ns.labels = { diff --git a/awx/ui/client/src/templates/job_templates/job-template.form.js b/awx/ui/client/src/templates/job_templates/job-template.form.js index 7a87f99a56..a73c35f97d 100644 --- a/awx/ui/client/src/templates/job_templates/job-template.form.js +++ b/awx/ui/client/src/templates/job_templates/job-template.form.js @@ -343,7 +343,7 @@ function(NotificationsList, i18n) { label: i18n._('Webhooks'), type: 'checkbox', column: 2, - awPopOver: "

" + i18n._("Enabled webhook for this job template.") + "

", + awPopOver: "

" + i18n._("Enable webhook for this job template.") + "

", dataPlacement: 'right', dataTitle: i18n._('Enable Webhook'), dataContainer: "body", diff --git a/awx/ui/client/src/templates/workflows.form.js b/awx/ui/client/src/templates/workflows.form.js index e86ccada6d..519786ee7e 100644 --- a/awx/ui/client/src/templates/workflows.form.js +++ b/awx/ui/client/src/templates/workflows.form.js @@ -167,7 +167,7 @@ export default ['NotificationsList', 'i18n', function(NotificationsList, i18n) { label: i18n._('Webhooks'), type: 'checkbox', column: 2, - awPopOver: "

" + i18n._("Enabled webhook for this workflow job template.") + "

", + awPopOver: "

" + i18n._("Enable webhooks for this workflow job template.") + "

", dataPlacement: 'right', dataTitle: i18n._('Enable Webhook'), dataContainer: "body", diff --git a/awx/ui/client/src/workflow-results/workflow-results.controller.js b/awx/ui/client/src/workflow-results/workflow-results.controller.js index 871fa87a66..151b075f5f 100644 --- a/awx/ui/client/src/workflow-results/workflow-results.controller.js +++ b/awx/ui/client/src/workflow-results/workflow-results.controller.js @@ -37,6 +37,11 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions', $scope.cloud_credential_link = getLink('cloud_credential'); $scope.network_credential_link = getLink('network_credential'); + $scope.launched_by_webhook_link = null; + if ($scope.workflow.webhook_guid) { + $scope.launched_by_webhook_link = $scope.workflow_template_link; + } + if ($scope.workflow.summary_fields.inventory) { if ($scope.workflow.summary_fields.inventory.kind === 'smart') { $scope.inventory_link = '/#/inventories/smart/' + $scope.workflow.inventory; @@ -57,6 +62,7 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions', EDIT_INVENTORY: i18n._('Edit the inventory'), SOURCE_WORKFLOW_JOB: i18n._('View the source Workflow Job'), TOGGLE_STDOUT_FULLSCREEN: i18n._('Expand Output'), + WEBHOOK_WORKFLOW_JOB_TEMPLATE: i18n._('View the webhook configuration on the workflow job template.'), STATUS: '' // re-assigned elsewhere }, labels: { @@ -79,6 +85,7 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions', NOT_STARTED: i18n._('Not Started'), SHOW_LESS: i18n._('Show Less'), SHOW_MORE: i18n._('Show More'), + WEBHOOK: i18n._('Webhook'), }, results: { TOTAL_NODES: i18n._('Total Nodes'), diff --git a/awx/ui/client/src/workflow-results/workflow-results.partial.html b/awx/ui/client/src/workflow-results/workflow-results.partial.html index 635b69c60f..ca735286ec 100644 --- a/awx/ui/client/src/workflow-results/workflow-results.partial.html +++ b/awx/ui/client/src/workflow-results/workflow-results.partial.html @@ -206,6 +206,23 @@ + + +
+ +
+ + {{ strings.details.WEBHOOK }} + +
+
+