mirror of https://github.com/portainer/portainer
feature(UX): sort dropdowns alphabetically (#3524)
parent
1ef29f2671
commit
7365afa1bb
|
@ -48,9 +48,9 @@ function ($q, UserService, TeamService, Notifications, Authentication, ResourceC
|
||||||
availableUsers: isAdmin ? UserService.users(false) : []
|
availableUsers: isAdmin ? UserService.users(false) : []
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
ctrl.availableUsers = data.availableUsers;
|
ctrl.availableUsers = _.orderBy(data.availableUsers, 'Username', 'asc');
|
||||||
|
|
||||||
var availableTeams = data.availableTeams;
|
var availableTeams = _.orderBy(data.availableTeams, 'Name', 'asc');
|
||||||
ctrl.availableTeams = availableTeams;
|
ctrl.availableTeams = availableTeams;
|
||||||
if (!isAdmin && availableTeams.length === 1) {
|
if (!isAdmin && availableTeams.length === 1) {
|
||||||
ctrl.formData.AuthorizedTeams = availableTeams;
|
ctrl.formData.AuthorizedTeams = availableTeams;
|
||||||
|
|
|
@ -106,14 +106,14 @@ function ($q, $state, UserService, TeamService, ResourceControlHelper, ResourceC
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
ctrl.availableUsers = data.availableUsers;
|
ctrl.availableUsers = _.orderBy(data.availableUsers, 'Username', 'asc');
|
||||||
angular.forEach(ctrl.availableUsers, function(user) {
|
angular.forEach(ctrl.availableUsers, function(user) {
|
||||||
var found = _.find(ctrl.authorizedUsers, { Id: user.Id });
|
var found = _.find(ctrl.authorizedUsers, { Id: user.Id });
|
||||||
if (found) {
|
if (found) {
|
||||||
user.selected = true;
|
user.selected = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ctrl.availableTeams = data.availableTeams;
|
ctrl.availableTeams = _.orderBy(data.availableTeams, 'Name', 'asc');
|
||||||
angular.forEach(data.availableTeams, function(team) {
|
angular.forEach(data.availableTeams, function(team) {
|
||||||
var found = _.find(ctrl.authorizedTeams, { Id: team.Id });
|
var found = _.find(ctrl.authorizedTeams, { Id: team.Id });
|
||||||
if (found) {
|
if (found) {
|
||||||
|
|
|
@ -88,7 +88,7 @@ class PorAccessManagementController {
|
||||||
parent ? parent.TeamAccessPolicies : {},
|
parent ? parent.TeamAccessPolicies : {},
|
||||||
this.roles
|
this.roles
|
||||||
);
|
);
|
||||||
this.availableUsersAndTeams = data.availableUsersAndTeams;
|
this.availableUsersAndTeams = _.orderBy(data.availableUsersAndTeams, 'Name', 'asc');
|
||||||
this.authorizedUsersAndTeams = data.authorizedUsersAndTeams;
|
this.authorizedUsersAndTeams = data.authorizedUsersAndTeams;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.availableUsersAndTeams = [];
|
this.availableUsersAndTeams = [];
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import _ from 'lodash-es';
|
||||||
|
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.controller('TeamsController', ['$q', '$scope', '$state', 'TeamService', 'UserService', 'ModalService', 'Notifications', 'Authentication',
|
.controller('TeamsController', ['$q', '$scope', '$state', 'TeamService', 'UserService', 'ModalService', 'Notifications', 'Authentication',
|
||||||
function ($q, $scope, $state, TeamService, UserService, ModalService, Notifications, Authentication) {
|
function ($q, $scope, $state, TeamService, UserService, ModalService, Notifications, Authentication) {
|
||||||
|
@ -84,7 +86,7 @@ function ($q, $scope, $state, TeamService, UserService, ModalService, Notificati
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
var teams = data.teams;
|
var teams = data.teams;
|
||||||
$scope.teams = teams;
|
$scope.teams = teams;
|
||||||
$scope.users = data.users;
|
$scope.users = _.orderBy(data.users, 'Username', 'asc');
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
$scope.teams = [];
|
$scope.teams = [];
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import _ from 'lodash-es';
|
||||||
|
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.controller('UsersController', ['$q', '$scope', '$state', 'UserService', 'TeamService', 'TeamMembershipService', 'ModalService', 'Notifications', 'Authentication', 'SettingsService',
|
.controller('UsersController', ['$q', '$scope', '$state', 'UserService', 'TeamService', 'TeamMembershipService', 'ModalService', 'Notifications', 'Authentication', 'SettingsService',
|
||||||
function ($q, $scope, $state, UserService, TeamService, TeamMembershipService, ModalService, Notifications, Authentication, SettingsService) {
|
function ($q, $scope, $state, UserService, TeamService, TeamMembershipService, ModalService, Notifications, Authentication, SettingsService) {
|
||||||
|
@ -110,7 +112,7 @@ function ($q, $scope, $state, UserService, TeamService, TeamMembershipService, M
|
||||||
var users = data.users;
|
var users = data.users;
|
||||||
assignTeamLeaders(users, data.memberships);
|
assignTeamLeaders(users, data.memberships);
|
||||||
$scope.users = users;
|
$scope.users = users;
|
||||||
$scope.teams = data.teams;
|
$scope.teams = _.orderBy(data.teams, 'Name', 'asc');
|
||||||
$scope.AuthenticationMethod = data.settings.AuthenticationMethod;
|
$scope.AuthenticationMethod = data.settings.AuthenticationMethod;
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
|
|
Loading…
Reference in New Issue