Problem/Motivation
If the content area of a paragraph makes use of field groups, e.g. accordions, the field sets get shown on the behavior perspective. This can make for a very confusing user experience.
Below is an example of this problem. Note the Background Color and Background Image field groups bleeding thru from the content tab.
There are probably other entry form widgets / changes that will result in the same confusion on the behavior panel.
The JS that shows the behavior tab should be more strict in what it shows.
Proposed resolution
The attached patch (in first comment) updates the paragraphs.admin.js to use the following logic:
When showing the behavior tab, first hide all Divs in the form table. Then show items marked as paragraphs-behavior including parent and descendant divs. Also show the paragraph-top elements (summary) and parent/descendants.
The show content code does the inverse of this.
The code is done in a manner that does not effect any items that may have a style="display: none;" attribute (e.g. paragraph action dropdowns) which jQuery's .show()/.hide() effects will overwrite.
Here's the result of this new code:
Note: This issue overlaps with
#2882783: Hide add paragraph buttons when viewing behaviors perspective β
but does not supersede it. It will remove the add paragraphs from the main areas but it does not remove the last add paragraph reference which is outside the area. If the above issues patch is installed with this patch, this last add paragraph will be removed. There may be some issues applying both patches since some of the code overlaps.
Remaining tasks
Unfortunately, the time allocated to fixing this problem did not allow me to write tests for this. So tests may be needed.
One question that would be nice to decide is if the paragraph actions sections (e.g. Collapse button, etc.) should be show on the behavior tab. IMHO, it is cleaner/more logical only to show these actions on the content tab where the results of the action is clear. Hiding the actions here is easy to do with a one line JS change (in patch but commented out).
User interface changes
The behavior tab will only show the required information with no 'bleed thru' from the content tab.
API changes
None
Data model changes
None