Changes to title action buttons [Plugin maintainers: action needed]


Until today we have been using jQuery to ensure all title action buttons
have various classes that affect their layout. [1]
Using javascript for this is considered bad practice as these classes
should have been already set on the server side before rendering the page
and executing the JS. This also led to some inconsistencies in certain

In a commit that has just been merged, I have removed this code and moved
the class definitions to the helpers and views where relevant.
In addition, I have created a new helper, "new_link" which makes all the
"New X" buttons behave identically, reduces code duplication and makes sure
they are only shown to users with "create" permissions.
Two other helpers have been removed:

  • "add_html_classes" was only used once in the core and was
    over-complicated for what it did.
  • "toolbar_action_buttons" which performed the same action as the
    "action_buttons" helper and was also only used once.
    The complete changes can be seen at [2].

Plugin maintainers:
Please make sure any buttons you use for title actions set the required
classes - "btn btn-default" in most cases. If you have any "New" or "Help"
buttons, please use the "new_link" and "help_path" helpers respectively to
ensure the UI is consistent.
​Please also replace any uses of "toolbar_action_buttons" with "action_buttons"
and any
"add_html_classes" uses with manually adding any needed classes to
In case you have any questions or require assistance implementing these
changes, feel free to reach out to me.

​[1] ​

··· -- Have a nice day, Tomer Brisker Red Hat Engineering