Skip to content

Commit

Permalink
render help link in preview form
Browse files Browse the repository at this point in the history
  • Loading branch information
dshomoye committed Jan 21, 2021
1 parent 378993f commit b7fc8b2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions resources/templates/globalConfig.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@
</select>
</div>
</template>
<template x-if="entity.type === 'helpLink' && entity.options && entity.options.text">
<div>
<a x-text="entity.options.text" :href="entity.options.link || '#'"></a>
</div>
</template>
<template x-if="entity.help">
<span class="help-block text-secondary" x-text="entity.help"></span>
</template>
Expand Down Expand Up @@ -134,6 +139,7 @@
})
},
updateEntities(newForm) {
// destroying all old slim-selects as they will be removed from the DOM.
this.slimSelects.forEach(s => s?.destroy())
this.slimSelects = []
this.activeForm = newForm
Expand Down Expand Up @@ -172,15 +178,17 @@
} else {
this.entities = []
}
//using a custom event to trigger initializing slim-selects.
// required to ensure <select> nodes are added to DOM *before* trying to initialize.
window.dispatchEvent(new CustomEvent('update-slim-select'));
},
updatePage(page, form = '') {
this.activePage = page;
this.updateEntities(form);
if (page === 'Configuration') {
this.tabs = this.globalConfig.pages.configuration.tabs
this.tabs = this.globalConfig.pages.configuration?.tabs || []
} else if (page === 'Inputs') {
this.tabs = this.globalConfig.pages.inputs.services
this.tabs = this.globalConfig.pages.inputs?.services || []
} else if (page === 'Alerts') {
this.tabs = this.globalConfig.alerts || []
}
Expand Down

0 comments on commit b7fc8b2

Please sign in to comment.