diff --git a/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretOverviewTableRow.tsx b/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretOverviewTableRow.tsx index 8ae96d888e..8e9e60a3b1 100644 --- a/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretOverviewTableRow.tsx +++ b/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretOverviewTableRow.tsx @@ -4,6 +4,7 @@ import { faCheck, faEye, faEyeSlash, + faFileImport, faKey, faXmark } from "@fortawesome/free-solid-svg-icons"; @@ -26,6 +27,7 @@ type Props = { onSecretCreate: (env: string, key: string, value: string) => Promise; onSecretUpdate: (env: string, key: string, value: string, secretId?: string) => Promise; onSecretDelete: (env: string, key: string, secretId?: string) => Promise; + isImportedSecretPresentInEnv: (name: string, env: string) => boolean; }; export const SecretOverviewTableRow = ({ @@ -36,6 +38,7 @@ export const SecretOverviewTableRow = ({ onSecretUpdate, onSecretCreate, onSecretDelete, + isImportedSecretPresentInEnv, expandableColWidth }: Props) => { const [isFormExpanded, setIsFormExpanded] = useToggle(); @@ -61,6 +64,8 @@ export const SecretOverviewTableRow = ({ {environments.map(({ slug }, i) => { const secret = getSecretByKey(slug, secretKey); + + const isSecretImported = isImportedSecretPresentInEnv(secretPath, slug); const isSecretPresent = Boolean(secret); const isSecretEmpty = secret?.value === ""; return ( @@ -69,16 +74,29 @@ export const SecretOverviewTableRow = ({ className={twMerge( "py-0 px-0 group-hover:bg-mineshaft-700", isFormExpanded && "border-t-2 border-mineshaft-500", - isSecretPresent && !isSecretEmpty ? "text-green-600" : "", - isSecretPresent && isSecretEmpty ? "text-yellow" : "", - !isSecretPresent && !isSecretEmpty ? "text-red-600" : "" + (isSecretPresent && !isSecretEmpty) || isSecretImported ? "text-green-600" : "", + isSecretPresent && isSecretEmpty && !isSecretImported ? "text-yellow" : "", + !isSecretPresent && !isSecretEmpty && !isSecretImported ? "text-red-600" : "" )} >
{!isSecretEmpty && ( - - + + )} {isSecretEmpty && (