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:
Jake McDermott
2019-09-27 09:27:06 -04:00
committed by Jeff Bradberry
parent df24f5d28f
commit 84dcda0a61
3 changed files with 6 additions and 6 deletions

View File

@@ -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');