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 (
);
}
diff --git a/app/react/portainer/users/teams/ListView/CreateTeamForm/CreateTeamForm.tsx b/app/react/portainer/users/teams/ListView/CreateTeamForm/CreateTeamForm.tsx
index 662ad32d5..a13619ce5 100644
--- a/app/react/portainer/users/teams/ListView/CreateTeamForm/CreateTeamForm.tsx
+++ b/app/react/portainer/users/teams/ListView/CreateTeamForm/CreateTeamForm.tsx
@@ -5,12 +5,14 @@ import { useReducer } from 'react';
import { Icon } from '@/react/components/Icon';
import { User } from '@/portainer/users/types';
import { notifySuccess } from '@/portainer/services/notifications';
+import { usePublicSettings } from '@/react/portainer/settings/queries';
import { FormControl } from '@@/form-components/FormControl';
import { Widget } from '@@/Widget';
import { Input } from '@@/form-components/Input';
import { UsersSelector } from '@@/UsersSelector';
import { LoadingButton } from '@@/buttons/LoadingButton';
+import { TextTip } from '@@/Tip/TextTip';
import { createTeam } from '../../teams.service';
import { Team } from '../../types';
@@ -26,6 +28,9 @@ interface Props {
export function CreateTeamForm({ users, teams }: Props) {
const addTeamMutation = useAddTeamMutation();
const [formKey, incFormKey] = useReducer((state: number) => state + 1, 0);
+ const teamSyncQuery = usePublicSettings
({
+ select: (settings) => settings.TeamSync,
+ });
const initialValues = {
name: '',
@@ -95,10 +100,22 @@ export function CreateTeamForm({ users, teams }: Props) {
dataCy="team-teamLeaderSelect"
inputId="users-input"
placeholder="Select one or more team leaders"
+ disabled={teamSyncQuery.data}
/>
)}
+ {teamSyncQuery.data && (
+
+
+
+ The team leader feature is disabled as external
+ authentication is currently enabled with team sync.
+
+
+
+ )}
+