From 13751e73f9a456bf2ec5d9bbbe9e6dc3c0e4ec5b Mon Sep 17 00:00:00 2001
From: John Mitchell
Date: Thu, 1 Aug 2019 16:20:45 -0400
Subject: [PATCH] working commit
---
.../src/projects/add/projects-add.controller.js | 1 +
.../projects/edit/projects-edit.controller.js | 1 +
awx/ui/client/src/projects/projects.form.js | 17 +++++++++++++++++
3 files changed, 19 insertions(+)
diff --git a/awx/ui/client/src/projects/add/projects-add.controller.js b/awx/ui/client/src/projects/add/projects-add.controller.js
index bd6b5985c5..1983d4d465 100644
--- a/awx/ui/client/src/projects/add/projects-add.controller.js
+++ b/awx/ui/client/src/projects/add/projects-add.controller.js
@@ -128,6 +128,7 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm',
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
$scope.scmBranchLabel = i18n._('SCM Branch');
+ $scope.scmRefspecLabel = i18n._('SCM Refspec');
// Dynamically update popover values
if ($scope.scm_type.value) {
if(($scope.lookupType === 'insights_credential' && $scope.scm_type.value !== 'insights') || ($scope.lookupType === 'scm_credential' && $scope.scm_type.value === 'insights')) {
diff --git a/awx/ui/client/src/projects/edit/projects-edit.controller.js b/awx/ui/client/src/projects/edit/projects-edit.controller.js
index 5dd515828c..a793425d26 100644
--- a/awx/ui/client/src/projects/edit/projects-edit.controller.js
+++ b/awx/ui/client/src/projects/edit/projects-edit.controller.js
@@ -250,6 +250,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
$scope.pathRequired = ($scope.scm_type.value === 'manual') ? true : false;
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
$scope.scmBranchLabel = i18n._('SCM Branch');
+ $scope.scmRefspecLabel = i18n._('SCM Refspec');
// Dynamically update popover values
if ($scope.scm_type.value) {
diff --git a/awx/ui/client/src/projects/projects.form.js b/awx/ui/client/src/projects/projects.form.js
index 6f611a8333..1973696d98 100644
--- a/awx/ui/client/src/projects/projects.form.js
+++ b/awx/ui/client/src/projects/projects.form.js
@@ -125,6 +125,23 @@ export default ['i18n', 'NotificationsList', 'TemplateList',
type: 'text',
ngShow: "scm_type && scm_type.value !== 'manual' && scm_type.value !== 'insights'",
ngDisabled: '!(project_obj.summary_fields.user_capabilities.edit || canAdd)',
+ awPopOver: '' + i18n._("Branch to checkout. You can input other refs like tags and commit hashes as well. You can set a custom refspec, to allow for other refs to be input.") + '
',
+ dataTitle: i18n._('SCM Branch'),
+ subForm: 'sourceSubForm',
+ },
+ scm_refspec: {
+ labelBind: "scmRefspecLabel",
+ type: 'text',
+ ngShow: "scm_type && scm_type.value === 'git'",
+ ngDisabled: '!(project_obj.summary_fields.user_capabilities.edit || canAdd)',
+ awPopOver: '' + i18n._('A refspec to fetch (passed to the Ansible git module). This parameter allows access to references via the branch field not otherwise available.') + '
' +
+ '' + i18n._('NOTE: This field assumes the remote name is "origin".') + '
' +
+ '' + i18n._('Examples include:') + '
' +
+ '
- refs/*:refs/remotes/origin/*
' +
+ '- refs/pull/62/head:refs/remotes/origin/pull/62/head
' +
+ '' + i18n._('The first fetches all references. The second fetches only the Github pull request number 62, in this example the branch needs to be `refs/pull/62/head`.') +
+ '
',
+ dataTitle: i18n._('SCM Refspec'),
subForm: 'sourceSubForm',
},
credential: {