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.
The Drag&drop action should not be shown when translating
When translating, it is currently shown inconsistently.
Comment | File | Size | Author |
---|---|---|---|
#20 | interdiff-2918713-16-20.txt | 486 bytes | johnchque |
#20 | hide_drag_drop-2918713-20.patch | 7.89 KB | johnchque |
| |||
#16 | interdiff-2918713-13-16.txt | 2.25 KB | johnchque |
#16 | hide_drag_drop-2918713-16.patch | 7.94 KB | johnchque |
| |||
#16 | hide_drag_drop-2918713-16-test-only.patch | 3.47 KB | johnchque |
Comments
Comment #2
casey CreditAttribution: casey at SWIS commentedComment #3
johnchqueWe will need tests for this.
Comment #4
miro_dietikerFunny thing, i also thought that we should hide this...
But if we hide that button, we should also disable the drag handles. Either disallow both or none.
For current UX consistency, it makes sense to maximally reduce the UI while translating.
Comment #5
miro_dietikerComment #6
miro_dietikerThis is now simply first about checking $this->allowReferenceChanges() instead isTranslating.
To hide the drag handlers of the table rows completely i opened #2932334: Hide drag handler while translating
Comment #7
BerdirI don't think it's Novice, the order problem of when we initialize translation stuff remains, also needs a test. Maybe we can change allowReferenceChanges() to automatically initialize isTranslating if not.
Comment #8
johnchqueAdding tests. :)
Comment #10
Berdirdon't move this part, this needs to be done first. that might already be enough to fix the problem.
if header actions also return the complete button, then we need to move that out of that function into the part that must stay on top.
Comment #11
johnchqueHmm finally got it working, not sure if this is the best way, gonna see what happens with testbot. :)
Comment #13
BerdirComment #14
BerdirThis is what I was thinking. We separate the two cases, which allows us to remove a lot of conditional code.
Haven't tried the tests yet.
Comment #15
BerdirComment #16
johnchqueWow looks nice, always wondered why both buttons where built in the same place. :)
Improved tests and added allowReferenceChanges to both buttons. Also added test only patch.
Comment #18
Berdir> added allowReferenceChanges to both buttons
I removed that on purpose from the complete button. You can only enter drag and drop mode if references have been allowed, it is not necessary to check that again then. but yes, needed for the other one, looks like I dropped that when refactoring.
Comment #19
miro_dietikerComment #20
johnchqueRight, it makes sense. Thank you.
Comment #22
miro_dietikerThx, committed. Now ALL buttons are gone while translating. :-)
(Just the regular table drag handles remaining...)