mirror of
https://github.com/ansible/awx.git
synced 2024-10-30 22:21:13 +03:00
Merge pull request #3762 from leigh-johnson/3750
Resolves 404 when assigning resources/users to organizations in card view
This commit is contained in:
commit
5dfd9d4ec9
@ -23,10 +23,7 @@ export default [
|
||||
activityStreamTarget: 'organization'
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
parent: function($scope) {
|
||||
$scope.$parent.$emit("ReloadOrgListView");
|
||||
return "organizations.edit";
|
||||
},
|
||||
parent: "organizations.edit",
|
||||
label: "USERS"
|
||||
},
|
||||
resolve: {
|
||||
@ -45,10 +42,7 @@ export default [
|
||||
activityStreamTarget: 'organization'
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
parent: function($scope) {
|
||||
$scope.$parent.$emit("ReloadOrgListView");
|
||||
return "organizations.edit";
|
||||
},
|
||||
parent: "organizations.edit",
|
||||
label: "TEAMS"
|
||||
},
|
||||
resolve: {
|
||||
@ -67,10 +61,7 @@ export default [
|
||||
activityStreamTarget: 'organization'
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
parent: function($scope) {
|
||||
$scope.$parent.$emit("ReloadOrgListView");
|
||||
return "organizations.edit";
|
||||
},
|
||||
parent: "organizations.edit",
|
||||
label: "INVENTORIES"
|
||||
},
|
||||
resolve: {
|
||||
@ -89,10 +80,7 @@ export default [
|
||||
activityStreamTarget: 'organization'
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
parent: function($scope) {
|
||||
$scope.$parent.$emit("ReloadOrgListView");
|
||||
return "organizations.edit";
|
||||
},
|
||||
parent: "organizations.edit",
|
||||
label: "PROJECTS"
|
||||
},
|
||||
resolve: {
|
||||
@ -111,10 +99,7 @@ export default [
|
||||
activityStreamTarget: 'organization'
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
parent: function($scope) {
|
||||
$scope.$parent.$emit("ReloadOrgListView");
|
||||
return "organizations.edit";
|
||||
},
|
||||
parent: "organizations.edit",
|
||||
label: "JOB TEMPLATES"
|
||||
},
|
||||
resolve: {
|
||||
@ -133,10 +118,7 @@ export default [
|
||||
activityStreamTarget: 'organization'
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
parent: function($scope) {
|
||||
$scope.$parent.$emit("ReloadOrgListView");
|
||||
return "organizations.edit";
|
||||
},
|
||||
parent: "organizations.edit",
|
||||
label: "ADMINS"
|
||||
},
|
||||
resolve: {
|
||||
|
@ -8,12 +8,12 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
||||
'$log', '$compile', 'Rest', 'PaginateInit',
|
||||
'SearchInit', 'OrganizationList', 'Alert', 'Prompt', 'ClearScope',
|
||||
'ProcessErrors', 'GetBasePath', 'Wait',
|
||||
'$state', 'generateList', 'Refresh', '$filter',
|
||||
'$state', 'generateList', '$filter',
|
||||
function($stateParams, $scope, $rootScope, $location,
|
||||
$log, $compile, Rest, PaginateInit,
|
||||
SearchInit, OrganizationList, Alert, Prompt, ClearScope,
|
||||
ProcessErrors, GetBasePath, Wait,
|
||||
$state, generateList, Refresh, $filter) {
|
||||
$state, generateList, $filter) {
|
||||
|
||||
ClearScope();
|
||||
|
||||
@ -70,19 +70,14 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
||||
};
|
||||
|
||||
$scope.$on("ReloadOrgListView", function() {
|
||||
var url = GetBasePath('organizations') + '?';
|
||||
if ($state.$current.self.name === "organizations" ||
|
||||
$state.$current.self.name === "organizations.add") {
|
||||
$scope.activeCard = null;
|
||||
}
|
||||
if ($scope[list.iterator + 'SearchFilters']){
|
||||
url = url + _.reduce($scope[list.iterator+'SearchFilters'], (result, filter) => result + '&' + filter.url, '');
|
||||
}
|
||||
Refresh({
|
||||
scope: $scope,
|
||||
set: list.name,
|
||||
iterator: list.iterator,
|
||||
url: url
|
||||
Rest.setUrl($scope.current_url);
|
||||
Rest.get()
|
||||
.success((data) => $scope.organizations = data.results)
|
||||
.error(function(data, status) {
|
||||
ProcessErrors($scope, data, status, null, {
|
||||
hdr: 'Error!',
|
||||
msg: 'Call to ' + defaultUrl + ' failed. DELETE returned status: ' + status
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -158,7 +153,7 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
||||
});
|
||||
// grab the pagination elements, move, destroy list generator elements
|
||||
$('#organization-pagination').appendTo('#OrgCards');
|
||||
$('tag-search').appendTo('.OrgCards-search');
|
||||
$('#organizations tag-search').appendTo('.OrgCards-search');
|
||||
$('#organizations-list').remove();
|
||||
|
||||
PaginateInit({
|
||||
|
@ -17,10 +17,7 @@ export default {
|
||||
activityStreamTarget: 'organization'
|
||||
},
|
||||
ncyBreadcrumb: {
|
||||
parent: function($scope) {
|
||||
$scope.$parent.$emit("ReloadOrgListView");
|
||||
return "setup";
|
||||
},
|
||||
parent: "setup",
|
||||
label: "ORGANIZATIONS"
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user