UI: Add Mobile bundle validators (PROD-5516).
This commit is contained in:
parent
c34574ae1a
commit
b6a7c3231b
@ -46,6 +46,14 @@
|
|||||||
class="tb-error">
|
class="tb-error">
|
||||||
warning
|
warning
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
|
<mat-icon matSuffix
|
||||||
|
matTooltipPosition="above"
|
||||||
|
matTooltipClass="tb-error-tooltip"
|
||||||
|
matTooltip="{{ 'mobile.page-name-max-length' | translate }}"
|
||||||
|
*ngIf="customMobilePageForm.get('label').hasError('maxlength') && customMobilePageForm.get('label').touched"
|
||||||
|
class="tb-error">
|
||||||
|
warning
|
||||||
|
</mat-icon>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
||||||
|
|||||||
@ -65,7 +65,7 @@ export class CustomMobilePageComponent implements ControlValueAccessor, Validato
|
|||||||
customMobilePageForm = this.fb.group({
|
customMobilePageForm = this.fb.group({
|
||||||
visible: [true],
|
visible: [true],
|
||||||
icon: ['star'],
|
icon: ['star'],
|
||||||
label: ['', [Validators.required, Validators.pattern(/\S/)]],
|
label: ['', [Validators.required, Validators.pattern(/\S/), Validators.maxLength(255)]],
|
||||||
type: [MobilePageType.DASHBOARD],
|
type: [MobilePageType.DASHBOARD],
|
||||||
dashboardId: this.fb.control<string>(null, Validators.required),
|
dashboardId: this.fb.control<string>(null, Validators.required),
|
||||||
url: [{value:'', disabled: true}, [Validators.required, Validators.pattern(WEB_URL_REGEX)]],
|
url: [{value:'', disabled: true}, [Validators.required, Validators.pattern(WEB_URL_REGEX)]],
|
||||||
|
|||||||
@ -44,6 +44,12 @@
|
|||||||
<mat-error *ngIf="bundlesForms.get('title').hasError('required')">
|
<mat-error *ngIf="bundlesForms.get('title').hasError('required')">
|
||||||
{{ 'mobile.title-required' | translate }}
|
{{ 'mobile.title-required' | translate }}
|
||||||
</mat-error>
|
</mat-error>
|
||||||
|
<mat-error *ngIf="bundlesForms.get('title').hasError('pattern')">
|
||||||
|
{{ 'mobile.title-cannot-contain-only-spaces' | translate }}
|
||||||
|
</mat-error>
|
||||||
|
<mat-error *ngIf="bundlesForms.get('title').hasError('maxlength')">
|
||||||
|
{{ 'mobile.title-max-length' | translate }}
|
||||||
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<tb-entity-autocomplete
|
<tb-entity-autocomplete
|
||||||
allowCreateNew
|
allowCreateNew
|
||||||
|
|||||||
@ -64,7 +64,7 @@ export class MobileBundleDialogComponent extends DialogComponent<MobileBundleDia
|
|||||||
platformType = PlatformType;
|
platformType = PlatformType;
|
||||||
|
|
||||||
bundlesForms = this.fb.group({
|
bundlesForms = this.fb.group({
|
||||||
title: ['', Validators.required],
|
title: ['', [Validators.required, Validators.pattern(/\S/), Validators.maxLength(255)]],
|
||||||
androidAppId: [null],
|
androidAppId: [null],
|
||||||
iosAppId: [null],
|
iosAppId: [null],
|
||||||
description: [''],
|
description: [''],
|
||||||
|
|||||||
@ -3640,6 +3640,8 @@
|
|||||||
"add-bundle": "Add bundle",
|
"add-bundle": "Add bundle",
|
||||||
"title": "Title",
|
"title": "Title",
|
||||||
"title-required": "Title is required",
|
"title-required": "Title is required",
|
||||||
|
"title-cannot-contain-only-spaces": "Title cannot contain only spaces",
|
||||||
|
"title-max-length": "Title should be less than 256",
|
||||||
"oauth-clients": "OAuth 2.0 clients",
|
"oauth-clients": "OAuth 2.0 clients",
|
||||||
"android-app": "Android App",
|
"android-app": "Android App",
|
||||||
"android-application": "Android Application",
|
"android-application": "Android Application",
|
||||||
@ -3671,6 +3673,7 @@
|
|||||||
"page-name": "Page name",
|
"page-name": "Page name",
|
||||||
"page-name-required": "Page name is required.",
|
"page-name-required": "Page name is required.",
|
||||||
"page-name-cannot-contain-only-spaces": "Page name cannot contain only spaces.",
|
"page-name-cannot-contain-only-spaces": "Page name cannot contain only spaces.",
|
||||||
|
"page-name-max-length": "Page name should be less than 256",
|
||||||
"page-type": "Page type",
|
"page-type": "Page type",
|
||||||
"pages-types": {
|
"pages-types": {
|
||||||
"dashboard": "Dashboard",
|
"dashboard": "Dashboard",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user