fixing issues described in 595 (#602)

fixing: #595
This commit is contained in:
Erik Jan de Wit 2021-05-20 11:38:37 +02:00 committed by GitHub
parent c97c804ad9
commit 586375b5f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View file

@ -2,6 +2,7 @@ import React, { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFormContext, useWatch } from "react-hook-form"; import { useFormContext, useWatch } from "react-hook-form";
import { import {
Divider,
ExpandableSection, ExpandableSection,
FormGroup, FormGroup,
TextInput, TextInput,
@ -11,6 +12,8 @@ import {
import { SwitchField } from "../component/SwitchField"; import { SwitchField } from "../component/SwitchField";
import { TextField } from "../component/TextField"; import { TextField } from "../component/TextField";
import "./discovery-settings.css";
type DiscoverySettingsProps = { type DiscoverySettingsProps = {
readOnly: boolean; readOnly: boolean;
}; };
@ -124,6 +127,7 @@ export const DiscoverySettings = ({ readOnly }: DiscoverySettingsProps) => {
<> <>
{readOnly && ( {readOnly && (
<ExpandableSection <ExpandableSection
className="keycloak__discovery-settings__metadata"
toggleText={isExpanded ? t("hideMetaData") : t("showMetaData")} toggleText={isExpanded ? t("hideMetaData") : t("showMetaData")}
onToggle={() => setIsExpanded(!isExpanded)} onToggle={() => setIsExpanded(!isExpanded)}
isExpanded={isExpanded} isExpanded={isExpanded}
@ -132,6 +136,7 @@ export const DiscoverySettings = ({ readOnly }: DiscoverySettingsProps) => {
</ExpandableSection> </ExpandableSection>
)} )}
{!readOnly && <Fields readOnly={readOnly} />} {!readOnly && <Fields readOnly={readOnly} />}
<Divider />
</> </>
); );
}; };

View file

@ -0,0 +1,4 @@
.keycloak__discovery-settings__metadata .pf-c-expandable-section__toggle {
margin-left: var(--pf-c-form--m-horizontal__group-label--md--GridColumnWidth);
}

View file

@ -36,7 +36,7 @@ export const SwitchField = ({
onChange={(value) => onChange={(value) =>
onChange(fieldType === "string" ? "" + value : value) onChange(fieldType === "string" ? "" + value : value)
} }
readOnly={isReadOnly} isDisabled={isReadOnly}
/> />
)} )}
/> />