From 16ab2b6a31e18ad03e962926d66aeeb5da9c0063 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 12 Mar 2024 05:15:08 +0000 Subject: [PATCH] feat(nc-gui): open base/table/view in new tab on pressing cltr & cliking on then --- .../dashboard/TreeView/ProjectNode.vue | 2 ++ .../dashboard/TreeView/TableNode.vue | 2 +- packages/nc-gui/composables/useTableNew.ts | 2 ++ packages/nc-gui/store/views.ts | 27 +++++++++---------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue index 0230f38925..62599aee81 100644 --- a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue +++ b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue @@ -34,6 +34,8 @@ import { useTablesStore, useTabs, useToggle, + useMagicKeys, + navigateToBlankTargetOpenOption, } from '#imports' import type { NcProject } from '#imports' diff --git a/packages/nc-gui/components/dashboard/TreeView/TableNode.vue b/packages/nc-gui/components/dashboard/TreeView/TableNode.vue index 45f7fe848d..52e63ff52a 100644 --- a/packages/nc-gui/components/dashboard/TreeView/TableNode.vue +++ b/packages/nc-gui/components/dashboard/TreeView/TableNode.vue @@ -4,7 +4,7 @@ import { toRef } from '@vue/reactivity' import { message } from 'ant-design-vue' 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' const props = withDefaults( diff --git a/packages/nc-gui/composables/useTableNew.ts b/packages/nc-gui/composables/useTableNew.ts index d51e3dd67a..de4602bd54 100644 --- a/packages/nc-gui/composables/useTableNew.ts +++ b/packages/nc-gui/composables/useTableNew.ts @@ -20,6 +20,8 @@ import { useNuxtApp, useTabs, watch, + useMagicKeys, + navigateToBlankTargetOpenOption, } from '#imports' export function useTableNew(param: { onTableCreate?: (tableMeta: TableType) => void; baseId: string; sourceId?: string }) { diff --git a/packages/nc-gui/store/views.ts b/packages/nc-gui/store/views.ts index f5e60d480c..5c2a1c9e10 100644 --- a/packages/nc-gui/store/views.ts +++ b/packages/nc-gui/store/views.ts @@ -1,7 +1,7 @@ import type { FilterType, SortType, ViewType, ViewTypes } from 'nocodb-sdk' import { acceptHMRUpdate, defineStore } from 'pinia' import type { ViewPageType } from '~/lib' -import { navigateToBlankTargetOpenOption, useMagicKeys } from '#imports' +import { useMagicKeys, navigateToBlankTargetOpenOption } from '#imports' export const useViewsStore = defineStore('viewsStore', () => { const { $api } = useNuxtApp() @@ -266,20 +266,19 @@ export const useViewsStore = defineStore('viewsStore', () => { } } else { if (cmdOrCtrl) { - await navigateTo( - router.resolve({ - name: routeName, - params: { - viewTitle: view.id || '', - viewId: tableId, - baseId: baseIdOrBaseId, - slugs, - }, - }).href, - { - open: navigateToBlankTargetOpenOption, + const href = router.resolve({ + name: routeName, + params: { + viewTitle: view.id || '', + viewId: tableId, + baseId: baseIdOrBaseId, + slugs, }, - ) + }).href + + await navigateTo(href, { + open: navigateToBlankTargetOpenOption, + }) } else { await router.push({ name: routeName,