[MGNLUI-1367] Eliminate redundancy in application of Action availablility on ActionPopup and ActionBar Created: 15/May/13  Updated: 10/Mar/21  Resolved: 10/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.0
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-1564 BrowserSubApp: remove code duplicatio... Sub-task Closed Espen Jervidalo  
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)

 Description   

BrowserPresenter contains some functions that are identical or similar to those in BrowserSubApp.
The methods were created in BrowserPresenter because that seems to be the proper location and the ActionBar methods will probably move to that file as well.

isSectionVisible is duplicated.
getVisibleSection is duplicated.
showActionPopup is very similar to BrowserSubApp.updateActionBar

A solution would be to create a method (bad name) ±prepareConfiguredActionBarDefinitionForItem(item,...) which would get the currently selected items and would create a new bean of only the sections, groups, items that apply to this item - and also with enabled flags properly set according to the action availability rules.
Then, both the actionbar and the actionpopup could use this method to determine what to display - but then each could use the configuredDefintion in their own way.


Generated at Mon Feb 12 08:45:53 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.