Fix various issues with configforms table views.

Review Request #6050 — Created July 3, 2014 and submitted — Latest diff uploaded

Information

Djblets
release-0.8.x
d4865dd...

Reviewers

There were a few of bad assumptions made when using
TableView/TableItemView for configform item lists.

One was that there was already a <tbody> defined. This was the case in
the few places where we used it before, but isn't not always going to be
the case. We now add one if it's not already there.

The second bad assumption was that actions go on the element. In the
case of TableItemView, this is a <tr>. Now, ListItemView/TableItemView
subclasses can define a function to return where the actions should be
added. For TableItemView, this defaults to the last cell in the row.

The third bad assumption was that, by default, ListItemView would be
used if not specified otherwise, even for TableView. Now, ListView
subclasses can define their default.

Along with this, the template for TableItemView has been cleaned up to
remove extra whitespace, which matches a change made recently for
ListItemView.

Unit tests were added for all this. Some existing tests had to be
cleaned up, though, since they polluted prototype-level data.

Unit tests pass.

The issues I was hitting in some new code using TableItemView and TableView
were fixed.

    Loading...