Browse Source

fix(gui-v2): import modules from `#imports`

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2860/head
Pranav C 2 years ago
parent
commit
f8ed011dd4
  1. 3
      packages/nc-gui-v2/components/smartsheet-toolbar/DeleteTable.vue
  2. 3
      packages/nc-gui-v2/composables/index.ts
  3. 5
      packages/nc-gui-v2/composables/useDeleteTable.ts
  4. 4
      packages/nc-gui-v2/composables/useSmartsheetStore.ts
  5. 3
      packages/nc-gui-v2/composables/useViewFilters.ts

3
packages/nc-gui-v2/components/smartsheet-toolbar/DeleteTable.vue

@ -1,6 +1,5 @@
<script setup lang="ts">
import { inject } from '#imports'
import useDeleteTable from '~/composables/useDeleteTable'
import { inject, useDeleteTable } from '#imports'
import { MetaInj } from '~/context'
import MdiDeleteIcon from '~icons/mdi/delete-outline'

3
packages/nc-gui-v2/composables/index.ts

@ -18,3 +18,6 @@ export * from './useViewFilters'
export * from './useViews'
export * from './useViewSorts'
export * from './useVirtualCell'
export * from './useDeleteTable'
export * from './useColumnCreateStore'
export * from './useSmartsheetStore'

5
packages/nc-gui-v2/composables/useDeleteTable.ts

@ -2,10 +2,11 @@ import { Modal } from 'ant-design-vue'
import type { LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { UITypes } from 'nocodb-sdk'
import { useToast } from 'vue-toastification'
import useTabs, { TabType } from '~/composables/useTabs'
import { useTabs } from '#imports'
import { TabType } from '~/composables/useTabs'
import { extractSdkResponseErrorMsg } from '~/utils/errorUtils'
export default () => {
export function useDeleteTable() {
const { $e, $api } = useNuxtApp()
const toast = useToast()
const { getMeta, removeMeta } = useMetas()

4
packages/nc-gui-v2/composables/useSmartsheetStore.ts

@ -3,7 +3,7 @@ import { createInjectionState } from '@vueuse/core'
import type { TableType, ViewType } from 'nocodb-sdk'
import type { Ref } from 'vue'
import { useNuxtApp } from '#app'
import useProject from '~/composables/useProject'
import { useProject } from '#imports'
const [useProvideSmartsheetStore, useSmartsheetStore] = createInjectionState((view: Ref<ViewType>, meta: Ref<TableType>) => {
const { $api } = useNuxtApp()
@ -17,7 +17,7 @@ const [useProvideSmartsheetStore, useSmartsheetStore] = createInjectionState((vi
})
// getters
const isLocked = computed(() => view?.value?.lock_type === 'locked')
const isLocked = computed(() => (view?.value as any)?.lock_type === 'locked')
const xWhere = computed(() => {
let where
const col = meta?.value?.columns?.find(({ id }) => id === search.field) || meta?.value?.columns?.find((v) => v.pv)

3
packages/nc-gui-v2/composables/useViewFilters.ts

@ -1,7 +1,6 @@
import type { FilterType, GalleryType, GridType, KanbanType } from 'nocodb-sdk'
import type { ComputedRef, Ref } from 'vue'
import { useNuxtApp } from '#imports'
import useUIPermission from '~/composables/useUIPermission'
import { useNuxtApp, useUIPermission } from '#imports'
export function useViewFilters(
view: Ref<(GridType | KanbanType | GalleryType) & { id?: string }> | undefined,

Loading…
Cancel
Save