Problem/Motivation
Once #3293014: Support multiple source plugins to be used simultaneously is merged, we should follow up with the ability to control the order of the tabs.
We should be able to control the enabled/disabled status of each plugin as well as the order within the admin screen.
Steps to reproduce
Enable multiple plugins, you can't control the order of them.
Proposed resolution
(Updated from suggestions in comments) Open decision to whoever tries to implement it first. Consider tabledrag.
* Maybe add drag & drop to the checkboxes.
* An alternative to checkboxes would be a disabled section, like Field UI.
Remaining tasks
- ✅ File an issue about this project
- ☐ Manual Testing
- ☐ Code Review
- ☐ Accessibility Review
- ☐ Automated tests needed/written?
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | Screenshot from 2022-08-17 10-48-40.png | 77.38 KB | vighneshh |
| #34 | Screenshot from 2022-08-17 10-49-03.png | 58.95 KB | vighneshh |
| #24 | 3299029 After MR .png | 60.72 KB | aarti zikre |
| #24 | 3299029 After mr extends.png | 141.08 KB | aarti zikre |
Issue fork project_browser-3299029
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 #2
tim.plunkettWill this only handle order, or will it also include enable/disable?
Comment #3
fjgarlin commentedGood point, my idea was to handle both.
Comment #4
fjgarlin commentedUpdated description with more details.
Comment #5
tim.plunkettI leave the decision to whoever tries to implement it first (tabledrag is a beast), but an alternative to checkboxes would be a disabled section, like Field UI. I'm fine with either.
Comment #6
fjgarlin commentedComment #7
narendrarComment #9
narendrarComment #10
fjgarlin commentedI tested this on drupalpod. Drag and drop works as expected, but if I click on the dropdown to change region, I get a javascript error and it does not work.
Javascript error:
Watchdog entry:
Comment #11
narendrarThanks @fjgarlin for the review. Fixed the error in latest commit.
Comment #12
fjgarlin commentedI re-tested everything again and it works great! Easy and familiar UI. The code looks good too, and there are additional tests.
Marking RTBC though reminding the above note
Comment #13
tim.plunkettOh while this is a great start, I'd like to improve the MR a bit more before merging (and avoid even a temporary dependency on Field UI).
@narendraR if you want to work on it more, please do. But if not, let me know and I'll try to make some time for it.
Comment #14
tim.plunkettThose are out of order, but that's my suggestion on how to proceed next. Steps 1-6
Comment #15
narendrarComment #17
tim.plunkettTurns out the the magic part of tabledrag I was thinking of isn't part of tabledrag. Field UI, Block UI, and Views UI all have custom JS written to link together the select element and the tabledrag placement.
See block.es6.js: https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/modules/bloc...
I pushed up another branch for now with the rest of the changes, but we'll need our own version of tableDrag.onDrop in a custom (non-Svelte) JS.
Comment #18
narendrarblock.js added and modified as per requirement to make drag/drop workable. But still lots of cleanup needs to be done in new js file and select list is still not working.
Also order of saved plugins is correct but it is not displayed correctly in front-end.
Comment #20
narendrarComment #22
bnjmnmEDIT: -- comment left in wrong issue --
Comment #23
aarti zikre commentedReviewing this issue
Comment #24
aarti zikre commentedReview the MR. Looks good to me.
We can change the order of the plugins. Also enable and disable feature is working properly(Attaching SS for reference).
However, Having some doubt.
Suppose currently, the sequence is
1. Drupal.org (mocked)
2. Random data
Then in the extend it shows the result of Drupal.org (mocked).
But if we change the sequence and make Random data at first position then still it shows the data of Drupal.org (mocked). So not sure on which bases it filtering data Based on the order or based on total result.
Comment #25
aarti zikre commentedComment #26
fjgarlin commentedIt's just storing in the cookies or local storage somewhere which one last the last one that you had open. I think it's a non-issue.
Comment #27
aarti zikre commentedOkay than look good to me
Moving to RTBC
Comment #28
bnjmnmLeft some feedback in the MR
Comment #29
narendrarResolved all threads but not able to mark them as resolved.
Comment #30
bnjmnmI spotted one place that likely needs a bit more test coverage, but this is very close to done. Nice work @narendraR
Comment #31
narendrarComment #32
vighneshh commentedi Will Review It.
Comment #33
vighneshh commentedDone UI testing of this thing and everything works properly.
We can control the order of the plugin.
Comment #34
vighneshh commentedAdded some screenshots for reference after the patch is applied.
Comment #36
tim.plunkettGreat work, thanks!