Behavior tab should not show field group information or other non-behavior information

Created on 29 July 2019, over 5 years ago
Updated 9 March 2023, over 1 year ago

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

πŸ“Œ Task
Status

Needs review

Version

1.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States cgmonroe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡§πŸ‡ͺBelgium pbosmans

    Tested OK, but when $fieldgroup->format_settings['classes'] already contains a value (without a space at the end), then the 'paragraphs-content' class will concatinated with the already existing value. So the fieldgroup will still be visible in the behaviour view.
    A possible solution is to add a space at the begin of 'paragraphs-content' when $fieldgroup->format_settings['classes'] isn't empty.

Production build 0.71.5 2024