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

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

View File

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

View File

@ -1,5 +1,5 @@
<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-menu #sortMenu="matMenu">
@ -38,7 +38,7 @@
<mat-menu #sortValue="matMenu">
<button mat-menu-item *ngFor="let sortingField of sortingFields | mapValues"
(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}}
</span>
<ng-template #coloredValue>

View File

@ -4,3 +4,11 @@
color: $aquamarine;
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 {
@Input() sortingFields: Map<string, string>;
@Input() menuPosition = 'right';
@Input() defaultSortBy = 'key';
@Input() defaultSortBy = 'access-id';
@Output() performSorting = new EventEmitter<Sorting>();
@ -26,6 +26,7 @@ export class SortComponent implements OnInit {
changeSortBy(sortBy: string) {
this.sort.sortBy = sortBy;
console.log(sortBy);
this.search();
}