Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add form validation for CreateProcessDialog #2129

Merged
merged 7 commits into from
May 4, 2020
Next Next commit
Do not lazy translate shouldBeValidName() validation rule
  • Loading branch information
swaterkamp committed Apr 30, 2020
commit c08999f0778bc3a912dafa514176f1be483a21b6
2 changes: 1 addition & 1 deletion gsa/src/web/components/form/useFormValidation.js
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ export const shouldBeValidPassword = (password = '') => password.length > 5;
export const shouldBeValidName = (string = '') =>
string.match(/^[.#\-_ ,/a-z0-9]+$/i) !== null; // this is analogue to the
// regex in gsad.c for 'name'
export const VALID_NAME_ERROR_MESSAGE = _l(
export const VALID_NAME_ERROR_MESSAGE = _(
'The name must include at least one alphanumeric character or one of .,-_# and space.',
);
export default useFormValidation;