Skip to content

Commit 67102aa

Browse files
akoclaude
andcommitted
fix: populate TextTemplate translation defaults + Editable=Always on filters
Refs: mendixlabs#541 Two further CE0463 gaps closed: 1. TextTemplate translation defaults (4 templates: combobox.json + 3 datagrid filters). Widget XML <translations> elements on textTemplate properties (e.g. DatagridTextFilter's screenReaderInputCaption with en_US='Search', de_DE='Suche', nl_NL='Zoeken') become defaults that Studio Pro copies into the WidgetObject's Forms$ClientTemplate Template.Items at widget instantiation time. Previously: the embedded templates carried these translations only on the PropertyType's ValueType.Translations (the type-level definition), but the WidgetObject's WidgetValue.TextTemplate.Template.Items was empty. So mxcli emitted textfilters with no translation defaults, triggering CE0463. Fix: bulk-populated WidgetObject.Properties[].Value.TextTemplate. Template.Items from PropertyType.ValueType.Translations for every textTemplate property in every embedded template. 4 entries added across 4 files. 2. Filter widget Editable override (datagrid_builder.go line 87). The wrapper pages.CustomWidget struct explicitly set Editable="Inherited" even though buildFilterWidgetBSON wrote "Always" into the inner BSON. The struct value wins at serialization time, so the final BSON ended up "Inherited" — mismatch with Studio Pro's "Always" for filter widgets inside DataGrid columns. Fixed. Verification: focused textFilter1 diff (PgTest.DataGridExample vs mxcli recreation in same project, UUID-normalized): was 71 lines, now 0 lines. The textfilter widget BSON is now byte-identical to a Studio-Pro-emitted textfilter for the same MDL input. CE0463 status: still firing on parent DataGrid widgets. Diff at the DataGrid-WidgetObject level (excluding columns property) shows 72 remaining lines — Studio Pro populates additional TextTemplate values (`Microflows$TextTemplate`, populated Template.Items arrays) and one boolean value (true vs false) on properties the mxcli output leaves default/null. Closing these requires either runtime population of more default values from PropertyType.ValueType, or further targeted embedded-template patching. Tracked under mendixlabs#541 for follow-up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 301e329 commit 67102aa

5 files changed

Lines changed: 67 additions & 5 deletions

File tree

mdl/backend/mpr/datagrid_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (b *MprBackend) BuildFilterWidget(spec backend.FilterWidgetSpec, projectPat
8484
},
8585
Name: spec.FilterName,
8686
},
87-
Editable: "Inherited",
87+
Editable: "Always",
8888
RawObject: getBsonField(bsonD, "Object"),
8989
RawType: getBsonField(bsonD, "Type"),
9090
}

sdk/widgets/templates/mendix-11.6/combobox.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,19 @@
12061206
"$ID": "e3f4a5b6c7d8e9f0a1b2c3d4e5f60102",
12071207
"$Type": "Texts$Text",
12081208
"Items": [
1209-
3
1209+
3.0,
1210+
{
1211+
"$ID": "00000000000000000000000000000000",
1212+
"$Type": "Texts$Translation",
1213+
"LanguageCode": "en_US",
1214+
"Text": "Select all"
1215+
},
1216+
{
1217+
"$ID": "00000000000000000000000000000000",
1218+
"$Type": "Texts$Translation",
1219+
"LanguageCode": "nl_NL",
1220+
"Text": "Selecteer alles"
1221+
}
12101222
]
12111223
}
12121224
},

sdk/widgets/templates/mendix-11.6/datagrid-dropdown-filter.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,19 @@
21562156
"$ID": "5839c2234c144b4995fcd9df68928e35",
21572157
"$Type": "Texts$Text",
21582158
"Items": [
2159-
3
2159+
3.0,
2160+
{
2161+
"$ID": "00000000000000000000000000000000",
2162+
"$Type": "Texts$Translation",
2163+
"LanguageCode": "en_US",
2164+
"Text": "None"
2165+
},
2166+
{
2167+
"$ID": "00000000000000000000000000000000",
2168+
"$Type": "Texts$Translation",
2169+
"LanguageCode": "nl_NL",
2170+
"Text": "Niets"
2171+
}
21602172
]
21612173
}
21622174
},

sdk/widgets/templates/mendix-11.6/datagrid-number-filter.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,27 @@
469469
"Template": {
470470
"$ID": "dd2b3c4d5e6f700300000000000003a2",
471471
"$Type": "Texts$Text",
472-
"Items": []
472+
"Items": [
473+
3.0,
474+
{
475+
"$ID": "00000000000000000000000000000000",
476+
"$Type": "Texts$Translation",
477+
"LanguageCode": "en_US",
478+
"Text": "Search"
479+
},
480+
{
481+
"$ID": "00000000000000000000000000000000",
482+
"$Type": "Texts$Translation",
483+
"LanguageCode": "de_DE",
484+
"Text": "Suche"
485+
},
486+
{
487+
"$ID": "00000000000000000000000000000000",
488+
"$Type": "Texts$Translation",
489+
"LanguageCode": "nl_NL",
490+
"Text": "Zoeken"
491+
}
492+
]
473493
}
474494
},
475495
"TranslatableValue": null,

sdk/widgets/templates/mendix-11.6/datagrid-text-filter.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,25 @@
12841284
"$ID": "25e5dd1c08c8cd40b843741894ad3950",
12851285
"$Type": "Texts$Text",
12861286
"Items": [
1287-
3
1287+
3.0,
1288+
{
1289+
"$ID": "00000000000000000000000000000000",
1290+
"$Type": "Texts$Translation",
1291+
"LanguageCode": "en_US",
1292+
"Text": "Search"
1293+
},
1294+
{
1295+
"$ID": "00000000000000000000000000000000",
1296+
"$Type": "Texts$Translation",
1297+
"LanguageCode": "de_DE",
1298+
"Text": "Suche"
1299+
},
1300+
{
1301+
"$ID": "00000000000000000000000000000000",
1302+
"$Type": "Texts$Translation",
1303+
"LanguageCode": "nl_NL",
1304+
"Text": "Zoeken"
1305+
}
12881306
]
12891307
}
12901308
},

0 commit comments

Comments
 (0)