Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When in behavior perspective we still have the Add paragraph buttons. This makes the behavior form less obvious and harder to find.
Proposed resolution
Hide Add paragraph buttons too.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#31 | 2882783-hide-add-paragraph-31.patch | 5 KB | Berdir |
| |||
#29 | 2882783-hide-add-paragraph-29-interdiff.txt | 929 bytes | sasanikolic |
#29 | 2882783-hide-add-paragraph-29.patch | 5 KB | sasanikolic |
| |||
#27 | 2882783-hide-add-paragraph-27-interdiff.txt | 893 bytes | sasanikolic |
#27 | 2882783-hide-add-paragraph-27.patch | 4.09 KB | sasanikolic |
Comments
Comment #2
Primsi CreditAttribution: Primsi at MD Systems GmbH for MD Systems GmbH commentedPostponed until #2877847: Perspective tabs misbehave when multiple paragraphs fields gets in.
Comment #3
Primsi CreditAttribution: Primsi at MD Systems GmbH for MD Systems GmbH commentedComment #4
toncic CreditAttribution: toncic at MD Systems GmbH commentedAfter committing #2877847: Perspective tabs misbehave when multiple paragraphs fields we can continue with this.
Comment #5
toncic CreditAttribution: toncic at MD Systems GmbH commentedChanged .js a little bit, uploading screenshot.
Comment #6
miro_dietikerIf we define this as favorised, then we need to test cover it.
Comment #7
toncic CreditAttribution: toncic at MD Systems GmbH commentedThis should wait for this one #2877847: Perspective tabs misbehave when multiple paragraphs fields
Comment #8
miro_dietikerThe other issue was fixed long ago... :-)
With variable length, the related issue about scrolling is even more important.
Comment #9
BerdirReroll, cleaner approach for adding the class and better class name.
Will look at tests.
Comment #10
BerdirComment #11
BerdirHere are tests and removed the changes from the old widget, that doesn't have behaviors, no point in changing that.
Comment #13
miro_dietikerI tested it with default Paragraphs install based on Paragraphs Collection (with Dropbutton as add mode) and it didn't work.
In fact this is the problem:
The additional attribute added before is then overwritten.
Also as discussed, this works very well with the collapse all mode and the patch for sticky perspective tabs... Then switching the tabs leads to persistent scroll position as nothing above the viewport changes in height. But as soon as container like items above the viewport are expanded, the scroll position is messed up and you loose orientation. And now it's even harder to identify the item again.
Autocollapse is an optional thing, so this would be a UX degradation for most users IMHO if we get the sticky perspective tabs without scroll preservation.
The problem is also: If we would output the Paragraph summary on the behavior tab, it is likely outdated (or even empty for a just added Paragraph).
I would vote for this sequence:
- #2825581: [META] Introduce a sticky header
- #2901995: Scroll to the right position after edit / collapse
- (this issue) #2882783: Hide add paragraph buttons when viewing behaviors perspective
Comment #14
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedThe class should be added to the button now, and properly hidden on the behavior tab.
I am wondering, why don't we hide and show these things with css?
Comment #15
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedComment #17
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedThis should work.
Comment #18
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedComment #20
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedThis patch should apply.
Comment #21
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedComment #23
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedAdded some improvements and code fixes.
Comment #25
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedRerolled again.
Comment #27
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedI missed the button wrapper for the case when there is only one paragraph to add. This should make the test pass.
Comment #29
sasanikolic CreditAttribution: sasanikolic at MD Systems GmbH commentedThis should fix the failing test.
Comment #30
BerdirSoft-postponed on #3025693: Scroll to the right position after switching Behavior/Content tabs
Comment #31
BerdirReroll.
Comment #32
BerdirCommitted!