diff --git a/CHANGELOG.md b/CHANGELOG.md index 00d52aa4..98f61a0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,8 +37,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Avoid querying Astarte for trigger delivery policies when Astarte does not support them ([#459](https://github.com/astarte-platform/astarte-dashboard/issues/459)). - Simplified floating point values for specifying `known_value` in "incoming data" triggers. ([#465](https://github.com/astarte-platform/astarte-dashboard/issues/465)) -- Show falsey values in the DeviceLiveEventCard by `JSON.stringify` all values and not only objects. -- Resolved an issue where the search filter term was appended to the device ID and alias fields in the device list. ## [1.1.1] - 2023-11-15 ### Added diff --git a/src/DeviceStatusPage/DeviceLiveEventsCard.tsx b/src/DeviceStatusPage/DeviceLiveEventsCard.tsx index a2c7a4a0..0e23a162 100644 --- a/src/DeviceStatusPage/DeviceLiveEventsCard.tsx +++ b/src/DeviceStatusPage/DeviceLiveEventsCard.tsx @@ -242,7 +242,9 @@ const astarteDeviceEventBody = (event: AstarteDeviceEvent) => { {event.interfaceName} {event.path} - {JSON.stringify(event.value)} + + {_.isObject(event.value) ? JSON.stringify(event.value) : event.value} + ); } diff --git a/src/ui/CheckableDeviceTable.tsx b/src/ui/CheckableDeviceTable.tsx index 1961af63..ea0349ca 100644 --- a/src/ui/CheckableDeviceTable.tsx +++ b/src/ui/CheckableDeviceTable.tsx @@ -1,7 +1,7 @@ /* This file is part of Astarte. - Copyright 2024 SECO Mind Srl + Copyright 2020 Ispirata Srl Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -32,14 +32,15 @@ const Highlight = ({ text, word }: HighlightProps): React.ReactElement => { return ( <> - {text.split(new RegExp(`(${word})`, 'gi')).map((part, index) => - part.toLowerCase() === word?.toLowerCase() ? ( + {text.split(word).reduce( + (prev: React.ReactElement[], current, index) => [ + ...prev, - {part} - - ) : ( - {part} - ), + {word} + , + {current}, + ], + [], )} );