[MGNLUI-2967] Do not show empty form tabs / empty actions in action bar Created: 04/Jun/14  Updated: 03/Mar/21  Resolved: 13/Jun/14

Status: Closed
Project: Magnolia UI
Component/s: actionbar, forms
Affects Version/s: 5.2.5, 5.3
Fix Version/s: 5.2.7, 5.3.1

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: XML File config.modules.standard-templating-kit.dialogs.components.content.stkText.xml    
Issue Links:
causality
relation
is related to MGNLUI-6591 Hide tabs without fields 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
Date of First Response:

 Description   

A] Using the extends override for ui items can result in blank tabs on forms or spaces in the action bar.

I have provided an export of a dialog which illustrates the issue. This dialog takes stkTextImage and overrides the image tab to make it essential an stkText component.

Here are the steps to reproduce:
1. Import the attached dialog into: confg:/modules/standard-templating-kit/dialogs/components/content
2. Configure the stkTextImage component to use this dialog
3. Try adding this component to a page
4. Notice that the form in the dialog still has 2 tabs. The overridden image tab is blank but should be completely removed.

B] Another place that strange behavior has been observed is with the action bar. For example, if you wanted to create a subApp that has a similar actionbar as another subApp but removes a couple items. If you add the extends override at the individual item level it leaves a space in the actionbar rather than suppressing it completely. We do something similar in this exercise: http://wiki.magnolia-cms.com/display/TRAINING5/Exercise%3A+Create+JCR-Browser+Sub-App (Part: 2 #2)



 Comments   
Comment by Roman Kovařík [ 05/Jun/14 ]

Property override overrides the content under the current node. It means that you end up with an empty node if you don't add any other properties. That's the reason why you have an empty tab.
I think you need to use property extends=override one level higher and extend all other tabs. But I agree that possibility to disable a tab would be nice improvement.

Comment by Stefan Baur [ 05/Jun/14 ]

Would it not make sense to hide tabs without content, instead of displaying an empty tab? That's how it worked in earlier magnolia versions.

Comment by Roman Kovařík [ 05/Jun/14 ]

Hi Stefan,
I completely agree. I adjusted the title/description of this issue since it's not an issue in the extends mechanism.

Regards
Roman

Comment by Richard Gange [ 05/Jun/14 ]

Thanks Roman. That makes more sense. It's not that extends isn't working, it's more of a problem with how the UI interprets it.

Comment by Roman Kovařík [ 18/Jun/14 ]

Please change when integrating:

- verify(view, times(0)).addFormSection(eq("emptyTab"), any(FormSection.class));
+ verify(view, never()).addFormSection(eq("emptyTab"), any(FormSection.class));
Generated at Mon Feb 12 09:01:55 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.