blob: 538bb93ca6bd54aa0b956cc6064d85a33253611b [file] [log] [blame]
Yoshie Muranaka183c2752020-02-12 11:30:49 -08001import i18n from '../../i18n';
2
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -08003const BVToastMixin = {
4 methods: {
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -08005 successToast(message, title = i18n.t('global.status.success')) {
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -08006 this.$root.$bvToast.toast(message, {
Yoshie Muranaka183c2752020-02-12 11:30:49 -08007 title,
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -08008 variant: 'success',
9 autoHideDelay: 10000, //auto hide in milliseconds
10 isStatus: true,
11 solid: true
12 });
13 },
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080014 errorToast(message, title = i18n.t('global.status.error')) {
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080015 this.$root.$bvToast.toast(message, {
Yoshie Muranaka183c2752020-02-12 11:30:49 -080016 title,
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080017 variant: 'danger',
18 noAutoHide: true,
19 isStatus: true,
20 solid: true
21 });
Yoshie Muranaka183c2752020-02-12 11:30:49 -080022 },
Yoshie Muranaka547b5fc2020-02-24 15:42:40 -080023 warningToast(message, title = i18n.t('global.status.warning')) {
Yoshie Muranaka183c2752020-02-12 11:30:49 -080024 this.$root.$bvToast.toast(message, {
25 title,
26 variant: 'warning',
27 noAutoHide: true,
28 isStatus: true,
29 solid: true
30 });
Derick Montague4e90eed2020-03-03 18:11:44 -060031 },
32 infoToast(message, title = i18n.t('global.status.informational')) {
33 this.$root.$bvToast.toast(message, {
34 title,
35 variant: 'info',
36 noAutoHide: true,
37 isStatus: true,
38 solid: true
39 });
Yoshie Muranaka0fc91e72020-02-05 11:23:06 -080040 }
41 }
42};
43
44export default BVToastMixin;