From 183c27548046e12b94354aa598b5bcf956d31103 Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Wed, 12 Feb 2020 11:30:49 -0800 Subject: Add batch actions to local user table - Create TableToolbar component for table batch actions - Added Toast warning type and toast title message translations - Update vue-i18n package to latest v8.15.3 to use improved pluarlization features Signed-off-by: Yoshie Muranaka Change-Id: I455beba4f56b8209b1201bbc5ff3f616e960d189 --- src/components/Mixins/BVToastMixin.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/components/Mixins/BVToastMixin.js') diff --git a/src/components/Mixins/BVToastMixin.js b/src/components/Mixins/BVToastMixin.js index 489173c9..a46f5e50 100644 --- a/src/components/Mixins/BVToastMixin.js +++ b/src/components/Mixins/BVToastMixin.js @@ -1,22 +1,33 @@ +import i18n from '../../i18n'; + const BVToastMixin = { methods: { - successToast(message) { + successToast(message, title = i18n.t('global.response.success')) { this.$root.$bvToast.toast(message, { - title: 'Success', + title, variant: 'success', autoHideDelay: 10000, //auto hide in milliseconds isStatus: true, solid: true }); }, - errorToast(message) { + errorToast(message, title = i18n.t('global.response.error')) { this.$root.$bvToast.toast(message, { - title: 'Error', + title, variant: 'danger', noAutoHide: true, isStatus: true, solid: true }); + }, + warningToast(message, title = i18n.t('global.response.warning')) { + this.$root.$bvToast.toast(message, { + title, + variant: 'warning', + noAutoHide: true, + isStatus: true, + solid: true + }); } } }; -- cgit v1.2.3