Problem/Motivation
Original GH PR: https://github.com/nuvoleweb/ui_patterns/pull/208
UI Pattern definitions are in seemingly random order in the admin UI (e.g. in the Display Suite layout selector on "Manage Display" when using ui_patterns_layout and ui_patterns_ds).
I propose we sort them alphabetically. Luckily there is a trait for this that we can use :)
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Capture d’écran de 2022-11-21 16-12-57.png | 25.02 KB | grimreaper |
| #13 | Capture d’écran de 2022-11-21 16-13-27.png | 25.84 KB | grimreaper |
Issue fork ui_patterns-3311464
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
g4mbiniComment #6
g4mbiniComment #7
g4mbiniComment #8
grimreaperComment #11
grimreaperI have closed #3311342: Sort patterns library alphabetically by label on /patterns page in favor of this issue.
Comment #13
grimreaperBefore:
After:
I used ui_suite_bootstrap + ui_patterns_library_module_test + duplicate a button pattern into zbutton in the module.
As you can see now the patterns are sorted independently of the provider. If multiple patterns have the same label, sort by plugin ID.
I have added an automated test.
Thanks for the review.
Waiting until next monthly meeting to merge.
Comment #14
grimreaperFixing tests.
Comment #15
grimreaperThis time it is ready for the review.
Comment #16
duaelfrI added two minor comments about changes that are out of the scope of this issue (I ran the tests with and without these and they pass every time).
Except for these nitpicks, this is RTBC for me. Thanks for the work here!
On a side note: I'd have written the test as a Unit Test but that's fine with a Kernel one too (only a bit slower).
Comment #17
grimreaperHi,
Thanks for the review.
I have replied to the comments.
If you want to convert the test as a Unit one, feel free to do it ;)
Comment #19
grimreaperDiscussed during UI Suite monthly meeting.
Merged.
Thanks everyone!