From c7c59c6e8814f6f245f1d0e33ef76571bd45af11 Mon Sep 17 00:00:00 2001 From: "Jan N. Klug" Date: Mon, 8 Nov 2021 18:16:44 +0100 Subject: [PATCH 1/4] [mainui] Fix addons details serviceId The serviceId for details page in the addon store was not properly determined if the addonId did not start with marketplace:. Signed-off-by: Jan N. Klug --- .../web/src/pages/settings/addons/addon-details.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/addons/addon-details.vue b/bundles/org.openhab.ui/web/src/pages/settings/addons/addon-details.vue index 000d9e3a4d..b05042709b 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/addons/addon-details.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/addons/addon-details.vue @@ -254,8 +254,8 @@ export default { this.stopEventSource() let addonId = this.addonId let serviceId = null - if (addonId.indexOf('marketplace:') === 0) { - serviceId = 'marketplace' + if (addonId.indexOf(':') > 0) { + serviceId = addonId.substring(0, addonId.indexOf(":")) addonId = addonId.substring(addonId.indexOf(':') + 1) } this.bindingInfo = null From cd9760b195b2493fa6012219bea377cf6447ad29 Mon Sep 17 00:00:00 2001 From: "Jan N. Klug" Date: Mon, 8 Nov 2021 18:52:26 +0100 Subject: [PATCH 2/4] fix build Signed-off-by: Jan N. Klug --- .../web/src/pages/settings/addons/addon-details.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.ui/web/src/pages/settings/addons/addon-details.vue b/bundles/org.openhab.ui/web/src/pages/settings/addons/addon-details.vue index b05042709b..1aa95b4db0 100644 --- a/bundles/org.openhab.ui/web/src/pages/settings/addons/addon-details.vue +++ b/bundles/org.openhab.ui/web/src/pages/settings/addons/addon-details.vue @@ -255,7 +255,7 @@ export default { let addonId = this.addonId let serviceId = null if (addonId.indexOf(':') > 0) { - serviceId = addonId.substring(0, addonId.indexOf(":")) + serviceId = addonId.substring(0, addonId.indexOf(':')) addonId = addonId.substring(addonId.indexOf(':') + 1) } this.bindingInfo = null From e7e8a73abd420a8dbaf4ab6d2d437752c983ccf1 Mon Sep 17 00:00:00 2001 From: "Jan N. Klug" Date: Sat, 13 Nov 2021 12:27:04 +0100 Subject: [PATCH 3/4] address review comments Signed-off-by: Jan N. Klug --- .../components/addons/addon-info-table.vue | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/bundles/org.openhab.ui/web/src/components/addons/addon-info-table.vue b/bundles/org.openhab.ui/web/src/components/addons/addon-info-table.vue index 45f5c82a7f..61ba72f92c 100644 --- a/bundles/org.openhab.ui/web/src/components/addons/addon-info-table.vue +++ b/bundles/org.openhab.ui/web/src/components/addons/addon-info-table.vue @@ -42,12 +42,17 @@ export default { information () { let info = [] if (!this.addon || !this.addon.id) return info - const marketplace = this.addon.id.indexOf('marketplace:') === 0 - + const source = this.addon.id.indexOf(':') > 0 ? this.addon.id.substring(0, this.addon.id.indexOf(':')) : "karaf" + let sourceName = 'openHAB Distribution' + if (source === 'marketplace') { + sourceName = 'Community Marketplace' + } else if (source !== 'karaf') { + sourceName = '3rd Party (' + source + ')' + } info.push({ id: 'service', title: 'Source', - value: (marketplace) ? 'Community Marketplace' : 'openHAB Distribution' + value: sourceName }) info.push({ @@ -78,7 +83,7 @@ export default { }) let format = Formats.karaf - if (marketplace && Object.keys(this.addon.properties).length > 0) { + if (source !== 'karaf' && Object.keys(this.addon.properties).length > 0) { for (const property in this.addon.properties) { if (Formats[property]) format = Formats[property] } @@ -106,14 +111,14 @@ export default { }) } - if (marketplace) { + if (source === 'marketplace') { info.push({ id: 'communityTopicLink', title: 'Community Topic', afterIcon: 'chat_bubble_2_fill', linkUrl: this.addon.link }) - } else { + } else if (source === 'karaf') { info.push({ id: 'documentationLink', title: 'Documentation', @@ -132,6 +137,13 @@ export default { afterIcon: 'chat_bubble_2_fill', linkUrl: 'https://community.openhab.org/search?q=' + this.addon.id.substring(this.addon.id.indexOf('-') + 1) }) + } else { + info.push({ + id: 'documentationLink', + title: 'Documentation', + afterIcon: 'question_circle_fill', + linkUrl: this.addon.link + }) } return info From 3a076f98107c0e841916a4e6d12ab90f6dcf38fa Mon Sep 17 00:00:00 2001 From: "Jan N. Klug" Date: Sat, 13 Nov 2021 12:30:06 +0100 Subject: [PATCH 4/4] fix build Signed-off-by: Jan N. Klug --- .../web/src/components/addons/addon-info-table.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.ui/web/src/components/addons/addon-info-table.vue b/bundles/org.openhab.ui/web/src/components/addons/addon-info-table.vue index 61ba72f92c..bc144c69e5 100644 --- a/bundles/org.openhab.ui/web/src/components/addons/addon-info-table.vue +++ b/bundles/org.openhab.ui/web/src/components/addons/addon-info-table.vue @@ -42,7 +42,7 @@ export default { information () { let info = [] if (!this.addon || !this.addon.id) return info - const source = this.addon.id.indexOf(':') > 0 ? this.addon.id.substring(0, this.addon.id.indexOf(':')) : "karaf" + const source = this.addon.id.indexOf(':') > 0 ? this.addon.id.substring(0, this.addon.id.indexOf(':')) : 'karaf' let sourceName = 'openHAB Distribution' if (source === 'marketplace') { sourceName = 'Community Marketplace'