Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-828

Provide an image picker for the image parameter of the box and message macros

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 17.10.14, 18.8.0
    • None
    • Unknown

    Description

      The image parameter of the box and message macros is a plain text field in the Edit Macro dialog, so the user has to type the reference of an image they cannot browse for, and a reference to an attachment that does not exist is accepted silently.

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

      • box, info, warning, error and success: parameters declared in BoxMacroParameters.java, shared by the five macros.

      The main problems:

      • The parameter is typed as a resource reference, but declares no display type, so the dialog gives it no picker: the user can neither browse the attachments of the page nor upload an image.
      • A reference to a missing attachment is accepted by the dialog and, once rendered, gives a broken image with no message, so the user does not know that the reference is wrong.

      The office macro already gives a resource reference parameter an attachment picker, through a display type declared in OfficeMacroParameters.java and its edit displayer, which keeps the upload and restricts the files to the expected types. The same could be done for images.

      KOs covered

      Macro Criterion Parameter Problem
      box C4 input-assistance image A free text field, with no image picker, although the type is a resource reference; a reference to a missing attachment is accepted.
      error C4 input-assistance image A free text field, with no image picker; a reference to a missing attachment is accepted.
      info C4 input-assistance image A free text field, with no image picker; a reference to a missing attachment is accepted.
      success C4 input-assistance image A free text field, with no image picker; a reference to a missing attachment is accepted.
      warning C4 input-assistance image A free text field, with no image picker; a reference to a missing attachment is accepted.
      box E2 errors image image="missing.png" renders a broken image, with no attachment missing.png on the page and no message.
      error E2 errors image image="missing.png" renders a broken image, with no attachment missing.png on the page and no message.
      info E2 errors image image="missing.png" renders a broken image, with no attachment missing.png on the page and no message.
      success E2 errors image image="missing.png" renders a broken image, with no attachment missing.png on the page and no message.
      warning E2 errors image image="missing.png" renders a broken image, with no attachment missing.png on the page and no message.

      Impact found on macro fluidity

      These 10 KOs come from the WYSIWYG usability audit of the macros, under the criteria C4 input-assistance and E2 errors 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 image parameter in the macro definitions: a picker only offers existing images, so it also stops invalid values from being provided.

      The E2 errors KOs are only partly covered here, for the image. The same KOs also report the other invalid values accepted silently, covered elsewhere: the width by XRENDERING-826, the status by XCOMMONS-3847, and the wording of the error by XRENDERING-823.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Lucas C Charpentier Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: