Browse Source

fix(gui): Filter correction

added missing filter in where (not null)

fix #295

Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
pull/301/head
Pranav C 3 years ago
parent
commit
01d111ca06
  1. 10
      packages/nc-gui/components/project/spreadsheet/components/columnFilter.vue
  2. 2
      packages/nc-gui/components/project/spreadsheet/mixins/spreadsheet.js

10
packages/nc-gui/components/project/spreadsheet/components/columnFilter.vue

@ -82,8 +82,9 @@
<span class="caption font-weight-regular">{{ item }}</span> <span class="caption font-weight-regular">{{ item }}</span>
</template> </template>
</v-select> </v-select>
<span v-if="['is null', 'is not null'].includes(filter.op)"></span>
<v-text-field solo flat :key="i + '_7'" @click.stop hide-details dense class="caption" v-model="filter.value" <v-text-field v-else solo flat :key="i + '_7'" @click.stop hide-details dense class="caption"
v-model="filter.value"
:disabled="filter.readOnly"></v-text-field> :disabled="filter.readOnly"></v-text-field>
</template> </template>
@ -109,7 +110,10 @@ export default {
props: ['fieldList', 'value'], props: ['fieldList', 'value'],
data: () => ({ data: () => ({
filters: [], filters: [],
opList: ['is equal', 'is not equal', 'is like', 'is not like', 'is empty', 'is not empty', 'is null', 'is not null', opList: [
'is equal', 'is not equal', 'is like', 'is not like',
// 'is empty', 'is not empty',
'is null', 'is not null',
'>', '>',
'<', '<',
'>=', '>=',

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

@ -204,6 +204,8 @@ export default {
return condition + `~not(${filt.field},in,)`; return condition + `~not(${filt.field},in,)`;
case 'is null': case 'is null':
return condition + `(${filt.field},is,null)`; return condition + `(${filt.field},is,null)`;
case 'is not null':
return condition + `~not(${filt.field},is,null)`;
case '<': case '<':
return condition + `(${filt.field},lt,${filt.value})`; return condition + `(${filt.field},lt,${filt.value})`;
case '<=': case '<=':

Loading…
Cancel
Save