Merge pull request #12249 from vvlladd28/enhachment/mobile-cenet/help-whitespace

Improved mobile center
This commit is contained in:
Igor Kulikov 2024-12-16 17:53:57 +02:00 committed by GitHub
commit bec41c5bf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 34 additions and 9 deletions

View File

@ -30,6 +30,22 @@
<mat-form-field class="flex-1" appearance="outline" subscriptSizing="dynamic"> <mat-form-field class="flex-1" appearance="outline" subscriptSizing="dynamic">
<mat-label translate>mobile.page-name</mat-label> <mat-label translate>mobile.page-name</mat-label>
<input required matInput formControlName="label"> <input required matInput formControlName="label">
<mat-icon matSuffix
matTooltipPosition="above"
matTooltipClass="tb-error-tooltip"
matTooltip="{{ 'mobile.page-name-required' | translate }}"
*ngIf="customMobilePageForm.get('label').hasError('required') && customMobilePageForm.get('label').touched"
class="tb-error">
warning
</mat-icon>
<mat-icon matSuffix
matTooltipPosition="above"
matTooltipClass="tb-error-tooltip"
matTooltip="{{ 'mobile.page-name-cannot-contain-only-spaces' | translate }}"
*ngIf="customMobilePageForm.get('label').hasError('pattern') && 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">
@ -59,7 +75,7 @@
<input required matInput formControlName="url"> <input required matInput formControlName="url">
<mat-hint></mat-hint> <mat-hint></mat-hint>
<mat-error *ngIf="customMobilePageForm.get('url').hasError('pattern')"> <mat-error *ngIf="customMobilePageForm.get('url').hasError('pattern')">
{{ 'mobile.url-pattern' | translate }} {{ 'mobile.invalid-url-format' | translate }}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
</ng-container> </ng-container>
@ -69,7 +85,7 @@
<input required matInput formControlName="path"> <input required matInput formControlName="path">
<mat-hint></mat-hint> <mat-hint></mat-hint>
<mat-error *ngIf="customMobilePageForm.get('path').hasError('pattern')"> <mat-error *ngIf="customMobilePageForm.get('path').hasError('pattern')">
{{ 'mobile.path-pattern' | translate }} {{ 'mobile.invalid-path-format' | translate }}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
</ng-container> </ng-container>

View File

@ -60,7 +60,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], label: ['', [Validators.required, Validators.pattern(/\S/)]],
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(/^(https?:\/\/)?(localhost|([\w\-]+\.)+[\w\-]+)(:\d+)?(\/[\w\-._~:\/?#[\]@!$&'()*+,;=%]*)?$/)]], url: [{value:'', disabled: true}, [Validators.required, Validators.pattern(/^(https?:\/\/)?(localhost|([\w\-]+\.)+[\w\-]+)(:\d+)?(\/[\w\-._~:\/?#[\]@!$&'()*+,;=%]*)?$/)]],

View File

@ -42,6 +42,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-cannot-contain-only-spaces' | translate }}"
*ngIf="mobilePageRowForm.get('label').hasError('pattern') && mobilePageRowForm.get('label').touched"
class="tb-error">
warning
</mat-icon>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="isCustomMenuItem" <mat-form-field *ngIf="isCustomMenuItem"
class="tb-mobile-page-item-info flex" appearance="outline" subscriptSizing="dynamic"> class="tb-mobile-page-item-info flex" appearance="outline" subscriptSizing="dynamic">

View File

@ -99,7 +99,7 @@ export class MobilePageItemRowComponent implements ControlValueAccessor, OnInit,
mobilePageRowForm = this.fb.group({ mobilePageRowForm = this.fb.group({
visible: [true, []], visible: [true, []],
icon: ['', []], icon: ['', []],
label: ['', []], label: ['', [Validators.pattern(/\S/)]],
type: [MobilePageType.DEFAULT] type: [MobilePageType.DEFAULT]
}); });

View File

@ -72,7 +72,7 @@
<div class="flex-1" translate>mobile.configuration-step.more-information</div> <div class="flex-1" translate>mobile.configuration-step.more-information</div>
<a mat-stroked-button <a mat-stroked-button
color="primary" color="primary"
href="https://docs.flutter.dev/learn-flutter" href="https://docs.flutter.dev/get-started/learn-flutter"
target="_blank"> target="_blank">
<mat-icon class="tb-mat-24">rocket_launch</mat-icon>{{ 'mobile.configuration-step.getting-started' | translate }} <mat-icon class="tb-mat-24">rocket_launch</mat-icon>{{ 'mobile.configuration-step.getting-started' | translate }}
</a> </a>

View File

@ -193,8 +193,8 @@ export const HelpLinks = {
scadaSymbolDev: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/scada/scada-symbols-dev-guide/`, scadaSymbolDev: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/scada/scada-symbols-dev-guide/`,
scadaSymbolDevAnimation: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/scada/scada-symbols-dev-guide/#scadasymbolanimation`, scadaSymbolDevAnimation: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/scada/scada-symbols-dev-guide/#scadasymbolanimation`,
mobileApplication: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/mobile-qr-code/`, mobileApplication: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/mobile-qr-code/`,
mobileBundle: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/mobile-qr-code/`, mobileBundle: `${helpBaseUrl}/docs${docPlatformPrefix}/mobile-center/mobile-center/`,
mobileQrCode: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/mobile-qr-code/`, mobileQrCode: `${helpBaseUrl}/docs${docPlatformPrefix}/mobile-center/applications/`,
} }
}; };
/* eslint-enable max-len */ /* eslint-enable max-len */

View File

@ -3551,6 +3551,7 @@
"max-element-number": "Max elements number", "max-element-number": "Max elements number",
"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-type": "Page type", "page-type": "Page type",
"pages-types": { "pages-types": {
"dashboard": "Dashboard", "dashboard": "Dashboard",
@ -3558,9 +3559,9 @@
"custom": "Custom" "custom": "Custom"
}, },
"url": "URL", "url": "URL",
"url-pattern": "Invalid URL", "invalid-url-format": "Invalid URL format",
"path": "Path", "path": "Path",
"path-pattern": "Invalid path", "invalid-path-format": "Invalid path format",
"custom-page": "Custom page", "custom-page": "Custom page",
"edit-page": "Edit page", "edit-page": "Edit page",
"edit-custom-page": "Edit custom page", "edit-custom-page": "Edit custom page",