From 88eeb5ca27cd50160ef5bce24539b612afea57d5 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 11 Aug 2022 09:28:57 -0700 Subject: Search by more device fields (fix #1011) --- modern/src/main/MainPage.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modern/src/main') diff --git a/modern/src/main/MainPage.js b/modern/src/main/MainPage.js index 91b6768e..283c61a6 100644 --- a/modern/src/main/MainPage.js +++ b/modern/src/main/MainPage.js @@ -195,7 +195,10 @@ const MainPage = () => { const filtered = Object.values(devices) .filter((device) => !filterStatuses.length || filterStatuses.includes(device.status)) .filter((device) => !filterGroups.length || filterGroups.includes(device.groupId)) - .filter((device) => `${device.name} ${device.uniqueId}`.toLowerCase().includes(filterKeyword.toLowerCase())); + .filter((device) => { + const keyword = filterKeyword.toLowerCase(); + return [device.name, device.uniqueId, device.phone, device.model, device.contact].some((s) => s && s.toLowerCase().includes(keyword)); + }); if (filterSort === 'lastUpdate') { filtered.sort((device1, device2) => { const time1 = device1.lastUpdate ? moment(device1.lastUpdate).valueOf() : 0; -- cgit v1.2.3