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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,4 +1,3 @@
import { storeToRefs } from 'pinia'
import type { ComputedRef, Ref } from 'vue' 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 type { Row } from '~/lib' import type { Row } from '~/lib'
@ -14,6 +13,7 @@ import {
message, message,
provide, provide,
ref, ref,
storeToRefs,
useApi, useApi,
useFieldQuery, useFieldQuery,
useI18n, useI18n,

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

@ -1,8 +1,7 @@
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { storeToRefs } from 'pinia'
import type { WatchStopHandle } from 'vue' import type { WatchStopHandle } from 'vue'
import type { TableInfoType, TableType } from 'nocodb-sdk' 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() { export function useMetas() {
const { $api } = useNuxtApp() const { $api } = useNuxtApp()

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

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

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

@ -1,6 +1,5 @@
import useVuelidate from '@vuelidate/core' import useVuelidate from '@vuelidate/core'
import { helpers, minLength, required } from '@vuelidate/validators' import { helpers, minLength, required } from '@vuelidate/validators'
import { storeToRefs } from 'pinia'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import type { ColumnType, FormType, LinkToAnotherRecordType, TableType, ViewType } from 'nocodb-sdk' import type { ColumnType, FormType, LinkToAnotherRecordType, TableType, ViewType } from 'nocodb-sdk'
import { ErrorMessages, RelationTypes, UITypes, isVirtualCol } from 'nocodb-sdk' import { ErrorMessages, RelationTypes, UITypes, isVirtualCol } from 'nocodb-sdk'
@ -13,6 +12,7 @@ import {
message, message,
provide, provide,
ref, ref,
storeToRefs,
useApi, useApi,
useI18n, useI18n,
useInjectionState, 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 type { ExportTypes, FilterType, KanbanType, PaginatedType, RequestParams, SortType, TableType, ViewType } from 'nocodb-sdk'
import { UITypes } from 'nocodb-sdk' import { UITypes } from 'nocodb-sdk'
import { storeToRefs } from 'pinia' import { computed, storeToRefs, useGlobal, useMetas, useNuxtApp, useState } from '#imports'
import { computed, useGlobal, useMetas, useNuxtApp, useState } from '#imports'
export function useSharedView() { export function useSharedView() {
const nestedFilters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([]) 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 { RelationTypes, UITypes } from 'nocodb-sdk'
import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk' import type { ColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import type { MaybeRef } from '@vueuse/core' import type { MaybeRef } from '@vueuse/core'
import { import {
@ -14,6 +13,7 @@ import {
isMm, isMm,
message, message,
ref, ref,
storeToRefs,
unref, unref,
useI18n, useI18n,
useInjectionState, useInjectionState,

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

@ -1,8 +1,17 @@
import { ViewTypes } from 'nocodb-sdk' import { ViewTypes } from 'nocodb-sdk'
import type { FilterType, KanbanType, SortType, TableType, ViewType } from 'nocodb-sdk' import type { FilterType, KanbanType, SortType, TableType, ViewType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { Ref } from 'vue' 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' import type { SmartsheetStoreEvents } from '~/lib'
const [useProvideSmartsheetStore, useSmartsheetStore] = useInjectionState( const [useProvideSmartsheetStore, useSmartsheetStore] = useInjectionState(

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

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

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

@ -1,8 +1,7 @@
import { ViewTypes, isSystemColumn } from 'nocodb-sdk' import { ViewTypes, isSystemColumn } from 'nocodb-sdk'
import type { ColumnType, MapType, TableType, ViewType } from 'nocodb-sdk' import type { ColumnType, MapType, TableType, ViewType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import type { ComputedRef, Ref } from 'vue' 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' import type { Field } from '~/lib'
export function useViewColumns( export function useViewColumns(

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

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

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

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

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

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

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

@ -198,6 +198,7 @@ export default defineNuxtConfig({
{ name: 'Empty', from: 'ant-design-vue/es' }, { name: 'Empty', from: 'ant-design-vue/es' },
{ name: 'Form', from: 'ant-design-vue/es' }, { name: 'Form', from: 'ant-design-vue/es' },
{ name: 'useJwt', from: '@vueuse/integrations/useJwt' }, { 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"> <script setup lang="ts">
import { storeToRefs } from 'pinia'
import tinycolor from 'tinycolor2' import tinycolor from 'tinycolor2'
import { import {
TabType, TabType,
@ -18,6 +17,7 @@ import {
projectThemeColors, projectThemeColors,
ref, ref,
resolveComponent, resolveComponent,
storeToRefs,
useCopy, useCopy,
useDialog, useDialog,
useGlobal, useGlobal,

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

@ -1,9 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { Icon } from '@iconify/vue' import { Icon } from '@iconify/vue'
import { storeToRefs } from 'pinia'
import type { TabItem } from '~/lib' import type { TabItem } from '~/lib'
import { TabType } 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 tabStore = useTabs()
const { closeTab } = tabStore const { closeTab } = tabStore

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

@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { storeToRefs } from 'pinia'
import type { TabItem } from '~/lib' 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() const { getMeta } = useMetas()

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

@ -1,11 +1,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { UploadChangeParam, UploadFile } from 'ant-design-vue' import type { UploadChangeParam, UploadFile } from 'ant-design-vue'
import type { BaseType } from 'nocodb-sdk' import type { BaseType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import { import {
message, message,
ref, ref,
resolveComponent, resolveComponent,
storeToRefs,
useDialog, useDialog,
useDropZone, useDropZone,
useFileDialog, 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 { ProjectType } from 'nocodb-sdk'
import type { VNodeRef } from '@vue/runtime-core' import type { VNodeRef } from '@vue/runtime-core'
import type { RuleObject } from 'ant-design-vue/es/form' import type { RuleObject } from 'ant-design-vue/es/form'
import { storeToRefs } from 'pinia'
import { import {
extractSdkResponseErrorMsg, extractSdkResponseErrorMsg,
message, message,
@ -11,6 +10,7 @@ import {
projectTitleValidator, projectTitleValidator,
reactive, reactive,
ref, ref,
storeToRefs,
useProject, useProject,
useRoute, useRoute,
} from '#imports' } from '#imports'

Loading…
Cancel
Save