integral
integral copied to clipboard
UX Improvement: When creating list URLs add option to use domain as root of the URL.
Description of issue
When creating a new list item that is a link, I have to give the full URL for links within my own domain. I should be able to just use the path without any domain and it will automatically know to prepend my domain URL.
e.g. I want to be able to add a list item with the url http://mydomain.com/foo/bar
, when I create the item I should only have to add the URL /foo/bar
.
Current behaviour
Have to enter full URL for list item links.
Expected behaviour
Auto prepend domain URL onto list item links when the domain hasn't been provided. Alternatively add a checkbox to say this is an internal link which
This validation is carried out by Parsley (client side only) - It automatically validates the field with a URL regex because as it is a URL type. Workaround for this would be to change the type of the field to text. However then the only validation that would be carried out would be a presence check.
Possible improvement would be to carry out a custom validation, validates URL regex OR valid path.
We could also make a request to the URL and check if we get a healthy response, if we get a 404 or anything like that, then inform the user the link is broken. This would stop users adding broken links to the page, as regex would only catch a valid URL, but not a broken link.