Fix bugs in the API tokens config page.

Review Request #12616 — Created Sept. 21, 2022 and submitted

Information

Review Board
release-5.0.x

Reviewers

While testing the new token expiration controls on the API tokens page, it was
discovered that the displayed expiration date would revert to an old value
whenever the policy type changed. To fix this, we update the displayed
expiration date whenever its value changes and whenever the token's information
is rendered.

This change also fixes two bugs related to the custom policy editor. The first
being that you couldn't set custom policies due to an out of scope variable.
Secondly, canceling out of the custom policy editor would sometimes revert to
the wrong value. This would happen for tokens that currently have a custom
policy set.

  • Manually tested a bunch of combinations of changing expiration dates,
    policies and notes on the tokens config page.
  • Ran JS unit tests.
Summary ID
Fix bugs on API tokens config page.
710a8b7776f8287c45cf29de3593421e8bad7e28
Description From Last Updated

Typo in description: woudl -> would

daviddavid

In this case, we'll alert but then continue on below and try to save with an undefined policy. Seems like …

daviddavid

Let's move the definition of note into the if body here. No reason to fetch the value if we're not …

daviddavid

Can you add a trailing comma here?

daviddavid
maubin
david
  1. 
      
  2. Show all issues

    Typo in description: woudl -> would

  3. Show all issues

    In this case, we'll alert but then continue on below and try to save with an undefined policy. Seems like we should probably just return here.

  4. Show all issues

    Let's move the definition of note into the if body here. No reason to fetch the value if we're not going to do anything with it.

  5. Show all issues

    Can you add a trailing comma here?

  6. 
      
maubin
david
  1. Ship It!
  2. 
      
chipx86
  1. Ship It!
  2. 
      
maubin
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.0.x (4695d74)