mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 23:18:03 -03:30
Team add/edit now working. Temporarily disabled organization name lookup on Team and Inventory lists. This will get fixed with AC-93 -add summary fields to response.
This commit is contained in:
parent
e5057fbd83
commit
51ef375183
@ -24,7 +24,7 @@ function TeamsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Ale
|
||||
var scope = view.inject(list, { mode: mode }); // Inject our view
|
||||
scope.selected = [];
|
||||
|
||||
SetTeamListeners({ scope: scope, set: 'teams', iterator: list.iterator });
|
||||
//SetTeamListeners({ scope: scope, set: 'teams', iterator: list.iterator });
|
||||
SearchInit({ scope: scope, set: 'teams', list: list, url: defaultUrl });
|
||||
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
||||
scope.search(list.iterator);
|
||||
@ -199,7 +199,7 @@ function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
|
||||
var defaultUrl='/api/v1/teams/';
|
||||
var generator = GenerateForm;
|
||||
var form = InventoryForm;
|
||||
var form = TeamForm;
|
||||
var scope = generator.inject(form, {mode: 'edit', related: true});
|
||||
generator.reset();
|
||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||
@ -209,7 +209,7 @@ function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
|
||||
TeamLookUpOrganizationInit({ scope: scope });
|
||||
|
||||
// After inventory is loaded, retrieve each related set and any lookups
|
||||
// Retrieve each related set and any lookups
|
||||
scope.$on('teamLoaded', function() {
|
||||
Rest.setUrl(scope['organization_url']);
|
||||
Rest.get()
|
||||
@ -231,6 +231,7 @@ function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
Rest.get({ params: {id: id} })
|
||||
.success( function(data, status, headers, config) {
|
||||
LoadBreadCrumbs({ path: '/teams/' + id, title: data.name });
|
||||
console.log(data);
|
||||
for (var fld in form.fields) {
|
||||
if (data[fld]) {
|
||||
scope[fld] = data[fld];
|
||||
@ -243,7 +244,6 @@ function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
relatedSets[set] = { url: related[set], iterator: form.related[set].iterator };
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize related search functions. Doing it here to make sure relatedSets object is populated.
|
||||
RelatedSearchInit({ scope: scope, form: form, relatedSets: relatedSets });
|
||||
RelatedPaginateInit({ scope: scope, relatedSets: relatedSets });
|
||||
@ -265,7 +265,7 @@ function TeamsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
Rest.put(data)
|
||||
.success( function(data, status, headers, config) {
|
||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||
(base == 'inventories') ? ReturnToCaller() : ReturnToCaller(1);
|
||||
(base == 'teams') ? ReturnToCaller() : ReturnToCaller(1);
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, form,
|
||||
|
||||
@ -25,8 +25,8 @@ angular.module('GroupFormDefinition', [])
|
||||
description: {
|
||||
label: 'Description',
|
||||
type: 'text',
|
||||
addRequired: true,
|
||||
editRequired: true
|
||||
addRequired: false,
|
||||
editRequired: false
|
||||
},
|
||||
inventory: {
|
||||
label: 'Inventory',
|
||||
|
||||
@ -25,8 +25,8 @@ angular.module('HostFormDefinition', [])
|
||||
description: {
|
||||
label: 'Description',
|
||||
type: 'text',
|
||||
addRequired: true,
|
||||
editRequired: true
|
||||
addRequired: false,
|
||||
editRequired: false
|
||||
},
|
||||
inventory: {
|
||||
label: 'Inventory',
|
||||
|
||||
@ -26,8 +26,8 @@ angular.module('InventoryFormDefinition', [])
|
||||
description: {
|
||||
label: 'Description',
|
||||
type: 'text',
|
||||
addRequired: true,
|
||||
editRequired: true
|
||||
addRequired: false,
|
||||
editRequired: false
|
||||
},
|
||||
organization: {
|
||||
label: 'Organization',
|
||||
|
||||
@ -26,8 +26,8 @@ angular.module('OrganizationFormDefinition', [])
|
||||
description: {
|
||||
label: 'Description',
|
||||
type: 'text',
|
||||
addRequired: true,
|
||||
editRequired: true
|
||||
addRequired: false,
|
||||
editRequired: false
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ angular.module('TeamFormDefinition', [])
|
||||
description: {
|
||||
label: 'Description',
|
||||
type: 'text',
|
||||
addRequired: true,
|
||||
editRequired: true
|
||||
addRequired: false,
|
||||
editRequired: false
|
||||
},
|
||||
organization: {
|
||||
label: 'Organization',
|
||||
|
||||
@ -32,18 +32,8 @@ angular.module('RefreshHelper', ['RestServices', 'Utilities'])
|
||||
scope[iterator + 'PrevUrl'] = data.previous;
|
||||
scope[iterator + 'Count'] = data.count;
|
||||
scope[iterator + 'PageCount'] = Math.ceil((data.count / scope[iterator + 'PageSize']));
|
||||
if (set == 'inventories') {
|
||||
lookup_results = [];
|
||||
scope.$emit('refreshFinished', data['results']);
|
||||
}
|
||||
else if (set == 'teams') {
|
||||
lookup_results = [];
|
||||
scope.$emit('TeamRefreshFinished', data['results']);
|
||||
}
|
||||
else {
|
||||
scope[iterator + 'SearchSpin'] = false;
|
||||
scope[set] = data['results'];
|
||||
}
|
||||
scope[iterator + 'SearchSpin'] = false;
|
||||
scope[set] = data['results'];
|
||||
})
|
||||
.error ( function(data, status, headers, config) {
|
||||
scope[iterator + 'SearchSpin'] = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user