Browse Source

fix(nc-gui): kanbanviewstore related issues

pull/3563/head
Wing-Kam Wong 2 years ago
parent
commit
e4ab2c7680
  1. 4
      packages/nc-gui/components/smartsheet/Kanban.vue
  2. 3
      packages/nc-gui/components/tabs/Smartsheet.vue
  3. 4
      packages/nc-gui/composables/useKanbanViewStore.ts

4
packages/nc-gui/components/smartsheet/Kanban.vue

@ -16,7 +16,7 @@ import {
inject, inject,
onMounted, onMounted,
provide, provide,
useProvideKanbanViewStore, useKanbanViewStoreOrThrow,
} from '#imports' } from '#imports'
import type { Row as RowType } from '~/composables' import type { Row as RowType } from '~/composables'
@ -66,7 +66,7 @@ const {
deleteStack, deleteStack,
removeRowFromUncategorizedStack, removeRowFromUncategorizedStack,
shouldScrollToRight, shouldScrollToRight,
} = useProvideKanbanViewStore(meta, view) } = useKanbanViewStoreOrThrow()
const { isUIAllowed } = useUIPermission() const { isUIAllowed } = useUIPermission()

3
packages/nc-gui/components/tabs/Smartsheet.vue

@ -17,6 +17,7 @@ import {
ref, ref,
toRef, toRef,
useMetas, useMetas,
useProvideKanbanViewStore,
useProvideSmartsheetStore, useProvideSmartsheetStore,
watch, watch,
} from '#imports' } from '#imports'
@ -44,6 +45,8 @@ const openNewRecordFormHook = createEventHook()
const reloadViewMetaEventHook = createEventHook() const reloadViewMetaEventHook = createEventHook()
useProvideKanbanViewStore(meta, activeView)
// todo: move to store // todo: move to store
provide(MetaInj, meta) provide(MetaInj, meta)
provide(ActiveViewInj, activeView) provide(ActiveViewInj, activeView)

4
packages/nc-gui/composables/useKanbanViewStore.ts

@ -2,7 +2,7 @@ import type { ComputedRef, Ref } from 'vue'
import type { Api, ColumnType, KanbanType, SelectOptionType, SelectOptionsType, TableType, ViewType } from 'nocodb-sdk' import type { Api, ColumnType, KanbanType, SelectOptionType, SelectOptionsType, TableType, ViewType } from 'nocodb-sdk'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import type { Row } from '~/composables/useViewData' import type { Row } from '~/lib'
import { SharedViewPasswordInj, deepCompare, enumColor, useInjectionState, useNuxtApp } from '#imports' import { SharedViewPasswordInj, deepCompare, enumColor, useInjectionState, useNuxtApp } from '#imports'
type GroupingFieldColOptionsType = SelectOptionType & { collapsed: boolean } type GroupingFieldColOptionsType = SelectOptionType & { collapsed: boolean }
@ -449,7 +449,7 @@ export { useProvideKanbanViewStore }
export function useKanbanViewStoreOrThrow() { export function useKanbanViewStoreOrThrow() {
const kanbanViewStore = useKanbanViewStore() const kanbanViewStore = useKanbanViewStore()
if (kanbanViewStore == null) throw new Error('Please call `useKanbanViewStore` on the appropriate parent component') if (kanbanViewStore == null) throw new Error('Please call `useProvideKanbanViewStore` on the appropriate parent component')
return kanbanViewStore return kanbanViewStore
} }

Loading…
Cancel
Save