From 2200bd646efa6b7497daa45922b6b60efc55a754 Mon Sep 17 00:00:00 2001 From: Sheen Capadngan Date: Tue, 23 Apr 2024 11:17:12 +0800 Subject: [PATCH] adjustment: added isImport handling --- .../v2/InfisicalSecretInput/InfisicalSecretInput.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx b/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx index 09f42ff7d..29e91f110 100644 --- a/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx +++ b/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx @@ -19,7 +19,8 @@ const replaceContentWithDot = (str: string) => { return finalStr; }; -const syntaxHighlight = (content?: string | null, isVisible?: boolean) => { +const syntaxHighlight = (content?: string | null, isVisible?: boolean, isImport?: boolean) => { + if (isImport) return "IMPORTED"; if (content === "") return "EMPTY"; if (!content) return "EMPTY"; if (!isVisible) return replaceContentWithDot(content); @@ -59,6 +60,7 @@ const syntaxHighlight = (content?: string | null, isVisible?: boolean) => { type Props = TextareaHTMLAttributes & { value?: string | null; + isImport?: boolean; isVisible?: boolean; isReadOnly?: boolean; isDisabled?: boolean; @@ -77,6 +79,7 @@ export const InfisicalSecretInput = forwardRef( containerClassName, onBlur, isDisabled, + isImport, isReadOnly, onFocus, secretPath: propSecretPath, @@ -275,7 +278,7 @@ export const InfisicalSecretInput = forwardRef(
               
                 
-                  {syntaxHighlight(value, isVisible || isSecretFocused)}
+                  {syntaxHighlight(value, isVisible || isSecretFocused, isImport)}