|
@@ -10,6 +10,7 @@ export default class UserGroupsCtrl {
|
|
|
totalPages: number;
|
|
totalPages: number;
|
|
|
showPaging = false;
|
|
showPaging = false;
|
|
|
query: any = '';
|
|
query: any = '';
|
|
|
|
|
+ userGroupName: any = '';
|
|
|
|
|
|
|
|
/** @ngInject */
|
|
/** @ngInject */
|
|
|
constructor(private $scope, private $http, private backendSrv) {
|
|
constructor(private $scope, private $http, private backendSrv) {
|
|
@@ -37,6 +38,13 @@ export default class UserGroupsCtrl {
|
|
|
this.get();
|
|
this.get();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ createUserGroup() {
|
|
|
|
|
+ this.backendSrv.post('/api/user-groups', {name: this.userGroupName}).then(result => {
|
|
|
|
|
+ this.get();
|
|
|
|
|
+ this.userGroupName = '';
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
deleteUserGroup(userGroup) {
|
|
deleteUserGroup(userGroup) {
|
|
|
this.$scope.appEvent('confirm-modal', {
|
|
this.$scope.appEvent('confirm-modal', {
|
|
|
title: 'Delete',
|
|
title: 'Delete',
|
|
@@ -53,16 +61,6 @@ export default class UserGroupsCtrl {
|
|
|
this.backendSrv.delete('/api/user-groups/' + userGroup.id)
|
|
this.backendSrv.delete('/api/user-groups/' + userGroup.id)
|
|
|
.then(this.get.bind(this));
|
|
.then(this.get.bind(this));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- openUserGroupModal() {
|
|
|
|
|
- var modalScope = this.$scope.$new();
|
|
|
|
|
-
|
|
|
|
|
- this.$scope.appEvent('show-modal', {
|
|
|
|
|
- src: 'public/app/features/org/partials/add_user.html',
|
|
|
|
|
- modalClass: 'user-group-modal',
|
|
|
|
|
- scope: modalScope
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
coreModule.controller('UserGroupsCtrl', UserGroupsCtrl);
|
|
coreModule.controller('UserGroupsCtrl', UserGroupsCtrl);
|