Unify validation errors for Harbor integration form

Scenario

When testing the Harbor registry, we noticed this different ways of showing the validation error.

Note: This is minor and does not affect functionality.

When enabling the integration, Project name and Harbor username are both required but looks like they have different validation methods:

  • Harbor username is validated through an HTML required. It blocks the submission of the form when username is not present.
  • Project name is validated through rails form validations. The form continues to submit and hit the server even if the project name is empty. The error happens on the rails side.

A. Harbor Username with a HTML error Screenshot_2023-02-05_at_21.48.02

B. Project Name with a Rails form error Screenshot_2023-02-05_at_21.48.26

Proposed Solution

Ideally, Project name should also have a HTML required validation so it does not need to make a call to the server as it is already required in the HTML. The same validation method also provides for a more uniform user experience.