Browse Source

chore(gui): corrections and lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3370/head
Pranav C 2 years ago
parent
commit
41788be13b
  1. 21
      packages/nc-gui/components/tabs/Smartsheet.vue
  2. 3
      packages/nc-gui/composables/useViewSorts.ts
  3. 2
      packages/nc-gui/lib/types.ts

21
packages/nc-gui/components/tabs/Smartsheet.vue

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { ColumnType, TableType } from 'nocodb-sdk'
import SmartsheetGrid from '../smartsheet/Grid.vue'
import {
ActiveViewInj,
FieldsInj,
@ -19,8 +18,6 @@ import {
useMetas,
useProvideKanbanViewStore,
useProvideSmartsheetStore,
useUIPermission,
watch,
} from '#imports'
import type { TabItem } from '~/lib'
@ -38,16 +35,13 @@ const fields = ref<ColumnType[]>([])
const meta = computed<TableType | undefined>(() => activeTab.value && metas.value[activeTab.value.id!])
const reloadEventHook = createEventHook()
const { isGallery, isGrid, isForm, isKanban, isLocked, nestedFilters, sorts } = useProvideSmartsheetStore(activeView, meta)
const openNewRecordFormHook = createEventHook()
const { isGallery, isGrid, isForm, isKanban, isLocked } = useProvideSmartsheetStore(activeView, meta)
const reloadEventHook = createEventHook<void | boolean>()
const reloadViewMetaEventHook = createEventHook<void | boolean>()
const openNewRecordFormHook = createEventHook<void>()
const { isGallery, isGrid, isForm, isLocked } = useProvideSmartsheetStore(activeView, meta)
useProvideKanbanViewStore(meta, activeView)
// todo: move to store
provide(MetaInj, meta)
@ -59,15 +53,6 @@ provide(OpenNewRecordFormHookInj, openNewRecordFormHook)
provide(FieldsInj, fields)
provide(IsFormInj, isForm)
provide(TabMetaInj, activeTab)
watch(nestedFilters, (newFilters) => {
activeTab.value.state = activeTab.value.state || {}
activeTab.value.state[activeView.value.id] = newFilters
})
watch(activeView, (newView: ViewType) => {
nestedFilters.value = activeTab.value.state?.[newView.id!]
})
</script>
<template>

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

@ -1,5 +1,4 @@
import { ViewType } from 'nocodb-sdk'
import type { GalleryType, GridType, KanbanType, SortType } from 'nocodb-sdk'
import type { SortType, ViewType } from 'nocodb-sdk'
import type { Ref } from 'vue'
import {
IsPublicInj,

2
packages/nc-gui/lib/types.ts

@ -69,6 +69,8 @@ export interface TabItem {
id?: string
viewTitle?: string
viewId?: string
sortsState?: Map<string, any>
filterState?: Map<string, any>
}
export interface SharedViewMeta extends Record<string, any> {

Loading…
Cancel
Save