From d33142b3c3f88ae0d30a32065413a7e322b8a9e0 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Sun, 25 Sep 2022 19:54:23 +0200 Subject: [PATCH] chore(nc-gui): cleanup --- .../components/smartsheet/sidebar/index.vue | 3 ++- packages/nc-gui/components/tabs/Smartsheet.vue | 14 ++++++++------ packages/nc-gui/nuxt.config.ts | 18 +++++++++--------- .../[projectType]/[projectId]/index/index.vue | 8 +------- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/sidebar/index.vue b/packages/nc-gui/components/smartsheet/sidebar/index.vue index 5478223bda..137fce1f75 100644 --- a/packages/nc-gui/components/smartsheet/sidebar/index.vue +++ b/packages/nc-gui/components/smartsheet/sidebar/index.vue @@ -8,6 +8,7 @@ import { inject, provide, ref, + useNuxtApp, useRoute, useRouter, useSidebar, @@ -102,7 +103,7 @@ function onCreate(view: ViewType) { ref="sidebar" :collapsed="sidebarCollapsed" collapsiple - collapsed-width="50" + collapsed-width="0" width="250" class="relative shadow-md h-full" theme="light" diff --git a/packages/nc-gui/components/tabs/Smartsheet.vue b/packages/nc-gui/components/tabs/Smartsheet.vue index 1efd57026c..ea912fe9e4 100644 --- a/packages/nc-gui/components/tabs/Smartsheet.vue +++ b/packages/nc-gui/components/tabs/Smartsheet.vue @@ -15,6 +15,7 @@ import { inject, provide, ref, + toRef, useMetas, useProvideSmartsheetStore, useSidebar, @@ -22,24 +23,24 @@ import { } from '#imports' import type { TabItem } from '~/lib' -const { activeTab } = defineProps<{ +const props = defineProps<{ activeTab: TabItem }>() const { metas } = useMetas() -const activeView = ref() +const activeTab = toRef(props, 'activeTab') -const el = ref() +const activeView = ref() const fields = ref([]) -provide(TabMetaInj, ref(activeTab)) -const meta = computed(() => metas.value?.[activeTab?.id as string]) +const meta = computed(() => metas.value[activeTab.value.id!]) const reloadEventHook = createEventHook() const reloadViewMetaEventHook = createEventHook() + const openNewRecordFormHook = createEventHook() const { isGallery, isGrid, isForm, isLocked } = useProvideSmartsheetStore(activeView, meta) @@ -56,6 +57,7 @@ provide(ReloadViewMetaHookInj, reloadViewMetaEventHook) provide(OpenNewRecordFormHookInj, openNewRecordFormHook) provide(FieldsInj, fields) provide(IsFormInj, isForm) +provide(TabMetaInj, activeTab) const treeViewIsLockedInj = inject('TreeViewIsLockedInj', ref(false)) @@ -71,7 +73,7 @@ watch(isLocked, (nextValue) => (treeViewIsLockedInj.value = nextValue), { immedi