[MGNLUI-3269] WorkbenchField fails to initialise properly when tree view is not configured Created: 21/Nov/14  Updated: 09/Mar/21  Resolved: 09/Mar/21

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

Type: Bug Priority: Neutral
Reporter: Jan Haderka Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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   

WorkbenchField.initContent() calls this.view.setViewType(TreePresenterDefinition.VIEW_TYPE);
to initialize default view to tree, but when workbench doesn't have a tree and only list or only thumbnails view is configured, this call ends up in WorkbenchViewImpl.setViewType() which does

        final Component c = contentViews.get(type).asVaadinComponent();

... and since tree type is not in the list of views it fails w/ NPE.

It should either signal back to field that request can't be fulfilled, or field should check for existence of tree before trying to set it or there should be some fallback to first available view or ...


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