Sign In: Show link to Terms of Use only if terms exist
What does this MR do and why?
On the Sign in page, there's a hard-coded link to the Terms of Use page (/-/users/terms
). But if no terms exist, the user is redirected back to the Sign in page. In that case, the link is useless (see also #372425 (comment 1113600607)). So let's show the link only if terms exist.
/cc @bufferoverflow
Screenshots or screen recordings
Before MR (if no terms exist):
After MR:
If terms exist | If terms don't exist |
---|---|
How to set up and validate locally
- Visit Sign In page: http://localhost:3000/users/sign_in
- Verify that no link is shown
- Sign in as administrator and add Terms of Use in the Admin area: http://localhost:3000/admin/application_settings/general#js-terms-settings
- Sign out
- Verify that the link is shown
Note: Once you added Terms of Use, you can't remove it again over UI, but using Rails:
ApplicationSetting::Term.destroy_all
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.