Skip to content

Commit 8373734

Browse files
authored
Merge branch 'main' into use-widget-context
2 parents 2dc7d1d + 88ae3f0 commit 8373734

File tree

7 files changed

+23
-16
lines changed

7 files changed

+23
-16
lines changed

bundles/org.openhab.ui/web/src/js/stores/useThingEditStore.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,18 @@ export const useThingEditStore = defineStore('thingEditStore', () => {
9898
thingType.value = thingTypeResult.value && Object.keys(thingTypeResult.value).length > 0 ? thingTypeResult.value : null
9999
} else {
100100
thingType.value = null
101-
const message = `Cannot load thing-type '${data.thingTypeUID}': `
102-
console.error(message + getErrorMessage(thingTypeResult.reason, true))
103-
f7.dialog.alert(message + getErrorMessage(thingTypeResult.reason))
101+
const message = `Cannot load thing-type '${data.thingTypeUID}'`
102+
console.error(message, thingTypeResult.reason)
103+
f7.dialog.alert(message + ': ' + getErrorMessage(thingTypeResult.reason))
104104
}
105105

106106
if (channelTypesResult.status === 'fulfilled') {
107-
channelTypes.value = channelTypesResult.value || []
107+
channelTypes.value = channelTypesResult.value ?? []
108108
} else {
109109
channelTypes.value = null
110-
const message = `Cannot load channel-types for thing-type '${data.thingTypeUID}': `
111-
console.error(message + getErrorMessage(channelTypesResult.reason, true))
112-
f7.dialog.alert(message + getErrorMessage(channelTypesResult.reason))
110+
const message = `Cannot load channel-types for thing-type '${data.thingTypeUID}'`
111+
console.error(message, channelTypesResult.reason)
112+
f7.dialog.alert(message + ': ' + getErrorMessage(channelTypesResult.reason))
113113
}
114114

115115
if (actionsResult.status === 'fulfilled') {
@@ -123,8 +123,7 @@ export const useThingEditStore = defineStore('thingEditStore', () => {
123123
}
124124
} else {
125125
thingActions.value = []
126-
const message = getErrorMessage(actionsResult.reason, true)
127-
console.error(`Cannot load '${thingUID}' thing actions: ${message}`)
126+
console.error(`Cannot load '${thingUID}' thing actions`, actionsResult.reason)
128127
}
129128

130129
if (configDescResult.status === 'fulfilled') {
@@ -140,20 +139,23 @@ export const useThingEditStore = defineStore('thingEditStore', () => {
140139
if (!applyThingTypeConfigDescriptions()) {
141140
configDescriptions.value = null
142141
}
143-
console.error(`Cannot load '${thingUID}' config descriptions: ` + getErrorMessage(configDescResult.reason, true))
142+
console.error(`Cannot load '${thingUID}' config descriptions`, configDescResult.reason)
144143
}
144+
145145
if (firmwareResult.status === 'fulfilled') {
146146
firmwares.value = firmwareResult.value && Object.keys(firmwareResult.value).length > 0 ? firmwareResult.value : null
147147
} else {
148148
firmwares.value = null
149-
console.error(`Cannot load '${thingUID}' firmwares: ` + getErrorMessage(firmwareResult.reason, true))
149+
console.error(`Cannot load '${thingUID}' firmwares`, firmwareResult.reason)
150150
}
151+
151152
if (configStatusResult.status === 'fulfilled') {
152153
configStatusInfo.value = configStatusResult.value ?? null
153154
} else {
154155
configStatusInfo.value = null
155-
console.error(`Cannot load '${thingUID}' config status: ` + getErrorMessage(configStatusResult.reason, true))
156+
console.error(`Cannot load '${thingUID}' config status`, configStatusResult.reason)
156157
}
158+
157159
savedThing.value = cloneDeep(thing.value)
158160
loadingFinishedCallback(true)
159161
loading.value = false

bundles/org.openhab.ui/web/src/pages/settings/model/add-from-thing.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ export default {
392392
})
393393
}
394394
}).catch((err) => {
395+
console.error('Error loading thing type or channel type', err)
395396
f7.dialog.alert('Error loading thing type or channel types: ' + err)
396397
397398
this.selectedThingId = ''

bundles/org.openhab.ui/web/src/pages/settings/things/add/thing-add.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export default {
129129
this.ready = true
130130
})
131131
}).catch((err) => {
132+
console.error('Error loading thing type', err)
132133
f7.dialog.alert('Error loading thing type: ' + err)
133134
this.f7router.back()
134135
})

bundles/org.openhab.ui/web/src/pages/settings/things/channel/channel-add.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export default {
8282
this.channelTypes = ct
8383
this.ready = true
8484
}).catch((err) => {
85+
console.error('Error loading channel types', err)
8586
f7.dialog.alert('Error loading channel type: ' + err)
8687
this.f7router.back()
8788
})

bundles/org.openhab.ui/web/src/pages/settings/things/link/link-add.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ export default {
392392
this.selectedThingChannelTypes = data2[1]
393393
this.ready = true
394394
}).catch((err) => {
395+
console.error('Error loading thing type or channel types', err)
395396
f7.dialog.alert('Error loading thing type or channel types: ' + err)
396397
this.selectedThingId = ''
397398
this.ready = true

bundles/org.openhab.ui/web/src/pages/settings/things/link/link-edit.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export default {
211211
})
212212
})
213213
}).catch((err) => {
214+
console.error('Error loading profile type or channel type', err)
214215
f7.dialog.alert('Error loading profile type or channel type: ' + err)
215216
this.f7router.back()
216217
})

bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ export default {
483483
return this.thingActions && Array.isArray(this.thingActions) ? this.thingActions.filter((a) => a.visibility === 'EXPERT').length : 0
484484
},
485485
filteredThingActions () {
486-
if (this.showAdvancedThingActions) return this.thingActions
487-
return this.thingActions && Array.isArray(this.thingActions) ? this.thingActions.filter((a) => a.visibility !== 'EXPERT') : []
486+
if (this.showAdvancedThingActions) return this.thingActions ?? []
487+
return this.thingActions?.filter((a) => a.visibility !== 'EXPERT') ?? []
488488
},
489489
...mapState(useThingEditStore, ['configDirty', 'thingDirty', 'thing', 'thingType', 'channelTypes', 'configDescriptions', 'configStatusInfo', 'thingActions', 'firmwares', 'editable', 'isExtensible', 'hasLinkedItems'])
490490
},
@@ -565,9 +565,9 @@ export default {
565565
return
566566
}
567567
568-
if (useThingEditStore().thing.configDescription) {
568+
if (this.configDescription) {
569569
// gather actions (rendered as buttons at the bottom)
570-
this.configActionsByGroup = this.getBindingActions(useThingEditStore().configDescriptions)
570+
this.configActionsByGroup = this.getBindingActions(this.configDescriptions)
571571
}
572572
573573
if (!this.eventSource) this.startEventSource()

0 commit comments

Comments
 (0)