Browse Source

Merge pull request #2611 from nocodb/fix/2610-empty-pills-appear-in-lookup-column-unwanted-tables-appear-in-lookup-dropdown-and-ui-issue-sort

fix/Fixed empty pills from appearing in lookup column, unwanted tables appearing in lookup dropdown and UI issue of sort
pull/2646/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
8cfe7f7860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/nc-gui/components/project/spreadsheet/components/SortListMenu.vue
  2. 3
      packages/nc-gui/components/project/spreadsheet/components/editColumn/LookupOptions.vue
  3. 2
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/LookupCell.vue

7
packages/nc-gui/components/project/spreadsheet/components/SortListMenu.vue

@ -1,7 +1,7 @@
<template> <template>
<v-menu offset-y transition="slide-y-transition"> <v-menu offset-y transition="slide-y-transition">
<template #activator="{ on }"> <template #activator="{ on }">
<v-badge :value="sortList && sortList.length" color="primary" dot overlap> <v-badge :value="validSortsExist" color="primary" dot overlap>
<v-btn <v-btn
v-t="['c:sort']" v-t="['c:sort']"
class="nc-sort-menu-btn px-2 nc-remove-border" class="nc-sort-menu-btn px-2 nc-remove-border"
@ -10,7 +10,7 @@
text text
outlined outlined
:class="{ :class="{
'primary lighten-5 grey--text text--darken-3': sortList && sortList.length, 'primary lighten-5 grey--text text--darken-3': validSortsExist,
}" }"
v-on="on" v-on="on"
> >
@ -98,6 +98,9 @@ export default {
icon: getUIDTIcon(c.uidt), icon: getUIDTIcon(c.uidt),
})); }));
}, },
validSortsExist() {
return this.sortList && this.sortList.filter(sort => sort.fk_column_id !== null).length > 0;
},
}, },
watch: { watch: {
value(v) { value(v) {

3
packages/nc-gui/components/project/spreadsheet/components/editColumn/LookupOptions.vue

@ -75,7 +75,8 @@ export default {
col: c.colOptions, col: c.colOptions,
column: c, column: c,
...this.tables.find(t => t.id === c.colOptions.fk_related_model_id), ...this.tables.find(t => t.id === c.colOptions.fk_related_model_id),
})); }))
.filter(table => table.col.fk_related_model_id === table.id && !table.mm);
return refTables; return refTables;
}, },

2
packages/nc-gui/components/project/spreadsheet/components/virtualCell/LookupCell.vue

@ -141,7 +141,7 @@ export default {
}, },
localValueObj() {}, localValueObj() {},
localValue() { localValue() {
return this.value && (Array.isArray(this.value) ? this.value : [this.value]); return this.value && (Array.isArray(this.value) ? this.value : [this.value]).filter(v => v !== null);
}, },
queryParams() {}, queryParams() {},
}, },

Loading…
Cancel
Save