Update the API Tokens UI for setting token expiration dates.
Review Request #12597 — Created Sept. 15, 2022 and submitted — Latest diff uploaded
This change allows people to set token expiration dates from the API tokens
config page through a date picker. Consequently, expiration dates can also be
updated through the API. We create a
RB.DateInlineEditorViewto handle the
UI for the date editing.
This also updates the page to show the invalidated/expired text in
in red so that they stand out against valid tokens.
While running the JS unit tests it was discovered that the
RB.InlineEditorViewwould not disconnect from a window resize event that
it was handling, which caused problems with other JS tests when running the
full suite. This change adds a
handle this and disconnect from any events.
- Created new unit tests for setting the expiration date via the API
and ran all tests in
- Manually tested the API tokens page, setting various expiration dates and
making sure they were displayed and saved to the database properly.
DateInlineEditorViewJS tests and ran all JS tests.
- Manually tested resizing my browser that had the new review request page
open on it and saw that any inline editors that I was using on the page
would resize accordingly.