Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI updates: - search for combo asset id and attr name - getAttributeOptions() takes care of re-rendering when necessary so no need for these two calls

Vincent4b6ad1f76de7
diff --git a/ui/component/or-mwc-components/src/or-mwc-dialog.ts b/ui/component/or-mwc-components/src/or-mwc-dialog.ts
index 6e6af8444..5b870c72a 100644
--- a/ui/component/or-mwc-components/src/or-mwc-dialog.ts
+++ b/ui/component/or-mwc-components/src/or-mwc-dialog.ts
@@ -447,7 +447,7 @@ export class OrMwcAttributeSelector extends OrMwcDialog {
<div style="display: grid">
<or-mwc-list
id="attribute-selector" .type="${ListType.MULTI_CHECKBOX}" .listItems="${listItems}"
- .values="${this.selectedAttributes.map(e => e.name!)}"
+ .values="${this.selectedAttributes.map(e => e.id === this.selectedAsset!.id && e.name!)}"
@or-mwc-list-changed="${(ev: OrMwcListChangedEvent) => this._addRemoveAttrs(ev)}"></or-mwc-list>
</div>
` : html`<div style="display: flex;align-items: center;text-align: center;height: 100%;"><span style="width:100%"><or-translate value="selectAssetOnTheLeft"></or-translate></span></div>`}
@@ -499,14 +499,12 @@ export class OrMwcAttributeSelector extends OrMwcDialog {
}
this._getAttributeOptions();
- this.reRenderDialog();
}
protected _onAssetSelectionDeleted() {
this.selectedAsset = undefined;
this.assetAttributes = [];
this._getAttributeOptions();
- this.reRenderDialog();
}
}