From 5caf05b2d0119f676d2f0f1c19c65165245512da Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 13 Jul 2022 23:53:33 +0530 Subject: [PATCH] refactor(gui-v2): corrections Signed-off-by: Pranav C --- packages/nc-gui-v2/components/cell/Duration.vue | 7 ++++--- packages/nc-gui-v2/components/index.ts | 4 +--- packages/nc-gui-v2/composables/useViewCreate.ts | 3 +-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/nc-gui-v2/components/cell/Duration.vue b/packages/nc-gui-v2/components/cell/Duration.vue index d997a660ce..3be0e2e786 100644 --- a/packages/nc-gui-v2/components/cell/Duration.vue +++ b/packages/nc-gui-v2/components/cell/Duration.vue @@ -3,15 +3,16 @@ import { computed, inject, ref } from '#imports' import { ColumnInj } from '~/components' import { convertDurationToSeconds, convertMS2Duration, durationOptions } from '~/utils/durationHelper' +interface Props { + modelValue: number | string +} + const { modelValue } = defineProps() const emit = defineEmits(['update:modelValue']) const column = inject(ColumnInj) -interface Props { - modelValue: number | string -} const showWarningMessage = ref(false) const durationInMS = ref(0) const isEdited = ref(false) diff --git a/packages/nc-gui-v2/components/index.ts b/packages/nc-gui-v2/components/index.ts index 751984d570..b6070aa3c4 100644 --- a/packages/nc-gui-v2/components/index.ts +++ b/packages/nc-gui-v2/components/index.ts @@ -1,10 +1,8 @@ -import type { ColumnType, FormType, GalleryType, GridType, KanbanType, TableType } from 'nocodb-sdk' +import type { ColumnType, TableType, ViewType } from 'nocodb-sdk' import type { InjectionKey, Ref } from 'vue' import type { EventHook } from '@vueuse/core' import type useViewData from '~/composables/useViewData' -export type ViewType = (GridType | GalleryType | FormType | KanbanType) & { id?: string } - export const ColumnInj: InjectionKey = Symbol('column-injection') export const MetaInj: InjectionKey> = Symbol('meta-injection') export const TabMetaInj: InjectionKey = Symbol('tab-meta-injection') diff --git a/packages/nc-gui-v2/composables/useViewCreate.ts b/packages/nc-gui-v2/composables/useViewCreate.ts index 61c6784aa1..f200413294 100644 --- a/packages/nc-gui-v2/composables/useViewCreate.ts +++ b/packages/nc-gui-v2/composables/useViewCreate.ts @@ -1,9 +1,8 @@ -import type { TableType } from 'nocodb-sdk' +import type { TableType, ViewType } from 'nocodb-sdk' import { ViewTypes } from 'nocodb-sdk' import type { Ref } from 'vue' import { useToast } from 'vue-toastification' import { useNuxtApp } from '#app' -import type { ViewType } from '~/components' import useMetas from '~/composables/useMetas' export default (meta: Ref, onViewCreate?: (viewMeta: any) => void) => {