Problem/Motivation

Initially brought up in Convert theme_views_ui_build_group_filter_form() to Twig, but deemed out of scope.

In the Grouped filters table, there is a default checkbox and radio button, only one of which is available depending on whether the mode is set to allow multiple selections or a single selection. They are properly hidden however both of their labels are always shown.

Proposed resolution

Patch attached, fixes that.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NickDickinsonWilde’s picture

FileSize
935 bytes
joelpittet’s picture

This may also fix it? #2489826: tabledrag is broken

olli’s picture

Status: Active » Needs review
Issue tags: +VDC, +JavaScript

@joelpittet: This is about the double labels when configuring a grouped filter (edit frontpage view, click "Content: Publishing status (grouped)" below filter criteria, try un/checking "Allow multiple selections").

joelpittet’s picture

@olli ah thanks for clarifying.

droplet’s picture

  • +++ b/core/modules/views_ui/js/views-admin.js
    @@ -836,13 +836,13 @@
    + $('input.default-checkboxes').parent().hide()

    Missing `;`

  • All jQuery queries in `Drupal.behaviors.viewsUiChangeDefaultWidget` should be limited the scope to this form only.

----
Some Issues I've seen and can be fix in new threads (please pointed me to there if it's an issue opened already):

  • Hidden checkbox / radio box in this way is dirty markups and breaking accessibility I think.
  • vertical aligned radio selection in same column would looks better
  • Grouped filters, next to radio/checbox with label `Grouping 1`, `Grouping 2`, `Grouping 3`, not easy to understand what it is...
olli’s picture

FileSize
1.55 KB
1.59 KB

Fixed #5, thanks @droplet.
----
There's #2387353: Improve form element labels in views grouped filter for labels, not sure about the other points.

Hidden checkbox / radio box in this way is dirty markups and breaking accessibility I think.

Here we want to replace checkboxes with radios when user should select only one default value, and replace radios with checkboxes to allow selecting multiple default values. What is the right way to do that?

vertical aligned radio selection in same column would looks better

Maybe also change the order of Default and Label columns?

Grouped filters, next to radio/checbox with label `Grouping 1`, `Grouping 2`, `Grouping 3`, not easy to understand what it is...

I agree. Any ideas how to improve that?

droplet’s picture

Status: Needs review » Reviewed & tested by the community

Improve in #6 looks good and fixing the problems.

@olli,
I have no good idea for other issues yet :)

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs screenshots

I've tried to manually test this but there is quite a bit wrong with this form so it'd be great to have screenshot so I can see what this is fixing. Sorry for being dumb.

olli’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs screenshots
FileSize
1.54 KB
23.2 KB
21.87 KB

Reroll and screenshots.

olli’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 8d9f1ea and pushed to 8.0.x. Thanks!

  • alexpott committed 8d9f1ea on 8.0.x
    Issue #2496501 by olli, NickWilde: Grouped Filters Javascript...

Status: Fixed » Closed (fixed)

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