Browse Source

Merge branch 'main' into bugfix/fix-date-picker-date-format

pull/912/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
f737ab3327
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 2
      apps/client/src/app/components/accounts-table/accounts-table.component.html
  3. 12
      libs/ui/src/lib/activities-filter/activities-filter.component.ts

2
CHANGELOG.md

@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed the date format of the date picker and support manual changes
- 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

2
apps/client/src/app/components/accounts-table/accounts-table.component.html

@ -200,7 +200,7 @@
</button>
<button
mat-menu-item
[disabled]="element.isDefault || element.Order?.length > 0"
[disabled]="element.isDefault || element.transactionCount > 0"
(click)="onDeleteAccount(element.id)"
>
<ion-icon class="mr-2" name="trash-outline"></ion-icon>

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

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

Loading…
Cancel
Save