Skip to content

Commit 74da899

Browse files
authored
Item edit: Fix missing semantic config breaks view (#3271)
Regression from #3178. Signed-off-by: Florian Hotze <dev@florianhotze.com>
1 parent b850517 commit 74da899

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

bundles/org.openhab.ui/web/src/pages/developer/developer-tools.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</f7-toolbar>
1616

1717
<f7-tabs>
18-
<f7-tab id="menu-tab" @ tab:show="() => this.currentTab = 'menu'" :tab-active="currentTab === 'menu'">
18+
<f7-tab id="menu-tab" tab:show="() => this.currentTab = 'menu'" :tab-active="currentTab === 'menu'">
1919
<f7-block class="block-narrow after-big-title settings-menu">
2020
<f7-row>
2121
<f7-col width="100" medium="50">

bundles/org.openhab.ui/web/src/pages/settings/items/item-details.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ export default {
209209
if (propertyArray.length > 1) return propertyArray.slice(1).join('->')
210210
return propertyArray[0]
211211
},
212+
/**
213+
* Returns the semantic attributes of the item, i.e. "Point Of" - "X", "In Location" - "Y", "Part Of" - "Z".
214+
*
215+
* @return {{}|null}
216+
*/
212217
semanticAttributes () {
213218
const config = this.item?.metadata?.semantics?.config
214219
if (!config) return null
@@ -224,7 +229,9 @@ export default {
224229
return attributes
225230
},
226231
nonSemanticGroupNames () {
227-
return this.item.groupNames.filter((g) => !Object.values(this.semanticAttributes).includes(g))
232+
if (this.semanticAttributes === null) return this.item?.groupNames ?? []
233+
const semanticGroupNames = Object.values(this.semanticAttributes)
234+
return this.item?.groupNames?.filter((g) => !semanticGroupNames.includes(g)) ?? []
228235
},
229236
nonSemanticTags () {
230237
return this.item?.tags?.filter((tag) => tag !== this.semanticTag(this.semanticValue) && tag !== this.semanticTag(this.semanticProperty))

0 commit comments

Comments
 (0)