From cf85fccb1559097353e364e55725253616a350f9 Mon Sep 17 00:00:00 2001 From: Nedelcho Delchev Date: Thu, 10 Sep 2026 17:26:13 +0300 Subject: [PATCH] templates: escape the authored field label into every Harmonia JS/Alpine interpolation (#7294) Same defect class as #7205/#7206/#7207: an authored string (this time the field `label:`, #6424) was interpolated verbatim into single-quoted JS string literals and Alpine T() call arguments across the Harmonia templates. `label: "Owner's copy"` closed the literal early - the report page's column list became a syntax error (blank page), and in the form/master/list/document views the apostrophe ended the T() fallback argument inside an Alpine x-text expression, throwing at evaluation and aborting the walk of the enclosing element. Resolve a `widgetLabelJs` (JsLiterals.escape(widgetLabel)) once in ModelParameterProcessor, the same way widgetPatternJs/dataDefaultValueJsLiteral already are, and route every JS-string/Alpine-expression interpolation of the label through it: the my/partner/main form and document views, the list/master/ report page+view templates, and the item-dialog's detail-register. Plain HTML text content (the report table header) is untouched - an apostrophe there is harmless. Verified: ide-template unit tests (JsLiteralsTest, ModelParameterProcessorTest, 143/143); a new IntentEngineIT test declaring an apostrophe-carrying label and asserting the escaped literal reaches the form, master page and item-dialog register (and never the raw apostrophe); the full IntentEngineIT class (78/78, no regressions); repo-wide `mvn formatter:validate` (BUILD SUCCESS). Fixes #7294 Co-Authored-By: Claude Sonnet 5 --- .../model/ModelParameterProcessor.java | 6 +++ .../ui/my/my-document-view.html.template | 10 ++-- .../ui/my/my-form-view.html.template | 10 ++-- .../ui/my/my-list-page.js.template | 2 +- .../partner-document-view.html.template | 10 ++-- .../partner/partner-form-view.html.template | 10 ++-- .../ui/partner/partner-list-page.js.template | 2 +- .../document/document-page.js.template | 2 +- .../document/document-view.html.template | 6 +-- .../ui/perspective/list/page.js.template | 2 +- .../ui/perspective/list/view.html.template | 2 +- .../perspective/manage/form-page.js.template | 2 +- .../manage/form-view.html.template | 4 +- .../perspective/manage/list-page.js.template | 2 +- .../manage/list-view.html.template | 2 +- .../master/detail-register.js.template | 4 +- .../master/master-page.js.template | 2 +- .../master/master-view.html.template | 2 +- .../perspective/report/chart-page.js.template | 2 +- .../perspective/report/table-page.js.template | 2 +- .../integration/tests/api/IntentEngineIT.java | 52 +++++++++++++++++++ 21 files changed, 97 insertions(+), 39 deletions(-) diff --git a/components/ide/ide-template/src/main/java/org/eclipse/dirigible/components/ide/template/service/model/ModelParameterProcessor.java b/components/ide/ide-template/src/main/java/org/eclipse/dirigible/components/ide/template/service/model/ModelParameterProcessor.java index 1270b1002e1..c1e31d77746 100644 --- a/components/ide/ide-template/src/main/java/org/eclipse/dirigible/components/ide/template/service/model/ModelParameterProcessor.java +++ b/components/ide/ide-template/src/main/java/org/eclipse/dirigible/components/ide/template/service/model/ModelParameterProcessor.java @@ -359,6 +359,12 @@ private static void processProperty(Map property, Map - #if($property.isRequiredProperty == "true") *#end + #if($property.isRequiredProperty == "true") *#end #end #if($property.widgetType == "DROPDOWN")
- +
@@ -71,7 +71,7 @@
- +
@@ -90,7 +90,7 @@ absorbs the stretch, and the layout is then the power form's. -->
- +
#elseif($property.widgetType == "DATE")
@@ -271,7 +271,7 @@ #foreach($property in $properties) #if($property.aggregate == "true" && !$property.sensitiveProperty)
- +
#end diff --git a/components/template/template-application-ui-harmonia-java/src/main/resources/META-INF/dirigible/template-application-ui-harmonia-java/ui/my/my-form-view.html.template b/components/template/template-application-ui-harmonia-java/src/main/resources/META-INF/dirigible/template-application-ui-harmonia-java/ui/my/my-form-view.html.template index 21e058dcaf7..43e92422eaf 100644 --- a/components/template/template-application-ui-harmonia-java/src/main/resources/META-INF/dirigible/template-application-ui-harmonia-java/ui/my/my-form-view.html.template +++ b/components/template/template-application-ui-harmonia-java/src/main/resources/META-INF/dirigible/template-application-ui-harmonia-java/ui/my/my-form-view.html.template @@ -54,12 +54,12 @@ ## other control does. #if($property.widgetType != "CHECKBOX") #end #if($property.widgetType == "DROPDOWN")
- +
@@ -73,7 +73,7 @@
- +
@@ -92,7 +92,7 @@ absorbs the stretch, and the layout is then the power form's. -->
- +
#elseif($property.widgetType == "DATE")
- +
@@ -90,7 +90,7 @@ absorbs the stretch, and the layout is then the power form's. -->
- +
#elseif($property.widgetType == "DATE")
@@ -204,7 +204,7 @@ #foreach($property in $properties) #if($property.aggregate == "true")
- +
#end diff --git a/components/template/template-application-ui-harmonia-java/src/main/resources/META-INF/dirigible/template-application-ui-harmonia-java/ui/partner/partner-form-view.html.template b/components/template/template-application-ui-harmonia-java/src/main/resources/META-INF/dirigible/template-application-ui-harmonia-java/ui/partner/partner-form-view.html.template index 7c8852c438c..d46285361e9 100644 --- a/components/template/template-application-ui-harmonia-java/src/main/resources/META-INF/dirigible/template-application-ui-harmonia-java/ui/partner/partner-form-view.html.template +++ b/components/template/template-application-ui-harmonia-java/src/main/resources/META-INF/dirigible/template-application-ui-harmonia-java/ui/partner/partner-form-view.html.template @@ -54,12 +54,12 @@ ## other control does. #if($property.widgetType != "CHECKBOX") #end #if($property.widgetType == "DROPDOWN")
- +
@@ -73,7 +73,7 @@
- +
@@ -92,7 +92,7 @@ absorbs the stretch, and the layout is then the power form's. -->
- +
#elseif($property.widgetType == "DATE")