From 37d62e2b0655e437f12439cb1da211e5b5b64931 Mon Sep 17 00:00:00 2001 From: MananTank Date: Thu, 3 Oct 2024 15:55:30 +0000 Subject: [PATCH] Fix Engine /configuration page textarea populated with data (#4908) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem solved Short description of the bug fixed or feature added --- ## PR-Codex overview This PR focuses on updating the `useForm` hook in two components, changing the prop from `defaultValues` to `values`. This change ensures that the form initializes with the provided values directly. ### Detailed summary - In `cors.tsx`, changed `defaultValues` to `values` in the `useForm` hook. - In `ip-allowlist.tsx`, changed `defaultValues` to `values` in the `useForm` hook. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- apps/dashboard/src/components/engine/configuration/cors.tsx | 2 +- .../src/components/engine/configuration/ip-allowlist.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/components/engine/configuration/cors.tsx b/apps/dashboard/src/components/engine/configuration/cors.tsx index 330b3142a25..56eaebfb1fb 100644 --- a/apps/dashboard/src/components/engine/configuration/cors.tsx +++ b/apps/dashboard/src/components/engine/configuration/cors.tsx @@ -29,7 +29,7 @@ export const EngineCorsConfig: React.FC = ({ ); const form = useForm({ - defaultValues: { raw: existingUrls?.join("\n") ?? "" }, + values: { raw: existingUrls?.join("\n") ?? "" }, }); const onSubmit = async (data: CorsForm) => { diff --git a/apps/dashboard/src/components/engine/configuration/ip-allowlist.tsx b/apps/dashboard/src/components/engine/configuration/ip-allowlist.tsx index 632ffcca19f..6d27612a06b 100644 --- a/apps/dashboard/src/components/engine/configuration/ip-allowlist.tsx +++ b/apps/dashboard/src/components/engine/configuration/ip-allowlist.tsx @@ -34,7 +34,7 @@ export const EngineIpAllowlistConfig: React.FC< const { data: engineHealthInfo } = useEngineSystemHealth(instanceUrl); const form = useForm({ - defaultValues: { raw: existingIpAllowlist?.join("\n") ?? "" }, + values: { raw: existingIpAllowlist?.join("\n") ?? "" }, }); const onSubmit = async (data: IpForm) => {