Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
17.10.14, 18.8.0
-
None
-
Unknown
-
Description
The source parameter of the code and context macros is a reference to the content to use, written as "type:value", like page:Space.Page, attachment:Space.Page@file.txt or script:myvariable. It is declared with the MacroContentSourceReference type, which has no field in the Edit Macro dialog, so it falls back to a plain text field: the user has to know the types and the syntax of each reference, and gets no page or attachment picker where one applies.
The macros using this type:
- code: CodeMacroParameters.java.
- context: ContextMacroParameters.java.
- content also declares its source with this type, but it supports only the string and script types, so a plain text field fits it.
The improvement is a field for this type in the Edit Macro dialog, an html_displayer template for macrocontentsourcereference: a select of the type, then a value input that is the page picker for the page and document types, the attachment picker for the attachment types, and a text field for the others. It needs design work first:
- The type defines 11 types, string, script, url, file, entity, document, page, object_property, page_object_property, attachment and page_attachment, while each macro supports only some of them: the macro would need to declare which ones it accepts, or the field would offer types that fail at rendering with "Unsupported source type".
- Some types, like script and string, cannot have a picker.
The office macro has a field for its own typed resource reference, officeresourcereference/edit.vm, which can serve as a starting point.
Related issues: XWIKI-25456, to offer the source and the content as alternatives, and XWIKI-25477, which improves the description of the source parameter of the context macro.
KOs covered
| Macro | Criterion | Parameter | Problem |
|---|---|---|---|
| code | C4 input-assistance | source | A free text field for a typed reference, like "page:Page/SubPage" or "attachment:Space.Page@file.txt", with no page or attachment picker: the user has to know the syntax of the reference. |
| context | C4 input-assistance | source | A free text field for a typed reference, with no picker for the types that could have one, like a page: the user has to know the syntax. |
Impact found on macro fluidity
These 2 KOs come from the WYSIWYG usability audit of the macros, under the criterion C4 input-assistance of its usability criteria, which asks that each parameter uses an appropriate input, such as a picker. The page of each macro, linked in the table, has the full notes and the steps to reproduce.
Attachments
Issue Links
- is related to
-
XWIKI-25456 Allow the macro content and a parameter to be offered as alternatives in the Edit Macro dialog
-
- Open
-
-
XWIKI-25477 Improve the names and descriptions of the content reuse macros and of their parameters
-
- Open
-