Browse Source

chore(gui): lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3370/head
Pranav C 2 years ago
parent
commit
20a9f3eef6
  1. 2
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
  2. 9
      packages/nc-gui/composables/useViewFilters.ts
  3. 10
      packages/nc-gui/composables/useViewSorts.ts

2
packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue

@ -87,7 +87,7 @@ watch(
() => activeView.value?.id,
(n, o) => {
if (!nested && n !== o && (hookId || !webHook)) loadFilters(hookId as string)
}
},
)
loadFilters(hookId as string)

9
packages/nc-gui/composables/useViewFilters.ts

@ -13,9 +13,8 @@ import {
useUIPermission,
watch,
} from '#imports'
import type { TabItem } from '~/composables/useTabs'
import { TabMetaInj } from '~/context'
import type { Filter } from '~/lib'
import type { Filter, TabItem } from '~/lib'
export function useViewFilters(
view: Ref<ViewType | undefined>,
@ -53,7 +52,7 @@ export function useViewFilters(
currentFilters = value
if (isNestedRoot) {
nestedFilters.value = value
tabMeta.value.filterState!.set(view!.value.id!, nestedFilters.value)
tabMeta.value.filterState!.set(view.value!.id!, nestedFilters.value)
}
nestedFilters.value = [...nestedFilters.value]
reloadHook?.trigger()
@ -77,8 +76,8 @@ export function useViewFilters(
const loadFilters = async (hookId?: string) => {
if (nestedMode.value) {
if (isNestedRoot)
filters.value = tabMeta.value.filterState!.get(view.value.id!) || []
// ignore restoring if not root filter group
if (isNestedRoot) filters.value = tabMeta.value.filterState!.get(view.value!.id!) || []
return
}

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

@ -13,7 +13,7 @@ import {
useSmartsheetStoreOrThrow,
useUIPermission,
} from '#imports'
import { TabItem } from '~/lib'
import type { TabItem } from '~/lib'
export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () => void) {
const { sharedView } = useSharedView()
@ -42,7 +42,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
try {
if (!isUIAllowed('sortSync')) {
const sortsBackup = tabMeta.value.sortsState.get(view.value.id!)
const sortsBackup = tabMeta.value.sortsState!.get(view.value!.id!)
if (sortsBackup) {
sorts.value = sortsBackup
return
@ -61,7 +61,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
sorts.value[i] = sort
sorts.value = [...sorts.value]
reloadHook?.trigger()
tabMeta.value.sortsState.set(view.value.id!, sorts.value)
tabMeta.value.sortsState!.set(view.value!.id!, sorts.value)
return
}
@ -91,7 +91,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
$e('a:sort:add', { length: sorts?.value?.length })
tabMeta.value.sortsState.set(view.value.id!, sorts.value)
tabMeta.value.sortsState!.set(view.value!.id!, sorts.value)
}
const deleteSort = async (sort: SortType, i: number) => {
@ -102,7 +102,7 @@ export function useViewSorts(view: Ref<ViewType | undefined>, reloadData?: () =>
sorts.value.splice(i, 1)
sorts.value = [...sorts.value]
tabMeta.value.sortsState.set(view.value.id!, sorts.value)
tabMeta.value.sortsState!.set(view.value!.id!, sorts.value)
reloadHook?.trigger()
$e('a:sort:delete')

Loading…
Cancel
Save