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
UI updates: - remove attr selector event listener from html element as it's already defined in constructor - explicitly update prop so ui gets updated by lit - remove padding from attr selector - also consider agentlink props from attributese when asking for datapoint compatible attrs
Vincent8701b7b1e3ef
diff --git a/ui/component/or-chart/src/index.ts b/ui/component/or-chart/src/index.tsindex a8fb952ed..f9b52fe5f 100644--- a/ui/component/or-chart/src/index.ts+++ b/ui/component/or-chart/src/index.ts@@ -590,7 +590,7 @@ export class OrChart extends translate(i18next)(LitElement) {</div><or-mwc-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled}" label="${i18next.t("addAttribute")}" icon="plus" @click="${() => this._openDialog()}"></or-mwc-input><div id="mdc-dialog">- <or-mwc-attribute-selector id="attribute-selector-dialog" @or-attribute-refs-add="${(ev: OrAddAttributeRefsEvent) => this._addAttribute(ev.detail.selectedAttributes)}"></or-mwc-attribute-selector>+ <or-mwc-attribute-selector id="attribute-selector-dialog"></or-mwc-attribute-selector></div></div></div>@@ -817,6 +817,7 @@ export class OrChart extends translate(i18next)(LitElement) {this.assetAttributes.push([assetIndex, attrRef]);}}+ this.assetAttributes = [...this.assetAttributes];this.saveSettings();}diff --git a/ui/component/or-mwc-components/src/or-mwc-dialog.ts b/ui/component/or-mwc-components/src/or-mwc-dialog.tsindex 8591d98bc..0ec25a556 100644--- a/ui/component/or-mwc-components/src/or-mwc-dialog.ts+++ b/ui/component/or-mwc-components/src/or-mwc-dialog.ts@@ -6,7 +6,7 @@ import "./or-mwc-input";import {InputType} from "./or-mwc-input";import { i18next } from "@openremote/or-translate";import {DefaultColor2, DefaultColor4, DefaultColor5, Util } from "@openremote/core";-import { Asset, AssetEvent, Attribute, AttributeRef } from "@openremote/model";+import { Asset, AssetEvent, Attribute, AttributeRef, WellknownMetaItems } from "@openremote/model";import manager from "@openremote/core";import {ListItem, ListType, OrMwcListChangedEvent} from "./or-mwc-list";@@ -388,6 +388,9 @@ export class OrMwcAttributeSelector extends OrMwcDialog {#header {background-color: ${unsafeCSS(DefaultColor4)} !important;}+ #dialog-content {+ padding: 0;+ }`;this.reRenderDialog();@@ -478,7 +481,8 @@ export class OrMwcAttributeSelector extends OrMwcDialog {.then(result => {this.assetAttributes = Object.values(result.data.attributes!) as Attribute<any>[];if (this.showOnlyDatapointAttrs) {- this.assetAttributes = this.assetAttributes.filter(e => e.meta && e.meta.storeDataPoints);+ this.assetAttributes = this.assetAttributes+ .filter(e => e.meta && (e.meta[WellknownMetaItems.STOREDATAPOINTS] || e.meta[WellknownMetaItems.AGENTLINK]));}this.reRenderDialog();});diff --git a/yarn.lock b/yarn.lockindex c0d1bd381..64134c2fa 100644--- a/yarn.lock+++ b/yarn.lock@@ -5942,11 +5942,6 @@ lit-element@^3.0.0-rc.2:"@lit/reactive-element" "^1.0.0-rc.2"lit-html "^2.0.0-rc.3"-lit-html@^1.0.0:- version "1.4.1"- resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.4.1.tgz#0c6f3ee4ad4eb610a49831787f0478ad8e9ae5e0"- integrity sha512-B9btcSgPYb1q4oSOb/PrOT6Z/H+r6xuNzfH4lFli/AWhYwdtrgQkQWBbIc6mdnf6E2IL3gDXdkkqNktpU0OZQA==-lit-html@^2.0.0-rc.3:version "2.0.0-rc.3"resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.0.0-rc.3.tgz#1c216e548630e18d3093d97f4e29563abce659af"