[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,6 +1,6 @@
<template> <template>
<b-alert :variant="type" show> <b-alert :variant="type" show>
<icon :iname="icon" /> <icon :iname="icon_" />
{{ label }} {{ label }}
</b-alert> </b-alert>
</template> </template>
@ -9,6 +9,18 @@
export default { export default {
name: 'ReadOnlyAlertItem', name: 'ReadOnlyAlertItem',
data () {
let icons = {
success: 'thumbs-up',
info: 'info',
warning: 'warning',
danger: 'ban'
}
return {
icon_: (this.icon) ? this.icon : icons[this.type]
}
},
props: { props: {
id: { type: String, default: null }, id: { type: String, default: null },
label: { 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. * @return {Object} an formated argument containing formItem props, validation and base value.
*/ */
export function formatYunoHostArgument (arg) { 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 = {} const validation = {}
arg.ask = formatI18nField(arg.ask) arg.ask = formatI18nField(arg.ask)
const field = { const field = {