Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master' into anno-panel
Browse files Browse the repository at this point in the history
* grafana/master:
  release: update latest.json to v6.2.5 (grafana#17767)
  release: 6.2.5 changelog (grafana#17766)
  Fix typo s/Applicaiton/Application/ in error messages (grafana#17765)
  UserAdmin: UI for disabling users (grafana#17333)
  • Loading branch information
ryantxu committed Jun 25, 2019
2 parents 8314c7b + 5aa13ee commit 2c9f407
Show file tree
Hide file tree
Showing 9 changed files with 252 additions and 158 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# 6.3.0 (unreleased)

# 6.2.5 (2019-06-25)

### Features / Enhancements
* **Grafana-CLI**: Wrapper for `grafana-cli` within RPM/DEB packages and config/homepath are now global flags. [#17695](https://github.com/grafana/grafana/pull/17695), [@gotjosh](https://github.com/gotjosh)
* **Panel**: Fully escape html in drilldown links (was only sanitized before) . [#17731](https://github.com/grafana/grafana/pull/17731), [@dehrax](https://github.com/dehrax)

### Bug Fixes
* **Config**: Fix connectionstring for remote_cache in defaults.ini. [#17675](https://github.com/grafana/grafana/pull/17675), [@kylebrandt](https://github.com/kylebrandt)
* **Elasticsearch**: Fix empty query (via template variable) should be sent as wildcard. [#17488](https://github.com/grafana/grafana/pull/17488), [@davewat](https://github.com/davewat)
* **HTTP-Server**: Fix Strict-Transport-Security header. [#17644](https://github.com/grafana/grafana/pull/17644), [@kylebrandt](https://github.com/kylebrandt)
* **TablePanel**: fix annotations display. [#17646](https://github.com/grafana/grafana/pull/17646), [@ryantxu](https://github.com/ryantxu)

# 6.2.4 (2019-06-18)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions latest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"stable": "6.2.4",
"testing": "6.2.4"
"stable": "6.2.5",
"testing": "6.2.5"
}
34 changes: 31 additions & 3 deletions public/app/features/admin/AdminEditUserCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ export default class AdminEditUserCtrl {
$scope.updatePermissions = () => {
const payload = $scope.permissions;

backendSrv.put('/api/admin/users/' + $scope.user_id + '/permissions', payload).then(() => {
$location.path('/admin/users');
});
backendSrv.put('/api/admin/users/' + $scope.user_id + '/permissions', payload);
};

$scope.create = () => {
Expand Down Expand Up @@ -163,6 +161,36 @@ export default class AdminEditUserCtrl {
});
};

$scope.deleteUser = (user: any) => {
$scope.appEvent('confirm-modal', {
title: 'Delete',
text: 'Do you want to delete ' + user.login + '?',
icon: 'fa-trash',
yesText: 'Delete',
onConfirm: () => {
backendSrv.delete('/api/admin/users/' + user.id).then(() => {
$location.path('/admin/users');
});
},
});
};

$scope.disableUser = event => {
const user = $scope.user;

// External user can not be disabled
if (user.authModule) {
event.preventDefault();
event.stopPropagation();
return;
}

const actionEndpoint = user.isDisabled ? '/enable' : '/disable';
backendSrv.post('/api/admin/users/' + user.id + actionEndpoint).then(() => {
$scope.init();
});
};

$scope.init();
}
}
19 changes: 6 additions & 13 deletions public/app/features/admin/AdminListUsersCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class AdminListUsersCtrl {
navModel: any;

/** @ngInject */
constructor(private $scope: any, private backendSrv: BackendSrv, navModelSrv: NavModelSrv) {
constructor(private backendSrv: BackendSrv, navModelSrv: NavModelSrv) {
this.navModel = navModelSrv.getNav('admin', 'global-users', 0);
this.query = '';
this.getUsers();
Expand Down Expand Up @@ -40,17 +40,10 @@ export default class AdminListUsersCtrl {
this.getUsers();
}

deleteUser(user: any) {
this.$scope.appEvent('confirm-modal', {
title: 'Delete',
text: 'Do you want to delete ' + user.login + '?',
icon: 'fa-trash',
yesText: 'Delete',
onConfirm: () => {
this.backendSrv.delete('/api/admin/users/' + user.id).then(() => {
this.getUsers();
});
},
});
getAuthModule(user: any) {
if (user.authModule && user.authModule.length) {
return user.authModule[0];
}
return undefined;
}
}
Loading

0 comments on commit 2c9f407

Please sign in to comment.