Browse Source

refactor(gui-v2): linting

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2716/head
Pranav C 2 years ago
parent
commit
eb18e318c8
  1. 10
      packages/nc-gui-v2/components/smartsheet-toolbar/FieldsMenu.vue
  2. 10
      packages/nc-gui-v2/composables/useViewColumns.ts

10
packages/nc-gui-v2/components/smartsheet-toolbar/FieldsMenu.vue

@ -365,7 +365,7 @@ export default {
<v-divider class="my-2" /> <v-divider class="my-2" />
<v-list-item v-if="!isPublic" dense> <v-list-item v-if="!isPublic" dense>
<!-- <!--
show_system_fields show_system_fields
<v-checkbox v-model="showSystemFields" class="mt-0 pt-0" dense hide-details @click.stop> <v-checkbox v-model="showSystemFields" class="mt-0 pt-0" dense hide-details @click.stop>
<template #label> <template #label>
@ -374,9 +374,11 @@ show_system_fields
{{ $t('activity.showSystemFields') }} {{ $t('activity.showSystemFields') }}
</span> </span>
</template> </template>
</v-checkbox>--> </v-checkbox> -->
<input type="checkbox" v-model="showSystemFields" :id="`${activeView?.id}-show-system-fields`"/> <input :id="`${activeView?.id}-show-system-fields`" v-model="showSystemFields" type="checkbox" />
<label :for="`${activeView.id}-show-system-fields`" class="caption text-sm ml-2">{{ $t('activity.showSystemFields') }}</label> <label :for="`${activeView.id}-show-system-fields`" class="caption text-sm ml-2">{{
$t('activity.showSystemFields')
}}</label>
</v-list-item> </v-list-item>
<v-list-item dense class="mt-2 list-btn mb-3"> <v-list-item dense class="mt-2 list-btn mb-3">
<v-btn small class="elevation-0 grey--text text-sm text-capitalize" @click.stop="showAll"> <v-btn small class="elevation-0 grey--text text-sm text-capitalize" @click.stop="showAll">

10
packages/nc-gui-v2/composables/useViewColumns.ts

@ -1,4 +1,4 @@
import { isSystemColumn } from "nocodb-sdk"; import { isSystemColumn } from 'nocodb-sdk'
import type { ColumnType, FormType, GalleryType, GridType, TableType } from 'nocodb-sdk' import type { ColumnType, FormType, GalleryType, GridType, TableType } from 'nocodb-sdk'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { useNuxtApp } from '#app' import { useNuxtApp } from '#app'
@ -20,7 +20,6 @@ export default function (
const filterQuery = ref('') const filterQuery = ref('')
const { $api } = useNuxtApp() const { $api } = useNuxtApp()
const loadViewColumns = async () => { const loadViewColumns = async () => {
@ -99,9 +98,8 @@ export default function (
const filteredFieldList = computed(() => { const filteredFieldList = computed(() => {
return fields.value?.filter((field) => { return fields.value?.filter((field) => {
// hide system columns if not enabled // hide system columns if not enabled
if(!showSystemFields.value && isSystemColumn(metaColumnById?.value?.[field.fk_column_id as string])) { if (!showSystemFields.value && isSystemColumn(metaColumnById?.value?.[field.fk_column_id as string])) {
return false return false
} }
@ -109,12 +107,11 @@ export default function (
}) })
}) })
const sortedAndFilteredFields = computed<ColumnType[]>(() => { const sortedAndFilteredFields = computed<ColumnType[]>(() => {
return (fields?.value return (fields?.value
?.filter((c) => { ?.filter((c) => {
// hide system columns if not enabled // hide system columns if not enabled
if(!showSystemFields.value && isSystemColumn(metaColumnById?.value?.[c.fk_column_id as string])) { if (!showSystemFields.value && isSystemColumn(metaColumnById?.value?.[c.fk_column_id as string])) {
return false return false
} }
return c.show return c.show
@ -123,7 +120,6 @@ export default function (
?.map((c) => metaColumnById?.value?.[c.fk_column_id as string]) || []) as ColumnType[] ?.map((c) => metaColumnById?.value?.[c.fk_column_id as string]) || []) as ColumnType[]
}) })
return { return {
fields, fields,
loadViewColumns, loadViewColumns,

Loading…
Cancel
Save