mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(signup): selecting org after invite now works
This commit is contained in:
@@ -27,8 +27,11 @@ function (angular, config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
backendSrv.post('/api/user/signup/step2', $scope.formModel).then(function(rsp) {
|
backendSrv.post('/api/user/signup/step2', $scope.formModel).then(function(rsp) {
|
||||||
console.log(rsp);
|
if (rsp.code === 'redirect-to-select-org') {
|
||||||
//window.location.href = config.appSubUrl + '/';
|
window.location.href = config.appSubUrl + '/profile/select-org?signup=1';
|
||||||
|
} else {
|
||||||
|
window.location.href = config.appSubUrl + '/';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ define([
|
|||||||
'./panel/all',
|
'./panel/all',
|
||||||
'./profile/profileCtrl',
|
'./profile/profileCtrl',
|
||||||
'./profile/changePasswordCtrl',
|
'./profile/changePasswordCtrl',
|
||||||
|
'./profile/selectOrgCtrl',
|
||||||
'./org/all',
|
'./org/all',
|
||||||
'./admin/all',
|
'./admin/all',
|
||||||
], function () {});
|
], function () {});
|
||||||
|
|||||||
53
public/app/features/profile/partials/select_org.html
Normal file
53
public/app/features/profile/partials/select_org.html
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<div class="signup-page-background">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="login-box">
|
||||||
|
|
||||||
|
<div class="login-box-logo">
|
||||||
|
<img src="img/logo_transparent_200x75.png">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="invite-box">
|
||||||
|
<h3>
|
||||||
|
<i class="fa fa-users"></i>
|
||||||
|
Change active organization
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="modal-tagline">
|
||||||
|
You have been added to another Organization <br>
|
||||||
|
due to an open invitation!
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
Please select which organization you want to <br>
|
||||||
|
use right now (you can change this later at any time).
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: inline-block; width: 400px; margin: 30px 0">
|
||||||
|
<table class="grafana-options-table">
|
||||||
|
<tr ng-repeat="org in orgs">
|
||||||
|
<td class="nobg max-width-btns">
|
||||||
|
<a ng-click="setUsingOrg(org)" class="btn btn-inverse">
|
||||||
|
{{org.name}} ({{org.role}})
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row" style="margin-top: 50px">
|
||||||
|
<div class="version-footer text-center small">
|
||||||
|
Grafana version: {{buildInfo.version}}, commit: {{buildInfo.commit}},
|
||||||
|
build date: {{buildInfo.buildstamp | date: 'yyyy-MM-dd HH:mm:ss' }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
33
public/app/features/profile/selectOrgCtrl.js
Normal file
33
public/app/features/profile/selectOrgCtrl.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
define([
|
||||||
|
'angular',
|
||||||
|
'config',
|
||||||
|
],
|
||||||
|
function (angular, config) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var module = angular.module('grafana.controllers');
|
||||||
|
|
||||||
|
module.controller('SelectOrgCtrl', function($scope, backendSrv, contextSrv) {
|
||||||
|
|
||||||
|
contextSrv.sidemenu = false;
|
||||||
|
|
||||||
|
$scope.init = function() {
|
||||||
|
$scope.getUserOrgs();
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.getUserOrgs = function() {
|
||||||
|
backendSrv.get('/api/user/orgs').then(function(orgs) {
|
||||||
|
$scope.orgs = orgs;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.setUsingOrg = function(org) {
|
||||||
|
backendSrv.post('/api/user/using/' + org.orgId).then(function() {
|
||||||
|
window.location.href = config.appSubUrl + '/';
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.init();
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form name="loginForm" class="login-form">
|
<form name="loginForm" class="login-form" style="margin-top: 25px;">
|
||||||
<div class="tight-from-container">
|
<div class="tight-from-container">
|
||||||
<div class="tight-form" ng-if="loginMode">
|
<div class="tight-form" ng-if="loginMode">
|
||||||
<ul class="tight-form-list">
|
<ul class="tight-form-list">
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tight-form" ng-if="!loginMode">
|
<div class="tight-form" ng-if="!loginMode" style="margin: 20px 0 57px 0">
|
||||||
<ul class="tight-form-list">
|
<ul class="tight-form-list">
|
||||||
<li class="tight-form-item" style="width: 79px">
|
<li class="tight-form-item" style="width: 79px">
|
||||||
<strong>Email</strong>
|
<strong>Email</strong>
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ define([
|
|||||||
templateUrl: 'app/features/profile/partials/password.html',
|
templateUrl: 'app/features/profile/partials/password.html',
|
||||||
controller : 'ChangePasswordCtrl',
|
controller : 'ChangePasswordCtrl',
|
||||||
})
|
})
|
||||||
|
.when('/profile/select-org', {
|
||||||
|
templateUrl: 'app/features/profile/partials/select_org.html',
|
||||||
|
controller : 'SelectOrgCtrl',
|
||||||
|
})
|
||||||
.when('/admin/settings', {
|
.when('/admin/settings', {
|
||||||
templateUrl: 'app/features/admin/partials/settings.html',
|
templateUrl: 'app/features/admin/partials/settings.html',
|
||||||
controller : 'AdminSettingsCtrl',
|
controller : 'AdminSettingsCtrl',
|
||||||
|
|||||||
Reference in New Issue
Block a user