From 756040d7a650060fc5f2b3a493114f2c6bac50ef Mon Sep 17 00:00:00 2001 From: Jos Warmer Date: Thu, 28 Nov 2024 13:55:52 +0100 Subject: [PATCH] Make decision for using text references or controls earlier. --- .../core/src/editor/simplifiedBoxAPI/BoxUtil.ts | 6 ++---- .../box-util-helpers/UtilRefHelpers.ts | 14 +------------- .../templates/boxproviderhelpers/ItemBoxHelper.ts | 6 ++---- .../boxproviderhelpers/LimitedBoxHelper.ts | 3 +-- .../boxproviderhelpers/ListPropertyBoxHelper.ts | 7 +++---- 5 files changed, 9 insertions(+), 27 deletions(-) diff --git a/packages/core/src/editor/simplifiedBoxAPI/BoxUtil.ts b/packages/core/src/editor/simplifiedBoxAPI/BoxUtil.ts index 5ccd0e357..0a9065601 100644 --- a/packages/core/src/editor/simplifiedBoxAPI/BoxUtil.ts +++ b/packages/core/src/editor/simplifiedBoxAPI/BoxUtil.ts @@ -291,11 +291,10 @@ export class BoxUtil { node: FreNode, propertyName: string, scoper: FreScoper, - isLimited: boolean, listInfo?: FreListInfo, initializer?: Partial, ): VerticalListBox { - return UtilRefHelpers.verticalReferenceListBox(node, propertyName, scoper, isLimited, listInfo, initializer); + return UtilRefHelpers.verticalReferenceListBox(node, propertyName, scoper, listInfo, initializer); } /** @@ -315,11 +314,10 @@ export class BoxUtil { node: FreNode, propertyName: string, scoper: FreScoper, - isLimited: boolean, listJoin?: FreListInfo, initializer?: Partial, ): HorizontalListBox { - return UtilRefHelpers.horizontalReferenceListBox(node, propertyName, scoper, isLimited, listJoin, initializer); + return UtilRefHelpers.horizontalReferenceListBox(node, propertyName, scoper, listJoin, initializer); } diff --git a/packages/core/src/editor/simplifiedBoxAPI/box-util-helpers/UtilRefHelpers.ts b/packages/core/src/editor/simplifiedBoxAPI/box-util-helpers/UtilRefHelpers.ts index fe0bc3238..808ca709f 100644 --- a/packages/core/src/editor/simplifiedBoxAPI/box-util-helpers/UtilRefHelpers.ts +++ b/packages/core/src/editor/simplifiedBoxAPI/box-util-helpers/UtilRefHelpers.ts @@ -5,7 +5,6 @@ import { BoxFactory, ExternalRefListBox, HorizontalListBox, - LimitedDisplay, ReferenceBox, SelectOption, VerticalListBox, @@ -93,7 +92,6 @@ export class UtilRefHelpers { node: FreNode, propertyName: string, scoper: FreScoper, - isLimited: boolean, listInfo?: FreListInfo, initializer?: Partial, ): VerticalListBox { @@ -106,7 +104,6 @@ export class UtilRefHelpers { node, property as FreNodeReference[], propertyName, - isLimited, scoper, listInfo, ); @@ -131,7 +128,6 @@ export class UtilRefHelpers { node: FreNode, propertyName: string, scoper: FreScoper, - isLimited: boolean, listJoin?: FreListInfo, initializer?: Partial, ): HorizontalListBox { @@ -145,7 +141,6 @@ export class UtilRefHelpers { node, property as FreNodeReference[], propertyName, - isLimited, scoper, listJoin, ); @@ -187,7 +182,6 @@ export class UtilRefHelpers { node, property as FreNodeReference[], propertyName, - false, scoper, ); // determine the role @@ -230,7 +224,6 @@ export class UtilRefHelpers { element: FreNode, properties: FreNodeReference[], propertyName: string, - asSelect: boolean, scoper: FreScoper, listJoin?: FreListInfo, ): Box[] { @@ -247,12 +240,7 @@ export class UtilRefHelpers { listElem.name = selected; return BehaviorExecutionResult.EXECUTED; }; - let innerBox: Box; - if (asSelect) { - innerBox = BoxUtil.limitedBox(element, propertyName, setFunc, LimitedDisplay.SELECT, scoper, index); - } else { - innerBox = BoxUtil.referenceBox(element, propertyName, setFunc, scoper, index); - } + let innerBox = BoxUtil.referenceBox(element, propertyName, setFunc, scoper, index); if (listJoin !== null && listJoin !== undefined) { result.push(...UtilCommon.addListJoin(listJoin, index, numberOfItems, element, roleName, propertyName, innerBox)); } else { diff --git a/packages/meta/src/editordef/generator/templates/boxproviderhelpers/ItemBoxHelper.ts b/packages/meta/src/editordef/generator/templates/boxproviderhelpers/ItemBoxHelper.ts index 8e20cfcbe..2add4f393 100644 --- a/packages/meta/src/editordef/generator/templates/boxproviderhelpers/ItemBoxHelper.ts +++ b/packages/meta/src/editordef/generator/templates/boxproviderhelpers/ItemBoxHelper.ts @@ -196,8 +196,7 @@ export class ItemBoxHelper { language, item.listInfo, property, - elementVarName, - false + elementVarName ); } else if (!!item.listInfo) { // if there is information on how to project the property as a list, make it a list @@ -205,8 +204,7 @@ export class ItemBoxHelper { language, item.listInfo, property, - elementVarName, - false + elementVarName ); } if (!!item.externalInfo) { diff --git a/packages/meta/src/editordef/generator/templates/boxproviderhelpers/LimitedBoxHelper.ts b/packages/meta/src/editordef/generator/templates/boxproviderhelpers/LimitedBoxHelper.ts index 075c95914..cc6f9bff1 100644 --- a/packages/meta/src/editordef/generator/templates/boxproviderhelpers/LimitedBoxHelper.ts +++ b/packages/meta/src/editordef/generator/templates/boxproviderhelpers/LimitedBoxHelper.ts @@ -59,8 +59,7 @@ export class LimitedBoxHelper { language, listInfo, property, - elementVarName, - true + elementVarName ); } } diff --git a/packages/meta/src/editordef/generator/templates/boxproviderhelpers/ListPropertyBoxHelper.ts b/packages/meta/src/editordef/generator/templates/boxproviderhelpers/ListPropertyBoxHelper.ts index 00164e08b..2cc591e55 100644 --- a/packages/meta/src/editordef/generator/templates/boxproviderhelpers/ListPropertyBoxHelper.ts +++ b/packages/meta/src/editordef/generator/templates/boxproviderhelpers/ListPropertyBoxHelper.ts @@ -19,16 +19,15 @@ export class ListPropertyBoxHelper { language: FreMetaLanguage, listJoin: FreEditListInfo, reference: FreMetaConceptProperty, - element: string, - isLimited: boolean + element: string ): string { ListUtil.addIfNotPresent(this._myTemplate.coreImports, "BoxUtil"); ListUtil.addIfNotPresent(this._myTemplate.configImports, Names.environment(language)); const joinEntry = this.getJoinEntry(listJoin); if (listJoin.direction === FreEditProjectionDirection.Vertical) { - return `BoxUtil.verticalReferenceListBox(${element}, "${reference.name}", ${Names.environment(language)}.getInstance().scoper, ${isLimited}, ${joinEntry})`; + return `BoxUtil.verticalReferenceListBox(${element}, "${reference.name}", ${Names.environment(language)}.getInstance().scoper, ${joinEntry})`; } // else - return `BoxUtil.horizontalReferenceListBox(${element}, "${reference.name}", ${Names.environment(language)}.getInstance().scoper, ${isLimited}, ${joinEntry})`; + return `BoxUtil.horizontalReferenceListBox(${element}, "${reference.name}", ${Names.environment(language)}.getInstance().scoper, ${joinEntry})`; } public getJoinEntry(listJoin: FreEditListInfo): string {