From caaf7baff0b5995ef6c8fef213f1ec7af34ca911 Mon Sep 17 00:00:00 2001 From: Derick Montague Date: Fri, 9 Oct 2020 11:17:48 -0500 Subject: Fix documentation render bug Using the i18n module in the BVToastMixin file caused an issue with VuePress that resulted in the static files not being created and the documentation rendering as a blank page. - Removed the import of the BVToastMixin - Copied BVToastMixin to docs components and removed i18n - Copied the StatusIcon to docs components to so icons will render with the correct fill color in the toast notifications GitHub Issue: https://github.com/openbmc/webui-vue/issues/40 Signed-off-by: Derick Montague Change-Id: Ie479df17d529ad2803c41e7442801e13601a0a02 --- .../components/app-imports/BVToastMixin.js | 58 ++++++++++++++++++++ .../components/app-imports/StatusIcon.vue | 61 ++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 docs/.vuepress/components/app-imports/BVToastMixin.js create mode 100644 docs/.vuepress/components/app-imports/StatusIcon.vue (limited to 'docs/.vuepress/components/app-imports') diff --git a/docs/.vuepress/components/app-imports/BVToastMixin.js b/docs/.vuepress/components/app-imports/BVToastMixin.js new file mode 100644 index 00000000..10075658 --- /dev/null +++ b/docs/.vuepress/components/app-imports/BVToastMixin.js @@ -0,0 +1,58 @@ +import StatusIcon from './StatusIcon'; +const BVToastMixin = { + components: { + StatusIcon + }, + methods: { + toastTitle(title, status) { + // Create title with icon + const titleWithIcon = this.$createElement( + 'strong', + { class: 'toast-icon' }, + [ + this.$createElement('StatusIcon', { props: { status: status } }), + title + ] + ); + return titleWithIcon; + }, + successToast(message, title = 'Success') { + this.$root.$bvToast.toast(message, { + title: this.toastTitle(title, 'success'), + variant: 'success', + autoHideDelay: 10000, //auto hide in milliseconds + isStatus: true, + solid: true + }); + }, + errorToast(message, title = 'Error') { + this.$root.$bvToast.toast(message, { + title: this.toastTitle(title, 'danger'), + variant: 'danger', + noAutoHide: true, + isStatus: true, + solid: true + }); + }, + warningToast(message, title = 'Warning') { + this.$root.$bvToast.toast(message, { + title: this.toastTitle(title, 'warning'), + variant: 'warning', + noAutoHide: true, + isStatus: true, + solid: true + }); + }, + infoToast(message, title = 'Informational') { + this.$root.$bvToast.toast(message, { + title: this.toastTitle(title, 'info'), + variant: 'info', + noAutoHide: true, + isStatus: true, + solid: true + }); + } + } +}; + +export default BVToastMixin; diff --git a/docs/.vuepress/components/app-imports/StatusIcon.vue b/docs/.vuepress/components/app-imports/StatusIcon.vue new file mode 100644 index 00000000..954e4775 --- /dev/null +++ b/docs/.vuepress/components/app-imports/StatusIcon.vue @@ -0,0 +1,61 @@ + + + + + -- cgit v1.2.3