It would be nice if the Instant Filter is also added to permission configuration form, as that form also grows pretty big while more modules are installed.

Comments

casey’s picture

Status: Active » Postponed

For this featue we need the ability to group table rows: #31535: Allow table row groups in table.html.twig and template_preprocess_table().

klonos’s picture

...subscribing.

Kiphaas7’s picture

A js snippet I worked on a little bit to add multiple tbody's to the permissions form. It's not done, but more of a concept to show that workarounds are possible:

var $table = jQuery('table');
var $rows = $table.find('tbody tr');
var groups = [];

$rows.each(function(i) {
  var $this = jQuery(this);
  if ($this.find('td').length === 1) {
    groups.push({number: i, element: $this});
  }
});

var len = groups.length;
var output = '';
if (len) {
  for (var i = 0; i < len; i++) {
    if (i === 0 && i === (len - 1)) {
      // Only a single item group, wrap around the entire collection.
      var part = $rows.wrapAll('<tbody></tbody>').parent();
    }
    else if (i !== (len - 1)) {
      // Wrap around the current untill the next item in the array.
      var part = $rows.slice(groups[i].number, groups[(i + 1)].number).wrapAll('<tbody></tbody>').parent();
    }
    else if (i === (len - 1)) {
      // Last group, wrap around the current item untill the end of the
      // collection.
      var part = $rows.slice(groups[i].number).wrapAll('<tbody></tbody>').parent();
    }

    var id = 'group-' + groups[i].element.find('td:first').attr('id');
    output += '<tbody id="' + id + '">' + part.html() + '</tbody>';
  }
}

$table.find('tbody').replaceWith(output);
Kiphaas7’s picture

Status: Postponed » Active

...And because the core issue mentioned in #1 got pushed to D8, this does not need to be postponed any more :).

casey’s picture

I think we should override #theme for this admin page and add a theme_table_intstantfilter() in this module for as long as #31535: Allow table row groups in table.html.twig and template_preprocess_table() is not fixed.

Kiphaas7’s picture

But wouldn't that be effectively duplicating theme_table, plus the patch of 31535? In other words, huge code additions to instantfilter?

casey’s picture

Yes it would, however not too huge in my opinion. Plus it would be a good showcase why #31535: Allow table row groups in table.html.twig and template_preprocess_table() should land.

Kiphaas7’s picture

Hmm, since you worked on that patch, would you be willing to throw it in here? Might be a nice reason for a beta3 release ;).

Kiphaas7’s picture

Also, shameless plug for #1255172: [meta] Roadmap to RC and eventually stable release.. Would really appreciate your input as project lead (:D) there!

Kiphaas7’s picture

Priority: Normal » Major
Dave Reid’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Active » Fixed

7.x-2.0 has been released which adds support for filtering the permissions page.

Status: Fixed » Closed (fixed)

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