mirror of
https://github.com/ansible/awx.git
synced 2026-01-25 00:11:23 -03:30
Merge pull request #5602 from mabashian/5600-project-scm-cred
Typing in scm credential when add/edit project fix
This commit is contained in:
commit
999c3dca08
@ -137,6 +137,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
|
||||
},
|
||||
ngShow: "scm_type && scm_type.value !== 'manual'",
|
||||
sourceModel: 'credential',
|
||||
awLookupType: 'scm_credential',
|
||||
sourceField: 'name',
|
||||
ngDisabled: '!(project_obj.summary_fields.user_capabilities.edit || canAdd)',
|
||||
subForm: 'sourceSubForm'
|
||||
|
||||
@ -482,6 +482,7 @@ function(ConfigurationUtils, i18n, $rootScope) {
|
||||
autopopulateLookup,
|
||||
modelKey = attrs.ngModel,
|
||||
modelName = attrs.source,
|
||||
lookupType = attrs.awlookuptype,
|
||||
watcher = attrs.awRequiredWhen || undefined,
|
||||
watchBasePath;
|
||||
|
||||
@ -516,10 +517,14 @@ function(ConfigurationUtils, i18n, $rootScope) {
|
||||
}
|
||||
else {
|
||||
basePath = GetBasePath(elm.attr('data-basePath')) || elm.attr('data-basePath');
|
||||
switch(modelName) {
|
||||
let switchType = lookupType ? lookupType : modelName;
|
||||
switch(switchType) {
|
||||
case 'credential':
|
||||
query = '?kind=ssh&role_level=use_role';
|
||||
break;
|
||||
case 'scm_credential':
|
||||
query = '?kind=scm&role_level=use_role';
|
||||
break;
|
||||
case 'network_credential':
|
||||
query = '?kind=net&role_level=use_role';
|
||||
break;
|
||||
@ -601,7 +606,7 @@ function(ConfigurationUtils, i18n, $rootScope) {
|
||||
query = elm.attr('data-query');
|
||||
query = query.replace(/\:value/, encodeURIComponent(viewValue));
|
||||
|
||||
let base = ctrl.$name.split('_name')[0];
|
||||
let base = lookupType ? lookupType : ctrl.$name.split('_name')[0];
|
||||
if (attrs.watchbasepath !== undefined && scope[attrs.watchbasepath] !== undefined) {
|
||||
basePath = scope[attrs.watchbasepath];
|
||||
query += '&role_level=use_role';
|
||||
@ -612,6 +617,9 @@ function(ConfigurationUtils, i18n, $rootScope) {
|
||||
case 'credential':
|
||||
query += '&kind=ssh&role_level=use_role';
|
||||
break;
|
||||
case 'scm_credential':
|
||||
query += '&kind=scm&role_level=use_role';
|
||||
break;
|
||||
case 'network_credential':
|
||||
query += '&kind=net&role_level=use_role';
|
||||
break;
|
||||
|
||||
@ -1384,6 +1384,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
||||
html += `data-basePath="${field.basePath}"`;
|
||||
html += `data-source="${field.sourceModel}"`;
|
||||
html += `data-query="?${field.sourceField}__iexact=:value"`;
|
||||
html += (field.awLookupType !== undefined) ? ` data-awLookupType=${field.awLookupType} ` : "";
|
||||
html += (field.autopopulateLookup !== undefined) ? ` autopopulateLookup=${field.autopopulateLookup} ` : "";
|
||||
html += (field.watchBasePath !== undefined) ? ` watchBasePath=${field.watchBasePath} ` : "";
|
||||
html += `ng-model-options="{ updateOn: 'default blur', debounce: { 'default': 300, 'blur': 0 } }"`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user