From 527b4a23df0d83a7565366fed41160ccc677da07 Mon Sep 17 00:00:00 2001 From: Vidyoot Senthil Date: Fri, 23 Aug 2024 14:17:05 -0500 Subject: [PATCH] feature: dashboard link in search links to current organization and dataset --- .../search/src/components/Atoms/Navbar.tsx | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/frontends/search/src/components/Atoms/Navbar.tsx b/frontends/search/src/components/Atoms/Navbar.tsx index a22ec83dbe..415f58b44c 100644 --- a/frontends/search/src/components/Atoms/Navbar.tsx +++ b/frontends/search/src/components/Atoms/Navbar.tsx @@ -14,8 +14,22 @@ export const Navbar = () => { return datasetAndUserContext.currentDataset?.()?.dataset.id; }); + const currentOrganizationId = createMemo(() => { + return datasetAndUserContext.currentOrganization?.()?.id; + }); + const [isOpen, setIsOpen] = createSignal(false); + //Construct a7b64c7f-01ad-43b2-aaaf-c78192ca3d72/start?org=ca34dafa-7826-41b4-9953-cd58617834f1 + const orgDatasetParams = createMemo(() => { + const orgId = currentOrganizationId(); + const datasetId = currentDatasetId(); + let params = ""; + if (datasetId) params += datasetId; + if (orgId && datasetId) params += `/start?org=${orgId}`; + return params; + }); + return (