mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 20:54:22 -06:00
feat(profile): hide orgs list when it only contains one org
This commit is contained in:
parent
592ae5a39a
commit
21c5b543fb
@ -33,8 +33,8 @@
|
|||||||
<a href="profile/password" class="btn btn-inverse">Change Password</a>
|
<a href="profile/password" class="btn btn-inverse">Change Password</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="page-heading">Organizations</h3>
|
<h3 class="page-heading" ng-show="ctrl.showOrgsList">Organizations</h3>
|
||||||
<div class="gf-form-group">
|
<div class="gf-form-group" ng-show="ctrl.showOrgsList">
|
||||||
<table class="filter-table form-inline">
|
<table class="filter-table form-inline">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -7,8 +7,9 @@ import _ from 'lodash';
|
|||||||
export class ProfileCtrl {
|
export class ProfileCtrl {
|
||||||
user: any;
|
user: any;
|
||||||
old_theme: any;
|
old_theme: any;
|
||||||
orgs: any;
|
orgs: any = [];
|
||||||
userForm: any;
|
userForm: any;
|
||||||
|
showOrgsList: boolean = false;
|
||||||
|
|
||||||
/** @ngInject **/
|
/** @ngInject **/
|
||||||
constructor(private backendSrv, private contextSrv, private $location) {
|
constructor(private backendSrv, private contextSrv, private $location) {
|
||||||
@ -26,6 +27,7 @@ export class ProfileCtrl {
|
|||||||
getUserOrgs() {
|
getUserOrgs() {
|
||||||
this.backendSrv.get('/api/user/orgs').then(orgs => {
|
this.backendSrv.get('/api/user/orgs').then(orgs => {
|
||||||
this.orgs = orgs;
|
this.orgs = orgs;
|
||||||
|
this.showOrgsList = orgs.length > 1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user