This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-13860758-5d25-4c7a-9708-203944989e59 XWIKI-25499 Open

Use number fields and lists of values for the parameters of the attachment picker macros

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-4b5d7c70-5f09-4484-84a9-fafa0dc9b52a Charpentier Lucas created this issue on 22/Oct/26 15:40
 
Summary: Use number fields and lists of values for the parameters of the attachment picker macros
Issue Type: cid:jira-generated-image-avatar-13860758-5d25-4c7a-9708-203944989e59 Improvement
Affects Versions: 17.10.14, 18.8.0
Assignee: Unassigned
Components: Attachments
Created: 22/Oct/26 15:40
Priority: cid:jira-generated-image-static-major-57d32554-8167-44b0-ac19-c657b2dd2efc Major
Reporter: Charpentier Lucas
Description:

The attachment picker macros take sizes, file types and class properties in plain text fields of the Edit Macro dialog, so the user has to know the expected values and a wrong one is accepted silently.

The macros to change, with the file where most of the fix is done:

The main problems:

  • The width and height of attachmentSelector are numbers of pixels declared as strings.
  • The filters take file extensions or media types typed by hand, while the common ones could be offered, keeping any other value possible.
  • The property of attachmentSelector is a property of the class chosen in classname, so its list of values depends on that field.

Depends on

Most of these fields cannot be offered before these generic changes, each giving the macro the means to declare the expected value:

  • XWIKI-25182, which gives a number input to the parameters of a numeric type.
  • XWIKI-25197, which lets a wiki macro parameter declare its minimum and maximum.
  • XWIKI-23045, which lets a parameter get its values from a provider, with or without custom values.
  • XWIKI-25180, which lets a parameter depend on another one, whose value its list of values follows.

KOs covered

Macro Criterion Parameter Problem Depends on
attachmentSelector C4 input-assistance width A plain text field for a number of pixels: width="abc" is accepted and output as is. XWIKI-25182, XWIKI-25197
attachmentSelector C4 input-assistance height A plain text field for a number of pixels: height="abc" is accepted and output as is. XWIKI-25182, XWIKI-25197
attachmentSelector C4 input-assistance filter A plain text field for a list of file extensions, where the common file types could be offered: pdf odt or ,,pdf is accepted. XWIKI-23045
attachmentSelector C4 input-assistance property A plain text field for a property of the chosen class, where a select of the properties of that class could be used: nosuchprop is accepted and the macro displays nothing. XWIKI-23045, XWIKI-25180
attachmentGalleryPicker C4 input-assistance filter A plain text field for a list of media types, where a select of the common types, like Images or PDF, with several values, could be used: pictures is accepted and gives "No result.". XWIKI-23045

Impact found on macro fluidity

These 5 KOs come from the WYSIWYG usability audit of the macros, under the criterion C4 input-assistance of its usability criteria. The page of each macro, linked in the table, has the full notes and the steps to reproduce. Fixing them means changing the declaration of the parameters in the macro definitions.