I'm following the development workflow but running into an issue with splitting configuration.
I'm trying to select more than one module for "Complete Split" (labeled "Blacklist" in the documentation) but the select UI makes this extremely difficult.
To create a split configuration, I have to go through a non-alphabetical list in a far-too-small window holding down the Ctrl button and clicking on every single module I want to split. This is just awful for user experience. Why not have check boxes so I can select modules in a reasonable fashion?
Furthermore, if I want to add another module to the split, I can't just click on it, save, and export configuration because doing so overrides what I previously have exported. This means that every time I want to make a change to configuration I have to re-select every module.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | Screen Shot 2019-01-22 at 12.27.16 PM.png | 128.08 KB | esteinborn |
| #13 | interdiff.txt | 1.83 KB | daggerhart |
| #13 | 2965738-13.patch | 5.99 KB | daggerhart |
| #5 | 2965738-5.patch | 6.8 KB | lucaslg |
| #5 | checkboxes_overflow.png | 43.08 KB | lucaslg |
Comments
Comment #2
bircherI am wondering if this is potentially a duplicate of: #2930585: Suggest using the chosen module
We could make the module list a list of checkboxes but that can grow very big too. Though arguably a permissions overview style list of checkboxes would be easier to manage than a multi select element. So similarly to the other issue we could use that instead when chosen is not installed.
Comment #3
lucaslg commentedI'll try something
Comment #4
birchercool! make sure to check that the chosen module is not enabled for the checkbox UI.
Comment #5
lucaslg commentedHere is a first shot.
What I did:
- added a function to test if Chosen is active
- if not, change fields from select to checkboxes
- added a function to read values from form_state depending on field type (the array content is a bit different for checkboxes)
- added a bit of css to add an overflow and adjust display
Here is how it looks like :

It does not change a lot from the current version but checkboxes are still easier to use than ctrl + click.
I thought about adding a bit more interactivity in javascript (we could imagine showing selecting value in another div on the right for instance) but it feels like we are going to develop a brand new widget similar to Chosen. Probably not worth it, even if would be dependency free.
I fixed the width and height of the checkbox divs (400 x 300px). I wonder if there are responsive classes available for this in the backoffice theme.
Comment #6
lucaslg commentedComment #7
lucaslg commentedComment #8
kimberlydb commentedInstalled this patch and it is definitely much more intuitive than the multi-select list. Seems to work well.
One minor thing - the constants in here were switched from uppercase to lowercase, but the Drupal standard is to have them as all uppercase.
Comment #9
kimberlydb commentedComment #10
dbjpanda commentedWhat about making the UI something like, "Select all except below " . One use case, I want to make a three split default, live and dev. Default will contain all the modules's config except some selected modules. So that I can ask my deploy team to drush csim default_config && drush csim live_config and can ask my developers team to use drush csim default_config && drush csim dev_config.
Comment #11
rosk0Don't break Drupal code style, please revert this change.
Same as above
Same as above
Please revert
Comment #12
rosk0Some of the points was lost in previous comment...
Please check test result page https://www.drupal.org/pift-ci-job/1007536 "14 coding standards messages, 14 more than branch result" means this patch introduced 14 new code style violations.
Comment #13
daggerhart commentedRe-rolling with capitalized `TRUE`.
Comment #14
esteinborn commentedPatch applied cleanly, and adds a checkbox next to all of the options as advertised.
Might want to lengthen the options boxes to make them wider, as sometimes when there is long config it wraps and breaks the flow of the checkmarks:
Comment #15
kbeck303 commentedI have tested the patch in comment #13 running Drupal Core 8.7.5 and it works great! Thanks for making the patch!
Comment #17
bircherThank you all very much for your contribution!
I switched around a the css a bit and I added a variable for the multi select type and fixed coding standards. But it looks great now also without the chosen module.