disable vendor if provider exists (#1447)

This commit is contained in:
mfrances17 2021-11-01 14:44:23 -04:00 committed by GitHub
parent 9c48bb4d90
commit 8e5ce6aa34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -299,7 +299,7 @@ export default function UserFederationLdapSettings() {
t("advancedSettings"),
]}
>
<LdapSettingsGeneral form={form} />
<LdapSettingsGeneral form={form} vendorEdit={!!id} />
<LdapSettingsConnection form={form} edit={!!id} />
<LdapSettingsSearching form={form} />
<LdapSettingsSynchronization form={form} />

View file

@ -19,12 +19,14 @@ export type LdapSettingsGeneralProps = {
form: UseFormMethods;
showSectionHeading?: boolean;
showSectionDescription?: boolean;
vendorEdit?: boolean;
};
export const LdapSettingsGeneral = ({
form,
showSectionHeading = false,
showSectionDescription = false,
vendorEdit = false,
}: LdapSettingsGeneralProps) => {
const { t } = useTranslation("user-federation");
const helpText = useTranslation("user-federation-help").t;
@ -174,6 +176,7 @@ export const LdapSettingsGeneral = ({
control={form.control}
render={({ onChange, value }) => (
<Select
isDisabled={!!vendorEdit}
toggleId="kc-vendor"
required
onToggle={() => setIsVendorDropdownOpen(!isVendorDropdownOpen)}