From a2ef4bcb86902f988b3525e5c609caf01daaec06 Mon Sep 17 00:00:00 2001 From: Florian Steffens Date: Wed, 13 Sep 2023 22:52:43 +0200 Subject: [PATCH] fix(design): fix loading the default column-link providers - add configuration to avoid saving incorrect column configs - add info cards if no providers are chosen Signed-off-by: Florian Steffens --- src/modules/modals/EditColumn.vue | 9 ++-- .../forms/DatetimeDateForm.vue | 4 ++ .../columnTypePartials/forms/DatetimeForm.vue | 4 ++ .../forms/DatetimeTimeForm.vue | 4 ++ .../columnTypePartials/forms/NumberForm.vue | 4 ++ .../forms/NumberProgressForm.vue | 4 ++ .../forms/NumberStarsForm.vue | 4 ++ .../forms/SelectionCheckForm.vue | 4 ++ .../forms/SelectionForm.vue | 4 ++ .../forms/SelectionMultiForm.vue | 4 ++ .../columnTypePartials/forms/TextLineForm.vue | 4 ++ .../columnTypePartials/forms/TextLinkForm.vue | 29 ++++++++++-- .../columnTypePartials/forms/TextLongForm.vue | 4 ++ .../columnTypePartials/forms/TextRichForm.vue | 4 ++ .../partials/rowTypePartials/TextLinkForm.vue | 44 ++++++++++++------- 15 files changed, 108 insertions(+), 22 deletions(-) diff --git a/src/modules/modals/EditColumn.vue b/src/modules/modals/EditColumn.vue index b05e0a6aa..8b1348f46 100644 --- a/src/modules/modals/EditColumn.vue +++ b/src/modules/modals/EditColumn.vue @@ -18,7 +18,7 @@ :title-missing-error="editErrorTitle" />
- +
@@ -36,7 +36,7 @@ {{ t('tables', 'Cancel') }}
- + {{ t('tables', 'Save') }} @@ -108,9 +108,10 @@ export default { data() { return { loading: false, - editColumn: structuredClone(this.column), + editColumn: Object.assign({}, this.column), deleteId: null, editErrorTitle: false, + canSave: true, // avoid to save an incorrect config } }, computed: { @@ -165,7 +166,7 @@ export default { this.editErrorTitle = false }, async updateColumn() { - const data = { ...this.editColumn } + const data = Object.assign({}, this.editColumn) if ((this.column.type === ColumnTypes.SelectionMulti || this.column.type === ColumnTypes.SelectionCheck) && data.selectionDefault !== null) data.selectionDefault = JSON.stringify(data.selectionDefault) delete data.type delete data.id diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeDateForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeDateForm.vue index 974e5a75a..5d294db43 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeDateForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeDateForm.vue @@ -26,6 +26,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { return { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeForm.vue index 22cafa3b8..e206aa08e 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeForm.vue @@ -23,6 +23,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { return { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeTimeForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeTimeForm.vue index 686f33496..fbbef57b5 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeTimeForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/DatetimeTimeForm.vue @@ -23,6 +23,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { return { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberForm.vue index af59e2a60..d27a11bbb 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberForm.vue @@ -75,6 +75,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { return { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberProgressForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberProgressForm.vue index 696030e32..aab7a952d 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberProgressForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberProgressForm.vue @@ -26,6 +26,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { return { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberStarsForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberStarsForm.vue index 4c9d211d6..3c9efea6b 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberStarsForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/NumberStarsForm.vue @@ -44,6 +44,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { return { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionCheckForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionCheckForm.vue index 0a15aed6a..1de8b3eac 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionCheckForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionCheckForm.vue @@ -26,6 +26,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { return { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionForm.vue index 5cb75da72..f1d6a060a 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionForm.vue @@ -41,6 +41,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { return { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionMultiForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionMultiForm.vue index 0266cb076..f1d8f9cff 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionMultiForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/SelectionMultiForm.vue @@ -40,6 +40,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { return { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/TextLineForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/TextLineForm.vue index a7c98f8e4..8327bf02b 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/TextLineForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/TextLineForm.vue @@ -48,6 +48,10 @@ export default { type: Object, default: null, }, + canSave: { + type: Boolean, + default: true, + }, }, data() { diff --git a/src/shared/components/ncTable/partials/columnTypePartials/forms/TextLinkForm.vue b/src/shared/components/ncTable/partials/columnTypePartials/forms/TextLinkForm.vue index a6dedc34a..1c74af956 100644 --- a/src/shared/components/ncTable/partials/columnTypePartials/forms/TextLinkForm.vue +++ b/src/shared/components/ncTable/partials/columnTypePartials/forms/TextLinkForm.vue @@ -7,6 +7,11 @@
{{ t('tables', 'Allowed types') }}
+
+ + {{ t('tables', 'Please select at least one provider.') }} + +
{{ provider.label }} @@ -20,7 +25,7 @@