From 7b61de7cf9128d67f1d02a12ff1087181056ca73 Mon Sep 17 00:00:00 2001 From: Audrey Serra Date: Mon, 21 Feb 2022 11:01:12 +0100 Subject: [PATCH] Display DeviceID when the device has no Name + Allow to search on DeviceId or DeviceName --- .../Client/Pages/Devices/DeviceListPage.razor | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/AzureIoTHub.Portal/Client/Pages/Devices/DeviceListPage.razor b/src/AzureIoTHub.Portal/Client/Pages/Devices/DeviceListPage.razor index e21f74454..c355fd946 100644 --- a/src/AzureIoTHub.Portal/Client/Pages/Devices/DeviceListPage.razor +++ b/src/AzureIoTHub.Portal/Client/Pages/Devices/DeviceListPage.razor @@ -17,7 +17,7 @@ - + @**@ @@ -102,7 +102,9 @@ - @context.DeviceName + + @(string.IsNullOrEmpty(context.DeviceName) ? context.DeviceID : context.DeviceName) + @@ -154,7 +156,6 @@ private string searchID = ""; private string searchStatus = ""; private string searchState = ""; - // private string searchName = ""; private int[] pageSizeOptions = new int[] { 2, 5, 10 }; @@ -193,7 +194,6 @@ searchID = ""; searchStatus = ""; searchState = ""; - // searchName = ""; } /// @@ -224,12 +224,12 @@ private bool FilterFunc(DeviceListItem item) { bool flagID = checkFlag(item.DeviceID, searchID); + bool flagName = checkFlag(item.DeviceName, searchID); bool flagStatus = checkFlag(item.IsEnabled.ToString(), searchStatus); bool flagState = checkFlag(item.IsConnected.ToString(), searchState); - // bool flagLocation = checkFlag(item.Name, searchName); // Current row is shown only if all the flags are true - if (flagID && flagStatus && flagState) + if ((flagID || flagName) && flagStatus && flagState) return true; return false;