From 0cbfd9f92e0d6b7267b1a7e5914af03f23b6d444 Mon Sep 17 00:00:00 2001 From: mertmit Date: Thu, 24 Nov 2022 16:15:33 +0300 Subject: [PATCH] feat: change treeview root to bases if more than one base Signed-off-by: mertmit --- .../nc-gui/components/dashboard/TreeView.vue | 546 +++++++++++------- 1 file changed, 325 insertions(+), 221 deletions(-) diff --git a/packages/nc-gui/components/dashboard/TreeView.vue b/packages/nc-gui/components/dashboard/TreeView.vue index 35a7a372b0..02d0446dc4 100644 --- a/packages/nc-gui/components/dashboard/TreeView.vue +++ b/packages/nc-gui/components/dashboard/TreeView.vue @@ -47,7 +47,7 @@ const toggleDialog = inject(ToggleDialogInj, () => {}) const keys = $ref>({}) -const activeKey = ref([]) +const activeKey = ref([]) const menuRefs = $ref() @@ -272,6 +272,11 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => { } } }) + +onMounted(() => { + if (bases.value.filter((el) => el.enabled)[0]?.id) + activeKey.value.push(`collapse-${bases.value.filter((el) => el.enabled)[0].id}`) +})