Browse Source

fix(ui): allow select columns with no options

Re #2764

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/2751/head
mertmit 2 years ago
parent
commit
81bc459835
  1. 4
      packages/nc-gui/components/project/spreadsheet/components/cell/EnumCell.vue
  2. 4
      packages/nc-gui/components/project/spreadsheet/components/cell/SetListCell.vue
  3. 4
      packages/nc-gui/components/project/spreadsheet/components/editableCell/EnumListEditableCell.vue
  4. 4
      packages/nc-gui/components/project/spreadsheet/components/editableCell/SetListEditableCell.vue

4
packages/nc-gui/components/project/spreadsheet/components/cell/EnumCell.vue

@ -17,7 +17,9 @@ export default {
props: ['value', 'column'],
computed: {
enumValues() {
const opts = this.column.colOptions.options || [];
const opts = (this.column.colOptions)
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
for (const op of opts.filter(el => el.order === null)) {
op.title = op.title.replace(/^'/, '').replace(/'$/, '');
}

4
packages/nc-gui/components/project/spreadsheet/components/cell/SetListCell.vue

@ -19,7 +19,9 @@ export default {
props: ['value', 'column'],
computed: {
setValues() {
const opts = this.column.colOptions.options || [];
const opts = (this.column.colOptions)
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
for (const op of opts.filter(el => el.order === null)) {
op.title = op.title.replace(/^'/, '').replace(/'$/, '');
}

4
packages/nc-gui/components/project/spreadsheet/components/editableCell/EnumListEditableCell.vue

@ -55,7 +55,9 @@ export default {
},
},
enumValues() {
const opts = this.column.colOptions.options || [];
const opts = (this.column.colOptions)
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
for (const op of opts.filter(el => el.order === null)) {
op.title = op.title.replace(/^'/, '').replace(/'$/, '');
}

4
packages/nc-gui/components/project/spreadsheet/components/editableCell/SetListEditableCell.vue

@ -59,7 +59,9 @@ export default {
},
},
setValues() {
const opts = this.column.colOptions.options || [];
const opts = (this.column.colOptions)
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
for (const op of opts.filter(el => el.order === null)) {
op.title = op.title.replace(/^'/, '').replace(/'$/, '');
}

Loading…
Cancel
Save