Merge pull request #3805 from vvlladd28/improvement/mac/filter

UI: Fixed show in Safari browser dashboard filter
This commit is contained in:
Igor Kulikov 2020-12-03 18:44:29 +02:00 committed by GitHub
commit 8519f0a9f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 36 deletions

View File

@ -27,10 +27,10 @@
</mat-toolbar> </mat-toolbar>
<div mat-dialog-content> <div mat-dialog-content>
<fieldset [disabled]="isLoading$ | async" fxLayout="column"> <fieldset [disabled]="isLoading$ | async" fxLayout="column">
<mat-checkbox fxFlex formControlName="editable" style="margin-bottom: 16px;"> <mat-checkbox formControlName="editable" style="margin-bottom: 16px;">
{{ 'filter.editable' | translate }} {{ 'filter.editable' | translate }}
</mat-checkbox> </mat-checkbox>
<div fxFlex fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> <div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px">
<mat-form-field fxFlex class="mat-block"> <mat-form-field fxFlex class="mat-block">
<mat-label translate>filter.display-label</mat-label> <mat-label translate>filter.display-label</mat-label>
<input matInput formControlName="label"> <input matInput formControlName="label">
@ -39,7 +39,7 @@
{{ 'filter.autogenerated-label' | translate }} {{ 'filter.autogenerated-label' | translate }}
</mat-checkbox> </mat-checkbox>
</div> </div>
<mat-form-field fxFlex class="mat-block"> <mat-form-field class="mat-block">
<mat-label translate>filter.order-priority</mat-label> <mat-label translate>filter.order-priority</mat-label>
<input matInput type="number" formControlName="order"> <input matInput type="number" formControlName="order">
</mat-form-field> </mat-form-field>

View File

@ -16,8 +16,8 @@
--> -->
<div fxLayout="column" class="mat-content mat-padding"> <div fxLayout="column" class="mat-content mat-padding">
<div fxLayout="column" *ngFor="let filter of filtersInfo | keyvalue; let last = last"> <div *ngFor="let filter of filtersInfo | keyvalue; let last = last">
<div fxFlex fxLayout="row" fxLayoutAlign="start center"> <div fxLayout="row" fxLayoutAlign="start center">
<mat-label fxFlex>{{filter.value.filter}}</mat-label> <mat-label fxFlex>{{filter.value.filter}}</mat-label>
<button mat-icon-button color="primary" <button mat-icon-button color="primary"
style="min-width: 40px;" style="min-width: 40px;"

View File

@ -29,37 +29,33 @@
</mat-progress-bar> </mat-progress-bar>
<div mat-dialog-content> <div mat-dialog-content>
<fieldset [disabled]="isLoading$ | async"> <fieldset [disabled]="isLoading$ | async">
<div fxFlex fxLayout="column"> <div formArrayName="userInputs"
<div fxFlex fxLayout="row" fxLayoutAlign="start center" *ngFor="let userInputControl of userInputsFormArray().controls; let $index = index">
formArrayName="userInputs" <div [ngSwitch]="userInputControl.get('valueType').value">
*ngFor="let userInputControl of userInputsFormArray().controls; let $index = index"> <ng-template [ngSwitchCase]="valueTypeEnum.STRING">
<div fxFlex fxLayout="column" <mat-form-field class="mat-block">
[ngSwitch]="userInputControl.get('valueType').value"> <mat-label>{{ userInputControl.get('label').value }}</mat-label>
<ng-template [ngSwitchCase]="valueTypeEnum.STRING"> <input matInput [formControl]="userInputControl.get('value')">
<mat-form-field fxFlex class="mat-block"> </mat-form-field>
<mat-label>{{ userInputControl.get('label').value }}</mat-label> </ng-template>
<input matInput [formControl]="userInputControl.get('value')"> <ng-template [ngSwitchCase]="valueTypeEnum.NUMERIC">
</mat-form-field> <mat-form-field class="mat-block">
</ng-template> <mat-label>{{ userInputControl.get('label').value }}</mat-label>
<ng-template [ngSwitchCase]="valueTypeEnum.NUMERIC"> <input required type="number" matInput [formControl]="userInputControl.get('value')">
<mat-form-field fxFlex class="mat-block"> </mat-form-field>
<mat-label>{{ userInputControl.get('label').value }}</mat-label> </ng-template>
<input required type="number" matInput [formControl]="userInputControl.get('value')"> <ng-template [ngSwitchCase]="valueTypeEnum.DATE_TIME">
</mat-form-field> <label class="tb-title no-padding tb-required">{{ userInputControl.get('label').value }}</label>
</ng-template> <tb-datetime [formControl]="userInputControl.get('value')"
<ng-template [ngSwitchCase]="valueTypeEnum.DATE_TIME"> dateText="filter.date"
<label class="tb-title no-padding tb-required">{{ userInputControl.get('label').value }}</label> timeText="filter.time"
<tb-datetime fxFlex [formControl]="userInputControl.get('value')" required [showLabel]="false"></tb-datetime>
dateText="filter.date" </ng-template>
timeText="filter.time" <ng-template [ngSwitchCase]="valueTypeEnum.BOOLEAN">
required [showLabel]="false"></tb-datetime> <mat-checkbox labelPosition="before" [formControl]="userInputControl.get('value')">
</ng-template> {{ userInputControl.get('label').value }}
<ng-template [ngSwitchCase]="valueTypeEnum.BOOLEAN"> </mat-checkbox>
<mat-checkbox labelPosition="before" fxFlex [formControl]="userInputControl.get('value')"> </ng-template>
{{ userInputControl.get('label').value }}
</mat-checkbox>
</ng-template>
</div>
</div> </div>
</div> </div>
</fieldset> </fieldset>