From e61dfe31fb14170000db8caa3a349e3e11f9fa5a Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 18:19:07 +0200 Subject: [PATCH] chore(gui-v2): correct tab item type and export enum --- packages/nc-gui-v2/components/smartsheet/Sidebar.vue | 6 ++++-- packages/nc-gui-v2/composables/useTabs.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue index bf2c62e5af..0364d8c85f 100644 --- a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue @@ -23,6 +23,8 @@ import MdiContentCopy from '~icons/mdi/content-copy' import MdiXml from '~icons/mdi/xml' import MdiHook from '~icons/mdi/hook' import MdiHeartsCard from '~icons/mdi/cards-heart' +import type { TabItem } from '~/composables/useTabs' +import { TabType } from '~/composables/useTabs' const meta = inject(MetaInj, ref()) @@ -102,10 +104,10 @@ function onCreate(view: GridType | FormType | KanbanType | GalleryType) { function changeView(view: { id: string; alias?: string; title?: string; type: ViewTypes }) { activeView.value = view - const tabProps = { + const tabProps: TabItem = { id: view.id, title: (view.alias ?? view.title) || '', - type: ViewTypes[view.type], + type: TabType.VIEW, } addTab(tabProps) diff --git a/packages/nc-gui-v2/composables/useTabs.ts b/packages/nc-gui-v2/composables/useTabs.ts index 2ef34dbac5..ee5351995c 100644 --- a/packages/nc-gui-v2/composables/useTabs.ts +++ b/packages/nc-gui-v2/composables/useTabs.ts @@ -2,7 +2,7 @@ import type { WritableComputedRef } from '@vue/reactivity' import { useState } from '#app' import useProject from '~/composables/useProject' -enum TabType { +export enum TabType { TABLE = 'table', VIEW = 'view', AUTH = 'auth',