Make the expiration controls on the API tokens config page nicer.

Review Request #12670 — Created Oct. 5, 2022 and updated

maubin
Review Board
release-5.0.x
reviewboard

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.

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.

  • 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
Allow users to edit expiration date ofexpired tokens from the API tokens config page.
Make the expiration date controls on the API tokens config page nicer.

Description From Last Updated

Can you update the description to talk about the changes to the browser compatibility list?

chipx86chipx86

Let's put an Oxford Comma after description and change that to "expiration date and time".

chipx86chipx86

For chaining, the preferred format would be: this._$datePicker = $(dedent` ... `) .prepend(this.options.descriptorText); Though if we're looking to build this …

chipx86chipx86
chipx86
  1. 
      
  2. Can you update the description to talk about the changes to the browser compatibility list?

  3. Let's put an Oxford Comma after description and change that to "expiration date and time".

  4. reviewboard/static/rb/js/ui/views/inlineEditorView.es6.js (Diff revision 1)
     
     
     
     
     
     

    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).

  5. 
      
maubin
Review request changed

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'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.

  ~ 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
-
Allow users to edit expiration date ofexpired tokens from the API tokens config page.
-
Make the expiration date controls on the API tokens config page nicer.
+
Allow users to edit expiration date ofexpired tokens from the API tokens config page.
+
Make the expiration date controls on the API tokens config page nicer.

Diff:

Revision 2 (+657 -97)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
Loading...