TSK-1466: fix bug in sort component

This commit is contained in:
Franzi321 2020-11-13 08:27:50 +01:00
parent ea38c7ddba
commit 7693c25efa
5 changed files with 16 additions and 8 deletions

View File

@ -16,7 +16,7 @@
.has-changes { .has-changes {
border-bottom: 1px solid $brown; border-bottom: 1px solid $brown;
} }
.table > thead > tr > th { .table > thead > tr > th {
max-width: 150px; max-width: 150px;

View File

@ -22,8 +22,8 @@
} }
.sidenav__drawer__container { .sidenav__drawer__container {
display:flex; display: flex;
flex-direction:row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
color: white; color: white;
margin-top: 5px; margin-top: 5px;
@ -36,7 +36,6 @@
.sidenav__drawer__container-logout { .sidenav__drawer__container-logout {
text-align: end; text-align: end;
margin-right: 15px; margin-right: 15px;
} }
.sidenav__drawer-version { .sidenav__drawer-version {

View File

@ -1,5 +1,5 @@
<div class="sort"> <div class="sort">
<button mat-stroked-button style="color: #555;" [matMenuTriggerFor]="sortMenu" matTooltip="Sort workbaskets"> <button class="sort__button" mat-stroked-button style="color: #555;" [matMenuTriggerFor]="sortMenu" matTooltip="Sort workbaskets">
<mat-icon>sort</mat-icon> <mat-icon>sort</mat-icon>
<mat-menu #sortMenu="matMenu"> <mat-menu #sortMenu="matMenu">
@ -38,7 +38,7 @@
<mat-menu #sortValue="matMenu"> <mat-menu #sortValue="matMenu">
<button mat-menu-item *ngFor="let sortingField of sortingFields | mapValues" <button mat-menu-item *ngFor="let sortingField of sortingFields | mapValues"
(click)="changeSortBy(sortingField.key)"> (click)="changeSortBy(sortingField.key)">
<span *ngIf="sortingField.value.toLowerCase() === sort.sortBy; else coloredValue" class="sort__selected-value"> <span class="{{sortingField.key === sort.sortBy ? 'sort__selected-value' : ''}}">
{{sortingField.value}} {{sortingField.value}}
</span> </span>
<ng-template #coloredValue> <ng-template #coloredValue>

View File

@ -4,3 +4,11 @@
color: $aquamarine; color: $aquamarine;
font-weight: bold; font-weight: bold;
} }
.sort__button {
outline: none;
}
.mat-menu-item {
outline: none;
}

View File

@ -9,7 +9,7 @@ import { Direction, Sorting } from 'app/shared/models/sorting';
export class SortComponent implements OnInit { export class SortComponent implements OnInit {
@Input() sortingFields: Map<string, string>; @Input() sortingFields: Map<string, string>;
@Input() menuPosition = 'right'; @Input() menuPosition = 'right';
@Input() defaultSortBy = 'key'; @Input() defaultSortBy = 'access-id';
@Output() performSorting = new EventEmitter<Sorting>(); @Output() performSorting = new EventEmitter<Sorting>();
@ -26,6 +26,7 @@ export class SortComponent implements OnInit {
changeSortBy(sortBy: string) { changeSortBy(sortBy: string) {
this.sort.sortBy = sortBy; this.sort.sortBy = sortBy;
console.log(sortBy);
this.search(); this.search();
} }