feat(profile): hide orgs list when it only contains one org

This commit is contained in:
bergquist 2016-09-08 09:03:29 +02:00
parent 592ae5a39a
commit 21c5b543fb
2 changed files with 5 additions and 3 deletions

View File

@ -33,8 +33,8 @@
<a href="profile/password" class="btn btn-inverse">Change Password</a>
</div>
<h3 class="page-heading">Organizations</h3>
<div class="gf-form-group">
<h3 class="page-heading" ng-show="ctrl.showOrgsList">Organizations</h3>
<div class="gf-form-group" ng-show="ctrl.showOrgsList">
<table class="filter-table form-inline">
<thead>
<tr>

View File

@ -7,8 +7,9 @@ import _ from 'lodash';
export class ProfileCtrl {
user: any;
old_theme: any;
orgs: any;
orgs: any = [];
userForm: any;
showOrgsList: boolean = false;
/** @ngInject **/
constructor(private backendSrv, private contextSrv, private $location) {
@ -26,6 +27,7 @@ export class ProfileCtrl {
getUserOrgs() {
this.backendSrv.get('/api/user/orgs').then(orgs => {
this.orgs = orgs;
this.showOrgsList = orgs.length > 1;
});
}