changed the values for some forms thats have select drop down input fields

This commit is contained in:
Jared Tabor 2014-09-16 12:34:04 -04:00
parent 6fd86b881f
commit b505e7ae41
7 changed files with 32 additions and 5 deletions

View File

@ -87,7 +87,7 @@ angular.module('CredentialFormDefinition', [])
label: 'Type',
excludeModal: true,
type: 'select',
ngOptions: 'kind.label for kind in credential_kind_options',
ngOptions: 'kind.label for kind in credential_kind_options track by kind.value', // select as label for value in array 'kind.label for kind in credential_kind_options',
ngChange: 'kindChange()',
addRequired: true,
editRequired: true,

View File

@ -25,7 +25,7 @@ angular.module('HostGroupsFormDefinition', [])
label: 'Groups',
type: 'select',
multiple: true,
ngOptions: 'group.name for group in inventory_groups',
ngOptions: 'group.name for group in inventory_groups track by group.value',
addRequired: true,
editRequired: true,
awPopOver: "<p>Provide a host name, ip address, or ip address:port. Examples include:</p>" +

View File

@ -83,7 +83,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition'])
scm_type: {
label: 'SCM Type',
type: 'select',
ngOptions: 'type.label for type in scm_type_options',
ngOptions: 'type.label for type in scm_type_options track by type.value',
ngChange: 'scmChange()',
addRequired: true,
editRequired: true

View File

@ -25,7 +25,7 @@ angular.module('SourceFormDefinition', [])
source: {
label: 'Source',
type: 'select',
ngOptions: 'source.label for source in source_type_options',
ngOptions: 'source.label for source in source_type_options track by source.value',
ngChange: 'sourceChange()',
addRequired: false,
editRequired: false

View File

@ -188,6 +188,32 @@ angular.module('RestServices', ['ngCookies', 'AuthService'])
}, 401);
}
},
patch: function (data) {
var token = Authorization.getToken(),
expired = this.checkExpired();
if (expired) {
return this.createResponse({
detail: 'Token is expired'
}, 401);
} else if (token) {
this.setHeader({
Authorization: 'Token ' + token
});
this.setHeader({
"X-Auth-Token": 'Token ' + token
});
return $http({
method: 'PATCH',
url: this.url,
headers: this.headers,
data: data
});
} else {
return this.createResponse({
detail: 'Invalid token'
}, 401);
}
},
destroy: function (data) {
var token = Authorization.getToken(),
expired = this.checkExpired();

View File

@ -637,6 +637,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator
html += (field.falseValue !== undefined) ? Attr(field, 'falseValue') : "";
html += (field.checked) ? "checked " : "";
html += (field.readonly) ? "disabled " : "";
html += (field.ngChange) ? "ng-change=\"" +field.ngChange + "\" " : "";
html += (field.ngDisabled) ? "ng-disabled=\"" + field.ngDisabled + "\" " : "";
html += " > ";

View File

@ -769,7 +769,7 @@ angular.module('GeneratorHelpers', [])
html += "<select id=\"search_value_select\" ng-show=\"" + iterator + "SelectShow" + modifier + "\" " +
"ng-model=\"" + iterator + "SearchSelectValue" + modifier + "\" ng-change=\"search('" + iterator + "')\" ";
html += "ng-options=\"c.name for c in " + iterator + "SearchSelectOpts" + modifier + "\" class=\"form-control search-select";
html += "ng-options=\"c.name for c in " + iterator + "SearchSelectOpts track by c.value" + modifier + "\" class=\"form-control search-select";
html += "\"></select>\n";