Fix calculation for expiring token badges

What does this MR do and why?

Fix calculation for tagging expiring tokens

In the vue_shared access tokens components, we should tag tokens that are expiring if the expiration happens in less or equal than two weeks (0-14 days, both included). However, currently tokens are tagged if the expiration is less than to weeks. We correct here this one-day offset.

Changelog: fixed

References

Screenshots or screen recordings

No changes except the expiring badge.

How to set up and validate locally

  1. Enable the migrate_user_access_tokens_ui feature flag.
  2. Go to https://gdk.test:3443/-/user_settings/personal_access_tokens
  3. Create a token with an expiry day of 15 days in the future. It should have an active badge.
  4. Create a token with an expiry day of 14 days in the future. It should have an expiring badge and it should be listed in the Tokens expiring in 2 weeks card.

image

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Eduardo Sanz García

Merge request reports

Loading