Remove callout and replace with help text for personal access tokens
Problem to solve
A callout is presented to the user when the maximum lifetime of an access token is set, which does not conform to Pajamas.
Proposal
- Restrict the datepicker from allowing a user to pick a date later than the maximum life
- Replace the callout with a description field
- Add 1 day to maximum lifetime count, for example a user can create an access token for 2022-01-12
Before | After no expiration | After with expiration enforcement |
---|---|---|
Implementation plan
- Create a
parseExpiresAtFieldData
util inapp/assets/javascripts/access_tokens/utils.js
andee/app/assets/javascripts/access_tokens/utils.js
. Use that util in app/assets/javascripts/access_tokens/index.js#L19 - Create a
_expires_at_field.html.haml
partial inapp/views/shared/access_tokens
andee/app/views/shared/access_tokens
. Add app/views/shared/access_tokens/_form.html.haml#L32 to these partials. - Pass the value of the
max_personal_access_token_lifetime
to mount element inee/app/views/shared/access_tokens
- Inject
maxDate
into app/assets/javascripts/access_tokens/components/expires_at_field.vue. - Pass
maxDate
as a prop toGlDatepicker
Edited by Austin Regnery