Browse Source

Merge pull request #14151 from mtsymbarov-del/fix/dashboard-filter-translations

Add support for custom translations in the dashboard user filters dialog
pull/14267/head
Igor Kulikov 11 months ago
committed by GitHub
parent
commit
475fe5b8c4
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 14
      ui-ngx/src/app/modules/home/components/filter/user-filter-dialog.component.html

14
ui-ngx/src/app/modules/home/components/filter/user-filter-dialog.component.html

@ -17,7 +17,7 @@
-->
<form [formGroup]="userFilterFormGroup" (ngSubmit)="save()" style="width: 400px;" class="user-filter-dialog">
<mat-toolbar color="primary">
<h2>{{ filter.filter }}</h2>
<h2>{{ filter.filter | customTranslate }}</h2>
<span class="flex-1"></span>
<button mat-icon-button
(click)="cancel()"
@ -33,14 +33,14 @@
*ngFor="let userInputControl of userInputsFormArray().controls; let $index = index">
<div [ngSwitch]="userInputControl.get('valueType').value">
<ng-template [ngSwitchCase]="valueTypeEnum.STRING">
<mat-form-field class="mat-block">
<mat-label>{{ userInputControl.get('label').value }}</mat-label>
<mat-form-field class="mat-block" appearance="outline">
<mat-label>{{ userInputControl.get('label').value | customTranslate }}</mat-label>
<input matInput [formControl]="userInputControl.get('value')">
</mat-form-field>
</ng-template>
<ng-template [ngSwitchCase]="valueTypeEnum.NUMERIC">
<mat-form-field class="mat-block">
<mat-label>{{ userInputControl.get('label').value }}</mat-label>
<mat-form-field class="mat-block" appearance="outline">
<mat-label>{{ userInputControl.get('label').value | customTranslate }}</mat-label>
<input required type="number" matInput [formControl]="userInputControl.get('value')">
<div matSuffix class="mr-2"
[class.!hidden]="!userInputControl.get('unitSymbol').value">
@ -49,14 +49,14 @@
</mat-form-field>
</ng-template>
<ng-template [ngSwitchCase]="valueTypeEnum.DATE_TIME">
<label class="tb-title no-padding tb-required">{{ userInputControl.get('label').value }}</label>
<label class="tb-title no-padding tb-required">{{ userInputControl.get('label').value | customTranslate }}</label>
<tb-datetime [formControl]="userInputControl.get('value')"
dateText="{{ 'filter.date' | translate }}"
required [showLabel]="false"></tb-datetime>
</ng-template>
<ng-template [ngSwitchCase]="valueTypeEnum.BOOLEAN">
<mat-checkbox labelPosition="before" [formControl]="userInputControl.get('value')">
{{ userInputControl.get('label').value }}
{{ userInputControl.get('label').value | customTranslate }}
</mat-checkbox>
</ng-template>
</div>

Loading…
Cancel
Save