From 5eb466276ba1b3a113f10125b315bf21fadfd748 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 9 Sep 2022 15:47:43 +0800 Subject: [PATCH] fix(nc-gui): add loadKanbanData in useViewData --- packages/nc-gui/composables/useViewData.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/composables/useViewData.ts b/packages/nc-gui/composables/useViewData.ts index 05b86d81e8..82ac9e3cf5 100644 --- a/packages/nc-gui/composables/useViewData.ts +++ b/packages/nc-gui/composables/useViewData.ts @@ -1,4 +1,4 @@ -import type { Api, ColumnType, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk' +import type { Api, ColumnType, FormType, GalleryType, KanbanType, PaginatedType, TableType, ViewType } from 'nocodb-sdk' import type { ComputedRef, Ref } from 'vue' import { message } from 'ant-design-vue' import { useI18n } from 'vue-i18n' @@ -45,6 +45,7 @@ export function useViewData( const _paginationData = ref({ page: 1, pageSize: 25 }) const aggCommentCount = ref<{ row_id: string; count: number }[]>([]) const galleryData = ref() + const kanbanData = ref() const formColumnData = ref() // todo: missing properties on FormType (success_msg, show_blank_form, const formViewData = ref() @@ -182,6 +183,11 @@ export function useViewData( galleryData.value = await $api.dbView.galleryRead(viewMeta.value.id) } + async function loadKanbanData() { + if (!viewMeta?.value?.id) return + galleryData.value = await $api.dbView.kanbanRead(viewMeta.value.id) + } + async function insertRow(row: Record, rowIndex = formattedData.value?.length) { try { const insertObj = meta?.value?.columns?.reduce((o: any, col) => { @@ -408,5 +414,6 @@ export function useViewData( aggCommentCount, loadAggCommentsCount, removeLastEmptyRow, + loadKanbanData, } }