diff --git a/src/app/features/admin/adminSettingsCtrl.js b/src/app/features/admin/adminSettingsCtrl.js index e04372bd6ac..d980281577d 100644 --- a/src/app/features/admin/adminSettingsCtrl.js +++ b/src/app/features/admin/adminSettingsCtrl.js @@ -9,7 +9,6 @@ function (angular) { module.controller('AdminSettingsCtrl', function($scope, backendSrv) { $scope.init = function() { - $scope.accounts = []; $scope.getUsers(); }; diff --git a/src/app/features/admin/adminUsersCtrl.js b/src/app/features/admin/adminUsersCtrl.js index bf8e998a16f..3c45d067a6e 100644 --- a/src/app/features/admin/adminUsersCtrl.js +++ b/src/app/features/admin/adminUsersCtrl.js @@ -9,7 +9,6 @@ function (angular) { module.controller('AdminUsersCtrl', function($scope, backendSrv) { $scope.init = function() { - $scope.accounts = []; $scope.getUsers(); }; diff --git a/src/app/features/org/datasourceEditCtrl.js b/src/app/features/org/datasourceEditCtrl.js index 5366cd05aa5..1acb30cfa83 100644 --- a/src/app/features/org/datasourceEditCtrl.js +++ b/src/app/features/org/datasourceEditCtrl.js @@ -54,7 +54,7 @@ function (angular) { backendSrv.post('/api/datasources', $scope.current).then(function() { $scope.updateFrontendSettings(); - $location.path("account/datasources"); + $location.path("datasources"); }); }; @@ -65,7 +65,7 @@ function (angular) { backendSrv.put('/api/datasources', $scope.current).then(function() { $scope.updateFrontendSettings(); - $location.path("account/datasources"); + $location.path("datasources"); }); }; diff --git a/src/app/features/org/orgDetailsCtrl.js b/src/app/features/org/orgDetailsCtrl.js index ab0f8be4078..4a3c3dcc7e5 100644 --- a/src/app/features/org/orgDetailsCtrl.js +++ b/src/app/features/org/orgDetailsCtrl.js @@ -13,8 +13,8 @@ function (angular) { }; $scope.getOrgInfo = function() { - backendSrv.get('/api/org').then(function(account) { - $scope.org = account; + backendSrv.get('/api/org').then(function(org) { + $scope.org = org; }); }; diff --git a/src/app/features/profile/partials/profile.html b/src/app/features/profile/partials/profile.html index ac9b5298774..eb1e7b81fd7 100644 --- a/src/app/features/profile/partials/profile.html +++ b/src/app/features/profile/partials/profile.html @@ -51,34 +51,34 @@ -

Your accounts

+

Your Organizations

- - - + + +
Name: {{ac.name}}Role: {{ac.role}}
Name: {{org.name}}Role: {{org.role}} - + Current - + Select
-

Add account

+

Add Organization

  • - Account name + Org. name
  • - +
  • @@ -87,7 +87,7 @@

- +
diff --git a/src/app/features/profile/profileCtrl.js b/src/app/features/profile/profileCtrl.js index dd957fb1228..2f419305b31 100644 --- a/src/app/features/profile/profileCtrl.js +++ b/src/app/features/profile/profileCtrl.js @@ -9,11 +9,11 @@ function (angular, config) { module.controller('ProfileCtrl', function($scope, backendSrv) { - $scope.newAccount = {name: ''}; + $scope.newOrg = {name: ''}; $scope.init = function() { $scope.getUser(); - $scope.getUserAccounts(); + $scope.getUserOrgs(); }; $scope.getUser = function() { @@ -22,14 +22,14 @@ function (angular, config) { }); }; - $scope.getUserAccounts = function() { - backendSrv.get('/api/user/accounts').then(function(accounts) { - $scope.accounts = accounts; + $scope.getUserOrgs = function() { + backendSrv.get('/api/user/orgs').then(function(orgs) { + $scope.orgs = orgs; }); }; - $scope.setUsingAccount = function(account) { - backendSrv.post('/api/user/using/' + account.accountId).then(function() { + $scope.setUsingOrg = function(org) { + backendSrv.post('/api/user/using/' + org.orgId).then(function() { window.location.href = config.appSubUrl + '/profile'; }); }; @@ -39,8 +39,8 @@ function (angular, config) { backendSrv.put('/api/user/', $scope.user); }; - $scope.createAccount = function() { - backendSrv.post('/api/account/', $scope.newAccount).then($scope.getUserAccounts); + $scope.createOrg = function() { + backendSrv.post('/api/org/', $scope.newOrg).then($scope.getUserOrgs); }; $scope.init(); diff --git a/src/app/services/contextSrv.js b/src/app/services/contextSrv.js index fc22079d6e9..4f9dc69994e 100644 --- a/src/app/services/contextSrv.js +++ b/src/app/services/contextSrv.js @@ -28,7 +28,7 @@ function (angular, _, store) { }); this.hasRole = function(role) { - return this.user.accountRole === role; + return this.user.orgRole === role; }; this.setSideMenuState = function(state) {