[MGNLUI-3096] Section availability for multiple selection is plain wrong Created: 13/Aug/14  Updated: 09/Mar/21  Resolved: 09/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.2.8, 5.3.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Mikaël Geljić Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: actionbar, availability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLUI-3626 Deprecate hack for multiple selection... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

There was one silly code leftover from 5.3 development in ConfiguredActionbarSectionDefinition, which I tentatively removed ahead of 5.3.2, but had to revert back:

    public void setAvailability(AvailabilityDefinition availability) {
        // FIXME This is plain wrong, availability for multiple selection matches sections for which it is not configured (i.e. set to false)
        // But we have to keep it for the time being because some content apps rely on this incorrect behavior.
        ((ConfiguredAvailabilityDefinition) availability).setMultiple(true);
        this.availability = availability;
    }

In essence:

  • availability for multiple selection matches sections for which the multiple property is not true (i.e. non-exisiting or set to false)
  • but many content apps (+ UI tests) rely on this incorrect behavior.
    • e.g. contacts, categories do have a multiple section configured, but they don't even have an availability subnode with multiple set to true.
    • When trashing the silly line, one can end up with en empty action bar.

As a result, currently we always fall back on the first configured section — typically the one dealing with singular item selection — so the set of actions displayed, their labeling and the section title are all wrong.

Side note: multiple availability does work correctly on individual actions; most of them are expectedly disabled when selecting multiple items.


Generated at Mon Feb 12 09:03:10 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.