Merge pull request #13340 from gamuniz/change_wf_scmbranch_behavior

Change workflow create/edit to null scm_branch when not provided.
This commit is contained in:
Sarah Akus 2022-12-19 10:52:21 -05:00 committed by GitHub
commit 821b1701bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,7 @@ function WorkflowJobTemplateAdd() {
limit,
job_tags,
skip_tags,
scm_branch,
...templatePayload
} = values;
templatePayload.inventory = inventory?.id;
@ -32,6 +33,7 @@ function WorkflowJobTemplateAdd() {
templatePayload.limit = limit === '' ? null : limit;
templatePayload.job_tags = job_tags === '' ? null : job_tags;
templatePayload.skip_tags = skip_tags === '' ? null : skip_tags;
templatePayload.scm_branch = scm_branch === '' ? null : scm_branch;
const organizationId =
organization?.id || inventory?.summary_fields?.organization.id;
try {

View File

@ -119,7 +119,7 @@ describe('<WorkflowJobTemplateAdd/>', () => {
job_tags: null,
limit: null,
organization: undefined,
scm_branch: '',
scm_branch: null,
skip_tags: null,
webhook_credential: undefined,
webhook_service: '',

View File

@ -30,6 +30,7 @@ function WorkflowJobTemplateEdit({ template }) {
limit,
job_tags,
skip_tags,
scm_branch,
...templatePayload
} = values;
templatePayload.inventory = inventory?.id || null;
@ -38,6 +39,7 @@ function WorkflowJobTemplateEdit({ template }) {
templatePayload.limit = limit === '' ? null : limit;
templatePayload.job_tags = job_tags === '' ? null : job_tags;
templatePayload.skip_tags = skip_tags === '' ? null : skip_tags;
templatePayload.scm_branch = scm_branch === '' ? null : scm_branch;
const formOrgId =
organization?.id || inventory?.summary_fields?.organization.id || null;