Skip to content

Commit

Permalink
Fix add-on information issues (#1607)
Browse files Browse the repository at this point in the history
Fixes the following issues:

* Markdown documentation for JDBC features does not show
* Documentation link for JDBC features results in 404 not found
* Issue links always point to openhab-addons repository (also for UI add-ons and Zigbee, Zwave)
  This causes users not to find exising issues and causes them to create issues in the wrong repository

Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn authored and kaikreuzer committed Jan 1, 2023
1 parent f7a0ff8 commit b82a1db
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,35 @@ export default {
id: 'documentationLink',
title: 'Documentation',
afterIcon: 'question_circle_fill',
linkUrl: `https://${this.$store.state.runtimeInfo.buildString === 'Release Build' ? 'www' : 'next'}.openhab.org/addons/${this.addon.type.replace('misc', 'integrations').replace('binding', 'bindings').replace('transformation', 'transformations')}/${this.addon.id.substring(this.addon.id.indexOf('-') + 1)}` // this.addon.link
linkUrl: `https://${this.$store.state.runtimeInfo.buildString === 'Release Build' ? 'www' : 'next'}.openhab.org/addons/${this.addon.type.replace('misc', 'integrations').replace('binding', 'bindings').replace('transformation', 'transformations')}/${this.addon.id.split('-')[1]}` // this.addon.link
})
let repository
let issueFilter = 'q=is%3Aopen'
if (this.addon.id === 'binding-zigbee') {
repository = 'org.openhab.binding.zigbee'
} else if (this.addon.id === 'binding-zwave') {
repository = 'org.openhab.binding.zwave'
} else {
if (this.addon.type === 'ui') {
repository = 'openhab-webui'
} else {
repository = 'openhab-addons'
}
issueFilter += `+${this.addon.id.split('-')[1]}`
}
info.push({
id: 'issuesLink',
title: 'Issues',
afterIcon: 'exclamationmark_bubble_fill',
linkUrl: 'https://github.com/openhab/openhab-addons/issues?q=is%3Aopen+' + this.addon.id.substring(this.addon.id.indexOf('-') + 1)
linkUrl: `https://github.com/openhab/${repository}/issues?${issueFilter}`
})
info.push({
id: 'discussionsLink',
title: 'Community Discussions',
afterIcon: 'chat_bubble_2_fill',
linkUrl: 'https://community.openhab.org/search?q=' + this.addon.id.substring(this.addon.id.indexOf('-') + 1)
linkUrl: 'https://community.openhab.org/search?q=' + this.addon.id.split('-')[1]
})
} else {
info.push({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default {
if (this.addon.id.indexOf('-') > 0) {
let url = `https://${this.$store.state.runtimeInfo.buildString === 'Release Build' ? 'www' : 'next'}.openhab.org` +
`/addons/${this.addon.type.replace('misc', 'integrations').replace('binding', 'bindings').replace('transformation', 'transformations')}` +
`/${this.addon.id.substring(this.addon.id.indexOf('-') + 1)}`
`/${this.addon.id.split('-')[1]}`
return url
}
return ''
Expand Down Expand Up @@ -293,7 +293,7 @@ export default {
let addonTypeFolder = '_addons_' + this.addon.type
if (this.addon.type === 'misc') addonTypeFolder = '_addons_io'
if (this.addon.type !== 'automation') addonTypeFolder += 's'
let addonId = this.addon.id.substring(this.addon.id.indexOf('-') + 1)
let addonId = this.addon.id.split('-')[1]
let docUrl = (this.$store.state.runtimeInfo.buildString === 'Release Build') ? 'https://www.openhab.org' : 'https://next.openhab.org'
docUrl += `/addons/${this.addon.type}/${addonId}`
let docSrcUrl = `https://raw.githubusercontent.com/openhab/openhab-docs/${docsBranch}/${addonTypeFolder}/${addonId}`
Expand Down

0 comments on commit b82a1db

Please sign in to comment.