Browse Source

refactor: include `storeToRefs` in imports alias

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5274/head
Pranav C 2 years ago
parent
commit
d62b3d9419
  1. 2
      packages/nc-gui/components/cell/SingleSelect.vue
  2. 2
      packages/nc-gui/components/cell/attachment/utils.ts
  3. 2
      packages/nc-gui/components/dashboard/TreeView.vue
  4. 3
      packages/nc-gui/components/dashboard/settings/AuditTab.vue
  5. 3
      packages/nc-gui/components/dashboard/settings/Metadata.vue
  6. 2
      packages/nc-gui/components/dashboard/settings/UIAcl.vue
  7. 2
      packages/nc-gui/components/dlg/QuickImport.vue
  8. 2
      packages/nc-gui/components/smartsheet/Cell.vue
  9. 2
      packages/nc-gui/components/smartsheet/header/CellIcon.ts
  10. 2
      packages/nc-gui/components/smartsheet/sidebar/index.vue
  11. 2
      packages/nc-gui/composables/useKanbanViewStore.ts
  12. 3
      packages/nc-gui/composables/useMetas.ts
  13. 2
      packages/nc-gui/composables/useMultiSelect/index.ts
  14. 2
      packages/nc-gui/composables/useSharedFormViewStore.ts
  15. 3
      packages/nc-gui/composables/useSharedView.ts
  16. 2
      packages/nc-gui/composables/useSmartsheetRowStore.ts
  17. 13
      packages/nc-gui/composables/useSmartsheetStore.ts
  18. 2
      packages/nc-gui/composables/useTable.ts
  19. 3
      packages/nc-gui/composables/useViewColumns.ts
  20. 2
      packages/nc-gui/composables/useViewData.ts
  21. 2
      packages/nc-gui/composables/useViewFilters.ts
  22. 2
      packages/nc-gui/composables/useViewSorts.ts
  23. 1
      packages/nc-gui/nuxt.config.ts
  24. 2
      packages/nc-gui/pages/[projectType]/[projectId]/index.vue
  25. 3
      packages/nc-gui/pages/[projectType]/[projectId]/index/index.vue
  26. 3
      packages/nc-gui/pages/[projectType]/[projectId]/index/index/[type]/[title]/[[viewTitle]].vue
  27. 2
      packages/nc-gui/pages/[projectType]/[projectId]/index/index/index.vue
  28. 2
      packages/nc-gui/pages/index/index/[projectId].vue

2
packages/nc-gui/components/cell/SingleSelect.vue

