diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 2301445ce9..5f69f25d47 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -181,6 +181,13 @@ align-items: flex-start; } +.Form-textUneditable { + .Form-textInput { + border: none; + padding: 0; + } +} + .Form-subForm { width: 100%; margin-bottom: 15px; diff --git a/awx/ui/client/src/controllers/Projects.js b/awx/ui/client/src/controllers/Projects.js index aae513ba14..089fda112a 100644 --- a/awx/ui/client/src/controllers/Projects.js +++ b/awx/ui/client/src/controllers/Projects.js @@ -495,6 +495,35 @@ export function ProjectsAdd(Refresh, $scope, $rootScope, $compile, $location, $l $scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false; $scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? 'Revision #' : 'SCM Branch'; } + + // Dynamically update popover values + if($scope.scm_type.value) { + switch ($scope.scm_type.value) { + case 'git': + $scope.urlPopover = '
Example URLs for GIT SCM include:
Note: When using SSH protocol for GitHub or Bitbucket, enter an SSH key only, ' + + 'do not enter a username (other than git). Additionally, GitHub and Bitbucket do not support password authentication when using ' + + 'SSH. GIT read only protocol (git://) does not use username or password information.'; + break; + case 'svn': + $scope.urlPopover = '
Example URLs for Subversion SCM include:
' + + 'Example URLs for Mercurial SCM include:
' + + 'Note: Mercurial does not support password authentication for SSH. ' + + 'Do not put the username and key in the URL. ' + + 'If using Bitbucket and SSH, do not supply your Bitbucket username.'; + break; + default: + $scope.urlPopover = '
URL popover text'; + } + } + }; $scope.formCancel = function () { diff --git a/awx/ui/client/src/forms/Projects.js b/awx/ui/client/src/forms/Projects.js index a57e73dd25..24f666c0d5 100644 --- a/awx/ui/client/src/forms/Projects.js +++ b/awx/ui/client/src/forms/Projects.js @@ -64,11 +64,10 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) ngChange: 'scmChange()', addRequired: true, editRequired: true, - hasSubForm: true + hasSubForm: true, }, missing_path_alert: { type: 'alertblock', - "class": 'alert-info', ngShow: "showMissingPlaybooksAlert && scm_type.value == 'manual'", alertTxt: '
WARNING: There are no available playbook directories in {{ base_dir }}. ' + 'Either that directory is empty, or all of the contents are already assigned to other projects. ' + @@ -79,7 +78,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) base_dir: { label: 'Project Base Path', type: 'text', - //"class": 'col-lg-6', + class: 'Form-textUneditable', showonly: true, ngShow: "scm_type.value == 'manual' " , awPopOver: '
Base path used for locating playbooks. Directories found inside this path will be listed in the playbook directory drop-down. ' + @@ -115,30 +114,12 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) init: false }, subForm: 'sourceSubForm', - helpCollapse: [{ - hdr: 'GIT URLs', - content: '
Example URLs for GIT SCM include:
Note: When using SSH protocol for GitHub or Bitbucket, enter an SSH key only, ' + - 'do not enter a username (other than git). Additionally, GitHub and Bitbucket do not support password authentication when using ' + - 'SSH. GIT read only protocol (git://) does not use username or password information.', - show: "scm_type.value == 'git'" - }, { - hdr: 'SVN URLs', - content: '
Example URLs for Subversion SCM include:
' + - 'Example URLs for Mercurial SCM include:
' + - 'Note: Mercurial does not support password authentication for SSH. ' + - 'Do not put the username and key in the URL. ' + - 'If using Bitbucket and SSH, do not supply your Bitbucket username.', - show: "scm_type.value == 'hg'" - }], + hideSubForm: "scm_type.value === 'manual'", + awPopOverWatch: "urlPopover", + awPopOver: "set in controllers/projects", + dataTitle: 'SCM URL', + dataContainer: 'body', + dataPlacement: 'right' }, scm_branch: { labelBind: "scmBranchLabel", diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 9a3ca9d395..f92d22d922 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -792,7 +792,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat if ((!field.readonly) || (field.readonly && options.mode === 'edit')) { - if((field.excludeMode === undefined || field.excludeMode !== options.mode)) { + if((field.excludeMode === undefined || field.excludeMode !== options.mode) && field.type !== 'alertblock') { html += "