From ea946edd871ac0c53a095872601f14b7b54c97dd Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Sun, 18 Sep 2022 13:28:41 +0200 Subject: [PATCH] chore(nc-gui): cleanup types --- packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue | 2 -- .../components/smartsheet/sidebar/RenameableMenuItem.vue | 4 ++-- packages/nc-gui/components/smartsheet/sidebar/index.vue | 3 ++- packages/nc-gui/composables/useSharedFormViewStore.ts | 2 +- .../nc-gui/composables/useUIPermission/rolePermissions.ts | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue b/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue index cec93e16d2..e32063c96c 100644 --- a/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue +++ b/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue @@ -32,8 +32,6 @@ interface Emits { (event: 'openModal', data: { type: ViewTypes; title?: string; copyViewId?: string }): void (event: 'deleted'): void - - (event: 'sorted'): void } const { $e } = useNuxtApp() diff --git a/packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue b/packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue index 2602e742a7..6501be738d 100644 --- a/packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue +++ b/packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue @@ -2,7 +2,7 @@ import type { ViewType, ViewTypes } from 'nocodb-sdk' import { message } from 'ant-design-vue' import type { WritableComputedRef } from '@vue/reactivity' -import { IsLockedInj, onKeyStroke, useDebounceFn, useNuxtApp, useUIPermission, useVModel, viewIcons } from '#imports' +import { IsLockedInj, inject, onKeyStroke, useDebounceFn, useNuxtApp, useUIPermission, useVModel, viewIcons } from '#imports' interface Props { view: ViewType @@ -21,7 +21,7 @@ const props = defineProps() const emits = defineEmits() -const vModel = useVModel(props, 'view', emits) as WritableComputedRef +const vModel = useVModel(props, 'view', emits) as WritableComputedRef const { $e } = useNuxtApp() diff --git a/packages/nc-gui/components/smartsheet/sidebar/index.vue b/packages/nc-gui/components/smartsheet/sidebar/index.vue index ec45026669..7964bf4337 100644 --- a/packages/nc-gui/components/smartsheet/sidebar/index.vue +++ b/packages/nc-gui/components/smartsheet/sidebar/index.vue @@ -14,6 +14,7 @@ import { useRoute, useRouter, useSidebar, + useUIPermission, useViews, watch, } from '#imports' @@ -114,7 +115,7 @@ function onCreate(view: ViewType) { class="min-h-[var(--toolbar-height)] max-h-[var(--toolbar-height)] flex items-center py-3 px-3 justify-between border-b-1" />
- +
diff --git a/packages/nc-gui/composables/useSharedFormViewStore.ts b/packages/nc-gui/composables/useSharedFormViewStore.ts index 6bc3e54499..a64b2365d0 100644 --- a/packages/nc-gui/composables/useSharedFormViewStore.ts +++ b/packages/nc-gui/composables/useSharedFormViewStore.ts @@ -30,7 +30,7 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share const sharedView = ref() const sharedFormView = ref() const meta = ref() - const columns = ref<(ColumnType & { required?: boolean; show?: boolean })[]>() + const columns = ref<(ColumnType & { required?: boolean; show?: boolean; label?: string })[]>() const { api, isLoading } = useApi() diff --git a/packages/nc-gui/composables/useUIPermission/rolePermissions.ts b/packages/nc-gui/composables/useUIPermission/rolePermissions.ts index fcc46c7031..997799c704 100644 --- a/packages/nc-gui/composables/useUIPermission/rolePermissions.ts +++ b/packages/nc-gui/composables/useUIPermission/rolePermissions.ts @@ -47,6 +47,6 @@ type GetKeys = T extends Record ? keyof T : never export type Permission = | (K extends 'creator' | 'owner' ? T[K] : never | T[K] extends Record ? GetKeys : never) - | string + | T[K] export default rolePermissions