@ -1,7 +1,6 @@
<script lang="ts" setup>
import { onUnmounted } from '@vue/runtime-core'
import { message } from 'ant-design-vue'
import { storeToRefs } from 'pinia'
import tinycolor from 'tinycolor2'
import type { Select as AntSelect } from 'ant-design-vue'
import type { SelectOptionType } from 'nocodb-sdk'
@ -19,6 +18,7 @@ import {
inject,
isDrawerOrModalExist,
ref,
storeToRefs,
useEventListener,
useRoles,
useSelectedCellKeyupListener,

2
packages/nc-gui/components/cell/attachment/utils.ts

@ -1,5 +1,4 @@
import type { AttachmentType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import RenameFile from './RenameFile.vue'
import {
ColumnInj,
@ -14,6 +13,7 @@ import {
isImage,
message,
ref,
storeToRefs,
useApi,
useAttachment,
useFileDialog,

2
packages/nc-gui/components/dashboard/TreeView.vue

@ -2,7 +2,6 @@
import type { TableType } from 'nocodb-sdk'
import type { Input } from 'ant-design-vue'
import { Dropdown, Tooltip, message } from 'ant-design-vue'
import { storeToRefs } from 'pinia'
import Sortable from 'sortablejs'
import GithubButton from 'vue-github-button'
import { Icon } from '@iconify/vue'
@ -18,6 +17,7 @@ import {
reactive,
ref,
resolveComponent,
storeToRefs,
useDialog,
useGlobal,
useNuxtApp,

3
packages/nc-gui/components/dashboard/settings/AuditTab.vue

@ -1,8 +1,7 @@
<script setup lang="ts">
import { Tooltip as ATooltip, Empty } from 'ant-design-vue'
import type { AuditType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import { h, onMounted, timeAgo, useGlobal, useI18n, useNuxtApp, useProject } from '#imports'
import { h, onMounted, storeToRefs, timeAgo, useGlobal, useI18n, useNuxtApp, useProject } from '#imports'
const { $api } = useNuxtApp()

3
packages/nc-gui/components/dashboard/settings/Metadata.vue

@ -1,6 +1,5 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { Empty, extractSdkResponseErrorMsg, h, message, useI18n, useNuxtApp, useProject } from '#imports'
import { Empty, extractSdkResponseErrorMsg, h, message, storeToRefs, useI18n, useNuxtApp, useProject } from '#imports'
const props = defineProps<{
baseId: string

2
packages/nc-gui/components/dashboard/settings/UIAcl.vue

@ -1,5 +1,4 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import {
Empty,
computed,
@ -7,6 +6,7 @@ import {
h,
message,
onMounted,
storeToRefs,
useGlobal,
useI18n,
useNuxtApp,

2
packages/nc-gui/components/dlg/QuickImport.vue

@ -2,7 +2,6 @@
import type { TableType } from 'nocodb-sdk'
import type { UploadChangeParam, UploadFile } from 'ant-design-vue'
import { Upload } from 'ant-design-vue'
import { storeToRefs } from 'pinia'
import {
CSVTemplateAdapter,
ExcelTemplateAdapter,
@ -19,6 +18,7 @@ import {
message,
reactive,
ref,
storeToRefs,
useI18n,
useProject,
useVModel,

2
packages/nc-gui/components/smartsheet/Cell.vue

@ -1,7 +1,6 @@
<script setup lang="ts">
import type { ColumnType } from 'nocodb-sdk'
import { isSystemColumn } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import {
ActiveCellInj,
ColumnInj,
@ -40,6 +39,7 @@ import {
isYear,
provide,
ref,
storeToRefs,
toRef,
useDebounceFn,
useProject,

2
packages/nc-gui/components/smartsheet/header/CellIcon.ts

@ -1,6 +1,5 @@
import type { ColumnType } from 'nocodb-sdk'
import type { PropType } from '@vue/runtime-core'
import { storeToRefs } from 'pinia'
import {
ColumnInj,
computed,
@ -31,6 +30,7 @@ import {
isTime,
isURL,
isYear,
storeToRefs,
toRef,
useProject,
} from '#imports'

2
packages/nc-gui/components/smartsheet/sidebar/index.vue

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { ViewType, ViewTypes } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import {
ActiveViewInj,
MetaInj,
@ -8,6 +7,7 @@ import {
inject,
ref,
resolveComponent,
storeToRefs,
useDialog,
useNuxtApp,
useRoute,

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

@ -1,4 +1,3 @@
import { storeToRefs } from 'pinia'
import type { ComputedRef, Ref } from 'vue'
import type { Api, ColumnType, KanbanType, SelectOptionType, SelectOptionsType, TableType, ViewType } from 'nocodb-sdk'
import type { Row } from '~/lib'
@ -14,6 +13,7 @@ import {
message,
provide,
ref,
storeToRefs,
useApi,
useFieldQuery,
useI18n,

3
packages/nc-gui/composables/useMetas.ts

@ -1,8 +1,7 @@
import { message } from 'ant-design-vue'
import { storeToRefs } from 'pinia'
import type { WatchStopHandle } from 'vue'
import type { TableInfoType, TableType } from 'nocodb-sdk'
import { extractSdkResponseErrorMsg, useNuxtApp, useProject, useState, watch } from '#imports'
import { extractSdkResponseErrorMsg, storeToRefs, useNuxtApp, useProject, useState, watch } from '#imports'
export function useMetas() {
const { $api } = useNuxtApp()

2
packages/nc-gui/composables/useMultiSelect/index.ts

@ -1,7 +1,6 @@
import type { MaybeRef } from '@vueuse/core'
import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { RelationTypes, UITypes, isVirtualCol } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { Cell } from './cellRange'
import { CellRange } from './cellRange'
import convertCellData from './convertCellData'
@ -15,6 +14,7 @@ import {
message,
reactive,
ref,
storeToRefs,
unref,
useCopy,
useEventListener,

2
packages/nc-gui/composables/useSharedFormViewStore.ts

@ -1,6 +1,5 @@
import useVuelidate from '@vuelidate/core'
import { helpers, minLength, required } from '@vuelidate/validators'
import { storeToRefs } from 'pinia'
import type { Ref } from 'vue'
import type { ColumnType, FormType, LinkToAnotherRecordType, TableType, ViewType } from 'nocodb-sdk'
import { ErrorMessages, RelationTypes, UITypes, isVirtualCol } from 'nocodb-sdk'
@ -13,6 +12,7 @@ import {
message,
provide,
ref,
storeToRefs,
useApi,
useI18n,
useInjectionState,

3
packages/nc-gui/composables/useSharedView.ts

@ -1,7 +1,6 @@
import type { ExportTypes, FilterType, KanbanType, PaginatedType, RequestParams, SortType, TableType, ViewType } from 'nocodb-sdk'
import { UITypes } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import { computed, useGlobal, useMetas, useNuxtApp, useState } from '#imports'
import { computed, storeToRefs, useGlobal, useMetas, useNuxtApp, useState } from '#imports'
export function useSharedView() {
const nestedFilters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([])

2
packages/nc-gui/composables/useSmartsheetRowStore.ts

@ -1,6 +1,5 @@
import { RelationTypes, UITypes } from 'nocodb-sdk'
import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { Ref } from 'vue'
import type { MaybeRef } from '@vueuse/core'
import {
@ -14,6 +13,7 @@ import {
isMm,
message,
ref,
storeToRefs,
unref,
useI18n,
useInjectionState,

13
packages/nc-gui/composables/useSmartsheetStore.ts

@ -1,8 +1,17 @@
import { ViewTypes } from 'nocodb-sdk'
import type { FilterType, KanbanType, SortType, TableType, ViewType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { Ref } from 'vue'
import { computed, ref, unref, useEventBus, useFieldQuery, useInjectionState, useNuxtApp, useProject } from '#imports'
import {
computed,
ref,
storeToRefs,
unref,
useEventBus,
useFieldQuery,
useInjectionState,
useNuxtApp,
useProject,
} from '#imports'
import type { SmartsheetStoreEvents } from '~/lib'
const [useProvideSmartsheetStore, useSmartsheetStore] = useInjectionState(

2
packages/nc-gui/composables/useTable.ts

@ -1,6 +1,5 @@
import type { LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { UITypes, isSystemColumn } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import {
Modal,
SYSTEM_COLUMNS,
@ -8,6 +7,7 @@ import {
generateUniqueTitle as generateTitle,
message,
reactive,
storeToRefs,
useI18n,
useMetas,
useNuxtApp,

3
packages/nc-gui/composables/useViewColumns.ts

@ -1,8 +1,7 @@
import { ViewTypes, isSystemColumn } from 'nocodb-sdk'
import type { ColumnType, MapType, TableType, ViewType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { ComputedRef, Ref } from 'vue'
import { IsPublicInj, computed, inject, ref, useNuxtApp, useProject, useUIPermission, watch } from '#imports'
import { IsPublicInj, computed, inject, ref, storeToRefs, useNuxtApp, useProject, useUIPermission, watch } from '#imports'
import type { Field } from '~/lib'
export function useViewColumns(

2
packages/nc-gui/composables/useViewData.ts

@ -1,6 +1,5 @@
import { UITypes, ViewTypes } from 'nocodb-sdk'
import type { Api, ColumnType, FormColumnType, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { ComputedRef, Ref } from 'vue'
import {
IsPublicInj,
@ -13,6 +12,7 @@ import {
message,
populateInsertObject,
ref,
storeToRefs,
until,
useApi,
useGlobal,

2
packages/nc-gui/composables/useViewFilters.ts

@ -1,5 +1,4 @@
import type { ColumnType, FilterType, ViewType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { ComputedRef, Ref } from 'vue'
import type { SelectProps } from 'ant-design-vue'
import { UITypes, isSystemColumn } from 'nocodb-sdk'
@ -12,6 +11,7 @@ import {
inject,
message,
ref,
storeToRefs,
useDebounceFn,
useMetas,
useNuxtApp,

2
packages/nc-gui/composables/useViewSorts.ts

@ -1,5 +1,4 @@
import type { SortType, ViewType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { Ref } from 'vue'
import {
IsPublicInj,
@ -8,6 +7,7 @@ import {
inject,
message,
ref,
storeToRefs,
useNuxtApp,
useProject,
useSharedView,

1
packages/nc-gui/nuxt.config.ts

@ -198,6 +198,7 @@ export default defineNuxtConfig({
{ name: 'Empty', from: 'ant-design-vue/es' },
{ name: 'Form', from: 'ant-design-vue/es' },
{ name: 'useJwt', from: '@vueuse/integrations/useJwt' },
{ name: 'storeToRefs', from: 'pinia' },
],
},
})

2
packages/nc-gui/pages/[projectType]/[projectId]/index.vue

@ -1,5 +1,4 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import tinycolor from 'tinycolor2'
import {
TabType,
@ -18,6 +17,7 @@ import {
projectThemeColors,
ref,
resolveComponent,
storeToRefs,
useCopy,
useDialog,
useGlobal,

3
packages/nc-gui/pages/[projectType]/[projectId]/index/index.vue

@ -1,9 +1,8 @@
<script setup lang="ts">
import { Icon } from '@iconify/vue'
import { storeToRefs } from 'pinia'
import type { TabItem } from '~/lib'
import { TabType } from '~/lib'
import { TabMetaInj, iconMap, provide, useGlobal, useSidebar, useTabs } from '#imports'
import { TabMetaInj, iconMap, provide, storeToRefs, useGlobal, useSidebar, useTabs } from '#imports'
const tabStore = useTabs()
const { closeTab } = tabStore

3
packages/nc-gui/pages/[projectType]/[projectId]/index/index/[type]/[title]/[[viewTitle]].vue

@ -1,7 +1,6 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia'
import type { TabItem } from '~/lib'
import { TabMetaInj, computed, inject, ref, until, useMetas, useProject, useRoute } from '#imports'
import { TabMetaInj, computed, inject, ref, storeToRefs, until, useMetas, useProject, useRoute } from '#imports'
const { getMeta } = useMetas()

2
packages/nc-gui/pages/[projectType]/[projectId]/index/index/index.vue

@ -1,11 +1,11 @@
<script lang="ts" setup>
import type { UploadChangeParam, UploadFile } from 'ant-design-vue'
import type { BaseType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import {
message,
ref,
resolveComponent,
storeToRefs,
useDialog,
useDropZone,
useFileDialog,

2
packages/nc-gui/pages/index/index/[projectId].vue

@ -3,7 +3,6 @@ import type { Form } from 'ant-design-vue'
import type { ProjectType } from 'nocodb-sdk'
import type { VNodeRef } from '@vue/runtime-core'
import type { RuleObject } from 'ant-design-vue/es/form'
import { storeToRefs } from 'pinia'
import {
extractSdkResponseErrorMsg,
message,
@ -11,6 +10,7 @@ import {
projectTitleValidator,
reactive,
ref,
storeToRefs,
useProject,
useRoute,
} from '#imports'

Loading…
Cancel
Save