mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
Project source types, popovers, form fixes
This commit is contained in:
parent
cad3ab6fd3
commit
ec065e0d97
@ -181,6 +181,13 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Form-textUneditable {
|
||||||
|
.Form-textInput {
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.Form-subForm {
|
.Form-subForm {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
|
@ -495,6 +495,35 @@ export function ProjectsAdd(Refresh, $scope, $rootScope, $compile, $location, $l
|
|||||||
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
|
$scope.scmRequired = ($scope.scm_type.value !== 'manual') ? true : false;
|
||||||
$scope.scmBranchLabel = ($scope.scm_type.value === 'svn') ? 'Revision #' : 'SCM Branch';
|
$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 = '<p>Example URLs for GIT SCM include:</p><ul class=\"no-bullets\"><li>https://github.com/ansible/ansible.git</li>' +
|
||||||
|
'<li>git@github.com:ansible/ansible.git</li><li>git://servername.example.com/ansible.git</li></ul>' +
|
||||||
|
'<p><strong>Note:</strong> 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 = '<p>Example URLs for Subversion SCM include:</p>' +
|
||||||
|
'<ul class=\"no-bullets\"><li>https://github.com/ansible/ansible</li><li>svn://servername.example.com/path</li>' +
|
||||||
|
'<li>svn+ssh://servername.example.com/path</li></ul>';
|
||||||
|
break;
|
||||||
|
case 'hg':
|
||||||
|
$scope.urlPopover = '<p>Example URLs for Mercurial SCM include:</p>' +
|
||||||
|
'<ul class=\"no-bullets\"><li>https://bitbucket.org/username/project</li><li>ssh://hg@bitbucket.org/username/project</li>' +
|
||||||
|
'<li>ssh://server.example.com/path</li></ul>' +
|
||||||
|
'<p><strong>Note:</strong> 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 = '<p> URL popover text';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.formCancel = function () {
|
$scope.formCancel = function () {
|
||||||
|
@ -64,11 +64,11 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
ngChange: 'scmChange()',
|
ngChange: 'scmChange()',
|
||||||
addRequired: true,
|
addRequired: true,
|
||||||
editRequired: true,
|
editRequired: true,
|
||||||
hasSubForm: true
|
hasSubForm: true,
|
||||||
},
|
},
|
||||||
missing_path_alert: {
|
missing_path_alert: {
|
||||||
type: 'alertblock',
|
type: 'alertblock',
|
||||||
"class": 'alert-info',
|
//"class": 'alert-info',
|
||||||
ngShow: "showMissingPlaybooksAlert && scm_type.value == 'manual'",
|
ngShow: "showMissingPlaybooksAlert && scm_type.value == 'manual'",
|
||||||
alertTxt: '<p class=\"text-justify\"><strong>WARNING:</strong> There are no available playbook directories in {{ base_dir }}. ' +
|
alertTxt: '<p class=\"text-justify\"><strong>WARNING:</strong> 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. ' +
|
'Either that directory is empty, or all of the contents are already assigned to other projects. ' +
|
||||||
@ -79,7 +79,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
base_dir: {
|
base_dir: {
|
||||||
label: 'Project Base Path',
|
label: 'Project Base Path',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
//"class": 'col-lg-6',
|
class: 'Form-textUneditable',
|
||||||
showonly: true,
|
showonly: true,
|
||||||
ngShow: "scm_type.value == 'manual' " ,
|
ngShow: "scm_type.value == 'manual' " ,
|
||||||
awPopOver: '<p>Base path used for locating playbooks. Directories found inside this path will be listed in the playbook directory drop-down. ' +
|
awPopOver: '<p>Base path used for locating playbooks. Directories found inside this path will be listed in the playbook directory drop-down. ' +
|
||||||
@ -87,7 +87,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
'<p>Use PROJECTS_ROOT in your environment settings file to determine the base path value.</p>',
|
'<p>Use PROJECTS_ROOT in your environment settings file to determine the base path value.</p>',
|
||||||
dataTitle: 'Project Base Path',
|
dataTitle: 'Project Base Path',
|
||||||
dataContainer: 'body',
|
dataContainer: 'body',
|
||||||
dataPlacement: 'right'
|
dataPlacement: 'right',
|
||||||
},
|
},
|
||||||
local_path: {
|
local_path: {
|
||||||
label: 'Playbook Directory',
|
label: 'Playbook Directory',
|
||||||
@ -115,30 +115,12 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
|||||||
init: false
|
init: false
|
||||||
},
|
},
|
||||||
subForm: 'sourceSubForm',
|
subForm: 'sourceSubForm',
|
||||||
helpCollapse: [{
|
hideSubForm: "scm_type.value === 'manual'",
|
||||||
hdr: 'GIT URLs',
|
awPopOverWatch: "urlPopover",
|
||||||
content: '<p>Example URLs for GIT SCM include:</p><ul class=\"no-bullets\"><li>https://github.com/ansible/ansible.git</li>' +
|
awPopOver: "set in controllers/projects",
|
||||||
'<li>git@github.com:ansible/ansible.git</li><li>git://servername.example.com/ansible.git</li></ul>' +
|
dataTitle: 'SCM URL',
|
||||||
'<p><strong>Note:</strong> When using SSH protocol for GitHub or Bitbucket, enter an SSH key only, ' +
|
dataContainer: 'body',
|
||||||
'do not enter a username (other than git). Additionally, GitHub and Bitbucket do not support password authentication when using ' +
|
dataPlacement: 'right',
|
||||||
'SSH. GIT read only protocol (git://) does not use username or password information.',
|
|
||||||
show: "scm_type.value == 'git'"
|
|
||||||
}, {
|
|
||||||
hdr: 'SVN URLs',
|
|
||||||
content: '<p>Example URLs for Subversion SCM include:</p>' +
|
|
||||||
'<ul class=\"no-bullets\"><li>https://github.com/ansible/ansible</li><li>svn://servername.example.com/path</li>' +
|
|
||||||
'<li>svn+ssh://servername.example.com/path</li></ul>',
|
|
||||||
show: "scm_type.value == 'svn'"
|
|
||||||
}, {
|
|
||||||
hdr: 'Mercurial URLs',
|
|
||||||
content: '<p>Example URLs for Mercurial SCM include:</p>' +
|
|
||||||
'<ul class=\"no-bullets\"><li>https://bitbucket.org/username/project</li><li>ssh://hg@bitbucket.org/username/project</li>' +
|
|
||||||
'<li>ssh://server.example.com/path</li></ul>' +
|
|
||||||
'<p><strong>Note:</strong> 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'"
|
|
||||||
}],
|
|
||||||
},
|
},
|
||||||
scm_branch: {
|
scm_branch: {
|
||||||
labelBind: "scmBranchLabel",
|
labelBind: "scmBranchLabel",
|
||||||
|
@ -787,7 +787,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
|
|
||||||
if ((!field.readonly) || (field.readonly && options.mode === 'edit')) {
|
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 += "<div class='form-group Form-formGroup ";
|
html += "<div class='form-group Form-formGroup ";
|
||||||
@ -1612,7 +1612,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
currentSubForm = field.subForm;
|
currentSubForm = field.subForm;
|
||||||
var subFormTitle = this.form.subFormTitles[field.subForm];
|
var subFormTitle = this.form.subFormTitles[field.subForm];
|
||||||
|
|
||||||
html += '<div class="Form-subForm '+ currentSubForm + '" ng-hide="'+ hasSubFormField + '.value === undefined"> ';
|
html += '<div class="Form-subForm '+ currentSubForm + '" ng-hide="'+ hasSubFormField + '.value === undefined || ' + field.hideSubForm + '"> ';
|
||||||
html += '<span class="Form-subForm--title">'+ subFormTitle +'</span>';
|
html += '<span class="Form-subForm--title">'+ subFormTitle +'</span>';
|
||||||
}
|
}
|
||||||
else if (!field.subForm && currentSubForm !== undefined) {
|
else if (!field.subForm && currentSubForm !== undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user