From a0e4a7738e1db892eb05608145201bc212ec3bfc Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Thu, 14 Nov 2024 10:52:58 +0200 Subject: [PATCH] UI: Add mobile custom page validation --- .../bundes/layout/custom-mobile-page.component.html | 8 ++++++++ .../mobile/bundes/layout/custom-mobile-page.component.ts | 4 ++-- .../bundes/mobile-app-configuration-dialog.component.ts | 2 +- ui-ngx/src/assets/locale/locale.constant-en_US.json | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.html b/ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.html index bde8187df0..f543126660 100644 --- a/ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.html +++ b/ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.html @@ -57,12 +57,20 @@ mobile.url + + + {{ 'mobile.url-pattern' | translate }} + mobile.path + + + {{ 'mobile.path-pattern' | translate }} + diff --git a/ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.ts b/ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.ts index df683cf572..8d2b0cc675 100644 --- a/ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.ts +++ b/ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.ts @@ -63,8 +63,8 @@ export class CustomMobilePageComponent implements ControlValueAccessor, Validato label: ['', Validators.required], type: [MobilePageType.DASHBOARD], dashboardId: ['', Validators.required], - url: [{value:'', disabled: true}, [Validators.required]], - path: [{value:'', disabled: true}, [Validators.required, Validators.pattern(/^((?!\s).)*$/)]] + url: [{value:'', disabled: true}, [Validators.required, Validators.pattern(/^(https?:\/\/)?(localhost|([\w\-]+\.)+[\w\-]+)(:\d+)?(\/[\w\-._~:\/?#[\]@!$&'()*+,;=%]*)?$/)]], + path: [{value:'', disabled: true}, [Validators.required, Validators.pattern(/^(\/[\w\-._~:\/?#[\]@!$&'()*+,;=%]*)?$/)]] }); private propagateChange = (_val: any) => {}; diff --git a/ui-ngx/src/app/modules/home/pages/mobile/bundes/mobile-app-configuration-dialog.component.ts b/ui-ngx/src/app/modules/home/pages/mobile/bundes/mobile-app-configuration-dialog.component.ts index 308f69ae50..897710def9 100644 --- a/ui-ngx/src/app/modules/home/pages/mobile/bundes/mobile-app-configuration-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/pages/mobile/bundes/mobile-app-configuration-dialog.component.ts @@ -53,7 +53,7 @@ export class MobileAppConfigurationDialogComponent extends DialogComponent