Browse Source

chore(nc-gui): lint

pull/5106/head
Wing-Kam Wong 2 years ago
parent
commit
03a7ab8829
  1. 4
      packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue
  2. 27
      packages/nc-gui/composables/useViewFilters.ts

4
packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue

@ -2,7 +2,7 @@
import type { SelectProps } from 'ant-design-vue'
import type { ColumnType, LinkToAnotherRecordType } from 'nocodb-sdk'
import { RelationTypes, UITypes, isVirtualCol } from 'nocodb-sdk'
import { MetaInj, FieldsInj, computed, inject, ref, resolveComponent } from '#imports'
import { MetaInj, computed, inject, ref, resolveComponent } from '#imports'
const { modelValue, isSort } = defineProps<{
modelValue?: string
@ -13,8 +13,6 @@ const emit = defineEmits(['update:modelValue'])
const meta = inject(MetaInj, ref())
const fields = inject(FieldsInj, ref())
const localValue = computed({
get: () => modelValue,
set: (val) => emit('update:modelValue', val),

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

@ -1,9 +1,8 @@
import type { ColumnType, FilterType, ViewType } from 'nocodb-sdk'
import type { ComputedRef, Ref } from 'vue'
import type { SelectProps } from 'ant-design-vue'
import { LinkToAnotherRecordType, RelationTypes, UITypes, isVirtualCol } from 'nocodb-sdk'
import { UITypes } from 'nocodb-sdk'
import {
FieldsInj,
IsPublicInj,
MetaInj,
computed,
@ -48,8 +47,6 @@ export function useViewFilters(
const tabMeta = inject(TabMetaInj, ref({ filterState: new Map(), sortsState: new Map() } as TabItem))
const fields = inject(FieldsInj, ref())
const filters = computed<Filter[]>({
get: () => {
return nestedMode.value ? currentFilters! : _filters.value
@ -87,6 +84,17 @@ export function useViewFilters(
}),
)
const types = computed(() => {
if (!meta.value?.columns?.length) {
return {}
}
return meta.value?.columns?.reduce((obj: any, col: any) => {
obj[col.id] = col.uidt
return obj
}, {})
})
const isComparisonOpAllowed = (
filter: FilterType,
compOp: {
@ -108,17 +116,6 @@ export function useViewFilters(
return true
}
const types = computed(() => {
if (!meta.value?.columns?.length) {
return {}
}
return meta.value?.columns?.reduce((obj: any, col: any) => {
obj[col.id] = col.uidt
return obj
}, {})
})
const placeholderFilter = (): Filter => {
return {
comparison_op: comparisonOpList(options.value[0].uidt as UITypes).filter((compOp) =>

Loading…
Cancel
Save