Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-2931

Add Component action availability

XMLWordPrintable

      • If you set an area to be of type noComponent then the "+ Add Component" action should be disabled/removed when that area has the focus.
        You can see an example by looking the page /demo-project/about/subsection-articles/article and bringing the PAGE HEADER into focus. Notice "+ Add Component" is still available.
      • If you set an area to have a maxComponents property then when that area has reached its max it should cause the "+ Add Component" action to be disabled/removed when that area has the focus.
        Steps to recreate:
        • In template defs configure stkArticle base area to have a max of 2 components
        • Edit the base area of /demo-project/about/subsection-articles/article
        • Add 2 components
        • Observe the max message is showing but you still have the ability to execute the add component action.
          The system still prevents the third component from being added but not until the save button is pushed in the dialog. A warning is is logged but there is no indication to the user that something has been restricted.

      At first it was attempted to fix this using an availability rule, but that turned to be complex to implement, regarding e.g. merged prototype in rendering whose definitions couldn't be accessed from the rule, + it was actually creating a second mechanism that was out-of-sync w/ what's done on the client-side, so we decided against this approach.

      The good news is that there is already a 'custom' availability mechanism in page-editor that checks for client-side "addibility", since MGNLUI-1586, it just doesn't take maxComponent into account.

        Acceptance criteria

              mgeljic Mikaël Geljić
              rgange Richard Gange
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD