|
|
|
@ -16,65 +16,77 @@ |
|
|
|
|
|
|
|
--> |
|
|
|
<section fxLayout="column" [formGroup]="keyFilterListFormGroup"> |
|
|
|
<mat-expansion-panel [expanded]="true"> |
|
|
|
<mat-expansion-panel-header> |
|
|
|
<mat-panel-title> |
|
|
|
<div translate>filter.key-filters</div> |
|
|
|
</mat-panel-title> |
|
|
|
</mat-expansion-panel-header> |
|
|
|
<div fxLayout="row"> |
|
|
|
<span fxFlex="8"></span> |
|
|
|
<div fxLayout="row" fxLayoutAlign="start center" fxFlex="92"> |
|
|
|
<label fxFlex translate class="tb-title no-padding">filter.key-name</label> |
|
|
|
<label fxFlex translate class="tb-title no-padding">filter.key-type.key-type</label> |
|
|
|
<span [fxShow]="!disabled" style="min-width: 80px;"> </span> |
|
|
|
<span [fxShow]="disabled" style="min-width: 40px;"> </span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<mat-divider></mat-divider> |
|
|
|
<div class="key-filter-list"> |
|
|
|
<div fxLayout="row" fxLayoutAlign="start center" style="max-height: 40px;" |
|
|
|
formArrayName="keyFilters" |
|
|
|
*ngFor="let keyFilterControl of keyFiltersFormArray().controls; let $index = index"> |
|
|
|
<div fxFlex="8" class="filters-operation"> |
|
|
|
<span *ngIf="$index > 0" translate>filter.operation.and</span> |
|
|
|
<mat-accordion [multi]="true"> |
|
|
|
<mat-expansion-panel [expanded]="true"> |
|
|
|
<mat-expansion-panel-header> |
|
|
|
<mat-panel-title> |
|
|
|
<div translate>filter.key-filters</div> |
|
|
|
</mat-panel-title> |
|
|
|
</mat-expansion-panel-header> |
|
|
|
<div fxLayout="row"> |
|
|
|
<span fxFlex="8"></span> |
|
|
|
<div fxLayout="row" fxLayoutAlign="start center" fxFlex="92"> |
|
|
|
<label fxFlex translate class="tb-title no-padding">filter.key-name</label> |
|
|
|
<label fxFlex translate class="tb-title no-padding">filter.key-type.key-type</label> |
|
|
|
<span [fxShow]="!disabled" style="min-width: 80px;"> </span> |
|
|
|
<span [fxShow]="disabled" style="min-width: 40px;"> </span> |
|
|
|
</div> |
|
|
|
<div fxLayout="column" fxFlex="92"> |
|
|
|
<div fxLayout="row" fxLayoutAlign="start center" fxFlex> |
|
|
|
<div fxFlex>{{ keyFilterControl.value.key.key }}</div> |
|
|
|
<div fxFlex translate>{{ entityKeyTypeTranslations.get(keyFilterControl.value.key.type) }}</div> |
|
|
|
<button mat-icon-button color="primary" |
|
|
|
type="button" |
|
|
|
(click)="editKeyFilter($index)" |
|
|
|
matTooltip="{{ (disabled ? 'filter.key-filter' : 'filter.edit-key-filter') | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>{{disabled ? 'more_vert' : 'edit'}}</mat-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button color="primary" |
|
|
|
[fxShow]="!disabled" |
|
|
|
type="button" |
|
|
|
(click)="removeKeyFilter($index)" |
|
|
|
matTooltip="{{ 'filter.remove-key-filter' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>close</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<mat-divider></mat-divider> |
|
|
|
<div class="key-filter-list"> |
|
|
|
<div fxLayout="row" fxLayoutAlign="start center" style="max-height: 40px;" |
|
|
|
formArrayName="keyFilters" |
|
|
|
*ngFor="let keyFilterControl of keyFiltersFormArray().controls; let $index = index"> |
|
|
|
<div fxFlex="8" class="filters-operation"> |
|
|
|
<span *ngIf="$index > 0" translate>filter.operation.and</span> |
|
|
|
</div> |
|
|
|
<div fxLayout="column" fxFlex="92"> |
|
|
|
<div fxLayout="row" fxLayoutAlign="start center" fxFlex> |
|
|
|
<div fxFlex>{{ keyFilterControl.value.key.key }}</div> |
|
|
|
<div fxFlex translate>{{ entityKeyTypeTranslations.get(keyFilterControl.value.key.type) }}</div> |
|
|
|
<button mat-icon-button color="primary" |
|
|
|
type="button" |
|
|
|
(click)="editKeyFilter($index)" |
|
|
|
matTooltip="{{ (disabled ? 'filter.key-filter' : 'filter.edit-key-filter') | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>{{disabled ? 'more_vert' : 'edit'}}</mat-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button color="primary" |
|
|
|
[fxShow]="!disabled" |
|
|
|
type="button" |
|
|
|
(click)="removeKeyFilter($index)" |
|
|
|
matTooltip="{{ 'filter.remove-key-filter' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon>close</mat-icon> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<mat-divider></mat-divider> |
|
|
|
</div> |
|
|
|
<mat-divider></mat-divider> |
|
|
|
</div> |
|
|
|
<span [fxShow]="!keyFiltersFormArray().length" |
|
|
|
fxLayoutAlign="center center" [ngClass]="{'disabled': disabled}" |
|
|
|
class="no-data-found" translate>filter.no-key-filters</span> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 16px;"> |
|
|
|
<button mat-button mat-raised-button color="primary" |
|
|
|
[fxShow]="!disabled" |
|
|
|
(click)="addKeyFilter()" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'filter.add-key-filter' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
{{ 'filter.add-key-filter' | translate }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</mat-expansion-panel> |
|
|
|
<mat-expansion-panel [expanded]="true"> |
|
|
|
<mat-expansion-panel-header> |
|
|
|
<mat-panel-title> |
|
|
|
<div translate>filter.preview</div> |
|
|
|
</mat-panel-title> |
|
|
|
</mat-expansion-panel-header> |
|
|
|
<div class="tb-filter-preview"> |
|
|
|
<tb-filter-text [formControl]="keyFiltersControl"></tb-filter-text> |
|
|
|
</div> |
|
|
|
<span [fxShow]="!keyFiltersFormArray().length" |
|
|
|
fxLayoutAlign="center center" [ngClass]="{'disabled': disabled}" |
|
|
|
class="no-data-found" translate>filter.no-key-filters</span> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 16px;"> |
|
|
|
<button mat-button mat-raised-button color="primary" |
|
|
|
[fxShow]="!disabled" |
|
|
|
(click)="addKeyFilter()" |
|
|
|
type="button" |
|
|
|
matTooltip="{{ 'filter.add-key-filter' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
{{ 'filter.add-key-filter' | translate }} |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</mat-expansion-panel> |
|
|
|
</mat-expansion-panel> |
|
|
|
</mat-accordion> |
|
|
|
</section> |
|
|
|
|