mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Merged PR 701: #1850 Default Filter Active Button Styling
#1850 Default Filter Active Button Styling
This commit is contained in:
committed by
Lorenz Hilpert
parent
7dcb279a6b
commit
d7c65efdc4
@@ -1,6 +1,6 @@
|
||||
<shell-breadcrumb key="task-calendar"></shell-breadcrumb>
|
||||
|
||||
<button class="filter" (click)="filterActive$.next(true)">
|
||||
<button class="filter" [class.active]="hasFilter$ | async" (click)="filterActive$.next(true)">
|
||||
<ui-icon size="20px" icon="filter_alit"></ui-icon>
|
||||
<span class="label">Filter</span>
|
||||
</button>
|
||||
|
||||
@@ -15,7 +15,7 @@ shell-breadcrumb {
|
||||
}
|
||||
|
||||
&.active {
|
||||
@apply bg-dark-cerulean text-white ml-px-5;
|
||||
@apply bg-active-branch text-white ml-px-5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { BreadcrumbService } from '@core/breadcrumb';
|
||||
import { isSelectFilter } from 'apps/ui/filter/src/lib/type-guards';
|
||||
import { BehaviorSubject, Observable, of } from 'rxjs';
|
||||
import { delay, switchMap } from 'rxjs/operators';
|
||||
import { delay, map, switchMap } from 'rxjs/operators';
|
||||
import { TaskCalendarStore } from './task-calendar.store';
|
||||
|
||||
@Component({
|
||||
@@ -14,6 +15,16 @@ export class PageTaskCalendarComponent implements OnInit {
|
||||
filterActive$ = new BehaviorSubject<boolean>(false);
|
||||
showMainContent$ = this.getShowMainContent();
|
||||
|
||||
hasFilter$: Observable<boolean> = this.taskCalendarStore.selectFilter.pipe(
|
||||
map((filter) => {
|
||||
for (const f of filter) {
|
||||
if (isSelectFilter(f)) {
|
||||
return !!f.options.find((filterOption) => filterOption.selected);
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
constructor(private breadcrumb: BreadcrumbService, private taskCalendarStore: TaskCalendarStore) {
|
||||
this.taskCalendarStore.loadFilter();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user