Skip to content

Draft: Added Validation For Metric Images URL

John Dorlus requested to merge gitlab-community/gitlab:Fixes#386254 into master

Closes #386254 (closed)

This PR addresses the above mentioned issue by adding the validation rules for the URL for the metrics image. Upon the form first loading, the url is considered valid because it is blank and the URL is allowed to be optional. Upon change, the URL is validated again and if it isn't a valid URL, there is a small message in red text stating that the URL is invalid right under the input element. Once the URL is either deleted or made to be valid, the error message goes away. If a user tries to submit the form while the URL is invalid, an alert pops up telling the user to properly address the URL issue. We can change this behavior to something more Vue-esque if desired

Screenshots

Empty State Upon Load

Screenshot_2023-01-12_at_8.30.37_PM

Invalid URL with single Character

Screenshot_2023-01-12_at_8.31.04_PM

Invalid URL With Improper Protocol

Screenshot_2023-01-12_at_8.31.27_PM

Valid URL

Screenshot_2023-01-12_at_8.31.55_PM

Empty State After Deleting Invalid URL

Screenshot_2023-01-12_at_8.30.37_PM

Edited by John Dorlus

Merge request reports