Update the API Tokens UI for new token format and status.

Review Request #12527 — Created Aug. 10, 2022 and submitted

Information

Review Board
release-5.0.x

Reviewers

This change updates the API tokens config page for most of the
features supported by the new API token generator:

  • Long API tokens are displayed nicely, inside an <input> element with
    a copy button.
  • A label shows when each token was last used.
  • Tokens which are expired or invalidated will show when that happened,
    and in the case of invalidation, will show the message.
  • Tokens with an expiration date will show the time left.

There's still some future work left to do in later changes:

  • Allow people to set the expiration date.
  • Show a warning when a token was created with a deprecated generator
    class.

Based on work by Michelle Aubin at /r/12492/

  • Ran unit tests.
  • Ran js-tests.
  • Set up a bunch of different API tokens with various expiration dates
    and validity settings. Checked that everything displayed correctly.
  • Checked that the copy button functioned as expected.
Summary ID
Update the API Tokens UI for new token format and status.
This change updates the API tokens config page for most of the features supported by the new API token generator: - Long API tokens are displayed nicely, inside an `<input>` element with a copy button. - A label shows when each token was last used. - Tokens which are expired or invalidated will show when that happened, and in the case of invalidation, will show the message. - Tokens with an expiration date will show the time left. There's still some future work left to do in later changes: - Allow people to set the expiration date. - Show a warning when a token was created with a deprecated generator class. Based on work by Michelle Aubin at /r/12492/ Testing Done: - Ran unit tests. - Ran js-tests. - Set up a bunch of different API tokens with various expiration dates and validity settings. Checked that everything displayed correctly. - Checked that the copy button functioned as expected.
737831d73541319b9f4b973c71106f6a6dae78c1

Description From Last Updated

I feel like the borders add so much visual noise. Can we maybe hide then until hovering over a row?

chipx86chipx86

Can we document these?

chipx86chipx86

"Copy to clipboard" should be localized.

chipx86chipx86

"Expired <...>" should be localized. Same for other strings in this template.

chipx86chipx86
chipx86
  1. Just some polishing stuff. None of these have to block this for beta 2, but I'd want to get them in after.

  2. I feel like the borders add so much visual noise. Can we maybe hide then until hovering over a row?

    1. Can I see a new screenshot with this change?

  3. Can we document these?

  4. "Copy to clipboard" should be localized.

    1. Because there's a whole bunch of text content, I just marked the entire template for localization.

    2. I don't think that's the right way to go. We should be separating out the content from the structure here, and there are clear areas of separation between them. But given beta 2 deadline, fine for now.

  5. "Expired <...>" should be localized.

    Same for other strings in this template.

  6. 
      
david
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-5.0.x (4c2c09f)
Loading...