From: Pedro Gonzalez Gomez Date: Wed, 6 Jul 2022 09:51:17 +0000 (+0200) Subject: mgr/dashboard: added pattern validaton for form input X-Git-Tag: v17.2.4~129^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F47329%2Fhead;p=ceph.git mgr/dashboard: added pattern validaton for form input Fixes: https://tracker.ceph.com/issues/56133 Signed-off-by: Pedro Gonzalez Gomez (cherry picked from commit ec688a96d32eac8185351ff8bf3239131b083423) --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html index 4a28c3e57234..6c00f37d42d8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.html @@ -82,6 +82,9 @@ class="form-control" type="text" formControlName="display_name"> + The value is not valid. This field is required. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts index 5ab333771781..9d4e1ce601b7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts @@ -98,7 +98,7 @@ export class RgwUserFormComponent extends CdForm implements OnInit { ) ] ], - display_name: [null, [Validators.required]], + display_name: [null, [Validators.required, Validators.pattern(/^[a-zA-Z0-9!@#%^&*()_ -]+$/)]], email: [ null, [CdValidators.email],