From 4b3733de2e9cc1b8232d519d69cb0265ddc84f9f Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 12 Jun 2023 12:53:29 +0200 Subject: [PATCH] little wrapper around the time selector (#20881) this makes it easier to use --- .../src/clients/advanced/ClusteringPanel.tsx | 13 ++---------- .../components/time-selector/TimeSelector.tsx | 21 +++++++++++-------- .../time-selector/TimeSelectorForm.tsx | 12 +++++++++++ 3 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 js/apps/admin-ui/src/components/time-selector/TimeSelectorForm.tsx diff --git a/js/apps/admin-ui/src/clients/advanced/ClusteringPanel.tsx b/js/apps/admin-ui/src/clients/advanced/ClusteringPanel.tsx index 3fda93b8d7..276509d843 100644 --- a/js/apps/admin-ui/src/clients/advanced/ClusteringPanel.tsx +++ b/js/apps/admin-ui/src/clients/advanced/ClusteringPanel.tsx @@ -9,7 +9,6 @@ import { ToolbarItem, } from "@patternfly/react-core"; import { useState } from "react"; -import { Controller, useFormContext } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { HelpItem } from "ui-shared"; @@ -22,7 +21,7 @@ import { Action, KeycloakDataTable, } from "../../components/table-toolbar/KeycloakDataTable"; -import { TimeSelector } from "../../components/time-selector/TimeSelector"; +import { TimeSelectorForm } from "../../components/time-selector/TimeSelectorForm"; import useFormatDate, { FORMAT_DATE_AND_TIME } from "../../utils/useFormatDate"; import { AddHostDialog } from ".././advanced/AddHostDialog"; import { AdvancedProps, parseResult } from "../AdvancedTab"; @@ -37,7 +36,6 @@ export const ClusteringPanel = ({ client: { id, registeredNodes, access }, }: AdvancedProps) => { const { t } = useTranslation("clients"); - const { control } = useFormContext(); const { addAlert, addError } = useAlerts(); const formatDate = useFormatDate(); @@ -101,14 +99,7 @@ export const ClusteringPanel = ({ > - ( - - )} - /> +