Page MenuHomePhabricator

horizon.tables.FixedFilterAction failing in puppet gui
Closed, ResolvedPublic

Description

On labtesthorizon the instance puppet tab users filter buttons implemented by horizon.tables.FixedFilterAction. The buttons render correctly and display the correct counts, but as soon as I add that filter the table empties out and the buttons do nothing.

I've confirmed that the filter methods themselves are returning the correct values; I've compared their behavior to similar code in the Image panel to confirm that the behavior is consistent. Probably something is broken on the client side where, presumably, the filtered and unfiltered lists are meant to be cached.

Usually when I have problems like this it's because of some simple difference in the rendered html or js which I'm too clueless to notice.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I've figured this out - horizon uses categorize to count the number of items in each, but the JS relies upon 'category-' + category classes to do the actual filtering on the client. openstack_dashboard's project images table deals with this by setting Meta.row_class to a tables.Row subclass (see /usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/images/images/tables.py). It has a load_cells function that adds the classes.

I've live hacked a fix on labtestweb2001 in /usr/lib/python2.7/dist-packages/wikimediapuppettab/puppet_tables.py

This is so much better now!