import { FormGroup, Select, SelectOption, SelectVariant, TextInput, } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; import React, { useState } from "react"; import { HelpItem } from "../components/help-enabler/HelpItem"; import { useForm, Controller } from "react-hook-form"; import ComponentRepresentation from "keycloak-admin/lib/defs/componentRepresentation"; import { FormAccess } from "../components/form-access/FormAccess"; export const LdapSettingsCache = () => { const { t } = useTranslation("user-federation"); const helpText = useTranslation("user-federation-help").t; const [isCachePolicyDropdownOpen, setIsCachePolicyDropdownOpen] = useState( false ); const [isEvictionHourDropdownOpen, setIsEvictionHourDropdownOpen] = useState( false ); const [ isEvictionMinuteDropdownOpen, setIsEvictionMinuteDropdownOpen, ] = useState(false); const [isEvictionDayDropdownOpen, setIsEvictionDayDropdownOpen] = useState( false ); const hourOptions = [ , ]; for (let index = 1; index <= 24; index++) { hourOptions.push(); } const minuteOptions = [ , ]; for (let index = 1; index <= 60; index++) { minuteOptions.push(); } const { control, register } = useForm(); return ( <> {/* Cache settings */} } fieldId="kc-cache-policy" > ( )} > {/* TODO: Field shows only if cache policy is EVICT_WEEKLY */} } fieldId="kc-eviction-day" > ( )} > {/* TODO: Field shows only if cache policy is EVICT_WEEKLY or EVICT_DAILY */} {/* TODO: Investigate whether this should be a number field instead of a dropdown/text field */} } fieldId="kc-eviction-hour" > ( )} > {/* TODO: Field shows only if cache policy is EVICT_WEEKLY or EVICT_DAILY */} {/* TODO: Investigate whether this should be a number field instead of a dropdown/text field */} } fieldId="kc-eviction-minute" > ( )} > {/* TODO: Field shows only if cache policy is MAX_LIFESPAN */} } fieldId="kc-max-lifespan" > ); };