From 6008273118eeeeef559179b41e6c31ef3bfe8b19 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:38:21 +0000 Subject: [PATCH 1/5] fix(test): enable form conditional field test cases in oss --- tests/playwright/tests/db/views/viewForm.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/playwright/tests/db/views/viewForm.spec.ts b/tests/playwright/tests/db/views/viewForm.spec.ts index 57ffe57a2b..c7ef227c52 100644 --- a/tests/playwright/tests/db/views/viewForm.spec.ts +++ b/tests/playwright/tests/db/views/viewForm.spec.ts @@ -1436,7 +1436,7 @@ test.describe('Form view: field validation', () => { }); test.describe('Form view: conditional fields', () => { - if (enableQuickRun() || !isEE()) test.skip(); + if (enableQuickRun()) test.skip(); let dashboard: DashboardPage; let form: FormPage; From 640cea9b7d6675c328b3cc60377c08f336470ad5 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:38:21 +0000 Subject: [PATCH 2/5] fix(nc-gui): enable conditional fields in oss frontend changes --- .../smartsheet/form/field-config-error.vue | 38 +- .../form/field-settings/visibility.vue | 124 +++++- .../nc-gui/composables/useFormViewStore.ts | 45 +- packages/nc-gui/lib/form.ts | 421 +++++++++++++++++- 4 files changed, 602 insertions(+), 26 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/form/field-config-error.vue b/packages/nc-gui/components/smartsheet/form/field-config-error.vue index cea98ebc8c..b4dcc896d6 100644 --- a/packages/nc-gui/components/smartsheet/form/field-config-error.vue +++ b/packages/nc-gui/components/smartsheet/form/field-config-error.vue @@ -5,7 +5,41 @@ interface Props { column: ColumnType mode: 'preview' | 'list' } -defineProps() +const props = defineProps() + +const { column, mode } = toRefs(props) + +const visibilityError = computed(() => { + return parseProp(column.value?.meta)?.visibility?.errors || {} +}) + +const firstErrorMsg = computed(() => { + const visibilityErr = Object.values(visibilityError.value ?? []) + if (visibilityErr.length) { + return visibilityErr[0] + } +}) - + diff --git a/packages/nc-gui/components/smartsheet/form/field-settings/visibility.vue b/packages/nc-gui/components/smartsheet/form/field-settings/visibility.vue index 41d0bd451a..c162f83e93 100644 --- a/packages/nc-gui/components/smartsheet/form/field-settings/visibility.vue +++ b/packages/nc-gui/components/smartsheet/form/field-settings/visibility.vue @@ -1,7 +1,46 @@