Browse Source

fix/removed unnecassary imports

pull/3083/head
Muhammed Mustafa 2 years ago
parent
commit
9a64809284
  1. 5
      packages/nc-gui-v2/components/shared-view/AskPassword.vue
  2. 17
      packages/nc-gui-v2/components/shared-view/Form.vue
  3. 3
      packages/nc-gui-v2/components/smartsheet/Toolbar.vue
  4. 2
      packages/nc-gui-v2/composables/useViewColumns.ts
  5. 3
      packages/nc-gui-v2/composables/useViewData.ts
  6. 4
      packages/nc-gui-v2/composables/useViewFilters.ts
  7. 3
      packages/nc-gui-v2/composables/useViewSorts.ts
  8. 9
      packages/nc-gui-v2/pages/[projectType]/form/[viewId].vue
  9. 3
      packages/nc-gui-v2/pages/[projectType]/view/[viewId].vue

5
packages/nc-gui-v2/components/shared-view/AskPassword.vue

@ -1,11 +1,12 @@
<script setup lang="ts">
import { message } from 'ant-design-vue'
import { extractSdkResponseErrorMsg } from '~/utils'
const props = defineProps<Props>()
const emit = defineEmits(['update:modelValue'])
interface Props {
modelValue: boolean
}
const props = defineProps<Props>()
const emit = defineEmits(['update:modelValue'])
const route = useRoute()
const { loadSharedView } = useSharedView()

17
packages/nc-gui-v2/components/shared-view/Form.vue

@ -1,6 +1,6 @@
<script setup lang="ts">
import { RelationTypes, UITypes, isVirtualCol } from 'nocodb-sdk'
import { FieldsInj, MetaInj } from '~/context'
import { FieldsInj, MetaInj } from '#imports'
const fields = inject(FieldsInj, ref([]))
const meta = inject(MetaInj)
@ -28,24 +28,15 @@ useSmartsheetStoreOrThrow()
useProvideSmartsheetRowStore(meta, formState)
const formRef = ref()
watch(
() => formState,
() => {
console.log('formData', formState.value)
},
)
console.log(fields)
</script>
<template>
<div class="flex flex-col my-4 space-y-2 mx-32 items-center">
<div class="flex w-2/3 flex-col mt-10">
<div class="flex flex-col items-start px-14 py-8 bg-gray-50 rounded-md w-full">
<a-typography-title class="border-b-1 border-gray-100 w-full pb-3" :level="1">{{
sharedView.view.heading
}}</a-typography-title>
<a-typography-title class="border-b-1 border-gray-100 w-full pb-3" :level="1">
{{ sharedView.view.heading }}
</a-typography-title>
<a-typography class="pl-1 text-sm">{{ sharedView.view.subheading }}</a-typography>
</div>

3
packages/nc-gui-v2/components/smartsheet/Toolbar.vue

@ -1,6 +1,5 @@
<script setup lang="ts">
import { useSmartsheetStoreOrThrow } from '~/composables'
import { IsPublicInj } from '~/context'
import { IsPublicInj, useSmartsheetStoreOrThrow } from '#imports'
const { isGrid, isForm, isGallery } = useSmartsheetStoreOrThrow()
const { allowCSVDownload } = useSharedView()

2
packages/nc-gui-v2/composables/useViewColumns.ts

@ -3,7 +3,7 @@ import type { ColumnType, TableType, ViewType } from 'nocodb-sdk'
import { watch } from 'vue'
import type { ComputedRef, Ref } from 'vue'
import { useNuxtApp } from '#app'
import { IsPublicInj } from '~/context'
import { IsPublicInj } from '#imports'
export function useViewColumns(view: Ref<ViewType> | undefined, meta: ComputedRef<TableType>, reloadData?: () => void) {
const isPublic = inject(IsPublicInj, ref(false))

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

@ -1,7 +1,8 @@
import type { Api, ColumnType, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk'
import type { ComputedRef, Ref } from 'vue'
import { message } from 'ant-design-vue'
import { IsPublicInj, NOCO, computed, extractPkFromRow, extractSdkResponseErrorMsg, ref, useNuxtApp, useProject } from '#imports'
import { useNuxtApp } from '#app'
import { IsPublicInj, NOCO, extractPkFromRow, extractSdkResponseErrorMsg, useProject } from '#imports'
const formatData = (list: Record<string, any>[]) =>
list.map((row) => ({

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

@ -1,8 +1,6 @@
import type { ViewType } from 'nocodb-sdk'
import type { ComputedRef, Ref } from 'vue'
import { useNuxtApp, useUIPermission } from '#imports'
import { useMetas } from '~/composables/useMetas'
import { IsPublicInj, ReloadViewDataHookInj } from '~/context'
import { IsPublicInj, ReloadViewDataHookInj, useMetas, useNuxtApp, useUIPermission } from '#imports'
import type { Filter } from '~/lib'
export function useViewFilters(

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

@ -1,7 +1,6 @@
import type { GalleryType, GridType, KanbanType, SortType } from 'nocodb-sdk'
import type { Ref } from 'vue'
import { useNuxtApp } from '#imports'
import { IsPublicInj, ReloadViewDataHookInj } from '~/context'
import { IsPublicInj, ReloadViewDataHookInj, useNuxtApp } from '#imports'
export function useViewSorts(
view: Ref<(GridType | KanbanType | GalleryType) & { id?: string }> | undefined,

9
packages/nc-gui-v2/pages/[projectType]/form/[viewId].vue

@ -1,10 +1,8 @@
<script setup lang="ts">
import type { Ref } from 'vue'
import type { TableType } from 'nocodb-sdk/build/main'
import type { TableType } from 'nocodb-sdk'
import { ActiveViewInj, FieldsInj, IsPublicInj, MetaInj, ReloadViewDataHookInj, useRoute } from '#imports'
import { ActiveViewInj, FieldsInj, IsPublicInj, MetaInj, ReloadViewDataHookInj } from '~/context'
import { useRoute } from '#imports'
definePageMeta({
requiresAuth: false,
})
@ -13,7 +11,7 @@ const route = useRoute()
const reloadEventHook = createEventHook<void>()
const { sharedView, loadSharedView, meta, formColumns } = useSharedView()
console.log(sharedView)
await loadSharedView(route.params.viewId as string)
provide(ReloadViewDataHookInj, reloadEventHook)
@ -23,7 +21,6 @@ provide(FieldsInj, formColumns)
provide(IsPublicInj, ref(true))
useProvideSmartsheetStore(sharedView as Ref<TableType>, meta)
// useSmartsheetRowStore()
</script>
<template>

3
packages/nc-gui-v2/pages/[projectType]/view/[viewId].vue

@ -1,7 +1,6 @@
<script setup lang="ts">
import { ReadonlyInj, ReloadViewDataHookInj } from '~/context'
import { ReadonlyInj, ReloadViewDataHookInj, useRoute } from '#imports'
import { useRoute } from '#imports'
definePageMeta({
requiresAuth: false,
layout: 'shared-view',

Loading…
Cancel
Save