From bcef7579bcc9098ee9922d25e7d1d29ae652ce12 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 14 Sep 2022 00:02:47 +0200 Subject: [PATCH 01/82] feat(nc-gui): add survey mode option to share view --- .../smartsheet/toolbar/ShareView.vue | 71 ++++++++++++------- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue index 3e76ccd682..c9c1dd01ad 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue @@ -33,6 +33,8 @@ let showShareModel = $ref(false) const passwordProtected = ref(false) +const surveyMode = ref(false) + const shared = ref() const allowCSVDownload = computed({ @@ -47,17 +49,21 @@ const allowCSVDownload = computed({ }) const genShareLink = async () => { - shared.value = await $api.dbViewShare.create(view.value?.id as string) + if (!view.value.id) return + + shared.value = await $api.dbViewShare.create(view.value?.id) shared.value.meta = shared.value.meta && typeof shared.value.meta === 'string' ? JSON.parse(shared.value.meta) : shared.value.meta + passwordProtected.value = shared.value.password !== null && shared.value.password !== '' + showShareModel = true } const sharedViewUrl = computed(() => { if (!shared.value) return - let viewType + let viewType switch (shared.value.type) { case ViewTypes.FORM: viewType = 'form' @@ -69,7 +75,7 @@ const sharedViewUrl = computed(() => { viewType = 'view' } - return `${dashboardUrl?.value}#/nc/${viewType}/${shared.value.uuid}` + return `${dashboardUrl?.value}#/nc/${viewType}/${shared.value.uuid}${surveyMode.value ? '?survey=1' : ''}` }) async function saveAllowCSVDownload() { @@ -105,9 +111,12 @@ const saveShareLinkPassword = async () => { } const copyLink = () => { - copy(sharedViewUrl?.value as string) - // Copied to clipboard - message.success(t('msg.info.copiedToClipboard')) + if (sharedViewUrl.value) { + copy(sharedViewUrl.value) + + // Copied to clipboard + message.success(t('msg.info.copiedToClipboard')) + } } watch(passwordProtected, (value) => { @@ -154,28 +163,36 @@ watch(passwordProtected, (value) => { -
- {{ $t('msg.info.beforeEnablePwd') }} - -
- - - - {{ $t('placeholder.password.save') }} - +
+
+ + Use Survey Mode +
+ +
+ + {{ $t('msg.info.beforeEnablePwd') }} +
+ + + + + {{ $t('placeholder.password.save') }} + +
+
+ +
+ + + {{ $t('labels.downloadAllowed') }} +
-
-
- - - {{ $t('labels.downloadAllowed') }} -
From 0f1668f082df558adb6afc47c91d01908ed71a78 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 14 Sep 2022 00:03:53 +0200 Subject: [PATCH 02/82] feat(nc-gui): add survey dir --- packages/nc-gui/components/shared-view/survey/index.vue | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/nc-gui/components/shared-view/survey/index.vue diff --git a/packages/nc-gui/components/shared-view/survey/index.vue b/packages/nc-gui/components/shared-view/survey/index.vue new file mode 100644 index 0000000000..4246b4dfdd --- /dev/null +++ b/packages/nc-gui/components/shared-view/survey/index.vue @@ -0,0 +1,7 @@ + + + From f3298470502995bfaebbf1179baa07e3b5d814c3 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 15 Sep 2022 01:10:23 +0200 Subject: [PATCH 03/82] chore(nc-gui): show survey mode checkbox for form type --- packages/nc-gui/components/smartsheet/toolbar/ShareView.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue index c9c1dd01ad..8778499003 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue @@ -166,7 +166,9 @@ watch(passwordProtected, (value) => {
- Use Survey Mode + + Use Survey Mode +
From a8d86acca60a8c102970e37515c29167c0c9d2e0 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 15 Sep 2022 10:39:16 +0200 Subject: [PATCH 04/82] chore(nc-gui): remove icon imports --- packages/nc-gui/components/smartsheet/toolbar/ShareView.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue index 8778499003..de7fd8ba23 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue @@ -49,9 +49,9 @@ const allowCSVDownload = computed({ }) const genShareLink = async () => { - if (!view.value.id) return + if (!view.value?.id) return - shared.value = await $api.dbViewShare.create(view.value?.id) + shared.value = await $api.dbViewShare.create(view.value.id) shared.value.meta = shared.value.meta && typeof shared.value.meta === 'string' ? JSON.parse(shared.value.meta) : shared.value.meta @@ -75,7 +75,7 @@ const sharedViewUrl = computed(() => { viewType = 'view' } - return `${dashboardUrl?.value}#/nc/${viewType}/${shared.value.uuid}${surveyMode.value ? '?survey=1' : ''}` + return `${dashboardUrl?.value}#/nc/${surveyMode.value ? 'survey' : ''}${viewType}/${shared.value.uuid}` }) async function saveAllowCSVDownload() { From 89f5b188782a0738bec547966525255bde4cb869 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 15 Sep 2022 11:16:50 +0200 Subject: [PATCH 05/82] chore(nc-gui): use path segment for survey mode --- 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 de7fd8ba23..d1e6a4522a 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/ShareView.vue @@ -75,7 +75,7 @@ const sharedViewUrl = computed(() => { viewType = 'view' } - return `${dashboardUrl?.value}#/nc/${surveyMode.value ? 'survey' : ''}${viewType}/${shared.value.uuid}` + return `${dashboardUrl?.value}#/nc/${viewType}/${shared.value.uuid}${surveyMode.value ? '/survey' : ''}` }) async function saveAllowCSVDownload() { From 1f490bde0a69444060bd575137bc9ccd6e36879d Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 15 Sep 2022 11:17:01 +0200 Subject: [PATCH 06/82] feat(nc-gui): add survey form pages --- .../[projectType]/form/[viewId]/index.vue | 191 ++++-------------- .../form/[viewId]/index/index.vue | 121 +++++++++++ .../form/[viewId]/index/survey.vue | 0 3 files changed, 164 insertions(+), 148 deletions(-) create mode 100644 packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue create mode 100644 packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue index 10003bdaf4..618425aae5 100644 --- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue +++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue @@ -1,159 +1,36 @@ @@ -162,5 +39,23 @@ function isRequired(_columnObj: Record, required = false) { .nc-input { @apply w-full rounded p-2 min-h-[40px] flex items-center border-solid border-1 border-primary; } + + .submit { + @apply z-1 relative color-transition rounded p-3 text-white shadow-sm; + + &::after { + @apply rounded absolute top-0 left-0 right-0 bottom-0 transition-all duration-150 ease-in-out bg-primary; + content: ''; + z-index: -1; + } + + &:hover::after { + @apply transform scale-110 ring ring-accent; + } + + &:active::after { + @apply ring ring-accent; + } + } } diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue new file mode 100644 index 0000000000..457e1e5178 --- /dev/null +++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue @@ -0,0 +1,121 @@ + + + diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue new file mode 100644 index 0000000000..e69de29bb2 From 415dd78de68eb3b2875b1c6065292f97a8e01c0a Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 15 Sep 2022 13:23:41 +0200 Subject: [PATCH 07/82] chore(nc-gui): update form view styles --- packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue | 2 +- .../nc-gui/pages/[projectType]/form/[viewId]/index/index.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue index 618425aae5..484f52de42 100644 --- a/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue +++ b/packages/nc-gui/pages/[projectType]/form/[viewId]/index.vue @@ -5,7 +5,7 @@ const { passwordDlg, password, loadSharedView } = useSharedFormStoreOrThrow()