fixed the wrong comment

This commit is contained in:
Erik Jan de Wit 2021-04-26 09:40:59 +02:00
parent 2a02b38888
commit 1521024abf
2 changed files with 8 additions and 7 deletions

View file

@ -26,7 +26,7 @@ export const CapabilityConfig = ({
const { control, watch, setValue } = useFormContext<ClientForm>();
const protocol = type || watch("protocol");
const clientAuthentication = watch("publicClient");
const clientAuthorization = watch("authorizationServicesEnabled");
const authorization = watch("authorizationServicesEnabled");
return (
<FormAccess isHorizontal role="manage-clients" unWrap={unWrap}>
@ -47,7 +47,7 @@ export const CapabilityConfig = ({
>
<Controller
name="publicClient"
defaultValue={true}
defaultValue={false}
control={control}
render={({ onChange, value }) => (
<Switch
@ -85,7 +85,7 @@ export const CapabilityConfig = ({
name="authorizationServicesEnabled"
label={t("common:on")}
labelOff={t("common:off")}
isChecked={value}
isChecked={value && !clientAuthentication}
onChange={(value) => {
onChange(value);
if (value) {
@ -188,11 +188,13 @@ export const CapabilityConfig = ({
id="kc-flow-service-account"
name="serviceAccountsEnabled"
isChecked={
value ||
(clientAuthentication && clientAuthorization)
value || (clientAuthentication && authorization)
}
onChange={onChange}
isDisabled={clientAuthorization}
isDisabled={
(clientAuthentication && !authorization) ||
(!clientAuthentication && authorization)
}
/>
<HelpItem
helpText="clients-help:serviceAccount"

View file

@ -7,7 +7,6 @@ import {
WizardFooter,
WizardContextConsumer,
Button,
WizardStepFunctionType,
} from "@patternfly/react-core";
import { useTranslation } from "react-i18next";
import { FormProvider, useForm } from "react-hook-form";