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

@@ -159,7 +159,7 @@ function ListJobsController (
}; };
vm.getWebhookDetails = (job) => { vm.getWebhookDetails = (job) => {
if (!job.webhook_guid) { if (job.launch_type !== 'webhook') {
return null; return null;
} }

View File

@@ -254,9 +254,9 @@ function getLaunchedByDetails () {
const workflowJobTemplate = resource.model.get('summary_fields.workflow_job_template'); const workflowJobTemplate = resource.model.get('summary_fields.workflow_job_template');
const relatedSchedule = resource.model.get('related.schedule'); const relatedSchedule = resource.model.get('related.schedule');
const schedule = resource.model.get('summary_fields.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; return null;
} }
@@ -266,11 +266,11 @@ function getLaunchedByDetails () {
let tooltip; let tooltip;
let value; let value;
if (webhookGUID && jobTemplate) { if (launchType === 'webhook' && jobTemplate) {
tooltip = strings.get('tooltips.WEBHOOK_JOB_TEMPLATE'); tooltip = strings.get('tooltips.WEBHOOK_JOB_TEMPLATE');
link = `/#/templates/job_template/${jobTemplate.id}`; link = `/#/templates/job_template/${jobTemplate.id}`;
value = strings.get('details.WEBHOOK'); value = strings.get('details.WEBHOOK');
} else if (webhookGUID && workflowJobTemplate) { } else if (launchType === 'webhook' && workflowJobTemplate) {
tooltip = strings.get('tooltips.WEBHOOK_WORKFLOW_JOB_TEMPLATE'); tooltip = strings.get('tooltips.WEBHOOK_WORKFLOW_JOB_TEMPLATE');
link = `/#/templates/workflow_job_template/${workflowJobTemplate.id}`; link = `/#/templates/workflow_job_template/${workflowJobTemplate.id}`;
value = strings.get('details.WEBHOOK'); value = strings.get('details.WEBHOOK');

View File

@@ -38,7 +38,7 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
$scope.network_credential_link = getLink('network_credential'); $scope.network_credential_link = getLink('network_credential');
$scope.launched_by_webhook_link = null; $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; $scope.launched_by_webhook_link = $scope.workflow_template_link;
} }