Skip to content

Commit

Permalink
Add doc link to state/commandDescription edit form (#1681)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
  • Loading branch information
stefan-hoehn authored Feb 9, 2023
1 parent 9299886 commit 92bca23
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
<small>Enter each option on a separate line.<br>Use <code>value=label</code> format to provide a label different than the option.</small>
</f7-block-footer>
</f7-list>
<p class="padding">
<f7-link v-if="namespace === 'stateDescription'" color="blue" external target="_blank" :href="docLink">
State Description Documentation
</f7-link>
<f7-link v-if="namespace === 'commandDescription'" color="blue" external target="_blank" :href="docLink">
Command Description Documentation
</f7-link>
</p>
</div>
</template>

Expand All @@ -33,13 +41,22 @@ export default {
{ type: 'TEXT', name: 'min', label: 'Min', description: 'Minimum allowed value' },
{ type: 'TEXT', name: 'max', label: 'Max', description: 'Maximum allowed value' },
{ type: 'TEXT', name: 'step', label: 'Step', description: 'Minimum interval between values' }
]
],
docUrl: `https://${this.$store.state.runtimeInfo?.buildString === 'Release Build' ? 'www' : 'next'}.openhab.org` +
'/link/thing'
}
},
computed: {
options () {
if (!this.metadata.config.options) return []
return this.metadata.config.options.trim().split(',').map((s) => s.trim()).join('\n')
},
docLink () {
if (this.namespace === 'stateDescription') {
return `${this.docUrl}#state-description`
} else {
return `${this.docUrl}#command-description`
}
}
},
methods: {
Expand Down

0 comments on commit 92bca23

Please sign in to comment.