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. 4
      packages/nc-gui/components/project/spreadsheet/components/editableCell/EnumListEditableCell.vue
  6. 10
      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" />
<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"
:column="column"
v-on="parentListeners"

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

@ -17,14 +17,12 @@ export default {
props: ['value', 'column'],
computed: {
enumValues() {
const opts = (this.column.colOptions)
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
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(/'$/, '');
}
return opts;
}
},
},
};
</script>

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

@ -19,9 +19,7 @@ export default {
props: ['value', 'column'],
computed: {
setValues() {
const opts = (this.column.colOptions)
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
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(/'$/, '');
}

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

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

@ -55,9 +55,7 @@ export default {
},
},
enumValues() {
const opts = (this.column.colOptions)
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
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(/'$/, '');
}

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

@ -33,9 +33,7 @@
</v-chip>
</template>
<template #append>
<v-icon small class="mt-1">
mdi-menu-down
</v-icon>
<v-icon small class="mt-1"> mdi-menu-down </v-icon>
</template>
</v-select>
</div>
@ -59,9 +57,7 @@ export default {
},
},
setValues() {
const opts = (this.column.colOptions)
? this.column.colOptions.options.filter(el => el.title !== '') || []
: [];
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(/'$/, '');
}
@ -91,7 +87,6 @@ export default {
</script>
<style scoped lang="scss">
::v-deep {
.v-select {
min-width: 150px;
@ -121,7 +116,6 @@ export default {
}
}
}
</style>
<!--
/**

Loading…
Cancel
Save