Browse Source

fix(nc-gui): shared base breadcrumb link issue nocodb/nocodb#7571

pull/7573/head
Ramesh Mane 11 months ago
parent
commit
ddf34029fc
  1. 3
      packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue
  2. 17
      packages/nc-gui/store/tables.ts

3
packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue

@ -17,6 +17,7 @@ const openedBaseUrl = computed(() => {
return `${window.location.origin}/#${baseUrl({ return `${window.location.origin}/#${baseUrl({
id: base.value.id!, id: base.value.id!,
type: 'database', type: 'database',
isSharedBase: isSharedBase.value,
})}` })}`
}) })
</script> </script>
@ -112,7 +113,7 @@ const openedBaseUrl = computed(() => {
<NuxtLink <NuxtLink
v-else v-else
class="!text-inherit !underline-transparent !hover:(text-black underline-gray-600)" class="!text-inherit !underline-transparent !hover:(text-black underline-gray-600)"
:to="tableUrl({ table: activeTable, completeUrl: true })" :to="tableUrl({ table: activeTable, completeUrl: true, isSharedBase })"
> >
{{ activeTable?.title }} {{ activeTable?.title }}
</NuxtLink> </NuxtLink>

17
packages/nc-gui/store/tables.ts

@ -214,17 +214,26 @@ export const useTablesStore = defineStore('tablesStore', () => {
} }
} }
const tableUrl = ({ table, completeUrl }: { table: TableType; completeUrl: boolean }) => { const tableUrl = ({ table, completeUrl, isSharedBase }: { table: TableType; completeUrl: boolean; isSharedBase?: boolean }) => {
const base = basesStore.bases.get(table.base_id!) let base
if (!isSharedBase) {
base = basesStore.bases.get(table.base_id!)
if (!base) return if (!base) return
}
const nuxtPageName = 'index-typeOrId-baseId-index-index-viewId-viewTitle' const nuxtPageName = 'index-typeOrId-baseId-index-index-viewId-viewTitle'
const url = router.resolve({ const url = router.resolve({
name: nuxtPageName, name: nuxtPageName,
params: { params: isSharedBase
? {
typeOrId: route.value.params.typeOrId,
baseId: route.value.params.baseId,
viewId: route.value.params.viewId,
}
: {
typeOrId: workspaceStore.activeWorkspaceId, typeOrId: workspaceStore.activeWorkspaceId,
baseId: base.id, baseId: base?.id,
viewId: table.id, viewId: table.id,
}, },
}) })

Loading…
Cancel
Save