Allow users to input username and full url for LinkedIn and Twitter. See also #13571
What does this MR do?
It allows users to input both their username only (e.g. 'testuser') as well as the full url for the twitter and linkedin profiles. It will validate input to ensure that it doesn't exceed a certain character limit (see #14406 (moved)) and that it doesn't contain special disallowed characters. If a user enters something that looks like a URL but doesn't match the social network's domain, it will also throw a validation error. See screenshots.
If there are special characters (fails format validation)
Are there points in the code the reviewer needs to double check?
Not particularly, but as a first-time contributor you may want to look at my approach and where I put things. @rspeicher thoughts?
Why was this MR needed?
As of now, if a user inputs the full URL into either the Twitter or LinkedIn field on their profile, no validation will occur even though the correct input is the username only, resulting in links like https://www.linkedin.com/in/https://linkedin.com/in/testuser
.
What are the relevant issue numbers?
Closes #13571 (moved), closes #14406 (moved), closes #17416 (closed)
Does this MR meet the acceptance criteria?
- [ YES] CHANGELOG entry added
- [ n/a] Documentation created/updated
- [ n/a] API support added
- Tests
- [ YES] Added for this feature/bug
- [YES, for spec/models/user ] All builds are passing
- [ YES] Conform by the style guides
- [ YES] Branch has no merge conflicts with
master
(if you do - rebase it please) - [YES ] Squashed related commits together