From e83c6c7638400e35a6e761a50e7b560fc683a283 Mon Sep 17 00:00:00 2001 From: Tomas Kikutis Date: Tue, 17 Dec 2024 13:50:22 +0100 Subject: [PATCH] clarify functionality on unimplemented fields --- .../planning-editor-standalone/profile-fields.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/client/components/planning-editor-standalone/profile-fields.ts b/client/components/planning-editor-standalone/profile-fields.ts index ed6a9afea..b1271c6a9 100644 --- a/client/components/planning-editor-standalone/profile-fields.ts +++ b/client/components/planning-editor-standalone/profile-fields.ts @@ -14,11 +14,12 @@ interface ICustomVocabularyField extends IBaseField<'custom_vocabulary'> { type IFieldConverted = IBaseField<'normal'> | ICustomVocabularyField; /** - * Fields that don't have a planning profile schema + * Fields that might exist in the planning profile (database) + * but aren't mapped to work in a standalone editor. */ -const FIELDS_TO_FILTER = [ +const unimplementedFields = new Set([ 'associated_event', -]; +]); /** * A function that handles planning profile field types so they can be used in authoring react. @@ -26,8 +27,9 @@ const FIELDS_TO_FILTER = [ export const getPlanningProfileFields = (): Array => { const planningProfile = planningApi.contentProfiles.get('planning'); const planningGroups = getEditorFormGroupsFromProfile(planningProfile); - const planningFieldIds = Object.values(planningGroups).flatMap((x) => x.fields) - .filter((x) => !FIELDS_TO_FILTER.includes(x)); + const planningFieldIds = Object.values(planningGroups) + .flatMap((x) => x.fields) + .filter((x) => !unimplementedFields.has(x)); const convertedFieldIds: Array = []; for (const fieldId of planningFieldIds) {