diff --git a/src/app/global/sideNavController.js b/src/app/global/sideNavController.js index b5096802da..44f5594f8e 100644 --- a/src/app/global/sideNavController.js +++ b/src/app/global/sideNavController.js @@ -1,7 +1,7 @@ angular .module('bit.global') - .controller('sideNavController', function ($scope, $state, authService) { + .controller('sideNavController', function ($scope, $state, authService, toastr) { $scope.$state = $state; $scope.params = $state.params; $scope.orgs = []; @@ -21,7 +21,8 @@ angular else { var orgs = []; for (var orgId in userProfile.organizations) { - if (userProfile.organizations.hasOwnProperty(orgId)) { + if (userProfile.organizations.hasOwnProperty(orgId) && + (userProfile.organizations[orgId].enabled || userProfile.organizations[orgId].type < 2)) { // 2 = User orgs.push(userProfile.organizations[orgId]); } } @@ -29,7 +30,12 @@ angular } }); - $scope.viewOrganization = function (id) { - $state.go('backend.org.dashboard', { orgId: id }); + $scope.viewOrganization = function (org) { + if (org.type === 2) { // 2 = User + toastr.error('You cannot manage this organization.'); + return; + } + + $state.go('backend.org.dashboard', { orgId: org.id }); }; }); diff --git a/src/app/organization/organizationDashboardController.js b/src/app/organization/organizationDashboardController.js index 2bf6cb1c39..0e0546a2b8 100644 --- a/src/app/organization/organizationDashboardController.js +++ b/src/app/organization/organizationDashboardController.js @@ -1,6 +1,15 @@ angular .module('bit.organization') - .controller('organizationDashboardController', function ($scope) { + .controller('organizationDashboardController', function ($scope, authService, $state) { + $scope.$on('$viewContentLoaded', function () { + authService.getUserProfile().then(function (userProfile) { + if (!userProfile.organizations) { + return; + } + + $scope.orgProfile = userProfile.organizations[$state.params.orgId]; + }); + }); }); diff --git a/src/app/organization/views/organizationBilling.html b/src/app/organization/views/organizationBilling.html index eb79a29975..7f4f97b112 100644 --- a/src/app/organization/views/organizationBilling.html +++ b/src/app/organization/views/organizationBilling.html @@ -5,25 +5,25 @@
+
+

Cancelled

+ The subscription to this organization has been canceled. +
+
+

Pending Cancellation

+

+ The subscription to this organization has been marked for cancellation at the end of the + current billing period. +

+ +

Plan

-
-

Cancelled

- The subscription to this organization has been canceled. -
-
-

Pending Cancellation

-

- The subscription to this organization has been marked for cancellation at the end of the - current billing period. -

- -
diff --git a/src/app/organization/views/organizationDashboard.html b/src/app/organization/views/organizationDashboard.html index 0d8f67bba1..115fc392ca 100644 --- a/src/app/organization/views/organizationDashboard.html +++ b/src/app/organization/views/organizationDashboard.html @@ -5,12 +5,28 @@
+
+

Organization Disabled

+

+ This organization is currently disabled. Users will not see your shared logins or subvaults. + Contact us if you would like to reinstate this organization. +

+ + Contact Us + +
-

My Org

+

Let's Get Started!

- Some data +

Dashboard features are coming soon. Get started by inviting users and creating your subvaults!

+ + Invite Users + + + Manage Subvaults +
diff --git a/src/app/services/authService.js b/src/app/services/authService.js index 3857dfe561..9d811a0bd1 100644 --- a/src/app/services/authService.js +++ b/src/app/services/authService.js @@ -103,7 +103,8 @@ angular name: profile.Organizations[i].Name, key: profile.Organizations[i].Key, status: profile.Organizations[i].Status, - type: profile.Organizations[i].Type + type: profile.Organizations[i].Type, + enabled: profile.Organizations[i].Enabled }; } @@ -130,7 +131,8 @@ angular name: org.Name, key: key, status: 2, // 2 = Confirmed - type: 0 // 0 = Owner + type: 0, // 0 = Owner + enabled: true }; profile.organizations[o.id] = o; diff --git a/src/app/settings/settingsController.js b/src/app/settings/settingsController.js index 012484c4cb..279d88d846 100644 --- a/src/app/settings/settingsController.js +++ b/src/app/settings/settingsController.js @@ -32,7 +32,8 @@ id: user.Organizations[i].Id, name: user.Organizations[i].Name, status: user.Organizations[i].Status, - type: user.Organizations[i].Type + type: user.Organizations[i].Type, + enabled: user.Organizations[i].Enabled }); } @@ -73,8 +74,13 @@ }); }; - $scope.viewOrganization = function (id) { - $state.go('backend.org.dashboard', { orgId: id }); + $scope.viewOrganization = function (org) { + if (org.type === 2) { // 2 = User + toastr.error('You cannot manage this organization.'); + return; + } + + $state.go('backend.org.dashboard', { orgId: org.id }); }; $scope.twoFactor = function () { diff --git a/src/app/settings/views/settings.html b/src/app/settings/views/settings.html index 5cd4e329b8..7d874abb8e 100644 --- a/src/app/settings/views/settings.html +++ b/src/app/settings/views/settings.html @@ -115,10 +115,11 @@
+ href="javascript:void(0)" ng-click="viewOrganization(org)" class="list-group-item"> {{org.name}} + DISABLED