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. 8
      packages/nc-gui/components/project/View.vue
  4. 115
      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>

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

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

115
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,35 +32,40 @@ 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"
> >
<template #title> <NcTooltip class="!text-inherit">
{{ base?.title }} <template #title>
</template> {{ base?.title }}
<div class="flex flex-row items-center gap-x-1.5"> </template>
<GeneralProjectIcon <div class="flex flex-row items-center gap-x-1.5">
:meta="{ type: base?.type }" <GeneralProjectIcon
class="!grayscale" :meta="{ type: base?.type }"
:style="{ class="!grayscale min-w-4"
filter: 'grayscale(100%) brightness(115%)', :style="{
}" filter: 'grayscale(100%) brightness(115%)',
/> }"
<div />
class="hidden !2xl:(flex truncate ml-1)" <div
:class="{ class="hidden !2xl:(flex truncate ml-1)"
'!flex': isSharedBase && !isMobileMode, :class="{
}" '!flex': isSharedBase && !isMobileMode,
> }"
<span class="truncate text-gray-700"> >
{{ base?.title }} <span class="truncate !text-inherit">
</span> {{ base?.title }}
</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,32 +80,43 @@ 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,
}" }"
> >
<template #title> <NcTooltip class="truncate nc-active-table-title max-w-full">
{{ activeTable?.title }} <template #title>
</template> {{ activeTable?.title }}
<span </template>
class="text-ellipsis overflow-hidden text-gray-500 xs:ml-2" <span
:class="{ class="text-ellipsis overflow-hidden text-gray-500 xs:ml-2"
'text-gray-500': !isMobileMode, :class="{
'text-gray-700 font-medium': isMobileMode || activeView?.is_default, 'text-gray-500': !isMobileMode,
}" 'text-gray-800 font-medium': isMobileMode || activeView?.is_default,
:style="{ }"
wordBreak: 'keep-all', :style="{
whiteSpace: 'nowrap', wordBreak: 'keep-all',
display: 'inline', whiteSpace: 'nowrap',
}" display: 'inline',
> }"
{{ activeTable?.title }} >
</span> <template v-if="activeView?.is_default">
</NcTooltip> {{ 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>
</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