From e5c381223930a8d80876b4acfd614e367551b49f Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Tue, 23 Sep 2025 23:58:35 +0400 Subject: [PATCH] Update SecretRenameRow.tsx --- .../SecretRenameRow.tsx | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewTableRow/SecretRenameRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewTableRow/SecretRenameRow.tsx index 5e1f27f57..37ff5aadf 100644 --- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewTableRow/SecretRenameRow.tsx +++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretOverviewTableRow/SecretRenameRow.tsx @@ -1,7 +1,7 @@ import { useEffect } from "react"; import { Controller, useForm } from "react-hook-form"; import { subject } from "@casl/ability"; -import { faCheck, faClose, faCopy } from "@fortawesome/free-solid-svg-icons"; +import { faCheck, faClose, faCopy, faWarning } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { zodResolver } from "@hookform/resolvers/zod"; import { AnimatePresence, motion } from "framer-motion"; @@ -78,6 +78,7 @@ function SecretRenameRow({ environments, getSecretByKey, secretKey, secretPath } control, reset, trigger, + watch, getValues, formState: { isDirty, isSubmitting, errors } } = useForm({ @@ -145,14 +146,35 @@ function SecretRenameRow({ environments, getSecretByKey, secretKey, secretPath } setIsSecNameCopied.on(); }; + const currentSecretValue = watch("key"); + return (
- + Key + {currentSecretValue?.trim()?.includes(" ") && + currentSecretValue?.trim() !== secretKey && ( + + Secret key contains whitespaces. +
+
If this is the desired format, you need to provide it as{" "} + + {encodeURIComponent(secretKey.trim())} + {" "} + when making API requests. +
+ } + > + + + )}