From 3893305821e9639914df65ebf0fa7a55e8f448cd Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 30 Oct 2023 05:26:27 +0000 Subject: [PATCH] fix: Added link for table section in bread crumb --- .../smartsheet/toolbar/ViewInfo.vue | 50 +++++++++++-------- packages/nc-gui/store/tables.ts | 21 ++++++++ 2 files changed, 50 insertions(+), 21 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue b/packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue index cba6d82fc4..ba72727a89 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue @@ -6,6 +6,7 @@ const { openedViewsTab, activeView } = storeToRefs(useViewsStore()) const { base, isSharedBase } = storeToRefs(useBase()) const { activeTable } = storeToRefs(useTablesStore()) +const { tableUrl } = useTablesStore() const { isLeftSidebarOpen } = storeToRefs(useSidebarStore()) @@ -33,7 +34,7 @@ const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
- - - - {{ activeTable?.title }} - - + + + + + {{ activeTable?.title }} + + + +
/
diff --git a/packages/nc-gui/store/tables.ts b/packages/nc-gui/store/tables.ts index 23765e6a24..81b2501487 100644 --- a/packages/nc-gui/store/tables.ts +++ b/packages/nc-gui/store/tables.ts @@ -213,6 +213,26 @@ export const useTablesStore = defineStore('tablesStore', () => { } } + const tableUrl = ({ table, completeUrl }: { table: TableType; completeUrl: boolean }) => { + const base = basesStore.bases.get(table.base_id!) + if (!base) return + + const nuxtPageName = 'index-typeOrId-baseId-index-index-viewId-viewTitle' + + const url = router.resolve({ + name: nuxtPageName, + params: { + typeOrId: workspaceStore.activeWorkspaceId, + baseId: base.id, + viewId: table.id, + }, + }) + + if (completeUrl) return `${window.location.origin}${url.href}` + + return url.href + } + return { baseTables, loadProjectTables, @@ -223,6 +243,7 @@ export const useTablesStore = defineStore('tablesStore', () => { updateTable, activeTableId, navigateToTable, + tableUrl, } })