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.

Comments

crash_springfield created an issue. See original summary.

bircher’s picture

I 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.

lucaslg’s picture

Assigned: Unassigned » lucaslg
Issue tags: +DevDaysLisbon

I'll try something

bircher’s picture

cool! make sure to check that the chosen module is not enabled for the checkbox UI.

lucaslg’s picture

StatusFileSize
new43.08 KB
new6.8 KB

Here 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.

lucaslg’s picture

Status: Active » Needs review
lucaslg’s picture

Assigned: lucaslg » Unassigned
kimberlydb’s picture

Installed 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.

kimberlydb’s picture

Status: Needs review » Reviewed & tested by the community
dbjpanda’s picture

What 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.

rosk0’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
Status: Reviewed & tested by the community » Needs work
  1. +++ b/src/Form/ConfigSplitEntityForm.php
    @@ -84,13 +84,18 @@ class ConfigSplitEntityForm extends EntityForm {
    +      '#multiple' => true,
    

    Don't break Drupal code style, please revert this change.

  2. +++ b/src/Form/ConfigSplitEntityForm.php
    @@ -101,12 +106,12 @@ class ConfigSplitEntityForm extends EntityForm {
    +      '#multiple' => true,
    

    Same as above

  3. +++ b/src/Form/ConfigSplitEntityForm.php
    @@ -114,13 +119,14 @@ class ConfigSplitEntityForm extends EntityForm {
    +      '#multiple' => true,
    

    Same as above

  4. +++ b/src/Form/ConfigSplitEntityForm.php
    @@ -274,5 +320,4 @@ class ConfigSplitEntityForm extends EntityForm {
    -
    

    Please revert

rosk0’s picture

Some 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.

daggerhart’s picture

Status: Needs work » Needs review
StatusFileSize
new5.99 KB
new1.83 KB

Re-rolling with capitalized `TRUE`.

esteinborn’s picture

StatusFileSize
new128.08 KB

Patch 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:

Checkbox layout not aligned for longer items

kbeck303’s picture

Status: Needs review » Reviewed & tested by the community

I have tested the patch in comment #13 running Drupal Core 8.7.5 and it works great! Thanks for making the patch!

  • bircher committed 1ecfbab on 8.x-1.x
    Issue #2965738 by bircher, lucaslg, daggerhart, esteinborn, kimberlydb,...
bircher’s picture

Status: Reviewed & tested by the community » Fixed

Thank 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.