From 6b447ceb38701354581d5b3ce226cc36630994fb Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Mon, 25 Jul 2022 10:34:49 +0200
Subject: [PATCH] chore(gui-v2): fix eslint issues
# What's changed?
* transform some components to script setup
* fix linting issues
---
.../nc-gui-v2/components/cell/Duration.vue | 2 +-
.../components/cell/JsonEditableCell.vue | 97 ++++++++-----------
packages/nc-gui-v2/components/cell/Time.vue | 18 +++-
.../nc-gui-v2/components/dlg/TableCreate.vue | 31 +++---
.../smartsheet-header/VirtualCellIcon.vue | 5 +-
.../smartsheet-toolbar/LockMenu.vue | 74 +++++++++-----
.../smartsheet-toolbar/MoreActions.vue | 12 +--
.../smartsheet-toolbar/SortListMenu.vue | 4 +-
.../components/ListChildItems.vue | 5 +-
.../components/ListChildItemsModal.vue | 6 +-
.../virtual-cell/components/ListItems.vue | 3 +-
.../nc-gui-v2/composables/useViewCreate.ts | 7 +-
packages/nc-gui-v2/plugins/i18n.ts | 6 +-
13 files changed, 147 insertions(+), 123 deletions(-)
diff --git a/packages/nc-gui-v2/components/cell/Duration.vue b/packages/nc-gui-v2/components/cell/Duration.vue
index 8e92ecea70..00a46e0847 100644
--- a/packages/nc-gui-v2/components/cell/Duration.vue
+++ b/packages/nc-gui-v2/components/cell/Duration.vue
@@ -66,7 +66,7 @@ const submitDuration = () => {
@keypress="checkDurationFormat($event)"
@keydown.enter="submitDuration"
/>
-
+
Please enter a number
diff --git a/packages/nc-gui-v2/components/cell/JsonEditableCell.vue b/packages/nc-gui-v2/components/cell/JsonEditableCell.vue
index 5561b8424e..9f9e2e00e8 100644
--- a/packages/nc-gui-v2/components/cell/JsonEditableCell.vue
+++ b/packages/nc-gui-v2/components/cell/JsonEditableCell.vue
@@ -1,66 +1,47 @@
-
+
+
diff --git a/packages/nc-gui-v2/components/cell/Time.vue b/packages/nc-gui-v2/components/cell/Time.vue
index 9261d40ac8..40954b39dd 100644
--- a/packages/nc-gui-v2/components/cell/Time.vue
+++ b/packages/nc-gui-v2/components/cell/Time.vue
@@ -1,17 +1,27 @@
-
-
+
+
-
-
+
+
{{ $t('general.save') }}
diff --git a/packages/nc-gui-v2/components/dlg/TableCreate.vue b/packages/nc-gui-v2/components/dlg/TableCreate.vue
index 9b87ef6f1e..9568dcb765 100644
--- a/packages/nc-gui-v2/components/dlg/TableCreate.vue
+++ b/packages/nc-gui-v2/components/dlg/TableCreate.vue
@@ -1,34 +1,34 @@
+
+
-
-
-
-
+
+
+
+
-
+
- mdi-check-bold
+ mdi-check-bold
@@ -39,9 +67,9 @@ export default {
-
+
- mdi-check-bold
+ mdi-check-bold
@@ -56,9 +84,9 @@ export default {
mdi-starLocked view.
-
+
- mdi-check-bold
+ mdi-check-bold
diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/MoreActions.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/MoreActions.vue
index e0358e4432..13f1bc5f98 100644
--- a/packages/nc-gui-v2/components/smartsheet-toolbar/MoreActions.vue
+++ b/packages/nc-gui-v2/components/smartsheet-toolbar/MoreActions.vue
@@ -13,7 +13,6 @@ export default {
name: 'ExportImport',
components: {
WebhookSlider,
- WebhookModal,
ColumnMappingModal,
DropOrSelectFileModal,
},
@@ -26,6 +25,7 @@ export default {
isView: Boolean,
reqPayload: Object,
},
+ emits: ['reload', 'showAdditionalFeatOverlay'],
data() {
return {
importModal: false,
@@ -206,19 +206,19 @@ export default {
const v = this.meta && this.meta.columns.find((c) => c.title === col.destCn)
let input = row[col.sourceCn]
// parse potential boolean values
- if (v.uidt == UITypes.Checkbox) {
+ if (v.uidt === UITypes.Checkbox) {
input = input.replace(/["']/g, '').toLowerCase().trim()
- if (input == 'false' || input == 'no' || input == 'n') {
+ if (input === 'false' || input === 'no' || input === 'n') {
input = '0'
- } else if (input == 'true' || input == 'yes' || input == 'y') {
+ } else if (input === 'true' || input === 'yes' || input === 'y') {
input = '1'
}
} else if (v.uidt === UITypes.Number) {
- if (input == '') {
+ if (input === '') {
input = null
}
} else if (v.uidt === UITypes.SingleSelect || v.uidt === UITypes.MultiSelect) {
- if (input == '') {
+ if (input === '') {
input = null
}
}
diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/SortListMenu.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/SortListMenu.vue
index 51496f435b..322d81eded 100644
--- a/packages/nc-gui-v2/components/smartsheet-toolbar/SortListMenu.vue
+++ b/packages/nc-gui-v2/components/smartsheet-toolbar/SortListMenu.vue
@@ -62,7 +62,7 @@ watch(
class="caption nc-sort-field-select"
:columns="columns"
@click.stop
- @update:modelValue="saveOrUpdate(sort, i)"
+ @update:model-value="saveOrUpdate(sort, i)"
/>
diff --git a/packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue b/packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue
index 2cc84c8f90..557ea8721c 100644
--- a/packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue
+++ b/packages/nc-gui-v2/components/virtual-cell/components/ListChildItems.vue
@@ -36,6 +36,7 @@ export default {
type: String,
password: String,
},
+ emits: ['input', 'edit', 'delete', 'unlink', 'newRecord'],
data: () => ({
RelationTypes,
data: null,
@@ -121,7 +122,7 @@ export default {
small
class="caption"
color="primary"
- @click="$emit('new-record')"
+ @click="$emit('newRecord')"
>
mdi-link Link to '{{ meta.title }}'
@@ -129,7 +130,7 @@ export default {
-
+
mdi-link Link to '{{ meta.title }}'
diff --git a/packages/nc-gui-v2/components/virtual-cell/components/ListChildItemsModal.vue b/packages/nc-gui-v2/components/virtual-cell/components/ListChildItemsModal.vue
index 258728d35d..6ed17a4d79 100644
--- a/packages/nc-gui-v2/components/virtual-cell/components/ListChildItemsModal.vue
+++ b/packages/nc-gui-v2/components/virtual-cell/components/ListChildItemsModal.vue
@@ -1,5 +1,5 @@