From 35826c288ee75e71dd8181fbe192c41006ada60c Mon Sep 17 00:00:00 2001 From: = Date: Sun, 20 Oct 2024 20:12:33 +0530 Subject: [PATCH] feat: changed to a simpler tree ascii ui --- frontend/src/styles/globals.css | 21 +++++++ .../SecretListView/SecretReferenceDetails.tsx | 58 ++++--------------- 2 files changed, 32 insertions(+), 47 deletions(-) diff --git a/frontend/src/styles/globals.css b/frontend/src/styles/globals.css index d3aa5c7f0..0ccfbc466 100644 --- a/frontend/src/styles/globals.css +++ b/frontend/src/styles/globals.css @@ -137,6 +137,27 @@ html { ); } +.tree-line::before { + content: ""; + position: absolute; + left: -16px; + top: 1px; + bottom: 0; + width: 1px; + height: 50%; + background-color: #cbd5e0; +} + +.tree-line::after { + content: ""; + position: absolute; + left: -16px; + top: 50%; + width: 12px; + height: 1px; + background-color: #cbd5e0; +} + .show-tags { transform: translateY(10px); transition: all 0.2s; diff --git a/frontend/src/views/SecretMainPage/components/SecretListView/SecretReferenceDetails.tsx b/frontend/src/views/SecretMainPage/components/SecretListView/SecretReferenceDetails.tsx index 90c90f415..c79373a31 100644 --- a/frontend/src/views/SecretMainPage/components/SecretListView/SecretReferenceDetails.tsx +++ b/frontend/src/views/SecretMainPage/components/SecretListView/SecretReferenceDetails.tsx @@ -1,6 +1,8 @@ +import { faEye, faEyeSlash } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { twMerge } from "tailwind-merge"; -import { FormControl, SecretInput, Spinner, Tag, Tooltip } from "@app/components/v2"; +import { FormControl, SecretInput, Spinner, Tooltip } from "@app/components/v2"; import { useWorkspace } from "@app/context"; import { useGetSecretReferenceTree } from "@app/hooks/api"; import { SecretV3RawSanitized, TSecretReferenceTraceNode } from "@app/hooks/api/types"; @@ -29,61 +31,23 @@ export const SecretReferenceNode = ({ /> ) : ( -
-
- {node.key} +
+
+ {`${node.environment}${ + node.secretPath === "/" ? "" : node.secretPath.split("/").join(".") + }.${node.key}`} - {node.value ? "Reveal Value" : "Empty"} +
-
-
-
- -
Environment
-
- -
- {node.environment} -
-
-
-
- -
Secret Path
-
- -
- {node.secretPath} -
-
-
-
-
-
)} {node.children.length > 0 && ( -
+
{node.children.map((el, index) => ( ))}