chipx86 got a fish trophy!
Improve list item state support for config forms.
Review Request #11011 — Created May 6, 2020 and submitted
This makes a few improvements to the item state support in list
forms, supporting some common patterns.
First, there's now a standard "error" state, used for items that have
failed in some way (useful for items that represent loadable things or
operations). This goes along with existing "enabled" and "disabled"
states, and has standard colors.
A new CSS class (
djblets-c-config-forms-list__item-state), used for
showing a representation of an item state, has been added as well. This
makes use of a new registered text color code and icon provided when
This new class can be added to an item's template, and it will be
automatically populated with the correct text for the item. This involves
model attribute on the item. This will not only apply the new text and
icon, but it will also apply the CSS modifier class to the item itself.
This all results in a lot less that items have to manage. They no longer
need to compute their own CSS classes to define item states, or maintain
custom columns. They can just set an attribute.
Items that do need specialized CSS classes or text can override the
Djblets.Config.ListItem.itemStateTextsto provide this customization.
Unit tests passed.
Updated the integrations support (not part of this change) and verified
all the state updating worked.
I feel like we use "El" when we're talking about a DOM element rather than a jQuery. How about just ...
Revision 2 (+380 -18)
Checks run (2 succeeded)