1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-07 23:05:26 +02:00

feat(oauth): default team for user on oauth settings

This commit is contained in:
baron_l 2019-02-07 19:32:02 +01:00
parent 4d8133f696
commit 2755527d28
6 changed files with 37 additions and 7 deletions

View file

@ -53,4 +53,5 @@ function OAuthSettingsViewModel(data) {
this.UserIdentifier = data.UserIdentifier;
this.Scopes = data.Scopes;
this.OAuthAutoCreateUsers = data.OAuthAutoCreateUsers;
this.DefaultTeamID = data.DefaultTeamID;
}

View file

@ -322,7 +322,7 @@
<!-- !group-search-settings -->
</div>
<oauth-settings ng-if="isOauthEnabled()" settings="OAuthSettings"></oauth-settings>
<oauth-settings ng-if="isOauthEnabled()" settings="OAuthSettings" teams="teams"></oauth-settings>
<!-- actions -->
<div class="form-group">

View file

@ -1,6 +1,6 @@
angular.module('portainer.app')
.controller('SettingsAuthenticationController', ['$q', '$scope', 'Notifications', 'SettingsService', 'FileUploadService',
function ($q, $scope, Notifications, SettingsService, FileUploadService) {
.controller('SettingsAuthenticationController', ['$q', '$scope', 'Notifications', 'SettingsService', 'FileUploadService', 'TeamService',
function ($q, $scope, Notifications, SettingsService, FileUploadService, TeamService) {
$scope.state = {
successfulConnectivityCheck: false,
@ -96,9 +96,12 @@ function ($q, $scope, Notifications, SettingsService, FileUploadService) {
}
function initView() {
SettingsService.settings()
.then(function success(data) {
var settings = data;
$q.all({
settings: SettingsService.settings(),
teams: TeamService.teams()
}).then(function success(data) {
var settings = data.settings;
$scope.teams = data.teams;
$scope.settings = settings;
$scope.LDAPSettings = settings.LDAPSettings;
$scope.OAuthSettings = settings.OAuthSettings;