From 27c25472eea36fad56aeb2e3c5a0ade39a154d2f Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 26 Apr 2021 13:48:09 +0200 Subject: [PATCH] small fixes --- src/clients/add/CapabilityConfig.tsx | 28 ++++++++++++++++++++------- src/clients/add/capability-config.css | 5 +++++ src/clients/messages.json | 2 +- 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 src/clients/add/capability-config.css diff --git a/src/clients/add/CapabilityConfig.tsx b/src/clients/add/CapabilityConfig.tsx index 8f2b58f339..3ba9036af5 100644 --- a/src/clients/add/CapabilityConfig.tsx +++ b/src/clients/add/CapabilityConfig.tsx @@ -1,5 +1,6 @@ import React from "react"; import { useTranslation } from "react-i18next"; +import { Controller, useFormContext } from "react-hook-form"; import { FormGroup, Switch, @@ -8,11 +9,13 @@ import { GridItem, InputGroup, } from "@patternfly/react-core"; -import { Controller, useFormContext } from "react-hook-form"; + import { FormAccess } from "../../components/form-access/FormAccess"; import { ClientForm } from "../ClientDetails"; import { HelpItem } from "../../components/help-enabler/HelpItem"; +import "./capability-config.css"; + type CapabilityConfigProps = { unWrap?: boolean; protocol?: string; @@ -29,7 +32,12 @@ export const CapabilityConfig = ({ const authorization = watch("authorizationServicesEnabled"); return ( - + <> {protocol === "openid-connect" && ( <> @@ -57,7 +65,13 @@ export const CapabilityConfig = ({ label={t("common:on")} labelOff={t("common:off")} isChecked={!value} - onChange={(value) => onChange(!value)} + onChange={(value) => { + onChange(!value); + if (!value) { + setValue("authorizationServicesEnabled", false); + setValue("serviceAccountsEnabled", false); + } + }} /> )} /> @@ -103,7 +117,7 @@ export const CapabilityConfig = ({ fieldId="kc-flow" > - + - + - + - +