[enh] Add default icon for alert

This commit is contained in:
ljf 2021-08-30 15:24:15 +02:00
parent f9fb6ed02a
commit 358e6978a4
3 changed files with 15 additions and 3 deletions

View file

@ -1,5 +1,5 @@
<template>
<vue-showdown :markdown="label" flavor="github"/>
<vue-showdown :markdown="label" flavor="github" />
</template>
<script>

View file

@ -1,6 +1,6 @@
<template>
<b-alert :variant="type" show>
<icon :iname="icon" />
<icon :iname="icon_" />
{{ label }}
</b-alert>
</template>
@ -9,6 +9,18 @@
export default {
name: 'ReadOnlyAlertItem',
data () {
let icons = {
success: 'thumbs-up',
info: 'info',
warning: 'warning',
danger: 'ban'
}
return {
icon_: (this.icon) ? this.icon : icons[this.type]
}
},
props: {
id: { type: String, default: null },
label: { type: String, default: null },

View file

@ -56,7 +56,7 @@ export function adressToFormValue (address) {
* @return {Object} an formated argument containing formItem props, validation and base value.
*/
export function formatYunoHostArgument (arg) {
let value = (arg.value !== undefined) ? arg.value : null
let value = (arg.value !== undefined) ? arg.value : (arg.current_value !== undefined) ? arg.current_value : null
const validation = {}
arg.ask = formatI18nField(arg.ask)
const field = {