Make the expiration controls on the API tokens config page nicer.
Review Request #12670 — Created Oct. 5, 2022 and submitted
This change offers several improvements to the expiration controls on the
API tokens config page:
- Users can edit the expiration of expired tokens.
- Users can set the specific time of the expiration.
- Users can set the expiration to a past date/time.With this, the API tokens config page offers the same flexibility for editing
expiration dates as the API.This change also resets the
expired_notification_sent
flag in a token's
extra_data
field whenever a token's expiration is updated, so that users can
get notified again if they set a new expiration date on already expired tokens.
- Ran JS unit tests.
- Ran
./reviewboard/webapi/tests/test_api_token.py
- Manually tested the expiration controls with various combinations of
starting states, ending states, and with the other controls on the page.
Summary | ID |
---|---|
2856e1c74e0a25cd93dc0069a30a72d7da6123a9 |
Description | From | Last Updated |
---|---|---|
Can you update the description to talk about the changes to the browser compatibility list? |
chipx86 | |
Let's put an Oxford Comma after description and change that to "expiration date and time". |
chipx86 | |
For chaining, the preferred format would be: this._$datePicker = $(dedent` ... `) .prepend(this.options.descriptorText); Though if we're looking to build this … |
chipx86 | |
We probably don't need to worry about changes here. This is important for transpiling code, but the usage of datetime-local … |
chipx86 | |
I think what Christian meant was: this._$datePicker = $( '<span class="rb-c-date-inline-editor__picker">' ) We also don't need the closing </span> here. |
david | |
No need for dedent here, since there's only one line. You can simply have a string on the next line. |
chipx86 | |
This will be 5.0.2 now. |
chipx86 | |
Same here. |
david | |
No need for dedent here. |
chipx86 | |
For repeat index lookups, let's assign to a variable. Helps group together related assertions, and reduces visual noise. |
chipx86 |
-
-
-
-
For chaining, the preferred format would be:
this._$datePicker = $(dedent` ... `) .prepend(this.options.descriptorText);
Though if we're looking to build this and put something in it at the same time, we should probably just use a template, or build the DOM elements incrementally (since we have to find the
input
, we might as well do the latter).
- Change Summary:
-
- Updated the description to mention the browser compatibility changes
- Updated the docs to mention that the expiration time can be changed
- Builds DOM elements incrementally for the
createField()
methods in the date and datetime inline editors.
- Description:
-
This change offers several improvements to the expiration controls on the
API tokens config page: - Users can edit the expiration of expired tokens. - Users can set the specific time of the expiration. - Users can set the expiration to a past date/time. With this, the API tokens config page offers the same flexibility for editing
~ expiration dates as the API. This change also resets the ~ expired_notification_sent
flag in a token'sextra_data
field whenever a~ token's expiration is updated, so that users can get notified again if they ~ set a new expiration date on already expired tokens. ~ expiration dates as the API. ~ ~ This change also resets the
expired_notification_sent
flag in a token's~ extra_data
field whenever a token's expiration is updated, so that users can+ get notified again if they set a new expiration date on already expired tokens. + + Lastly, the browser compatibility list was updated to reflect the support
+ needed for the datetime-local
input element which is used for editing+ the expiration date and time. - Commits:
-
Summary ID c5f65d0ad0f340f6dc8561996dcf35292124c256 04d47effac1538927529eb3e1c15f98a18cf0f2a c5f65d0ad0f340f6dc8561996dcf35292124c256 372e509e042577e45689b2cd0de79b4cd22299bb - Diff:
-
Revision 2 (+657 -97)
Checks run (2 succeeded)
- Change Summary:
-
Rebased onto release 5.0.x
- Commits:
-
Summary ID c5f65d0ad0f340f6dc8561996dcf35292124c256 372e509e042577e45689b2cd0de79b4cd22299bb b7b24f02fc942f1c2e1ae5f17d7bf7075e43eb95 52f52ecda4660ca099a83ea97bf2ff1fbd7d4676 - Diff:
-
Revision 3 (+656 -96)
Checks run (2 succeeded)
- Change Summary:
-
Squashed the change into one commit when moving the dev branch over to my new laptop.
- Commits:
-
Summary ID b7b24f02fc942f1c2e1ae5f17d7bf7075e43eb95 52f52ecda4660ca099a83ea97bf2ff1fbd7d4676 c63bf84a5cab7b9baed59d96514870621e98d9a0 - Diff:
-
Revision 4 (+652 -92)
Checks run (2 succeeded)
-
Looks really good! These changes are small.
-
We probably don't need to worry about changes here. This is important for transpiling code, but the usage of
datetime-local
doesn't really impact that. It's true thatdatetime-local
may not work on older browsers, but that's probably okay. People who need to be on older browsers that need to edit this can put in a date manually, if needed. -
No need for
dedent
here, since there's only one line. You can simply have a string on the next line. -
-
-
For repeat index lookups, let's assign to a variable. Helps group together related assertions, and reduces visual noise.
- Description:
-
This change offers several improvements to the expiration controls on the
API tokens config page: - Users can edit the expiration of expired tokens. - Users can set the specific time of the expiration. - Users can set the expiration to a past date/time. With this, the API tokens config page offers the same flexibility for editing
expiration dates as the API. This change also resets the
expired_notification_sent
flag in a token'sextra_data
field whenever a token's expiration is updated, so that users canget notified again if they set a new expiration date on already expired tokens. - - Lastly, the browser compatibility list was updated to reflect the support
- needed for the datetime-local
input element which is used for editing- the expiration date and time. - Commits:
-
Summary ID c63bf84a5cab7b9baed59d96514870621e98d9a0 b1ea6efb68b7bf734d33ee355728f05bcb0c32d3 - Diff:
-
Revision 5 (+698 -106)
Checks run (2 succeeded)
- Commits:
-
Summary ID b1ea6efb68b7bf734d33ee355728f05bcb0c32d3 2856e1c74e0a25cd93dc0069a30a72d7da6123a9 - Diff:
-
Revision 6 (+698 -106)