From fb3a881387c51f84360789d96a4cbbda61b0e413 Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Fri, 13 Sep 2024 21:10:17 -0700
Subject: [PATCH] Refactor: allow filterpipe to specify key
---
.../filterable-dropdown.component.html | 6 ++---
src-ui/src/app/pipes/filter.pipe.spec.ts | 21 +++++++++++++++
src-ui/src/app/pipes/filter.pipe.ts | 27 +++++++++++--------
3 files changed, 40 insertions(+), 14 deletions(-)
diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html
index cac217716..9e9a73124 100644
--- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html
+++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.html
@@ -35,7 +35,7 @@
@if (selectionModel.items) {
- @for (item of selectionModel.itemsSorted | filter: filterText; track item; let i = $index) {
+ @for (item of selectionModel.itemsSorted | filter: filterText:'name'; track item; let i = $index) {
@if (allowSelectNone || item.id) {
@@ -45,13 +45,13 @@
}
@if (editing) {
- @if ((selectionModel.itemsSorted | filter: filterText).length === 0 && createRef !== undefined) {
+ @if ((selectionModel.itemsSorted | filter: filterText:'name').length === 0 && createRef !== undefined) {
}
- @if ((selectionModel.itemsSorted | filter: filterText).length > 0) {
+ @if ((selectionModel.itemsSorted | filter: filterText:'name').length > 0) {