From ca57d58ba9b152c75456b486bb4ca5a3662818bc Mon Sep 17 00:00:00 2001 From: mertmit Date: Sat, 6 Jan 2024 08:47:49 +0000 Subject: [PATCH] fix: hide CreatedBy & LastModifiedBy system fields from dropdowns --- .../smartsheet/column/FormulaOptions.vue | 14 +++++++++++++- .../toolbar/FieldListAutoCompleteDropdown.vue | 17 +++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/column/FormulaOptions.vue b/packages/nc-gui/components/smartsheet/column/FormulaOptions.vue index bb9191caf2..d4e3531d27 100644 --- a/packages/nc-gui/components/smartsheet/column/FormulaOptions.vue +++ b/packages/nc-gui/components/smartsheet/column/FormulaOptions.vue @@ -5,6 +5,7 @@ import jsep from 'jsep' import { FormulaError, UITypes, + isCreatedOrLastModifiedByCol, jsepCurlyHook, substituteColumnIdWithAliasInFormula, validateFormulaAndExtractTreeWithType, @@ -51,7 +52,18 @@ const { predictFunction: _predictFunction } = useNocoEe() const meta = inject(MetaInj, ref()) const supportedColumns = computed( - () => meta?.value?.columns?.filter((col) => !uiTypesNotSupportedInFormulas.includes(col.uidt as UITypes)) || [], + () => + meta?.value?.columns?.filter((col) => { + if (uiTypesNotSupportedInFormulas.includes(col.uidt as UITypes)) { + return false + } + + if (isCreatedOrLastModifiedByCol(col) && col.system) { + return false + } + + return true + }) || [], ) const { getMeta } = useMetas() diff --git a/packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue b/packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue index 289e914e5a..d4945263d0 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue @@ -1,7 +1,7 @@