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" />
<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;
}

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

@ -9,7 +9,7 @@
dense
flat
hide-details
:class="`mt-0 ${isForm ? 'form-select': ''}`"
:class="`mt-0 ${isForm ? 'form-select' : ''}`"
:clearable="!column.rqd"
v-on="parentListeners"
>
@ -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(/'$/, '');
}
@ -105,7 +103,7 @@ export default {
}
.form-select {
.v-select__selections {
border: 1px solid rgba(127,130,139,0.2);
border: 1px solid rgba(127, 130, 139, 0.2);
}
input {
z-index: -1;

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

@ -12,7 +12,7 @@
solo
hide-details
deletable-chips
:class="`text-center mt-0 ${isForm ? 'form-select': ''}`"
:class="`text-center mt-0 ${isForm ? 'form-select' : ''}`"
>
<template #selection="data">
<v-chip
@ -27,15 +27,13 @@
</v-chip>
</template>
<template #item="{item}">
<template #item="{ item }">
<v-chip small :color="item.color">
{{ item.title }}
</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;
@ -99,7 +94,7 @@ export default {
min-height: 38px !important;
}
}
.v-input__slot{
.v-input__slot {
padding-right: 0 !important;
}
.v-input__icon.v-input__icon--clear {
@ -114,14 +109,13 @@ export default {
}
.form-select {
.v-select__selections {
border: 1px solid rgba(127,130,139,0.2);
border: 1px solid rgba(127, 130, 139, 0.2);
}
input {
z-index: -1;
}
}
}
</style>
<!--
/**

Loading…
Cancel
Save