From 21c5b543fb058d0d30737ffa098fe7ddec19049e Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 8 Sep 2016 09:03:29 +0200 Subject: [PATCH] feat(profile): hide orgs list when it only contains one org --- public/app/features/org/partials/profile.html | 4 ++-- public/app/features/org/profile_ctrl.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/app/features/org/partials/profile.html b/public/app/features/org/partials/profile.html index 02fa2878a17..c51c3750ee5 100644 --- a/public/app/features/org/partials/profile.html +++ b/public/app/features/org/partials/profile.html @@ -33,8 +33,8 @@ Change Password -

Organizations

-
+

Organizations

+
diff --git a/public/app/features/org/profile_ctrl.ts b/public/app/features/org/profile_ctrl.ts index 65bff1f6c12..a97799f1e85 100644 --- a/public/app/features/org/profile_ctrl.ts +++ b/public/app/features/org/profile_ctrl.ts @@ -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; }); }