Browse Source

fix: fix: wrong editable component

fix #198
pull/154/head
“pranavxc” 4 years ago
parent
commit
19b26f6a25
  1. 16
      packages/nc-gui/components/project/spreadsheet/components/editableCell.vue
  2. 6
      packages/nc-gui/components/project/spreadsheet/mixins/cell.js
  3. 2
      packages/nc-gui/helpers/PgUi.js

16
packages/nc-gui/components/project/spreadsheet/components/editableCell.vue

@ -13,13 +13,6 @@
v-model="localState"></editable-attachment-cell> v-model="localState"></editable-attachment-cell>
<text-cell v-else-if="isString" v-on="parentListeners" v-model="localState"></text-cell>
<text-area-cell
:is-form="isForm"
v-else-if="isTextArea" @input="$emit('save')" v-model="localState"
v-on="parentListeners"
></text-area-cell>
<boolean-cell :isForm="isForm" v-else-if="isBoolean" v-on="parentListeners" <boolean-cell :isForm="isForm" v-else-if="isBoolean" v-on="parentListeners"
v-model="localState" @input="$emit('change');"></boolean-cell> v-model="localState" @input="$emit('change');"></boolean-cell>
@ -58,6 +51,15 @@
v-on="parentListeners"></set-list-editable-cell> v-on="parentListeners"></set-list-editable-cell>
<set-list-cell :column="column" v-else-if="isSet" v-model="localState" <set-list-cell :column="column" v-else-if="isSet" v-model="localState"
v-on="parentListeners"></set-list-cell> v-on="parentListeners"></set-list-cell>
<text-cell v-else-if="isString" v-on="parentListeners" v-model="localState"></text-cell>
<text-area-cell
:is-form="isForm"
v-else-if="isTextArea" @input="$emit('save')" v-model="localState"
v-on="parentListeners"
></text-area-cell>
<!--<set-list-checkbox-cell :column="column" v-else-if="isSet" v-model="localState" <!--<set-list-checkbox-cell :column="column" v-else-if="isSet" v-model="localState"
v-on="parentListeners"></set-list-checkbox-cell>--> v-on="parentListeners"></set-list-checkbox-cell>-->

6
packages/nc-gui/components/project/spreadsheet/mixins/cell.js

@ -26,7 +26,7 @@ export default {
return this.abstractType === 'string'; return this.abstractType === 'string';
}, },
isTextArea() { isTextArea() {
return this.abstractType === 'text'; return this.column.uidt === 'LongText';
}, isInt() { }, isInt() {
return this.abstractType === 'integer'; return this.abstractType === 'integer';
}, isFloat() { }, isFloat() {
@ -40,9 +40,9 @@ export default {
}, isJSON() { }, isJSON() {
return this.abstractType === 'json'; return this.abstractType === 'json';
}, isEnum() { }, isEnum() {
return this.abstractType === 'enum'; return this.column.uidt === 'SingleSelect';
}, isSet() { }, isSet() {
return this.abstractType === 'set'; return this.column.uidt === 'MultiSelect';
}, isAttachment() { }, isAttachment() {
return this.column.uidt === 'Attachment'; return this.column.uidt === 'Attachment';
} }

2
packages/nc-gui/helpers/PgUi.js

@ -1717,7 +1717,7 @@ export class PgUi {
colProp.dt = 'text'; colProp.dt = 'text';
break; break;
case 'SingleSelect': case 'SingleSelect':
colProp.dt = 'enum'; colProp.dt = 'text';
break; break;
case 'Collaborator': case 'Collaborator':
colProp.dt = 'character varying'; colProp.dt = 'character varying';

Loading…
Cancel
Save