Fix bugs in the API tokens config page.
Review Request #12616 — Created Sept. 21, 2022 and submitted
Information | |
---|---|
maubin | |
Review Board | |
release-5.0.x | |
Reviewers | |
reviewboard | |
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 |
---|
Description | From | Last Updated |
---|---|---|
Typo in description: woudl -> would |
|
|
In this case, we'll alert but then continue on below and try to save with an undefined policy. Seems like … |
|
|
Let's move the definition of note into the if body here. No reason to fetch the value if we're not … |
|
|
Can you add a trailing comma here? |
|

Summary: |
|
||||||
---|---|---|---|---|---|---|---|
Commits: |
|
||||||
Diff: |
Revision 2 (+58 -28) |
Checks run (2 succeeded)
-
-
-
reviewboard/static/rb/js/accountPrefsPage/views/apiTokensView.es6.js (Diff revision 2) 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. -
reviewboard/static/rb/js/accountPrefsPage/views/apiTokensView.es6.js (Diff revision 2) Let's move the definition of
note
into theif
body here. No reason to fetch the value if we're not going to do anything with it. -
reviewboard/static/rb/js/accountPrefsPage/views/apiTokensView.es6.js (Diff revision 2) Can you add a trailing comma here?

Description: |
|
|||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||
Commits: |
|
|||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+64 -30) |