Browse Source

chore(nc-gui): cleanup types

pull/3703/head
braks 2 years ago
parent
commit
ea946edd87
  1. 2
      packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue
  2. 4
      packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue
  3. 3
      packages/nc-gui/components/smartsheet/sidebar/index.vue
  4. 2
      packages/nc-gui/composables/useSharedFormViewStore.ts
  5. 2
      packages/nc-gui/composables/useUIPermission/rolePermissions.ts

2
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()

4
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<Props>()
const emits = defineEmits<Emits>()
const vModel = useVModel(props, 'view', emits) as WritableComputedRef<any>
const vModel = useVModel(props, 'view', emits) as WritableComputedRef<ViewType & { is_default: boolean }>
const { $e } = useNuxtApp()

3
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"
/>
<div v-if="isOpen" class="flex-1 flex flex-col min-h-0">
<MenuTop @open-modal="openModal" @deleted="loadViews" @sorted="loadViews" />
<MenuTop @open-modal="openModal" @deleted="loadViews" />
<div v-if="isUIAllowed('virtualViewsCreateOrEdit')" class="!my-3 w-full border-b-1" />

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

@ -30,7 +30,7 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
const sharedView = ref<ViewType>()
const sharedFormView = ref<FormType>()
const meta = ref<TableType>()
const columns = ref<(ColumnType & { required?: boolean; show?: boolean })[]>()
const columns = ref<(ColumnType & { required?: boolean; show?: boolean; label?: string })[]>()
const { api, isLoading } = useApi()

2
packages/nc-gui/composables/useUIPermission/rolePermissions.ts

@ -47,6 +47,6 @@ type GetKeys<T> = T extends Record<string, boolean> ? keyof T : never
export type Permission<T extends typeof rolePermissions = typeof rolePermissions, K extends keyof T = keyof T> =
| (K extends 'creator' | 'owner' ? T[K] : never | T[K] extends Record<string, boolean> ? GetKeys<T[K]> : never)
| string
| T[K]
export default rolePermissions

Loading…
Cancel
Save