100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Bugfix for attribute history; data changes did not correctly update the UI. (#1039)
Martin Peeters52591bb4f6fa
diff --git a/ui/component/or-attribute-history/src/index.ts b/ui/component/or-attribute-history/src/index.tsindex 957aed2de..984e1e598 100644--- a/ui/component/or-attribute-history/src/index.ts+++ b/ui/component/or-attribute-history/src/index.ts@@ -321,8 +321,7 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {<div id="msg"><or-translate value="invalidAttribute"></or-translate></div>- ` : isChart- ? html`+ ` : isChart ? html`<div id="chart-container"><canvas id="chart"></canvas></div>@@ -335,8 +334,10 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {`;}- updated(changedProperties: PropertyValues) {- super.updated(changedProperties);+ // Method that is executed during an update, to compute (additional) values before rendering.+ // Used instead of updated() to prevent a second render when properties get changed.+ willUpdate(changedProperties: PropertyValues) {+ super.willUpdate(changedProperties);if (!this._type || !this._data) {return;@@ -445,6 +446,7 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {}}} else {+ // Updating the table template before render, if necessary, to prevent additional updateif (!this._tableTemplate || changedProperties.has("_data")) {this._tableTemplate = this._getTableTemplate();}