2020-05-11 18:22:23 +00:00
|
|
|
<template>
|
2020-08-16 13:41:43 +00:00
|
|
|
<div class="bot-alerts">
|
2020-05-11 18:22:23 +00:00
|
|
|
<b-alert
|
2020-08-31 15:43:44 +00:00
|
|
|
v-for="(alert, index) in activeMessages"
|
|
|
|
:key="index"
|
2020-05-11 18:22:23 +00:00
|
|
|
variant="warning"
|
|
|
|
dismissible
|
|
|
|
:show="5"
|
|
|
|
:value="!!alert.message"
|
|
|
|
@dismissed="closeAlert"
|
|
|
|
>
|
|
|
|
{{ alert.message }}
|
|
|
|
</b-alert>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2020-08-09 13:19:16 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
import { namespace } from 'vuex-class';
|
2020-09-02 18:18:17 +00:00
|
|
|
import { AlertActions } from '@/store/modules/alerts';
|
2021-12-20 19:12:57 +00:00
|
|
|
import StoreModules from '@/store/storeSubModules';
|
2021-12-20 19:15:39 +00:00
|
|
|
import { AlertType } from '@/types/alertTypes';
|
2020-05-11 18:22:23 +00:00
|
|
|
|
2021-12-20 19:12:57 +00:00
|
|
|
const alerts = namespace(StoreModules.alerts);
|
2020-08-09 13:19:16 +00:00
|
|
|
|
|
|
|
@Component({})
|
|
|
|
export default class BotAlerts extends Vue {
|
2021-12-20 19:15:39 +00:00
|
|
|
@alerts.State activeMessages!: AlertType[];
|
2020-08-09 13:19:16 +00:00
|
|
|
|
2020-09-02 18:18:17 +00:00
|
|
|
@alerts.Action [AlertActions.removeAlert];
|
2020-08-09 13:19:16 +00:00
|
|
|
|
|
|
|
closeAlert() {
|
2020-09-02 18:18:17 +00:00
|
|
|
this[AlertActions.removeAlert]();
|
2020-08-09 13:19:16 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-11 18:22:23 +00:00
|
|
|
</script>
|