mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
Use job launch_type field to detect webhook jobs
We have a launch type field for categorizing the different ways jobs can be launched. This updates the UI to use this field when checking if a job was launched by a webhook.
This commit is contained in:
parent
df24f5d28f
commit
84dcda0a61
@ -159,7 +159,7 @@ function ListJobsController (
|
||||
};
|
||||
|
||||
vm.getWebhookDetails = (job) => {
|
||||
if (!job.webhook_guid) {
|
||||
if (job.launch_type !== 'webhook') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -254,9 +254,9 @@ function getLaunchedByDetails () {
|
||||
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');
|
||||
const launchType = resource.model.get('launch_type');
|
||||
|
||||
if (!createdBy && !schedule && !webhookGUID) {
|
||||
if (!createdBy && !schedule && !launchType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -266,11 +266,11 @@ function getLaunchedByDetails () {
|
||||
let tooltip;
|
||||
let value;
|
||||
|
||||
if (webhookGUID && jobTemplate) {
|
||||
if (launchType === 'webhook' && jobTemplate) {
|
||||
tooltip = strings.get('tooltips.WEBHOOK_JOB_TEMPLATE');
|
||||
link = `/#/templates/job_template/${jobTemplate.id}`;
|
||||
value = strings.get('details.WEBHOOK');
|
||||
} else if (webhookGUID && workflowJobTemplate) {
|
||||
} else if (launchType === 'webhook' && workflowJobTemplate) {
|
||||
tooltip = strings.get('tooltips.WEBHOOK_WORKFLOW_JOB_TEMPLATE');
|
||||
link = `/#/templates/workflow_job_template/${workflowJobTemplate.id}`;
|
||||
value = strings.get('details.WEBHOOK');
|
||||
|
||||
@ -38,7 +38,7 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
|
||||
$scope.network_credential_link = getLink('network_credential');
|
||||
|
||||
$scope.launched_by_webhook_link = null;
|
||||
if ($scope.workflow.webhook_guid) {
|
||||
if ($scope.workflow.launch_type === 'webhook') {
|
||||
$scope.launched_by_webhook_link = $scope.workflow_template_link;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user