From a45453629c7e10883152a3cc32624d229fce39d6 Mon Sep 17 00:00:00 2001 From: Sheen Capadngan Date: Wed, 3 Jul 2024 18:32:21 +0800 Subject: [PATCH] misc: addressed main page ui/ux concerns --- frontend/src/views/SecretMainPage/SecretMainPage.tsx | 3 +-- .../views/SecretMainPage/components/ActionBar/ActionBar.tsx | 2 +- .../SecretMainPage/components/SecretListView/SecretItem.tsx | 4 ++-- frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/SecretMainPage/SecretMainPage.tsx b/frontend/src/views/SecretMainPage/SecretMainPage.tsx index 122135c03..79bc72855 100644 --- a/frontend/src/views/SecretMainPage/SecretMainPage.tsx +++ b/frontend/src/views/SecretMainPage/SecretMainPage.tsx @@ -53,13 +53,12 @@ export const SecretMainPage = () => { const { currentWorkspace, isLoading: isWorkspaceLoading } = useWorkspace(); const router = useRouter(); const { permission } = useProjectPermission(); - const [isVisible, setIsVisible] = useState(false); const [sortDir, setSortDir] = useState(SortDir.ASC); const [filter, setFilter] = useState({ tags: {}, - searchFilter: "" + searchFilter: (router.query.searchFilter as string) || "" }); const [snapshotId, setSnapshotId] = useState(null); diff --git a/frontend/src/views/SecretMainPage/components/ActionBar/ActionBar.tsx b/frontend/src/views/SecretMainPage/components/ActionBar/ActionBar.tsx index 0056c4a3b..627d27539 100644 --- a/frontend/src/views/SecretMainPage/components/ActionBar/ActionBar.tsx +++ b/frontend/src/views/SecretMainPage/components/ActionBar/ActionBar.tsx @@ -334,7 +334,7 @@ export const ActionBar = ({ className="h-10" isDisabled={!isAllowed} > - {`${snapshotCount} ${snapshotCount === 1 ? "Commit" : "Commits"}`} + {`${snapshotCount} ${snapshotCount === 1 ? "Snapshot" : "Snapshots"}`} )} diff --git a/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx b/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx index 3726f3057..6d45d3da0 100644 --- a/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx +++ b/frontend/src/views/SecretMainPage/components/SecretListView/SecretItem.tsx @@ -250,7 +250,7 @@ export const SecretItem = memo( />
@@ -498,7 +498,7 @@ export const SecretItem = memo( {!isDirty ? ( { }); } } - const query: Record = { ...router.query, env: slug }; + + const query: Record = { ...router.query, env: slug, searchFilter }; const envIndex = visibleEnvs.findIndex((el) => slug === el.slug); if (envIndex !== -1) { router.push({