From 8e9b9701d04812b6da631b068180428f58d49ffe Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:37:15 +0000 Subject: [PATCH 01/17] fix(nc-gui): disable fields edit if its readonly --- packages/nc-gui/components/cell/Decimal.vue | 12 ++++++++---- packages/nc-gui/components/cell/Integer.vue | 12 ++++++++---- packages/nc-gui/components/cell/Json.vue | 4 ++-- packages/nc-gui/components/cell/Percent.vue | 17 +++++++++++------ packages/nc-gui/components/cell/Rating.vue | 5 +++-- packages/nc-gui/components/cell/Text.vue | 16 ++++++++++++---- .../virtual-cell/components/ListChildItems.vue | 10 +++++----- .../virtual-cell/components/ListItem.vue | 11 ++++++----- 8 files changed, 55 insertions(+), 32 deletions(-) diff --git a/packages/nc-gui/components/cell/Decimal.vue b/packages/nc-gui/components/cell/Decimal.vue index 9e02452f04..9cfba6bb87 100644 --- a/packages/nc-gui/components/cell/Decimal.vue +++ b/packages/nc-gui/components/cell/Decimal.vue @@ -1,6 +1,6 @@ From aa42962eb20fc9a7db4fbbd4f2a1dbd2673d45d2 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:37:16 +0000 Subject: [PATCH 06/17] fix(nc-gui): show appropriate validation error for create column name input --- packages/nc-gui/composables/useColumnCreateStore.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/nc-gui/composables/useColumnCreateStore.ts b/packages/nc-gui/composables/useColumnCreateStore.ts index d68a1cea0b..144edcf59f 100644 --- a/packages/nc-gui/composables/useColumnCreateStore.ts +++ b/packages/nc-gui/composables/useColumnCreateStore.ts @@ -114,6 +114,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState validator: (rule: any, value: any) => { return new Promise((resolve, reject) => { if ( + value !== '' && (tableExplorerColumns?.value || meta.value?.columns)?.some( (c) => c.id !== formState.value.id && // ignore current column @@ -126,6 +127,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState return reject(new Error(t('msg.error.duplicateSystemColumnName'))) } if ( + value !== '' && (tableExplorerColumns?.value || meta.value?.columns)?.some( (c) => c.id !== formState.value.id && // ignore current column From b88ce8e0066f2294a1739ac1eb1d5204f3efc495 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:37:16 +0000 Subject: [PATCH 07/17] fix(nc-gui): maintain a consistent border-radius for all fields in the CreateOrUpdate Column modal --- .../nc-gui/components/smartsheet/column/EditOrAdd.vue | 8 ++++---- .../nc-gui/components/smartsheet/column/LinkOptions.vue | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue b/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue index 2fdc6c66a4..213205ed9c 100644 --- a/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue +++ b/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue @@ -260,7 +260,7 @@ if (props.fromTableExplorer) {
@@ -297,7 +297,7 @@ if (props.fromTableExplorer) { .nc-column-type-input { .ant-select-selector { - @apply !rounded; + @apply !rounded-md; } } diff --git a/packages/nc-gui/components/smartsheet/column/LinkOptions.vue b/packages/nc-gui/components/smartsheet/column/LinkOptions.vue index 513dec3ba0..cd11d46984 100644 --- a/packages/nc-gui/components/smartsheet/column/LinkOptions.vue +++ b/packages/nc-gui/components/smartsheet/column/LinkOptions.vue @@ -52,13 +52,13 @@ vModel.value.meta = { - + - + From b134ffe21ed15b5c0a25d79ee5cde22fa125725a Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:37:16 +0000 Subject: [PATCH 08/17] fix(nc-gui): lint errors --- packages/nc-gui/components/cell/Checkbox.vue | 3 +-- packages/nc-gui/components/cell/Currency.vue | 2 +- packages/nc-gui/components/cell/Decimal.vue | 2 +- packages/nc-gui/components/cell/Duration.vue | 2 +- packages/nc-gui/components/cell/Email.vue | 2 +- packages/nc-gui/components/cell/Integer.vue | 2 +- packages/nc-gui/components/cell/Json.vue | 2 +- packages/nc-gui/components/cell/Percent.vue | 2 +- packages/nc-gui/components/cell/Rating.vue | 2 +- packages/nc-gui/components/cell/RichText.vue | 2 +- packages/nc-gui/components/cell/Url.vue | 2 +- .../components/smartsheet/column/LinkOptions.vue | 12 ++++++++++-- .../nc-gui/components/virtual-cell/BelongsTo.vue | 2 +- packages/nc-gui/components/virtual-cell/Lookup.vue | 2 +- packages/nc-gui/components/virtual-cell/Rollup.vue | 4 ++-- .../components/virtual-cell/components/ListItem.vue | 2 +- 16 files changed, 26 insertions(+), 19 deletions(-) diff --git a/packages/nc-gui/components/cell/Checkbox.vue b/packages/nc-gui/components/cell/Checkbox.vue index c6bfecc871..38bc569923 100644 --- a/packages/nc-gui/components/cell/Checkbox.vue +++ b/packages/nc-gui/components/cell/Checkbox.vue @@ -96,10 +96,9 @@ useSelectedCellKeyupListener(active, (e) => { height: isForm || isExpandedFormOpen || isGallery || isEditColumnMenu ? undefined : `max(${(rowHeight || 1) * 1.8}rem, 41px)`, }" - tabindex="0" + :tabindex="readOnly ? -1 : 0" @click="onClick(false, $event)" @keydown.enter.stop="onClick(true, $event)" - :tabindex="readOnly ? -1 : 0" >
import type { VNodeRef } from '@vue/runtime-core' -import { EditColumnInj, EditModeInj, IsExpandedFormOpenInj, IsFormInj, inject, useVModel, ReadonlyInj } from '#imports' +import { EditColumnInj, EditModeInj, IsExpandedFormOpenInj, IsFormInj, ReadonlyInj, inject, useVModel } from '#imports' interface Props { // when we set a number, then it is number type diff --git a/packages/nc-gui/components/cell/Duration.vue b/packages/nc-gui/components/cell/Duration.vue index f1facc875d..8805b09031 100644 --- a/packages/nc-gui/components/cell/Duration.vue +++ b/packages/nc-gui/components/cell/Duration.vue @@ -6,6 +6,7 @@ import { EditModeInj, IsExpandedFormOpenInj, IsFormInj, + ReadonlyInj, computed, convertDurationToSeconds, convertMS2Duration, @@ -13,7 +14,6 @@ import { inject, parseProp, ref, - ReadonlyInj, } from '#imports' interface Props { diff --git a/packages/nc-gui/components/cell/Email.vue b/packages/nc-gui/components/cell/Email.vue index b6b4b82bed..065557e818 100644 --- a/packages/nc-gui/components/cell/Email.vue +++ b/packages/nc-gui/components/cell/Email.vue @@ -6,11 +6,11 @@ import { IsExpandedFormOpenInj, IsFormInj, IsSurveyFormInj, + ReadonlyInj, computed, inject, useI18n, validateEmail, - ReadonlyInj, } from '#imports' interface Props { diff --git a/packages/nc-gui/components/cell/Integer.vue b/packages/nc-gui/components/cell/Integer.vue index 4e042280dd..c9867a1073 100644 --- a/packages/nc-gui/components/cell/Integer.vue +++ b/packages/nc-gui/components/cell/Integer.vue @@ -1,6 +1,6 @@