Browse Source

fix(gui): search field selection

fixes search filed selection issue which breaks entire ui.

fix #210

Signed-off-by: Pranav C Balan <pranavxc@gmail.com>
pull/217/head
Pranav C Balan 3 years ago
parent
commit
6fe55b60aa
  1. 2
      packages/nc-gui/components/project/spreadsheet/mixins/spreadsheet.js
  2. 2
      packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

2
packages/nc-gui/components/project/spreadsheet/mixins/spreadsheet.js

@ -85,7 +85,7 @@ export default {
concatenatedXWhere() { concatenatedXWhere() {
let where = ''; let where = '';
if (this.searchField && this.searchQuery.trim()) { if (this.searchField && this.searchQuery.trim()) {
if (['text', 'string'].includes(this.sqlUi.getAbstractType(this.availableColumns.find(({_cn}) => _cn === this.searchField)))) { if (['text', 'string'].includes(this.sqlUi.getAbstractType(this.availableColumns.find(({_cn}) => _cn === this.searchField) || this.availableColumns[0]))) {
where = `(${this.searchField},like,%${this.searchQuery.trim()}%)` where = `(${this.searchField},like,%${this.searchQuery.trim()}%)`
} else { } else {
where = `(${this.searchField},eq,${this.searchQuery.trim()})` where = `(${this.searchField},eq,${this.searchQuery.trim()})`

2
packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

@ -19,7 +19,7 @@
</template> </template>
<v-list dense> <v-list dense>
<v-list-item v-for="col in availableColumns" :key="col.cn" <v-list-item v-for="col in availableColumns" :key="col.cn"
@click="searchField = col.cn"> @click="searchField = col._cn">
<span class="caption">{{ col._cn }}</span> <span class="caption">{{ col._cn }}</span>
</v-list-item> </v-list-item>
</v-list> </v-list>

Loading…
Cancel
Save