Reset access token form selectively
What does this MR do and why?
In the personal access token page, the default date is removed after successfully creation of a token. That's because we reset the whole form.
In !93128 (merged) we introduced a default date for access tokens because we want to discourage users from creating never expiring tokens.
With this change the expiration date is preserved after successful creation of a token. Ideally, the datepicker should be reseted to the default date, but this is difficult at the moment, because these are two independent Vue components. So instead, as a compromise, we preserve the date, if one is used, after successful creation of a token.
In the near future, we are planning to convert the whole form into a Vue component. At that point, it would be easier to reset the datepicker to the default date.
Screenshots or screen recordings
Before
Screencast_from_2022-07-25_09_31_38_AM
After
Personal_Access_Tokens___User_Settings___GitLab
How to set up and validate locally
- Go to Profile > Personal access tokens
- Create access token
- Track how the values are reset except the datepicker
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.