diff --git a/app/portainer/react/components/index.ts b/app/portainer/react/components/index.ts index fd11fb321..14eeff6f0 100644 --- a/app/portainer/react/components/index.ts +++ b/app/portainer/react/components/index.ts @@ -147,6 +147,7 @@ export const componentsModule = angular 'name', 'placeholder', 'teams', + 'disabled', ]) ) .component( diff --git a/app/portainer/views/users/users.html b/app/portainer/views/users/users.html index 97422fd2c..30a148024 100644 --- a/app/portainer/views/users/users.html +++ b/app/portainer/views/users/users.html @@ -118,9 +118,20 @@ data-cy="'user-teamSelect'" on-change="(onChangeTeamIds)" input-id="'teams-selector'" + disabled="teamSync" > +
+
+ +

+ + The team leader feature is disabled as external authentication is currently enabled with team sync. +

+
+
+
diff --git a/app/portainer/views/users/usersController.js b/app/portainer/views/users/usersController.js index d3a35547c..bd326a767 100644 --- a/app/portainer/views/users/usersController.js +++ b/app/portainer/views/users/usersController.js @@ -131,6 +131,7 @@ angular.module('portainer.app').controller('UsersController', [ $scope.teams = _.orderBy(data.teams, 'Name', 'asc'); $scope.AuthenticationMethod = data.settings.AuthenticationMethod; $scope.requiredPasswordLength = data.settings.RequiredPasswordLength; + $scope.teamSync = data.settings.TeamSync; }) .catch(function error(err) { Notifications.error('Failure', err, 'Unable to retrieve users and teams'); diff --git a/app/react/components/TeamsSelector/TeamsSelector.tsx b/app/react/components/TeamsSelector/TeamsSelector.tsx index b19532140..0158b8b06 100644 --- a/app/react/components/TeamsSelector/TeamsSelector.tsx +++ b/app/react/components/TeamsSelector/TeamsSelector.tsx @@ -10,6 +10,7 @@ interface Props { dataCy?: string; inputId?: string; placeholder?: string; + disabled?: boolean; } export function TeamsSelector({ @@ -20,6 +21,7 @@ export function TeamsSelector({ dataCy, inputId, placeholder, + disabled, }: Props) { const options = teams.map((team) => ({ label: team.Name, value: team.Id })); @@ -33,6 +35,7 @@ export function TeamsSelector({ data-cy={dataCy} inputId={inputId} placeholder={placeholder} + disabled={disabled} /> ); } diff --git a/app/react/components/UsersSelector/UsersSelector.tsx b/app/react/components/UsersSelector/UsersSelector.tsx index 2963830e8..4edb68028 100644 --- a/app/react/components/UsersSelector/UsersSelector.tsx +++ b/app/react/components/UsersSelector/UsersSelector.tsx @@ -10,6 +10,7 @@ interface Props { dataCy?: string; inputId?: string; placeholder?: string; + disabled?: boolean; } export function UsersSelector({ @@ -20,6 +21,7 @@ export function UsersSelector({ dataCy, inputId, placeholder, + disabled, }: Props) { return (