Browse Source

qr code: fix 'ignore qr codes in filter dropdown'

pull/4142/head
Daniel Spaude 2 years ago
parent
commit
330af1c4b0
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 20
      packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue

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

@ -21,16 +21,17 @@ const localValue = computed({
const options = computed<SelectProps['options']>(() =>
meta.value?.columns
?.filter((c: ColumnType) => {
/** ignore hasmany and manytomany relations if it's using within sort menu */
if (isSort) {
if (c.uidt === UITypes.QrCode) {
return false
} else if (isSort) {
/** ignore hasmany and manytomany relations if it's using within sort menu */
return !(
c.uidt === UITypes.LinkToAnotherRecord && (c.colOptions as LinkToAnotherRecordType).type !== RelationTypes.BELONGS_TO
)
/** ignore virtual fields which are system fields ( mm relation ) and qr code fields */
} else {
const isQrCode = c.uidt === UITypes.QrCode
const isVirtualSystemField = c.colOptions && c.system
return !isVirtualSystemField && !isQrCode
return !isVirtualSystemField
}
})
.map((c: ColumnType) => ({
@ -50,14 +51,9 @@ const filterOption = (input: string, option: any) => option.label.toLowerCase()?
</script>
<template>
<a-select
v-model:value="localValue"
:dropdown-match-select-width="false"
show-search
:placeholder="$t('placeholder.selectField')"
:filter-option="filterOption"
dropdown-class-name="nc-dropdown-toolbar-field-list"
>
<a-select v-model:value="localValue" :dropdown-match-select-width="false" show-search
:placeholder="$t('placeholder.selectField')" :filter-option="filterOption"
dropdown-class-name="nc-dropdown-toolbar-field-list">
<a-select-option v-for="option in options" :key="option.value" :label="option.label" :value="option.value">
<div class="flex gap-2 items-center items-center h-full">
<component :is="option.icon" class="min-w-5 !mx-0" />

Loading…
Cancel
Save