From ff7fd2b0595fcfc534367ea265ceed6774bd9fcb Mon Sep 17 00:00:00 2001 From: Razzmatazz Date: Wed, 28 Feb 2024 15:24:35 -0600 Subject: [PATCH] enable searching by item/task id --- src/components/item-search/index.js | 2 +- src/modules/item-search.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/item-search/index.js b/src/components/item-search/index.js index 8d32bf61c..380586d3e 100644 --- a/src/components/item-search/index.js +++ b/src/components/item-search/index.js @@ -117,7 +117,7 @@ function ItemSearch({ if (nameFilter.length === 0) { return true; } - return task.name.toLowerCase().includes(nameFilter.toLowerCase()); + return task.name.toLowerCase().includes(nameFilter.toLowerCase()) || task.id === nameFilter; }).map(task => { return { ...task, diff --git a/src/modules/item-search.js b/src/modules/item-search.js index bee445d31..56b577861 100644 --- a/src/modules/item-search.js +++ b/src/modules/item-search.js @@ -30,6 +30,10 @@ const itemSearch = (items, searchString) => { { name: 'normalizedName', weight: 0.9 + }, + { + name: 'id', + weight: 1 } ], threshold: 0.3,