Fixed decision strategy not selecting properly (#2569)

This commit is contained in:
agagancarczyk 2022-05-04 18:51:17 +01:00 committed by GitHub
parent c2df6e7dfb
commit 24f43d59ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -18,6 +18,7 @@ export const DecisionStrategySelect = ({
}: DecisionStrategySelectProps) => {
const { t } = useTranslation("clients");
const { control } = useFormContext();
return (
<FormGroup
label={t("decisionStrategy")}

View file

@ -1,6 +1,6 @@
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { Controller, useForm } from "react-hook-form";
import { Controller, FormProvider, useForm } from "react-hook-form";
import {
AlertVariant,
Button,
@ -33,10 +33,8 @@ export const AuthorizationSettings = ({ clientId }: { clientId: string }) => {
const [resource, setResource] = useState<ResourceServerRepresentation>();
const [importDialog, toggleImportDialog] = useToggle();
const { control, reset, handleSubmit } =
useForm<ResourceServerRepresentation>({
shouldUnregister: false,
});
const form = useForm<ResourceServerRepresentation>({});
const { control, reset, handleSubmit } = form;
const adminClient = useAdminClient();
const { addAlert, addError } = useAlerts();
@ -134,7 +132,9 @@ export const AuthorizationSettings = ({ clientId }: { clientId: string }) => {
)}
/>
</FormGroup>
<DecisionStrategySelect isLimited />
<FormProvider {...form}>
<DecisionStrategySelect isLimited />
</FormProvider>
<FormGroup
hasNoPaddingTop
label={t("allowRemoteResourceManagement")}