summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDerick Montague <derick.montague@ibm.com>2020-03-03 15:11:48 +0300
committerDerick Montague <derick.montague@ibm.com>2020-03-12 20:59:42 +0300
commit71650fff20c0ad29eb05d770736386863324b64e (patch)
tree2c3a71a9c71ab7c70f2d1ed0e5e7a437144e339f /docs
parent36016e45acae516045cbb74be40e74881a5fc95f (diff)
downloadwebui-vue-71650fff20c0ad29eb05d770736386863324b64e.tar.xz
Add alert message component and documentation
- Add custom alert component to simplify the use of custom alerts - Add documentation for using the custom alert - Update the login error alert to use the alert component instead of the Bootstrap-vue component. - Add the enhanceApp and bmcAppPlugin to extend vuepress to use both the BMC custom and Boostrap-Vue components along with the custom styles Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I5c0b696ca47ddba0df18041d6c5ee7509bf23572
Diffstat (limited to 'docs')
-rw-r--r--docs/.vuepress/bmcAppPlugin.js8
-rw-r--r--docs/.vuepress/components/BmcAlerts.vue15
-rw-r--r--docs/.vuepress/config.js5
-rw-r--r--docs/.vuepress/enhanceApp.js10
-rw-r--r--docs/guide/components/alert.md12
5 files changed, 49 insertions, 1 deletions
diff --git a/docs/.vuepress/bmcAppPlugin.js b/docs/.vuepress/bmcAppPlugin.js
new file mode 100644
index 00000000..d068b055
--- /dev/null
+++ b/docs/.vuepress/bmcAppPlugin.js
@@ -0,0 +1,8 @@
+import "../../src/assets/styles/_obmc-custom.scss";
+import Alert from '../../src/components/Global/Alert';
+
+export default {
+ install (Vue, options) {
+ Vue.component('Alert', Alert);
+ }
+} \ No newline at end of file
diff --git a/docs/.vuepress/components/BmcAlerts.vue b/docs/.vuepress/components/BmcAlerts.vue
new file mode 100644
index 00000000..a0c95034
--- /dev/null
+++ b/docs/.vuepress/components/BmcAlerts.vue
@@ -0,0 +1,15 @@
+<template>
+ <div>
+ <alert show variant="warning">This is a warning message</alert>
+ <alert show variant="danger">This is an error message</alert>
+ <alert show variant="info">This is an info message</alert>
+ </div>
+</template>
+
+<script>
+
+export default {
+ name: 'BmcAlerts',
+
+}
+</script> \ No newline at end of file
diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js
index 5a8e601f..abcbeb9e 100644
--- a/docs/.vuepress/config.js
+++ b/docs/.vuepress/config.js
@@ -42,7 +42,10 @@ module.exports = {
},
{
title: "Components",
- children: ["/guide/components/", "/guide/components/page-section"]
+ children: [
+ "/guide/components/",
+ "/guide/components/alert",
+ ]
}
],
"/themes/": [""]
diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js
new file mode 100644
index 00000000..5a84f619
--- /dev/null
+++ b/docs/.vuepress/enhanceApp.js
@@ -0,0 +1,10 @@
+import {
+ AlertPlugin,
+ } from 'bootstrap-vue';
+
+import BmcAppPlugin from './bmcAppPlugin';
+
+export default ({ Vue }) => {
+ Vue.use(AlertPlugin);
+ Vue.use(BmcAppPlugin);
+} \ No newline at end of file
diff --git a/docs/guide/components/alert.md b/docs/guide/components/alert.md
new file mode 100644
index 00000000..768aa873
--- /dev/null
+++ b/docs/guide/components/alert.md
@@ -0,0 +1,12 @@
+# Alerts
+An alert is an inline message that contains a short description that a user cannot manually dismiss. With exception to the error message on the login page, alerts are not triggered by user action. Success and error notifications based on user actions are created using a toast component.
+
+[Learn more about Bootstrap-vue alert options](https://bootstrap-vue.js.org/docs/components/alert)
+
+<BmcAlerts />
+
+```vue
+<alert show variant="warning">This is a warning message</alert>
+<alert show variant="danger">This is an error message</alert>
+<alert show variant="info">This is an info message</alert>
+``` \ No newline at end of file