Browse Source

Merge branch 'main' into bugfix/fix-state-of-delete-account-button

pull/911/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
ae85098a97
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 12
      libs/ui/src/lib/activities-filter/activities-filter.component.ts

1
CHANGELOG.md

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed the state of the account delete button (disable if account contains activities) - Fixed the state of the account delete button (disable if account contains activities)
- Fixed an issue in the activities filter component (typing a search term)
## 1.147.0 - 10.05.2022 ## 1.147.0 - 10.05.2022

12
libs/ui/src/lib/activities-filter/activities-filter.component.ts

@ -48,8 +48,8 @@ export class ActivitiesFilterComponent implements OnChanges, OnDestroy {
public constructor() { public constructor() {
this.searchControl.valueChanges this.searchControl.valueChanges
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe((currentFilter: Filter) => { .subscribe((filterOrSearchTerm: Filter | string) => {
if (currentFilter) { if (filterOrSearchTerm) {
this.filters$.next( this.filters$.next(
this.allFilters this.allFilters
.filter((filter) => { .filter((filter) => {
@ -59,9 +59,15 @@ export class ActivitiesFilterComponent implements OnChanges, OnDestroy {
}); });
}) })
.filter((filter) => { .filter((filter) => {
if (typeof filterOrSearchTerm === 'string') {
return filter.label return filter.label
.toLowerCase() .toLowerCase()
.startsWith(currentFilter.label.toLowerCase()); .startsWith(filterOrSearchTerm.toLowerCase());
}
return filter.label
.toLowerCase()
.startsWith(filterOrSearchTerm?.label?.toLowerCase());
}) })
.sort((a, b) => a.label.localeCompare(b.label)) .sort((a, b) => a.label.localeCompare(b.label))
); );

Loading…
Cancel
Save