Browse Source

fix: keep options when switching between single/multi select

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/927/head
Pranav C 3 years ago
parent
commit
3536478102
  1. 25
      packages/nc-gui/components/project/spreadsheet/components/editColumn.vue
  2. 14
      packages/nocodb/package-lock.json
  3. 2
      packages/nocodb/package.json

25
packages/nc-gui/components/project/spreadsheet/components/editColumn.vue

@ -104,6 +104,21 @@
<!-- <span class="caption">{{ item }}</span>-->
<!-- </v-list-item>-->
<!-- </v-list>-->
<!-- v-if="column && column.uidt === 'MultiSelect' &&newColumn.uidt === 'SingleSelect'"-->
<v-alert
dense
type="warning"
class="caption warning--text mt-2 mb-n4 pa-1"
outlined
>
<template #prepend>
<v-icon small class="mx-2" color="warning">
mdi-alert-outline
</v-icon>
</template>
Changing MultiSelect to SingleSelect can lead to errors when there are multiple values associated with a cell
</v-alert>
</v-col>
<v-col v-if="isSelect" cols="12">
@ -607,6 +622,11 @@ export default {
this.newColumn.dtx = 'specificType'
const selectTypes = [UITypes.MultiSelect, UITypes.SingleSelect]
if (this.column && selectTypes.includes(this.newColumn.uidt) && selectTypes.includes(this.column.uidt)) {
this.newColumn.dtxp = this.column.dtxp
}
// this.$set(this.newColumn, 'uidt', this.sqlUi.getUIType(this.newColumn));
this.newColumn.altered = this.newColumn.altered || 2
@ -627,6 +647,11 @@ export default {
this.newColumn.dtxp = this.sqlUi.getDefaultLengthForDatatype(this.newColumn.dt)
this.newColumn.dtxs = this.sqlUi.getDefaultScaleForDatatype(this.newColumn.dt)
const selectTypes = [UITypes.MultiSelect, UITypes.SingleSelect]
if (this.column && selectTypes.includes(this.newColumn.uidt) && selectTypes.includes(this.column.uidt)) {
this.newColumn.dtxp = this.column.dtxp
}
this.newColumn.altered = this.newColumn.altered || 2
},
focusInput() {

14
packages/nocodb/package-lock.json generated

@ -66,7 +66,7 @@
"mysql2": "^2.2.5",
"nanoid": "^3.1.20",
"nc-common": "0.0.6",
"nc-help": "^0.2.22",
"nc-help": "^0.2.23",
"nc-lib-gui": "0.84.1",
"nc-plugin": "^0.1.1",
"ncp": "^2.0.0",
@ -15850,9 +15850,9 @@
}
},
"node_modules/nc-help": {
"version": "0.2.22",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.22.tgz",
"integrity": "sha512-VCcXlPJm4EqtAqlN3FCXgJauqENRgAe+qMlrfn4aKxN6ey31l8wr00Mg4WalGjgjV2ZxiA8qORYWlYog5NxpGg==",
"version": "0.2.23",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.23.tgz",
"integrity": "sha512-4enEuzR9EhslpuSVh/uk04ti4euo6qOh+rvkRHbJbgAX7CEu/c8mHGWTEFDoZCIFZ0S3maVpCGDWp9RzonzEbA==",
"dependencies": {
"axios": "^0.21.1",
"boxen": "^4.2.0",
@ -37147,9 +37147,9 @@
"integrity": "sha512-3AryS9uwa5NfISLxMciUonrH7YfXp+nlahB9T7girXIsLQrmwX4MdnuKs32akduCOGpKmjTJSWmATULbuMkbfw=="
},
"nc-help": {
"version": "0.2.22",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.22.tgz",
"integrity": "sha512-VCcXlPJm4EqtAqlN3FCXgJauqENRgAe+qMlrfn4aKxN6ey31l8wr00Mg4WalGjgjV2ZxiA8qORYWlYog5NxpGg==",
"version": "0.2.23",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.23.tgz",
"integrity": "sha512-4enEuzR9EhslpuSVh/uk04ti4euo6qOh+rvkRHbJbgAX7CEu/c8mHGWTEFDoZCIFZ0S3maVpCGDWp9RzonzEbA==",
"requires": {
"axios": "^0.21.1",
"boxen": "^4.2.0",

2
packages/nocodb/package.json

@ -147,7 +147,7 @@
"mysql2": "^2.2.5",
"nanoid": "^3.1.20",
"nc-common": "0.0.6",
"nc-help": "^0.2.22",
"nc-help": "^0.2.23",
"nc-lib-gui": "0.84.1",
"nc-plugin": "^0.1.1",
"ncp": "^2.0.0",

Loading…
Cancel
Save