From d10f87810ed7f6ba549ffb6012bbc7b178995f40 Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Fri, 14 Oct 2022 23:58:18 +0200
Subject: [PATCH 1/7] fix(nc-gui): dark mode styles for longtext field in form
view
---
.../[projectType]/form/[viewId]/index.vue | 53 ++++++++++++-------
1 file changed, 34 insertions(+), 19 deletions(-)
diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
index a9acad9f97..05dfc72bfa 100644
--- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
+++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
@@ -1,39 +1,39 @@
@@ -69,6 +69,8 @@ p {
.nc-form-view {
.nc-cell {
+ @apply bg-white dark:bg-slate-500;
+
&.nc-cell-checkbox {
@apply color-transition !border-0;
@@ -92,6 +94,7 @@ p {
@apply w-full rounded p-2 min-h-[40px] flex items-center border-solid border-1 border-gray-300 dark:border-slate-200;
input,
+ textarea,
&.nc-virtual-cell,
> div {
@apply bg-white dark:(bg-slate-500 text-white);
@@ -104,12 +107,24 @@ p {
@apply dark:(bg-slate-700 text-white);
}
}
- }
- .nc-attachment-cell > div {
- @apply dark:(bg-slate-100);
+ &.nc-cell-longtext {
+ @apply !p-0 pb-2px pr-2px;
+ }
+
+ textarea {
+ @apply px-4 py-2 rounded;
+
+ &:focus {
+ box-shadow: none !important;
+ }
+ }
}
}
+
+ .nc-attachment-cell > div {
+ @apply dark:(bg-slate-100);
+ }
}
}
From 7744db0edcaa0e83f04431d867dec28a372a644b Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Mon, 17 Oct 2022 18:55:41 +0200
Subject: [PATCH 2/7] chore(nc-gui): lint
---
.../composables/useMultiSelect/index.ts | 2 +-
packages/nc-gui/composables/useViewData.ts | 3 +-
.../[projectType]/form/[viewId]/index.vue | 32 +++++++++----------
3 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts
index 91652a6cd0..23f634af3a 100644
--- a/packages/nc-gui/composables/useMultiSelect/index.ts
+++ b/packages/nc-gui/composables/useMultiSelect/index.ts
@@ -14,7 +14,7 @@ export function useMultiSelect(
fields: MaybeRef,
data: MaybeRef,
editEnabled: MaybeRef,
- isPkAvail: MaybeRef,
+ isPkAvail: MaybeRef,
clearCell: Function,
makeEditable: Function,
scrollToActiveCell?: (row?: number | null, col?: number | null) => void,
diff --git a/packages/nc-gui/composables/useViewData.ts b/packages/nc-gui/composables/useViewData.ts
index ae6508e1b5..98c60ef416 100644
--- a/packages/nc-gui/composables/useViewData.ts
+++ b/packages/nc-gui/composables/useViewData.ts
@@ -202,7 +202,6 @@ export function useViewData(
async function insertRow(
currentRow: Row,
- _rowIndex = formattedData.value?.length,
ltarState: Record = {},
{ metaValue = meta.value, viewMetaValue = viewMeta.value }: { metaValue?: TableType; viewMetaValue?: ViewType } = {},
) {
@@ -301,7 +300,7 @@ export function useViewData(
await until(() => !(row.rowMeta?.new && row.rowMeta?.saving)).toMatch((v) => v)
if (row.rowMeta.new) {
- return await insertRow(row, formattedData.value.indexOf(row), ltarState, args)
+ return await insertRow(row, ltarState, args)
} else {
await updateRowProperty(row, property!, args)
}
diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
index 05dfc72bfa..caf84a628e 100644
--- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
+++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
@@ -1,39 +1,39 @@
From d11cbde7f2b4d7afdc6707cd09faf14376369855 Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Tue, 25 Oct 2022 14:14:34 +0200
Subject: [PATCH 3/7] fix(nc-gui): disable submit if form was submitted
---
.../pages/[projectType]/form/[viewId]/index/survey.vue | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
index a2fd83afd4..474f645859 100644
--- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
+++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
@@ -159,6 +159,12 @@ function resetForm() {
goTo(steps.value[0])
}
+function submit() {
+ if (submitted.value) return
+
+ submitForm()
+}
+
onReset(resetForm)
onKeyStroke(['ArrowLeft', 'ArrowDown'], () => {
@@ -289,7 +295,7 @@ onMounted(() => {
type="submit"
class="uppercase scaling-btn prose-sm"
data-cy="nc-survey-form__btn-submit"
- @click="submitForm"
+ @click="submit"
>
{{ $t('general.submit') }}
From 17c30da02af9056f5953ab63bcb57723ff3f1098 Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Tue, 25 Oct 2022 14:25:47 +0200
Subject: [PATCH 4/7] fix(nc-gui): expand cell width for duration cells in form
view
---
.../nc-gui/pages/[projectType]/form/[viewId]/index.vue | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
index caf84a628e..94b30028a7 100644
--- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
+++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
@@ -93,6 +93,14 @@ p {
&.nc-input {
@apply w-full rounded p-2 min-h-[40px] flex items-center border-solid border-1 border-gray-300 dark:border-slate-200;
+ .duration-cell-wrapper {
+ @apply w-full;
+
+ input {
+ @apply !outline-none;
+ }
+ }
+
input,
textarea,
&.nc-virtual-cell,
From 4f5a4a6102a3586bd7f6ac5181cef8b986aae4fb Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Tue, 25 Oct 2022 14:28:31 +0200
Subject: [PATCH 5/7] chore(nc-gui): placeholder text color
---
packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
index 94b30028a7..22ff34cebc 100644
--- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
+++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
@@ -98,6 +98,10 @@ p {
input {
@apply !outline-none;
+
+ &::placeholder {
+ @apply text-gray-400 dark:text-slate-300;
+ }
}
}
From aef93008009bdccc1503bab7b48eeb3ab4fda2df Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Wed, 26 Oct 2022 08:43:46 +0200
Subject: [PATCH 6/7] fix(nc-gui): limit transition duration to 5s
---
packages/nc-gui/components/smartsheet/toolbar/ShareView.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue
index fd0878f974..3fd4cf1ee8 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue
@@ -43,7 +43,7 @@ const shared = ref({ id: '', meta: {}, password: undefined })
const transitionDuration = computed({
get: () => shared.value.meta.transitionDuration || 250,
set: (duration) => {
- shared.value.meta = { ...shared.value.meta, transitionDuration: duration }
+ shared.value.meta = { ...shared.value.meta, transitionDuration: duration > 5000 ? 5000 : duration }
},
})
From c0a9645d94cfdc347f3c71882b24194b1d9037a5 Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Wed, 26 Oct 2022 08:57:48 +0200
Subject: [PATCH 7/7] fix(nc-gui): replace submit
---
.../nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
index 474f645859..441cfd1ca9 100644
--- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
+++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
@@ -175,7 +175,7 @@ onKeyStroke(['ArrowRight', 'ArrowUp'], () => {
})
onKeyStroke(['Enter', 'Space'], () => {
if (isLast.value) {
- submitForm()
+ submit()
} else {
goNext(AnimationTarget.OkButton)
}