From de519ccfff2718133f098cbffd1bab80a8f52e62 Mon Sep 17 00:00:00 2001
From: braks <78412429+bcakmakoglu@users.noreply.github.com>
Date: Tue, 4 Oct 2022 17:07:39 +0200
Subject: [PATCH] refactor(nc-gui): form view styles
---
.../nc-gui/components/smartsheet/Form.vue | 103 +++++++++---------
.../[projectType]/form/[viewId]/index.vue | 10 +-
.../form/[viewId]/index/index.vue | 4 +-
.../form/[viewId]/index/survey.vue | 28 +++--
4 files changed, 71 insertions(+), 74 deletions(-)
diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue
index 8a69da9853..2892c67ead 100644
--- a/packages/nc-gui/components/smartsheet/Form.vue
+++ b/packages/nc-gui/components/smartsheet/Form.vue
@@ -555,6 +555,7 @@ watch(view, (nextView) => {
/>
+
{{ formViewData.subheading || '---' }}
{
:class="[
`nc-form-drag-${element.title.replaceAll(' ', '')}`,
{
- 'border-1': activeRow === element.title,
+ 'bg-primary bg-opacity-5 ring-0.5 ring-accent ring-opacity-100': activeRow === element.title,
},
]"
@click="activeRow = element.title"
@@ -584,62 +585,53 @@ watch(view, (nextView) => {
v-if="isUIAllowed('editFormView') && !isRequired(element, element.required)"
class="absolute flex top-2 right-2"
>
-
+
-
-
-
+
+
{
+ element.required = !element.required
+ updateColMeta(element)
+ }
+ "
>
-
-
{
- element.required = !element.required
- updateColMeta(element)
- }
- "
- >
- {{ $t('general.required') }}
-
-
-
-
-
+ {{ $t('general.required') }}
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
{
:required="isRequired(element, element.required)"
:hide-menu="true"
/>
+
{
{
{
/>
- {{ element.description }}
+ {{ element.description }}
@@ -700,7 +695,7 @@ watch(view, (nextView) => {
-
diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
index b1f5b50458..d5f27fa57e 100644
--- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
+++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue
@@ -27,15 +27,13 @@ const shouldRedirect = (to: string) => {
if (sharedViewMeta.value.surveyMode) {
if (!to.includes('survey')) navigateTo(`/nc/form/${route.params.viewId}/survey`)
} else {
- navigateTo(`/nc/form/${route.params.viewId}`)
+ if (to.includes('survey')) navigateTo(`/nc/form/${route.params.viewId}`)
}
}
shouldRedirect(route.name as string)
-router.afterEach((to) => {
- shouldRedirect(to.name as string)
-})
+router.afterEach((to) => shouldRedirect(to.name as string))
@@ -82,8 +80,8 @@ p {
> div {
@apply bg-white dark:(bg-slate-500 text-white);
- .nc-icon {
- @apply dark:text-slate-900;
+ .ant-btn {
+ @apply dark:(bg-slate-300);
}
.chip {
diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue
index 4ec20f3ded..6f2aa46a44 100644
--- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue
+++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue
@@ -21,7 +21,7 @@ function isRequired(_columnObj: Record, required = false) {
{{ sharedFormView.heading }}
@@ -109,7 +109,7 @@ function isRequired(_columnObj: Record, required = false) {
-
+
{{ $t('general.submit') }}
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 075d59489a..b2a90d89a2 100644
--- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
+++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
@@ -133,23 +133,25 @@ onKeyStroke(['ArrowRight', 'ArrowUp', 'Enter', 'Space'], goNext)
-
+
-
-
{{ sharedFormView.heading }}
+
+
+
{{ sharedFormView.heading }}
-
- {{ sharedFormView.subheading }}
-
+
+ {{ sharedFormView.subheading }}
+
+
-
+
@@ -190,7 +192,9 @@ onKeyStroke(['ArrowRight', 'ArrowUp', 'Enter', 'Space'], goNext)
{{ error.$message }}
- {{ field.description }}
+
+ {{ field.description }}
+
@@ -233,9 +237,9 @@ onKeyStroke(['ArrowRight', 'ArrowUp', 'Enter', 'Space'], goNext)
-
- {{ index + 1 }} / {{ formColumns?.length }}
-
+
+
+ {{ index + 1 }} / {{ formColumns?.length }}