Browse Source
Merge pull request #12704 from deaflynx/fix/prod-5516-5525
Improve Mobile center Bundle validators, remove redundant request
pull/12722/head
Andrew Shvayka
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with
20 additions and
7 deletions
-
ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.html
-
ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page.component.ts
-
ui-ngx/src/app/modules/home/pages/mobile/bundes/mobile-bundle-dialog.component.html
-
ui-ngx/src/app/modules/home/pages/mobile/bundes/mobile-bundle-dialog.component.ts
-
ui-ngx/src/app/modules/home/pages/mobile/bundes/mobile-bundle-table-config.resolve.ts
-
ui-ngx/src/assets/locale/locale.constant-en_US.json
|
|
|
@ -46,6 +46,14 @@ |
|
|
|
class="tb-error"> |
|
|
|
warning |
|
|
|
</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> |
|
|
|
</div> |
|
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic"> |
|
|
|
|
|
|
|
@ -65,7 +65,7 @@ export class CustomMobilePageComponent implements ControlValueAccessor, Validato |
|
|
|
customMobilePageForm = this.fb.group({ |
|
|
|
visible: [true], |
|
|
|
icon: ['star'], |
|
|
|
label: ['', [Validators.required, Validators.pattern(/\S/)]], |
|
|
|
label: ['', [Validators.required, Validators.pattern(/\S/), Validators.maxLength(255)]], |
|
|
|
type: [MobilePageType.DASHBOARD], |
|
|
|
dashboardId: this.fb.control<string>(null, Validators.required), |
|
|
|
url: [{value:'', disabled: true}, [Validators.required, Validators.pattern(WEB_URL_REGEX)]], |
|
|
|
|
|
|
|
@ -44,6 +44,12 @@ |
|
|
|
<mat-error *ngIf="bundlesForms.get('title').hasError('required')"> |
|
|
|
{{ 'mobile.title-required' | translate }} |
|
|
|
</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> |
|
|
|
<tb-entity-autocomplete |
|
|
|
allowCreateNew |
|
|
|
|
|
|
|
@ -64,7 +64,7 @@ export class MobileBundleDialogComponent extends DialogComponent<MobileBundleDia |
|
|
|
platformType = PlatformType; |
|
|
|
|
|
|
|
bundlesForms = this.fb.group({ |
|
|
|
title: ['', Validators.required], |
|
|
|
title: ['', [Validators.required, Validators.pattern(/\S/), Validators.maxLength(255)]], |
|
|
|
androidAppId: [null], |
|
|
|
iosAppId: [null], |
|
|
|
description: [''], |
|
|
|
|
|
|
|
@ -185,11 +185,7 @@ export class MobileBundleTableConfigResolver { |
|
|
|
iosApp: data.iosApp |
|
|
|
} |
|
|
|
}).afterClosed() |
|
|
|
.subscribe(() => { |
|
|
|
if (afterAdd) { |
|
|
|
this.config.updateData(); |
|
|
|
} |
|
|
|
}); |
|
|
|
.subscribe(); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -3640,6 +3640,8 @@ |
|
|
|
"add-bundle": "Add bundle", |
|
|
|
"title": "Title", |
|
|
|
"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", |
|
|
|
"android-app": "Android App", |
|
|
|
"android-application": "Android Application", |
|
|
|
@ -3671,6 +3673,7 @@ |
|
|
|
"page-name": "Page name", |
|
|
|
"page-name-required": "Page name is required.", |
|
|
|
"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", |
|
|
|
"pages-types": { |
|
|
|
"dashboard": "Dashboard", |
|
|
|
|