more ui work for branch and refspec on project/jt

- add refspec field to project
- update refspec and branch help text on project form
- add refspec field to job detail
- adjust form gen and ProcessErrors to show api errors for checkbox_groups correctly
- consolidate showPromptButton conditionals and fix the add/edit workflow node one for showing prompt when only branch is promptable
This commit is contained in:
John Mitchell
2019-08-05 12:22:32 -04:00
committed by AlanCoding
parent 13751e73f9
commit 139e8cde70
10 changed files with 112 additions and 119 deletions

View File

@@ -354,6 +354,17 @@ function getSCMBranchDetails (scmBranch) {
return { label, value };
}
function getSCMRefspecDetails (scmRefspec) {
const label = strings.get('labels.SCM_REFSPEC');
const value = scmRefspec || resource.model.get('scm_refspec');
if (!value) {
return null;
}
return { label, value };
}
function getInventoryScmDetails (updateId, updateStatus) {
const projectId = resource.model.get('summary_fields.source_project.id');
const projectName = resource.model.get('summary_fields.source_project.name');
@@ -812,6 +823,7 @@ function JobDetailsController (
vm.projectUpdate = getProjectUpdateDetails();
vm.projectStatus = getProjectStatusDetails();
vm.scmBranch = getSCMBranchDetails();
vm.scmRefspec = getSCMRefspecDetails();
vm.scmRevision = getSCMRevisionDetails();
vm.inventoryScm = getInventoryScmDetails();
vm.playbook = getPlaybookDetails();
@@ -853,6 +865,7 @@ function JobDetailsController (
finished,
scm,
scmBranch,
scmRefspec,
inventoryScm,
scmRevision,
instanceGroup,
@@ -865,6 +878,7 @@ function JobDetailsController (
vm.projectUpdate = getProjectUpdateDetails(scm.id);
vm.projectStatus = getProjectStatusDetails(scm.status);
vm.scmBranch = getSCMBranchDetails(scmBranch);
vm.scmRefspec = getSCMRefspecDetails(scmRefspec);
vm.environment = getEnvironmentDetails(environment);
vm.artifacts = getArtifactsDetails(artifacts);
vm.executionNode = getExecutionNodeDetails(executionNode);

View File

@@ -222,7 +222,13 @@
<div class="JobResults-resultRow" ng-if="vm.scmBranch">
<label class="JobResults-resultRowLabel">{{ vm.scmBranch.label }}</label>
<div class="JobResults-resultRowText">{{ vm.scmBranch.value }}</div>
</div>
</div>
<!-- REFSPEC DETAIL -->
<div class="JobResults-resultRow" ng-if="vm.scmRefspec">
<label class="JobResults-resultRowLabel">{{ vm.scmRefspec.label }}</label>
<div class="JobResults-resultRowText">{{ vm.scmRefspec.value }}</div>
</div>
<!-- INVENTORY SCM DETAIL -->
<div class="JobResults-resultRow" ng-if="!vm.project && vm.inventoryScm">

View File

@@ -79,6 +79,7 @@ function OutputStrings (BaseString) {
PLAYBOOK: t.s('Playbook'),
PROJECT: t.s('Project'),
SCM_BRANCH: t.s('Branch'),
SCM_REFSPEC: t.s('Refspec'),
RESULT_TRACEBACK: t.s('Error Details'),
SCM_REVISION: t.s('Revision'),
SKIP_TAGS: t.s('Skip Tags'),

View File

@@ -46,6 +46,7 @@ function JobStatusService (moment, message) {
status: model.get('summary_fields.project_update.status')
},
scmBranch: model.get('scm_branch'),
scmRefspec: model.get('scm_refspec'),
inventoryScm: {
id: model.get('source_project_update'),
status: model.get('summary_fields.inventory_source.status')