From a0031925c7f75767505946d0e6c2b6c133f2ca50 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Thu, 22 Feb 2024 16:16:34 +0000 Subject: [PATCH] feat(nc-gui): form theme color --- .../nc-gui/components/smartsheet/Form.vue | 304 +++++++++++------- 1 file changed, 180 insertions(+), 124 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue index 2ca13202a5..4c000bafd4 100644 --- a/packages/nc-gui/components/smartsheet/Form.vue +++ b/packages/nc-gui/components/smartsheet/Form.vue @@ -28,6 +28,7 @@ import { useViewColumnsOrThrow, useViewData, watch, + parseProp, } from '#imports' provide(IsFormInj, ref(true)) @@ -57,6 +58,8 @@ const { $api, $e } = useNuxtApp() const { isUIAllowed } = useRoles() +const { appInfo } = useGlobal() + const formState = reactive({}) const secondsRemain = ref(0) @@ -213,10 +216,10 @@ function onMove(event: any, isVisibleFormFields = false) { $e('a:form-view:reorder') } -function showOrHideColumn(column: Record, show: boolean) { +function showOrHideColumn(column: Record, show: boolean, isSidePannel = false) { if (shouldSkipColumn(column)) { // Required field can't be moved - message.info(t('msg.info.requriedFieldsCantBeMoved')) + !isSidePannel && message.info(t('msg.info.requriedFieldsCantBeMoved')) return } @@ -226,7 +229,7 @@ function showOrHideColumn(column: Record, show: boolean) { saveOrUpdate( { ...column, - show: show, + show, }, fieldIndex, ) @@ -288,6 +291,11 @@ function setFormData() { ...formViewData.value, submit_another_form: !!(formViewData.value?.submit_another_form ?? 0), show_blank_form: !!(formViewData.value?.show_blank_form ?? 0), + meta: { + hide_branding: false, + theme_color: '#F9F9FA', + ...(parseProp(formViewData.value?.meta) ?? {}), + }, } // email me @@ -443,9 +451,21 @@ const onFormItemClick = (element: any) => { - +
+
{ - - - -
- - NocoDB -
NocoDB Forms
-
+
- +
@@ -803,7 +824,7 @@ const onFormItemClick = (element: any) => { v-model:value="searchQuery" data-testid="nc-form-field-search-input" class="!h-9 !px-3 !py-1 !rounded-lg" - :placeholder="$t('placeholder.searchFields') + '...'" + :placeholder="`${$t('placeholder.searchFields')}...`" >