Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25180

Allow macro parameters to declare that they depend on another parameter

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • CKEditor, Rendering
    • None
    • Unknown

    Description

      Some macro parameters are only relevant, or only valid, once another parameter has a given value. The macro descriptor cannot express this, so the Edit Macro dialog always shows every parameter as independent. The user has to guess which fields matter, and can fill a field that is then silently ignored.

      @PropertyFeature and @PropertyGroup already cover mutually exclusive alternatives, but not a "parameter B depends on parameter A" relation.

      Example: a parameter that only makes sense when a boolean option is enabled, or a parameter whose allowed values depend on the value chosen in another one.

      Expected

      A parameter that depends on another one is hidden or disabled until the parameter it depends on is filled with a value that makes it relevant.

      Actual

      All parameters are always shown and enabled.

      Proposal

      • Add a way for Java and wiki macros to declare a dependency between parameters in the macro descriptor, for example a new annotation and its wiki macro parameter equivalent.
      • Expose it through the macro descriptor used by the editor.
      • Make the Edit Macro dialog hide or disable dependent parameters until their condition is met.

      Once the descriptor supports it, existing macros can be updated one by one, and new macros can use it from the start.

      Raised in https://forum.xwiki.org/t/brainstorming-usability-criteria-for-auditing-macros-in-the-wysiwyg-editor/18907/19

      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: