From 278fdece029b28195fbdbf2b93c230b159bdd416 Mon Sep 17 00:00:00 2001 From: Flora Thiebaut Date: Fri, 17 Jan 2025 16:08:02 +0100 Subject: [PATCH] wip: add option --- .../SessionForm/EditLauncherFormContent.tsx | 5 +- .../SessionForm/EnvironmentField.tsx | 2 +- .../SessionForm/EnvironmentKindField.tsx | 74 ++++++++++++------- .../UpdateSessionLauncherModal.tsx | 1 - 4 files changed, 51 insertions(+), 31 deletions(-) diff --git a/client/src/features/sessionsV2/components/SessionForm/EditLauncherFormContent.tsx b/client/src/features/sessionsV2/components/SessionForm/EditLauncherFormContent.tsx index d37607295c..cebe6c745b 100644 --- a/client/src/features/sessionsV2/components/SessionForm/EditLauncherFormContent.tsx +++ b/client/src/features/sessionsV2/components/SessionForm/EditLauncherFormContent.tsx @@ -23,7 +23,6 @@ import { Controller, FieldErrors, FieldNamesMarkedBoolean, - UseFormSetValue, UseFormWatch, } from "react-hook-form"; import { Collapse, Input, Label, ListGroup } from "reactstrap"; @@ -50,7 +49,6 @@ interface SessionLauncherFormContentProps { interface EditLauncherFormContentProps extends SessionLauncherFormContentProps { environmentId?: string; - setValue: UseFormSetValue; } export default function EditLauncherFormContent({ control, @@ -58,7 +56,6 @@ export default function EditLauncherFormContent({ watch, touchedFields, environmentId, - setValue, }: EditLauncherFormContentProps) { const { data: environments, @@ -221,7 +218,7 @@ export default function EditLauncherFormContent({ )} /> - + {environmentKind === "GLOBAL" && renderEnvironmentList()} diff --git a/client/src/features/sessionsV2/components/SessionForm/EnvironmentField.tsx b/client/src/features/sessionsV2/components/SessionForm/EnvironmentField.tsx index 51cc77c549..82cfa145b8 100644 --- a/client/src/features/sessionsV2/components/SessionForm/EnvironmentField.tsx +++ b/client/src/features/sessionsV2/components/SessionForm/EnvironmentField.tsx @@ -52,7 +52,7 @@ export function EnvironmentFields({ 1 of 2. Define environment
- +
; - setValue: UseFormSetValue; + control: Control; } export default function EnvironmentKindField({ control, - setValue, }: EnvironmentKindField) { return ( (
- - + + + field.onChange("BUILDER")} + onBlur={field.onBlur} + /> +
)} diff --git a/client/src/features/sessionsV2/components/SessionModals/UpdateSessionLauncherModal.tsx b/client/src/features/sessionsV2/components/SessionModals/UpdateSessionLauncherModal.tsx index c6a337f5d9..0c39e0d955 100644 --- a/client/src/features/sessionsV2/components/SessionModals/UpdateSessionLauncherModal.tsx +++ b/client/src/features/sessionsV2/components/SessionModals/UpdateSessionLauncherModal.tsx @@ -130,7 +130,6 @@ export default function UpdateSessionLauncherModal({ watch={watch} touchedFields={touchedFields} environmentId={launcher.environment?.id} - setValue={setValue} /> )}