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

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

@ -17,6 +17,7 @@ import {
ref,
toRef,
useMetas,
useProvideKanbanViewStore,
useProvideSmartsheetStore,
watch,
} from '#imports'
@ -44,6 +45,8 @@ const openNewRecordFormHook = createEventHook()
const reloadViewMetaEventHook = createEventHook()
useProvideKanbanViewStore(meta, activeView)
// todo: move to store
provide(MetaInj, meta)
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 { useI18n } from 'vue-i18n'
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'
type GroupingFieldColOptionsType = SelectOptionType & { collapsed: boolean }
@ -449,7 +449,7 @@ export { useProvideKanbanViewStore }
export function useKanbanViewStoreOrThrow() {
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
}

Loading…
Cancel
Save