mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 18:07:36 -02:30
Merge pull request #2660 from leigh-johnson/2591
Update org card counts on user/admin association/disassociation
This commit is contained in:
@@ -67,6 +67,7 @@ export default ['$scope', '$rootScope', 'ProcessErrors', 'UserList', 'generateLi
|
|||||||
Wait('stop');
|
Wait('stop');
|
||||||
$scope.$parent.search('user');
|
$scope.$parent.search('user');
|
||||||
$scope.closeModal();
|
$scope.closeModal();
|
||||||
|
$scope.$parent.$emit('ReloadOrgListView');
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$rootScope.$broadcast("refreshList", listToClose);
|
$rootScope.$broadcast("refreshList", listToClose);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export default ['$stateParams', '$scope', 'UserList', 'Rest', '$state', 'generat
|
|||||||
list.listTitle = listTitle;
|
list.listTitle = listTitle;
|
||||||
list.basePath = url;
|
list.basePath = url;
|
||||||
list.searchSize = "col-lg-12 col-md-12 col-sm-12 col-xs-12";
|
list.searchSize = "col-lg-12 col-md-12 col-sm-12 col-xs-12";
|
||||||
|
|
||||||
$scope.orgRelatedUrls = data.related;
|
$scope.orgRelatedUrls = data.related;
|
||||||
|
|
||||||
generator.inject(list, { mode: 'edit', scope: $scope, cancelButton: true });
|
generator.inject(list, { mode: 'edit', scope: $scope, cancelButton: true });
|
||||||
@@ -78,6 +78,7 @@ export default ['$stateParams', '$scope', 'UserList', 'Rest', '$state', 'generat
|
|||||||
disassociate: true
|
disassociate: true
|
||||||
}).success(function () {
|
}).success(function () {
|
||||||
$scope.search(list.iterator);
|
$scope.search(list.iterator);
|
||||||
|
$scope.$emit('ReloadOrgListView');
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
disassociate: true
|
disassociate: true
|
||||||
}).success(function () {
|
}).success(function () {
|
||||||
$scope.search(list.iterator);
|
$scope.search(list.iterator);
|
||||||
|
$scope.$emit('ReloadOrgListView');
|
||||||
})
|
})
|
||||||
.error(function (data, status) {
|
.error(function (data, status) {
|
||||||
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
'$log', '$compile', 'Rest', 'PaginateInit',
|
'$log', '$compile', 'Rest', 'PaginateInit',
|
||||||
'SearchInit', 'OrganizationList', 'Alert', 'Prompt', 'ClearScope',
|
'SearchInit', 'OrganizationList', 'Alert', 'Prompt', 'ClearScope',
|
||||||
'ProcessErrors', 'GetBasePath', 'Wait',
|
'ProcessErrors', 'GetBasePath', 'Wait',
|
||||||
'$state', 'generateList',
|
'$state', 'generateList', 'Refresh',
|
||||||
function($stateParams, $scope, $rootScope, $location,
|
function($stateParams, $scope, $rootScope, $location,
|
||||||
$log, $compile, Rest, PaginateInit,
|
$log, $compile, Rest, PaginateInit,
|
||||||
SearchInit, OrganizationList, Alert, Prompt, ClearScope,
|
SearchInit, OrganizationList, Alert, Prompt, ClearScope,
|
||||||
ProcessErrors, GetBasePath, Wait,
|
ProcessErrors, GetBasePath, Wait,
|
||||||
$state, generateList) {
|
$state, generateList, Refresh) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
|
|
||||||
@@ -70,10 +70,20 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.$on("ReloadOrgListView", function() {
|
$scope.$on("ReloadOrgListView", function() {
|
||||||
|
var url = GetBasePath('organizations') + '?';
|
||||||
if ($state.$current.self.name === "organizations" ||
|
if ($state.$current.self.name === "organizations" ||
|
||||||
$state.$current.self.name === "organizations.add") {
|
$state.$current.self.name === "organizations.add") {
|
||||||
$scope.activeCard = null;
|
$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
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user