Skip to content

armgit / core

Public Imported from GitHub
0

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

UI update: or-map-asset-card.ts now respects SHOW_ON_DASHBOARD meta item

Rich Turner990430628e6b
diff --git a/ui/component/or-map/src/or-map-asset-card.ts b/ui/component/or-map/src/or-map-asset-card.ts
index e0ceca57a..c91d7e7e1 100644
--- a/ui/component/or-map/src/or-map-asset-card.ts
+++ b/ui/component/or-map/src/or-map-asset-card.ts
@@ -14,7 +14,8 @@ import {
AssetEventCause,
AttributeEvent,
SharedEvent,
- WellknownAttributes
+ WellknownAttributes,
+ WellknownMetaItems
} from "@openremote/model";
import manager, {AssetModelUtil, subscribe, Util} from "@openremote/core";
import "@openremote/or-icon";
@@ -132,7 +133,8 @@ export class OrMapAssetCard extends subscribe(manager)(LitElement) {
const excludedAttributes = cardConfig && cardConfig.exclude ? cardConfig.exclude : [];
const attrs = attributes.filter((attr) =>
(!includedAttributes || includedAttributes.indexOf(attr.name!) >= 0)
- && (!excludedAttributes || excludedAttributes.indexOf(attr.name!) < 0))
+ && (!excludedAttributes || excludedAttributes.indexOf(attr.name!) < 0)
+ && (!attr.meta || !attr.meta.hasOwnProperty(WellknownMetaItems.SHOWONDASHBOARD) || !!Util.getMetaValue(WellknownMetaItems.SHOWONDASHBOARD, attr)))
.sort(Util.sortByString((listItem) => listItem.name!));
return html`