Browse Source

chore: fix prettier

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/2751/head
mertmit 2 years ago
parent
commit
bb861efe97
  1. 4
      packages/nc-gui/components/project/spreadsheet/components/EditableCell.vue
  2. 6
      packages/nc-gui/components/project/spreadsheet/components/cell/EnumCell.vue
  3. 4
      packages/nc-gui/components/project/spreadsheet/components/cell/SetListCell.vue
  4. 10
      packages/nc-gui/components/project/spreadsheet/components/editColumn/CustomSelectOptions.vue
  5. 8
      packages/nc-gui/components/project/spreadsheet/components/editableCell/EnumListEditableCell.vue
  6. 18
      packages/nc-gui/components/project/spreadsheet/components/editableCell/SetListEditableCell.vue

4
packages/nc-gui/components/project/spreadsheet/components/EditableCell.vue

@ -64,7 +64,9 @@
<date-time-picker-cell v-else-if="isDateTime" v-model="localState" ignore-focus v-on="parentListeners" /> <date-time-picker-cell v-else-if="isDateTime" v-model="localState" ignore-focus v-on="parentListeners" />
<enum-cell <enum-cell
v-else-if="isEnum && ((!isForm && !active) || isLocked || (isPublic && !isForm) || !_isUIAllowed('tableRowUpdate'))" v-else-if="
isEnum && ((!isForm && !active) || isLocked || (isPublic && !isForm) || !_isUIAllowed('tableRowUpdate'))
"
v-model="localState" v-model="localState"
:column="column" :column="column"
v-on="parentListeners" v-on="parentListeners"

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

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

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

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

10
packages/nc-gui/components/project/spreadsheet/components/editColumn/CustomSelectOptions.vue

@ -54,7 +54,7 @@ export default {
this.options = this.copyOptions(this.column.colOptions?.options) || []; this.options = this.copyOptions(this.column.colOptions?.options) || [];
// Support for older options // Support for older options
for (const op of this.options.filter(el => el.order === null)) { for (const op of this.options.filter(el => el.order === null)) {
op.title = op.title.replace(/^'/, '').replace(/'$/, '') op.title = op.title.replace(/^'/, '').replace(/'$/, '');
} }
}, },
methods: { methods: {
@ -88,9 +88,7 @@ export default {
}; };
await this.$api.dbTableColumn.create(this.meta.id, selectCol); await this.$api.dbTableColumn.create(this.meta.id, selectCol);
if (this.column.colOptions) { if (this.column.colOptions) {
this.$store this.$store.dispatch('meta/ActLoadMeta', { force: true, id: this.column.fk_model_id }).then(() => {});
.dispatch('meta/ActLoadMeta', { force: true, id: this.column.fk_model_id })
.then(() => {});
} }
this.$toast.success('Select column saved successfully').goAway(3000); this.$toast.success('Select column saved successfully').goAway(3000);
return true; return true;
@ -113,9 +111,7 @@ export default {
}; };
await this.$api.dbTableColumn.update(this.column.id, selectCol); await this.$api.dbTableColumn.update(this.column.id, selectCol);
if (this.column.colOptions) { if (this.column.colOptions) {
this.$store this.$store.dispatch('meta/ActLoadMeta', { force: true, id: this.column.fk_model_id }).then(() => {});
.dispatch('meta/ActLoadMeta', { force: true, id: this.column.fk_model_id })
.then(() => {});
} }
return true; return true;
} }

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

@ -9,7 +9,7 @@
dense dense
flat flat
hide-details hide-details
:class="`mt-0 ${isForm ? 'form-select': ''}`" :class="`mt-0 ${isForm ? 'form-select' : ''}`"
:clearable="!column.rqd" :clearable="!column.rqd"
v-on="parentListeners" v-on="parentListeners"
> >
@ -55,9 +55,7 @@ export default {
}, },
}, },
enumValues() { enumValues() {
const opts = (this.column.colOptions) const opts = this.column.colOptions ? this.column.colOptions.options.filter(el => el.title !== '') || [] : [];
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
for (const op of opts.filter(el => el.order === null)) { for (const op of opts.filter(el => el.order === null)) {
op.title = op.title.replace(/^'/, '').replace(/'$/, ''); op.title = op.title.replace(/^'/, '').replace(/'$/, '');
} }
@ -105,7 +103,7 @@ export default {
} }
.form-select { .form-select {
.v-select__selections { .v-select__selections {
border: 1px solid rgba(127,130,139,0.2); border: 1px solid rgba(127, 130, 139, 0.2);
} }
input { input {
z-index: -1; z-index: -1;

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

@ -12,7 +12,7 @@
solo solo
hide-details hide-details
deletable-chips deletable-chips
:class="`text-center mt-0 ${isForm ? 'form-select': ''}`" :class="`text-center mt-0 ${isForm ? 'form-select' : ''}`"
> >
<template #selection="data"> <template #selection="data">
<v-chip <v-chip
@ -27,15 +27,13 @@
</v-chip> </v-chip>
</template> </template>
<template #item="{item}"> <template #item="{ item }">
<v-chip small :color="item.color"> <v-chip small :color="item.color">
{{ item.title }} {{ item.title }}
</v-chip> </v-chip>
</template> </template>
<template #append> <template #append>
<v-icon small class="mt-1"> <v-icon small class="mt-1"> mdi-menu-down </v-icon>
mdi-menu-down
</v-icon>
</template> </template>
</v-select> </v-select>
</div> </div>
@ -59,9 +57,7 @@ export default {
}, },
}, },
setValues() { setValues() {
const opts = (this.column.colOptions) const opts = this.column.colOptions ? this.column.colOptions.options.filter(el => el.title !== '') || [] : [];
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
for (const op of opts.filter(el => el.order === null)) { for (const op of opts.filter(el => el.order === null)) {
op.title = op.title.replace(/^'/, '').replace(/'$/, ''); op.title = op.title.replace(/^'/, '').replace(/'$/, '');
} }
@ -91,7 +87,6 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep { ::v-deep {
.v-select { .v-select {
min-width: 150px; min-width: 150px;
@ -99,7 +94,7 @@ export default {
min-height: 38px !important; min-height: 38px !important;
} }
} }
.v-input__slot{ .v-input__slot {
padding-right: 0 !important; padding-right: 0 !important;
} }
.v-input__icon.v-input__icon--clear { .v-input__icon.v-input__icon--clear {
@ -114,14 +109,13 @@ export default {
} }
.form-select { .form-select {
.v-select__selections { .v-select__selections {
border: 1px solid rgba(127,130,139,0.2); border: 1px solid rgba(127, 130, 139, 0.2);
} }
input { input {
z-index: -1; z-index: -1;
} }
} }
} }
</style> </style>
<!-- <!--
/** /**

Loading…
Cancel
Save