[xwiki/xwiki-platform] 9e9402: XWIKI-24831: Add the Records macro with its Live D...
Branch: refs/heads/XWIKI-24831 Home: https://github.com/xwiki/xwiki-platform Commit: 9e940288b222b219ce9595b6e8789c18457e99a5 https://github.com/xwiki/xwiki-platform/commit/9e940288b222b219ce9595b6e8789... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M pnpm-lock.yaml M pnpm-workspace.yaml M xwiki-platform-core/pom.xml A xwiki-platform-core/xwiki-platform-records/pom.xml A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/pom.xml A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsColumns.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsDataType.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsMacroParameters.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/META-INF/components.txt A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/templates/html_displayer/recordscolumns/edit.vm A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/templates/html_displayer/recordsdatatype/edit.vm A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/pom.xml A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/eslint.config.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/package.json A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/dialog.test.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/fieldPicker.test.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/dialog.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/fieldPicker.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/xwiki.d.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/tsconfig.app.json A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/tsconfig.json A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/tsconfig.node.json A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/tsconfig.vitest.json A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/vite.config.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/vitest.config.ts Log Message: ----------- XWIKI-24831: Add the Records macro with its Live Data mapping Grows the Records macro prototype into a first shippable increment: the macro now renders a real table instead of echoing its parameters, its columns are picked rather than typed, and both halves are tested. * Live Data mapping. The macro owns no rendering: it maps its parameters onto a Live Data backed by the liveTable source and hands them to LiveDataRenderer, the component the liveData macro itself uses. Only class needs work, becoming a className source parameter; the rest are passed through, so a value means the same thing here as it would in a liveData macro. The doc.* headers are translated through a translationPrefix the macro sets itself, as the documents macro does. * The default column list is resolved by the macro. The liveTable source needs an explicit list: given none it renders a table with no columns at all, not one with every column, so an author who omitted the parameter got an empty table. The macro therefore asks the source for the data type's property descriptors, through LiveDataSourceManager so that the PER_LOOKUP source gets its className, and uses the data type's own fields in declaration order. The entry metadata and the Live Data pseudo-columns are left out: the default describes the data type, and an author can add any doc.* column themselves. This is what the documents macro does too, for the same reason. * No advanced configuration is passed, deliberately. LiveDataRenderer marks the content trusted only when the advanced configuration is blank or the author holds script right, so using it would downgrade every table authored without that right and get the link displayers sanitized away. * A TypeScript webjar holds the JavaScript. The columns parameter is a suggester whose candidates come from the Live Data properties REST resource for the data type currently selected. No declarative way to depend on a sibling parameter exists, but a suggester's data source is a callback invoked per keystroke rather than a URL fixed when the displayer template was rendered, so it can read the class input at query time. The coupling is to the input named after the parameter, which is the contract the macro editor itself relies on to assemble a macro call, and nothing else in the editor's DOM is touched. * The bundle is loaded as a classic script and exports nothing. The macro editor builds each parameter field detached and only then appends it to the dialog; jQuery evaluates the field's scripts at that append, and it refuses to fetch a type="module" script by src while evaluating every other one as a classic script. A module script is therefore silently skipped, and a bundle carrying an ES export fails to parse, so the entry point stays free of imports and exports and registers itself with define() for RequireJS instead. * The tabs are hidden until a data type is picked. Every tab is derived from it, so there is nothing to offer before it is set, and the macro editor has no disabled state for a group: the choice is between a tab that is reachable with nothing in it and no tab at all. * Changing the data type warns before discarding the parameters derived from it, then resets the columns, the filters and the sort to their defaults. A column, filter or sort naming a field the new data type does not have would render a table the author cannot explain, and the suggest widget caches its candidates, so the stale ones are dropped too. Declining the warning puts the previous data type back, in the enhanced widget as well as in the element. * The columns element does not carry the xwiki-selectize class. xwiki.selectize.js auto-enhances every element carrying it on xwiki:dom:updated, with default settings and so without the load callback this picker exists for, and $.fn.xwikiSelectize skips an element that is already enhanced. Owning the enhancement means keeping that class off. * Parameter groups follow the dialog the framework can actually build. class is mandatory and ungrouped, so it is rendered as a bare field above the tab strip; it will want a group again once location joins it, but a panel headed Data around a single Data type field earns nothing today. Every optional parameter, in contrast, must carry an explicit group: an ungrouped one is added to the framework's default group, which is pinned at order 0 and which no Java macro can reorder, so it would surface as the first tab ahead of Columns. A mandatory parameter never reaches that branch, which is why class is exempt. * A translation bundle, so the tabs read as names rather than raw group ids. Two parameters the design calls for are left out rather than shipped wrong. location needs an exact prefix predicate the liveTable source cannot express, so it waits on the results page this module will ship. editable maps onto the per-property flag of the Live Data configuration, which is the advanced configuration ruled out above. Tests: 16 Java tests covering the mapping (100% instruction coverage), 37 TypeScript tests covering the picker and the dialog behaviours. The picker's tests are written against the shape the properties resource really answers with, which is an envelope carrying the descriptors under properties rather than a bare array, and against the pseudo-columns it reports next to the real fields. Commit: 359fb83e1771e113a29a94fba05e281aa66c03eb https://github.com/xwiki/xwiki-platform/commit/359fb83e1771e113a29a94fba05e2... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsMacroParameters.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java Log Message: ----------- XWIKI-24831: Open the default column list with the entry title A Records table left with no explicit columns showed the data type's fields and nothing else, so a reader had no way to tell one entry from another and no way to reach the page an entry lives in. The title column is what makes the rest of the row mean something, and it is the first column of every mockup in the design. The default is now doc.title followed by the data type's fields, in declaration order. Naming any column still replaces the list entirely, so an author who wants the fields alone can say so. The rest of the entry metadata stays out: the title is the only piece of it the default needs, and the author can add any doc.* column. A data type with no field of its own now yields a one-column table a reader can still use, rather than no columns at all. Commit: de8a5fca94008c8920f17601a994b8743ecc2845 https://github.com/xwiki/xwiki-platform/commit/de8a5fca94008c8920f17601a994b... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsMacroParameters.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties Log Message: ----------- XWIKI-24831: Say what the description parameter actually does The parameter said the description was "announced to assistive technology", which reads as though it were screen-reader only. It is not: Live Data renders it as a plain visible paragraph above the table (LivedataLayout.vue), in normal flow, and additionally points the layout at it with aria-describedby. An author choosing whether to fill the field needs to know it will be on the page. Note also that it is the table's accessible *description*, not its name, which is a different ARIA concept and is what the design page claimed. Commit: 12fbbd52d1d8663cf163ce2e5fc14df5bde2a0f0 https://github.com/xwiki/xwiki-platform/commit/12fbbd52d1d8663cf163ce2e5fc14... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java Log Message: ----------- XWIKI-24831: Always give the table a unique identifier Live Data builds the element id of a table's description as <id>-description and points at it with aria-describedby, so a table without an id got the literal id "undefined-description". Harmless alone, but two such tables on one page shared that element id and the second was described by the first one's text. The macro now always hands Live Data an id, taken from the document's IdGenerator rather than a counter of its own, so a Records table takes its place among the ids the rest of the page generates -- headings included -- and cannot collide with them: * No id from the author yields "records", then "records-1", "records-2" for each further table on the page. * An authored id is kept as it is when it is unique, and suffixed the same way when another table already uses it. Two details of IdGenerator worth knowing. adaptId takes the first character of an id as its prefix and rejects one that is not a letter, so an id the author starts with a digit is prefixed instead of refused. And a macro executed outside a document has no XDOM and so no generator, which still has to yield an id. This makes the id parameter more than a way of keeping each table's reader state apart, which is all its description claims; that wording should follow. Commit: 512820b834b138d42116164aeaeb39ee4cb423ae https://github.com/xwiki/xwiki-platform/commit/512820b834b138d42116164aeaeb3... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsLayouts.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsMacroParameters.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/templates/html_displayer/recordslayouts/edit.vm M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java Log Message: ----------- XWIKI-24831: Close the layout choice and drop the entries per page * The layout is now picked from two radio buttons, table and cards, rather than typed as a comma-separated list of layout identifiers. The dialog is in a position to name the layouts a table of records can reasonably use, and an author who needs anything else has the liveData macro. The widget needs no JavaScript of its own: the macro editor already keeps a radio group together and checks the one matching the parameter value. * The entries per page parameter is gone. Nothing is lost by leaving it out: an unset limit is Live Data's own default of fifteen, and the reader can change the page size from the pagination controls anyway, so the parameter only chose a starting point. Commit: 470d1736ddc2e8b0fd8c6eba82d6065068be6450 https://github.com/xwiki/xwiki-platform/commit/470d1736ddc2e8b0fd8c6eba82d60... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts Log Message: ----------- XWIKI-24831: Hide the columns placeholder once columns are picked The columns field is a multiple-value suggest widget, and the suggest widget is backed by Tom Select, whose hidePlaceholder setting defaults to `mode !== 'multi'`. So the placeholder stayed next to the selected items. Here it names the default column list, which means it was telling the author the table shows the title and every field while they were looking at the columns they had just picked. Commit: de9eb96250e6f803f3dc6c5e20c99f914afad33c https://github.com/xwiki/xwiki-platform/commit/de9eb96250e6f803f3dc6c5e20c99... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsMacroParameters.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsSort.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/templates/html_displayer/recordssort/edit.vm A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/sortPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/fieldPicker.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/sortPicker.ts Log Message: ----------- XWIKI-24831: Pick the sort criteria instead of typing them The sort parameter now uses a suggester offering each field of the data type twice, once ascending and once descending, so a criterion is one choice and the direction is never typed. The platform has a generic sort widget, uicomponents/widgets/sortPicker.js, and it is deliberately not used: it edits a single criterion through a field select and an order select, while this parameter holds an ordered list of criteria. The suggester's drag-and-drop plugin is what lets that order be authored. That widget would also need its field select filled from the sibling class parameter, which is the same client-side work as this picker, so it would buy the harder half and still lose the list. A stored criterion is resolved exactly rather than searched, because the suggester refuses free text: a criterion naming no direction, or naming a field the data type no longer has, would otherwise be dropped the next time the dialog opens. The lookup of the selected data type is now shared between the pickers rather than repeated. Commit: 5018ef40d98b66357a1fb4030e8dc7d4feb548b2 https://github.com/xwiki/xwiki-platform/commit/5018ef40d98b66357a1fb4030e8dc... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsFilters.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsMacroParameters.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/templates/html_displayer/recordsfilters/edit.vm A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/filterPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/fieldPicker.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/filterPicker.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts Log Message: ----------- XWIKI-24831: Suggest the fields and the values of a filter The filters parameter now uses a suggester holding one item per field=value constraint, which is what the renderer parses the query string into. The suggestions come in two steps, since only the author knows which field they mean: the fields until a = is typed, then that field's values. Picking a field puts "field=" back in the text box rather than leaving half a constraint behind as an item. The values are not invented here. The Live Data properties resource already reports a filter.searchURL for every property whose values are enumerable, with an {encodedQuery} placeholder, and it is the same URL the Live Data filter row queries, so the dialog offers what a reader would be offered in the rendered table. A property without one is filtered by typing, which is why this is the only picker of this dialog that accepts free text. A suggested value is percent-encoded, because the renderer URL-decodes each half of a constraint: a value holding & or = would otherwise be read as another constraint. Repeating a field is left possible, since the renderer turns that into two constraints on that field, and it works because an item's value is the whole pair. Commit: 450f426acf2596280fcc2e23059a40b9ee14bfc4 https://github.com/xwiki/xwiki-platform/commit/450f426acf2596280fcc2e23059a4... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/sortPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/sortPicker.ts Log Message: ----------- XWIKI-24831: Stop offering a field that is already sorted on Both directions of a field disappear from the sort suggestions once that field is used, rather than only the criterion picked. Sorting a field twice says nothing the first criterion did not already say, and offering the pair invites reading it as a choice between directions when it is not one. The widget caches what it has loaded per query and keeps the options it has already seen, so neither the filtering at load time nor a removal would show through on its own. Adding or removing a criterion therefore drops the options that are not backing a selected one, which also clears that cache, and the next dropdown loads the rest afresh. Commit: fb0f4ee570a498fdcc0859dc3fa76d7030173659 https://github.com/xwiki/xwiki-platform/commit/fb0f4ee570a498fdcc0859dc3fa76... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/pom.xml M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsMacroParameters.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts Log Message: ----------- XWIKI-24831: Call the picked class an object type, as the search facet does The macro dialog, the descriptions and the reset warning now say "object type" where they said "data type". The default search already labels its facet filtering pages by class "Object type", and the two select the same pages, so a reader moving from one to the other should meet the same word. The UI also says "Objects of type {0}" elsewhere. Only the wording users read changes: the code identifiers keep "data type" while the vocabulary discussion on the forum is still open, so that a later rename touches the facet and this macro together. Commit: 9391fd09615b53b1b01ecbf62c07b68604191048 https://github.com/xwiki/xwiki-platform/commit/9391fd09615b53b1b01ecbf62c07b... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/pom.xml M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/pom.xml M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsColumns.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsDataType.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsFilters.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsLayouts.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsMacroParameters.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsSort.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/pom.xml Log Message: ----------- XWIKI-24831: Move the Records modules to 18.9.0-SNAPSHOT The branch is now rebased on master, which is on 18.9.0-SNAPSHOT, so the module versions follow and the new APIs are introduced in 18.9.0RC1. Commit: 2ae713c9675bd7adc86f9c6320245f77a07648e3 https://github.com/xwiki/xwiki-platform/commit/2ae713c9675bd7adc86f9c6320245... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/pom.xml M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java Log Message: ----------- XWIKI-24831: Degrade to a legible message when the object type or a field is gone A column, a sort criterion or a filter naming a field the object type no longer has used to reach Live Data as is, which is where the failure surfaced. The macro now reads the identifiers the source offers before rendering and drops what is gone, with a warning above the table naming the field and the object type. When no authored column is left, the default columns apply rather than a table without any. A deleted object type replaces the table by a single message, and the macro call is left untouched so that restoring the object type restores the table. Every message the macro produces, errors included, now goes through translation keys and says what happened and what to do in the words of the design page, instead of exposing parameter names and the Live Data source. The technical detail stays in the exception cause. Commit: 0638dde04fad38870e0a992ec2b0b9bdbd994058 https://github.com/xwiki/xwiki-platform/commit/0638dde04fad38870e0a992ec2b0b... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/pom.xml M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/sortPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/sortPicker.ts Log Message: ----------- XWIKI-24831: Translate the strings the macro dialog displays The warning shown before the object type changes, the labels of the sort directions and of the two groups of the columns picker were hard-coded in English in the webjar. They are now keys of the macro's translation bundle, loaded through the xwiki-l10n module that every page already has, which resolves them for the language of the current user. The module defining the keys is registered by the bundle itself, in the same way the BlockNote webjar does, so that the displayer templates still load it as a classic script. The native confirm is kept: only its text was the problem. A key missing from the bundle shows up as its identifier rather than as an empty label. Commit: 331260da299244835d9328665d4558b53a6468cd https://github.com/xwiki/xwiki-platform/commit/331260da299244835d9328665d455... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/macro/RecordsMacroParameters.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/fieldPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/filterPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/sortPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/fieldPicker.ts Log Message: ----------- XWIKI-24831: Call the doc.* columns page metadata, not entry metadata The group of the columns picker and the description of the Columns parameter said "Entry metadata" for the doc.* columns. The forum discussion kept page concepts for those columns, and the design page speaks of page metadata, so the dialog now uses that wording. The entries themselves are still called entries. Only the wording changes, including the comments that repeated it; the code identifiers are kept. Commit: 74a0334f9c6a830c05f9412d31b85e1c3e7f64eb https://github.com/xwiki/xwiki-platform/commit/74a0334f9c6a830c05f9412d31b85... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/fieldPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/dialog.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/xwiki.d.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/tsconfig.vitest.json Log Message: ----------- XWIKI-24831: Type the RequireJS and suggest widget calls instead of casting them The translation keys module is defined through the typed name, dependencies and factory form of define, which gives RequireJS the same module value. The selectize instance the suggest widget stores on the element it enhances is declared once, globally, so the dialog reads it without a cast. The one test feeding a null name, which the typings forbid, says so with @ts-expect-error. Commit: 4656b2c8e306b36e5caf1a7d5ce48e40ea01589c https://github.com/xwiki/xwiki-platform/commit/4656b2c8e306b36e5caf1a7d5ce48... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/pom.xml M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java Log Message: ----------- XWIKI-24831: Show the warnings and errors through the message macros The warnings and the missing data type error are now calls to the warning and error macros instead of hand-made boxes, so they get the same look, icon and accessible name as {{warning}} and {{error}}. The message macros parse their content as wiki syntax while our messages embed names that come from the wiki (field ids, class references), so the translated text is run through the plain text parser and rendered back as XWiki syntax to escape it. Commit: 7d6a26383702767756a2da943a47d3461f0aae4d https://github.com/xwiki/xwiki-platform/commit/7d6a26383702767756a2da943a47d... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/templates/html_displayer/recordsfilters/edit.vm M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts Log Message: ----------- XWIKI-24831: Save several filters with & so that they all apply * Render the filters field as a text input rather than a multiple select. The macro editor joins the values of a multiple select with a comma, which Live Data read as part of the first constraint's value, so two filters matched nothing. With a text input, the suggest widget builds the &-separated value itself. * A stored value such as status=Active&status=Draft now reopens as two items instead of one. Commit: afb8b555de17d2f49d0248440beb9231923296c0 https://github.com/xwiki/xwiki-platform/commit/afb8b555de17d2f49d0248440beb9... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts Log Message: ----------- XWIKI-24831: Clear the typed text once a suggested filter is picked * Tom Select keeps the search text when a suggested option is picked, so the text left over from picking status=published was prepended to the next constraint. Commit: e1f60258c0917b946078a4ccb76ff18e911f1a89 https://github.com/xwiki/xwiki-platform/commit/e1f60258c0917b946078a4ccb76ff... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/pom.xml A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/pom.xml A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/xwiki-platform-records-test-docker/pom.xml A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/xwiki-platform-records-test-docker/src/test/it/org/xwiki/records/test/ui/AllIT.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/xwiki-platform-records-test-docker/src/test/it/org/xwiki/records/test/ui/RecordsMacroIT.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/xwiki-platform-records-test-pageobjects/pom.xml A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/xwiki-platform-records-test-pageobjects/src/main/java/org/xwiki/records/test/po/RecordsMacroEditModal.java Log Message: ----------- XWIKI-24831: Add a functional test for the filters of the Records macro dialog * Add the xwiki-platform-records-test modules, with a page object for the tabbed macro dialog and a docker test. * The test picks two filters, checks that they are saved with & and that the table shows the one entry matching both, reopens the dialog, and checks that a field named twice opens as two items. Commit: b8eeb86a816b342fa25a780f72948fb16d43cec0 https://github.com/xwiki/xwiki-platform/commit/b8eeb86a816b342fa25a780f72948... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/pom.xml M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java Log Message: ----------- XWIKI-24831: Keep the authored columns, filters and sort for a reader who cannot view the object type * The liveTable source reports the fields of an object type only to a reader who can view it, so for any other reader every authored field looked gone: the columns, filters and sort were dropped with warnings about fields that exist, and the filtered-out entries were shown. * The authored fields are now checked only when the reader can view the object type, and passed through unchanged otherwise. Commit: 95c7c62306e7771b795ea2f584850296799b38de https://github.com/xwiki/xwiki-platform/commit/95c7c62306e7771b795ea2f584850... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/filterPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/filterPicker.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts Log Message: ----------- XWIKI-24831: Encode the filter values the author types, and ignore a filter that cannot be read * A value typed in the filters picker is now percent-encoded like a suggested one, so 100% no longer makes the whole table fail to load and C++ is no longer read as "C ". Typed text with no field and value creates no item. * The picker reads a + in a stored value as a space, as the renderer does, and searches value suggestions with the text as typed. * A hand-written filter the renderer cannot decode is dropped with a warning, instead of replacing the table with an error or failing the macro. Commit: 655ac7be2e197de03d3e3ebc9265674d4e9f67a8 https://github.com/xwiki/xwiki-platform/commit/655ac7be2e197de03d3e3ebc92656... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/dialog.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/fieldPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/dialog.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/fieldPicker.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/xwiki.d.ts Log Message: ----------- XWIKI-24831: Tell the author when the fields of the object type could not be loaded, or the object type no longer exists * A failed properties request shows "The fields of {0} could not be loaded." under the picker, with a Try again button, instead of an empty list; the chosen values are kept * Reopening the dialog on an object type the properties resource reports no field for (deleted or not viewable) warns on the object type picker and focuses it * A failed value suggestion in the filters picker falls back to free typing Commit: ba3d68b26e7686a6eaa6553ea1942100fb694727 https://github.com/xwiki/xwiki-platform/commit/ba3d68b26e7686a6eaa6553ea1942... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/templates/html_displayer/recordscolumns/edit.vm M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/templates/html_displayer/recordsfilters/edit.vm M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/templates/html_displayer/recordssort/edit.vm M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/vite.config.ts Log Message: ----------- XWIKI-24831: Build the dialog script as an IIFE so that its names do not overwrite the page's globals * The displayer templates load the bundle as a classic script, so the top-level names of the ES bundle were globals; the minifier named one `$`, which overwrote Prototype's and broke the page * The bundle is now index.js, in the "iife" format, and the templates load that file Commit: 9402ea8cce62909be7be7db029f6e6d0f25e6fbb https://github.com/xwiki/xwiki-platform/commit/9402ea8cce62909be7be7db029f6e... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/xwiki.d.ts Log Message: ----------- XWIKI-24831: Do not focus the object type picker when warning that the object type no longer exists * Focusing it opens its dropdown, which covers the warning Commit: bcaf2573b17a74c648c1960afe4103b646317163 https://github.com/xwiki/xwiki-platform/commit/bcaf2573b17a74c648c1960afe410... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java Log Message: ----------- XWIKI-24831: Ignore a filter or a sort criterion the type of its field no longer allows, and say so * Read whether each field can be sorted and filtered on, and with which filter, from its descriptor and from the defaults of the liveTable source for its type, as Live Data does. * Drop a filter on a field that cannot be filtered on, and a filter value a number or boolean field cannot match, which made the liveTable source return no entry at all. * Drop a sort criterion on a field that cannot be sorted on, and name what the table is sorted on instead, or say that it is not sorted. Commit: ec71e919f29ec255fd912020f28ebbc9f3fa7588 https://github.com/xwiki/xwiki-platform/commit/ec71e919f29ec255fd912020f28eb... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/ApplicationResources.properties M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/dialog.test.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/fieldUse.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/__tests__/sortPicker.test.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/dialog.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/fieldPicker.ts A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/fieldUse.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/sortPicker.ts Log Message: ----------- XWIKI-24831: Offer only the fields a sort or a filter can use, and point at the stored ones the table ignores * Read what a field can be used for from the defaults of its type, which the Live Data types resource reports, since the properties resource reports false for every flag the source left unset. * Stop offering in the sort and filters pickers the fields that cannot be sorted or filtered on. * Strike through the stored or typed sort criteria and filters the table ignores, with the reason as their tooltip, and list the reasons in a warning under the picker: a field the object type no longer has, a field that cannot be sorted or filtered on, a value a number or boolean field cannot take, a filter that cannot be read. Commit: 921ba2b6edc844e19593025a692c1488cd08de41 https://github.com/xwiki/xwiki-platform/commit/921ba2b6edc844e19593025a692c1... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/xwiki-platform-records-test-docker/src/test/it/org/xwiki/records/test/ui/RecordsMacroIT.java Log Message: ----------- XWIKI-24831: Simplify the functional test of the Records macro dialog * Write the macro calls and the page source as text blocks. * Name the entry pages after their title. * Order the test method. Commit: a9e53bf87120a4da0e25176e3e1abab391061681 https://github.com/xwiki/xwiki-platform/commit/a9e53bf87120a4da0e25176e3e1ab... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/pom.xml M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/xwiki-platform-records-test-docker/pom.xml Log Message: ----------- XWIKI-24831: Depend on what the Records macro needs to display its table and its messages * Declare the liveTable source, the Live Data webjar and the message macros as runtime dependencies of the macro, so that installing it brings them, rather than adding them to the functional tests only. * Keep in the functional tests only what a distribution already ships or what the tests need to edit the page. Commit: 3e505b6cb0e3b556aed0f56ea3baacb1c8ca290b https://github.com/xwiki/xwiki-platform/commit/3e505b6cb0e3b556aed0f56ea3baa... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/xwiki-platform-records-test-docker/src/test/it/org/xwiki/records/test/ui/RecordsMacroIT.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-test/xwiki-platform-records-test-pageobjects/src/main/java/org/xwiki/records/test/po/RecordsMacroEditModal.java Log Message: ----------- XWIKI-24831: Open the tabs of the Records macro dialog by the identifier of their parameter group * Find the tab by the panel it controls with a CSS selector, rather than by its translated label with an XPath. * Do not leave an empty paragraph after the macro, where the caret landed instead of selecting the macro. Commit: 6b4995eac9606b643c5675c4595bb7436df0656f https://github.com/xwiki/xwiki-platform/commit/6b4995eac9606b643c5675c4595bb... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/index.ts Log Message: ----------- XWIKI-24831: Offer the fields of the object type as soon as a picker is opened * Load the options of a picker again when it gets the focus, since the suggest widget only loads the empty query when it is created, which happens before the object type is picked when a new macro is inserted. * Load the options of the sort picker again right after a criterion is added or removed, since its dropdown stays open for the next one. Commit: f47b7609e46c5a9348ea33350832b5c1b5b2049f https://github.com/xwiki/xwiki-platform/commit/f47b7609e46c5a9348ea33350832b... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/dialog.ts Log Message: ----------- XWIKI-24831: Leave some space between a field of the Records macro dialog and the message shown under it * Give the message boxes of the dialog a top margin, since the box was glued to the field it follows, such as the object type picker when the object type no longer exists. Commit: 237d61a4349bf8f5cecd23ebbbc3d6dbbabc3c1b https://github.com/xwiki/xwiki-platform/commit/237d61a4349bf8f5cecd23ebbbc3d... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordField.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsFields.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMacro.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/java/org/xwiki/records/internal/macro/RecordsMessages.java M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/main/resources/META-INF/components.txt M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMacroTest.java A xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-macro/src/test/java/org/xwiki/records/internal/macro/RecordsMessagesTest.java Log Message: ----------- XWIKI-24831: Split the Records macro so that it no longer needs a checkstyle suppression * Move the building of the warning and error messages to a RecordsMessages component. * Move the reading of the fields of the object type, and the check that it exists, to a RecordsFields component. * Drop the ClassFanOutComplexity suppression the macro needed while it held both. * Test the failure to escape a message on RecordsMessages, where the plain text parser is a mock component, rather than replacing the parser of the macro by reflection. * Use jakarta.inject in the macro module. Commit: 448c8d0efb820265e36f8d57f409901575d9a418 https://github.com/xwiki/xwiki-platform/commit/448c8d0efb820265e36f8d57f4099... Author: Manuel Leduc <[email protected]> Date: 2026-10-09 (Fri, 09 Oct 2026) Changed paths: M pnpm-lock.yaml M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/package.json M xwiki-platform-core/xwiki-platform-records/xwiki-platform-records-webjar/src/main/node/src/xwiki.d.ts Log Message: ----------- XWIKI-24831: Use the shared TypeScript declaration of the global XWiki object in the Records webjar * Reference the global entry of `@xwiki/platform-xwiki-utils` instead of declaring the XWiki global again, following XWIKI-25237: Provide a single TypeScript declaration of the global XWiki object. Compare: https://github.com/xwiki/xwiki-platform/compare/16d058ee496b...448c8d0efb82 To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications