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"), t("advancedSettings"),
]} ]}
> >
<LdapSettingsGeneral form={form} /> <LdapSettingsGeneral form={form} vendorEdit={!!id} />
<LdapSettingsConnection form={form} edit={!!id} /> <LdapSettingsConnection form={form} edit={!!id} />
<LdapSettingsSearching form={form} /> <LdapSettingsSearching form={form} />
<LdapSettingsSynchronization form={form} /> <LdapSettingsSynchronization form={form} />

View file

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