Browse Source

Merge pull request #6827 from nocodb/nc-fix/breadcrumb-linked

Nc fix/breadcrumb linked
pull/6829/head
Raju Udava 1 year ago committed by GitHub
parent
commit
19a514e339
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/nc-gui/assets/style.scss
  2. 2
      packages/nc-gui/components/dashboard/Sidebar/TopSection.vue
  3. 2
      packages/nc-gui/components/project/View.vue
  4. 41
      packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue
  5. 1
      packages/nc-gui/lang/en.json
  6. 21
      packages/nc-gui/store/tables.ts

8
packages/nc-gui/assets/style.scss

@ -2,6 +2,10 @@
@import '@vue-flow/core/dist/style.css'; @import '@vue-flow/core/dist/style.css';
@import '@vue-flow/core/dist/theme-default.css'; @import '@vue-flow/core/dist/theme-default.css';
html {
overflow: hidden;
}
body { body {
line-height: 1.3125rem; line-height: 1.3125rem;
} }
@ -160,10 +164,6 @@ main {
} }
} }
html {
overflow-y: auto !important;
}
main { main {
@apply flex-0 w-full relative scrollbar-thin-dull; @apply flex-0 w-full relative scrollbar-thin-dull;
overflow-x: hidden; overflow-x: hidden;

2
packages/nc-gui/components/dashboard/Sidebar/TopSection.vue

@ -75,7 +75,7 @@ const navigateToSettings = () => {
<div class="gap-x-2 flex flex-row w-full items-center !font-normal"> <div class="gap-x-2 flex flex-row w-full items-center !font-normal">
<GeneralIcon icon="plus" /> <GeneralIcon icon="plus" />
<div class="flex">{{ $t('title.newProj') }}</div> <div class="flex">{{ $t('title.createBase') }}</div>
</div> </div>
</WorkspaceCreateProjectBtn> </WorkspaceCreateProjectBtn>
</div> </div>

2
packages/nc-gui/components/project/View.vue

@ -73,11 +73,13 @@ watch(
> >
<div class="flex flex-row items-center gap-x-3"> <div class="flex flex-row items-center gap-x-3">
<GeneralOpenLeftSidebarBtn /> <GeneralOpenLeftSidebarBtn />
<div class="flex flex-row items-center h-full gap-x-2.5">
<GeneralProjectIcon :type="openedProject?.type" /> <GeneralProjectIcon :type="openedProject?.type" />
<div class="flex font-medium text-sm capitalize"> <div class="flex font-medium text-sm capitalize">
{{ openedProject?.title }} {{ openedProject?.title }}
</div> </div>
</div> </div>
</div>
<LazyGeneralShareProject /> <LazyGeneralShareProject />
</div> </div>
<div <div

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

@ -4,10 +4,21 @@ const { isMobileMode } = useGlobal()
const { openedViewsTab, activeView } = storeToRefs(useViewsStore()) const { openedViewsTab, activeView } = storeToRefs(useViewsStore())
const { base, isSharedBase } = storeToRefs(useBase()) const { base, isSharedBase } = storeToRefs(useBase())
const { baseUrl } = useBase()
const { activeTable } = storeToRefs(useTablesStore()) const { activeTable } = storeToRefs(useTablesStore())
const { tableUrl } = useTablesStore()
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore()) const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const openedBaseUrl = computed(() => {
if (!base.value) return ''
return `${window.location.origin}/#${baseUrl({
id: base.value.id!,
type: 'database',
})}`
})
</script> </script>
<template> <template>
@ -21,19 +32,23 @@ const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
}" }"
> >
<template v-if="!isMobileMode"> <template v-if="!isMobileMode">
<NcTooltip <NuxtLink
class="ml-0.75 max-w-1/4 max-w-" class="!hover:(text-black underline-gray-600) !underline-transparent ml-0.75 max-w-1/4"
:class="{ :class="{
'!max-w-none': isSharedBase && !isMobileMode, '!max-w-none': isSharedBase && !isMobileMode,
'!text-gray-500': activeTable,
'!text-gray-700': !activeTable,
}" }"
:to="openedBaseUrl"
> >
<NcTooltip class="!text-inherit">
<template #title> <template #title>
{{ base?.title }} {{ base?.title }}
</template> </template>
<div class="flex flex-row items-center gap-x-1.5"> <div class="flex flex-row items-center gap-x-1.5">
<GeneralProjectIcon <GeneralProjectIcon
:meta="{ type: base?.type }" :meta="{ type: base?.type }"
class="!grayscale" class="!grayscale min-w-4"
:style="{ :style="{
filter: 'grayscale(100%) brightness(115%)', filter: 'grayscale(100%) brightness(115%)',
}" }"
@ -44,12 +59,13 @@ const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
'!flex': isSharedBase && !isMobileMode, '!flex': isSharedBase && !isMobileMode,
}" }"
> >
<span class="truncate text-gray-700"> <span class="truncate !text-inherit">
{{ base?.title }} {{ base?.title }}
</span> </span>
</div> </div>
</div> </div>
</NcTooltip> </NcTooltip>
</NuxtLink>
<div class="px-1.5 text-gray-500">/</div> <div class="px-1.5 text-gray-500">/</div>
</template> </template>
<template v-if="!(isMobileMode && !activeView?.is_default)"> <template v-if="!(isMobileMode && !activeView?.is_default)">
@ -64,14 +80,15 @@ const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
/> />
</template> </template>
</LazyGeneralEmojiPicker> </LazyGeneralEmojiPicker>
<NcTooltip <div
class="truncate nc-active-table-title" v-if="activeTable"
:class="{ :class="{
'max-w-1/2': isMobileMode || activeView?.is_default, 'max-w-1/2': isMobileMode || activeView?.is_default,
'max-w-20/100': !isSharedBase && !isMobileMode && !activeView?.is_default, 'max-w-20/100': !isSharedBase && !isMobileMode && !activeView?.is_default,
'max-w-none': isSharedBase && !isMobileMode, 'max-w-none': isSharedBase && !isMobileMode,
}" }"
> >
<NcTooltip class="truncate nc-active-table-title max-w-full">
<template #title> <template #title>
{{ activeTable?.title }} {{ activeTable?.title }}
</template> </template>
@ -79,7 +96,7 @@ const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
class="text-ellipsis overflow-hidden text-gray-500 xs:ml-2" class="text-ellipsis overflow-hidden text-gray-500 xs:ml-2"
:class="{ :class="{
'text-gray-500': !isMobileMode, 'text-gray-500': !isMobileMode,
'text-gray-700 font-medium': isMobileMode || activeView?.is_default, 'text-gray-800 font-medium': isMobileMode || activeView?.is_default,
}" }"
:style="{ :style="{
wordBreak: 'keep-all', wordBreak: 'keep-all',
@ -87,9 +104,19 @@ const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
display: 'inline', display: 'inline',
}" }"
> >
<template v-if="activeView?.is_default">
{{ activeTable?.title }} {{ activeTable?.title }}
</template>
<NuxtLink
v-else
class="!text-inherit !underline-transparent !hover:(text-black underline-gray-600)"
:to="tableUrl({ table: activeTable, completeUrl: true })"
>
{{ activeTable?.title }}
</NuxtLink>
</span> </span>
</NcTooltip> </NcTooltip>
</div>
</template> </template>
<div v-if="!isMobileMode" class="px-1 text-gray-500">/</div> <div v-if="!isMobileMode" class="px-1 text-gray-500">/</div>

1
packages/nc-gui/lang/en.json

@ -339,6 +339,7 @@
"erdView": "ERD View", "erdView": "ERD View",
"newBase": "New Data Source", "newBase": "New Data Source",
"newProj": "New Base", "newProj": "New Base",
"createBase": "Create Base",
"myProject": "My Bases", "myProject": "My Bases",
"formTitle": "Form Title", "formTitle": "Form Title",
"collabView": "Collaborative View", "collabView": "Collaborative View",

21
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 { return {
baseTables, baseTables,
loadProjectTables, loadProjectTables,
@ -223,6 +243,7 @@ export const useTablesStore = defineStore('tablesStore', () => {
updateTable, updateTable,
activeTableId, activeTableId,
navigateToTable, navigateToTable,
tableUrl,
} }
}) })

Loading…
Cancel
Save