Browse Source

feat(nc-gui): open base/table/view in new tab on pressing cltr & cliking on then

nc-feat/open-base-table-view-in-new-tab
Ramesh Mane 10 months ago
parent
commit
16ab2b6a31
  1. 2
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  2. 2
      packages/nc-gui/components/dashboard/TreeView/TableNode.vue
  3. 2
      packages/nc-gui/composables/useTableNew.ts
  4. 27
      packages/nc-gui/store/views.ts

2
packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue

@ -34,6 +34,8 @@ import {
useTablesStore, useTablesStore,
useTabs, useTabs,
useToggle, useToggle,
useMagicKeys,
navigateToBlankTargetOpenOption,
} from '#imports' } from '#imports'
import type { NcProject } from '#imports' import type { NcProject } from '#imports'

2
packages/nc-gui/components/dashboard/TreeView/TableNode.vue

@ -4,7 +4,7 @@ import { toRef } from '@vue/reactivity'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { ProjectRoleInj, TreeViewInj, useMagicKeys, useNuxtApp, useRoles, useTabs } from '#imports' import { ProjectRoleInj, TreeViewInj, useNuxtApp, useRoles, useTabs, useMagicKeys } from '#imports'
import type { SidebarTableNode } from '~/lib' import type { SidebarTableNode } from '~/lib'
const props = withDefaults( const props = withDefaults(

2
packages/nc-gui/composables/useTableNew.ts

@ -20,6 +20,8 @@ import {
useNuxtApp, useNuxtApp,
useTabs, useTabs,
watch, watch,
useMagicKeys,
navigateToBlankTargetOpenOption,
} from '#imports' } from '#imports'
export function useTableNew(param: { onTableCreate?: (tableMeta: TableType) => void; baseId: string; sourceId?: string }) { export function useTableNew(param: { onTableCreate?: (tableMeta: TableType) => void; baseId: string; sourceId?: string }) {

27
packages/nc-gui/store/views.ts

@ -1,7 +1,7 @@
import type { FilterType, SortType, ViewType, ViewTypes } from 'nocodb-sdk' import type { FilterType, SortType, ViewType, ViewTypes } from 'nocodb-sdk'
import { acceptHMRUpdate, defineStore } from 'pinia' import { acceptHMRUpdate, defineStore } from 'pinia'
import type { ViewPageType } from '~/lib' import type { ViewPageType } from '~/lib'
import { navigateToBlankTargetOpenOption, useMagicKeys } from '#imports' import { useMagicKeys, navigateToBlankTargetOpenOption } from '#imports'
export const useViewsStore = defineStore('viewsStore', () => { export const useViewsStore = defineStore('viewsStore', () => {
const { $api } = useNuxtApp() const { $api } = useNuxtApp()
@ -266,20 +266,19 @@ export const useViewsStore = defineStore('viewsStore', () => {
} }
} else { } else {
if (cmdOrCtrl) { if (cmdOrCtrl) {
await navigateTo( const href = router.resolve({
router.resolve({ name: routeName,
name: routeName, params: {
params: { viewTitle: view.id || '',
viewTitle: view.id || '', viewId: tableId,
viewId: tableId, baseId: baseIdOrBaseId,
baseId: baseIdOrBaseId, slugs,
slugs,
},
}).href,
{
open: navigateToBlankTargetOpenOption,
}, },
) }).href
await navigateTo(href, {
open: navigateToBlankTargetOpenOption,
})
} else { } else {
await router.push({ await router.push({
name: routeName, name: routeName,

Loading…
Cancel
Save