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
fix: external attribute change becomes user change (#1711) (#1722)
Ekhorne4095fca19a0
diff --git a/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts b/ui/component/or-asset-viewer/src/or-edit-asset-panel.tsindex 00dd98df0..a940410c0 100644--- a/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts+++ b/ui/component/or-asset-viewer/src/or-edit-asset-panel.ts@@ -204,7 +204,15 @@ export class OrEditAssetPanel extends LitElement {shouldUpdate(changedProperties: PropertyValues): boolean {if (changedProperties.has("asset")) {- this.changedAttributes = [];+ const oldAsset = changedProperties.get("asset") as Asset;+ if (this.asset.attributes && oldAsset?.attributes && this.asset.id === oldAsset.id) {+ // Handles external attribute changes post saving phase.+ this.changedAttributes = Object.values(oldAsset.attributes)+ .filter(({ name, timestamp: oldTimestamp }) => oldTimestamp !== this.asset.attributes?.[name!].timestamp)+ .map(({ name }) => name!);+ } else {+ this.changedAttributes = [];+ }}return super.shouldUpdate(changedProperties);}