From d35132d82d68acbbf83d95add7290f769d3b2436 Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Wed, 11 Nov 2020 15:00:15 -0800 Subject: Update VuePress configuration We are moving away from importing application components directly into the VuePress docs. We will document code snippets and add screenshots as a visual example. This commit removes all code and configurations that supported importing dynamic components into VuePress and added images in place of a working component example on the page. Signed-off-by: Yoshie Muranaka Change-Id: I9a75c5d51de8b6d941e4df7ae977d78c043d36e1 --- docs/.vuepress/components/BmcButtons.vue | 58 ------------------ docs/.vuepress/components/BmcTable.vue | 57 ------------------ docs/.vuepress/components/BmcToasts.vue | 36 ------------ .../components/app-imports/BVToastMixin.js | 58 ------------------ .../components/app-imports/StatusIcon.vue | 65 --------------------- docs/.vuepress/config.js | 7 --- docs/.vuepress/enhanceApp.js | 24 -------- docs/.vuepress/public/alert.png | Bin 0 -> 45130 bytes docs/.vuepress/public/button-disabled.png | Bin 0 -> 28504 bytes docs/.vuepress/public/button.png | Bin 0 -> 37823 bytes docs/.vuepress/public/table-empty.png | Bin 0 -> 23143 bytes docs/.vuepress/public/table-sort.png | Bin 0 -> 94267 bytes docs/.vuepress/public/table.png | Bin 0 -> 36144 bytes docs/.vuepress/public/toast.png | Bin 0 -> 100290 bytes docs/.vuepress/styles/_index.scss | 42 ------------- docs/.vuepress/styles/palette.styl | 16 ----- docs/guide/components/alert.md | 4 +- docs/guide/components/button.md | 9 ++- docs/guide/components/table.md | 32 ++-------- docs/guide/components/toast.md | 2 +- 20 files changed, 14 insertions(+), 396 deletions(-) delete mode 100644 docs/.vuepress/components/BmcButtons.vue delete mode 100644 docs/.vuepress/components/BmcTable.vue delete mode 100644 docs/.vuepress/components/BmcToasts.vue delete mode 100644 docs/.vuepress/components/app-imports/BVToastMixin.js delete mode 100644 docs/.vuepress/components/app-imports/StatusIcon.vue delete mode 100644 docs/.vuepress/enhanceApp.js create mode 100644 docs/.vuepress/public/alert.png create mode 100644 docs/.vuepress/public/button-disabled.png create mode 100644 docs/.vuepress/public/button.png create mode 100644 docs/.vuepress/public/table-empty.png create mode 100644 docs/.vuepress/public/table-sort.png create mode 100644 docs/.vuepress/public/table.png create mode 100644 docs/.vuepress/public/toast.png delete mode 100644 docs/.vuepress/styles/_index.scss (limited to 'docs') diff --git a/docs/.vuepress/components/BmcButtons.vue b/docs/.vuepress/components/BmcButtons.vue deleted file mode 100644 index 795c837a..00000000 --- a/docs/.vuepress/components/BmcButtons.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - \ No newline at end of file diff --git a/docs/.vuepress/components/BmcTable.vue b/docs/.vuepress/components/BmcTable.vue deleted file mode 100644 index 9cc7b645..00000000 --- a/docs/.vuepress/components/BmcTable.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - \ No newline at end of file diff --git a/docs/.vuepress/components/BmcToasts.vue b/docs/.vuepress/components/BmcToasts.vue deleted file mode 100644 index 6f90d1f1..00000000 --- a/docs/.vuepress/components/BmcToasts.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - \ No newline at end of file diff --git a/docs/.vuepress/components/app-imports/BVToastMixin.js b/docs/.vuepress/components/app-imports/BVToastMixin.js deleted file mode 100644 index 10075658..00000000 --- a/docs/.vuepress/components/app-imports/BVToastMixin.js +++ /dev/null @@ -1,58 +0,0 @@ -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 deleted file mode 100644 index ef2afb72..00000000 --- a/docs/.vuepress/components/app-imports/StatusIcon.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index c650d7e6..e4dd2004 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -61,12 +61,5 @@ module.exports = { ], "/themes/": ["", "customize", "env"] }, - }, - configureWebpack: { - resolve: { - alias: { - '@': path.resolve(__dirname, '../../src') - } - } } }; \ No newline at end of file diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js deleted file mode 100644 index 6ff87759..00000000 --- a/docs/.vuepress/enhanceApp.js +++ /dev/null @@ -1,24 +0,0 @@ - -import "./styles/_index.scss"; -import Alert from "../../src/components/Global/Alert"; -import StatusIcon from "./components/app-imports/StatusIcon"; - -// Bootstrap-vue Plugin imports -import { - AlertPlugin, - ButtonPlugin, - TablePlugin, - ToastPlugin - } from 'bootstrap-vue'; - - -export default ({ Vue }) => { - Vue.use(AlertPlugin); - Vue.use(ButtonPlugin); - Vue.use(TablePlugin); - Vue.use(ToastPlugin); - - // BMC Components and Mixins - Vue.component('Alert', Alert); - Vue.component('StatusIcon', StatusIcon); -} \ No newline at end of file diff --git a/docs/.vuepress/public/alert.png b/docs/.vuepress/public/alert.png new file mode 100644 index 00000000..7a368f7f Binary files /dev/null and b/docs/.vuepress/public/alert.png differ diff --git a/docs/.vuepress/public/button-disabled.png b/docs/.vuepress/public/button-disabled.png new file mode 100644 index 00000000..70f3b152 Binary files /dev/null and b/docs/.vuepress/public/button-disabled.png differ diff --git a/docs/.vuepress/public/button.png b/docs/.vuepress/public/button.png new file mode 100644 index 00000000..d994e86d Binary files /dev/null and b/docs/.vuepress/public/button.png differ diff --git a/docs/.vuepress/public/table-empty.png b/docs/.vuepress/public/table-empty.png new file mode 100644 index 00000000..90ecfc14 Binary files /dev/null and b/docs/.vuepress/public/table-empty.png differ diff --git a/docs/.vuepress/public/table-sort.png b/docs/.vuepress/public/table-sort.png new file mode 100644 index 00000000..af6d831e Binary files /dev/null and b/docs/.vuepress/public/table-sort.png differ diff --git a/docs/.vuepress/public/table.png b/docs/.vuepress/public/table.png new file mode 100644 index 00000000..0160013e Binary files /dev/null and b/docs/.vuepress/public/table.png differ diff --git a/docs/.vuepress/public/toast.png b/docs/.vuepress/public/toast.png new file mode 100644 index 00000000..97f9bc4c Binary files /dev/null and b/docs/.vuepress/public/toast.png differ diff --git a/docs/.vuepress/styles/_index.scss b/docs/.vuepress/styles/_index.scss deleted file mode 100644 index 700c14e2..00000000 --- a/docs/.vuepress/styles/_index.scss +++ /dev/null @@ -1,42 +0,0 @@ -// Custom and Vendor helpers -@import "src/assets/styles/bmc/helpers/index"; -@import "src/assets/styles/bootstrap/helpers"; - -// Vendor styles -@import "~bootstrap/scss/root"; -@import "~bootstrap/scss/transitions"; - -// Components -@import "~bootstrap/scss/alert"; -@import "~bootstrap/scss/badge"; -@import "~bootstrap/scss/breadcrumb"; -@import "~bootstrap/scss/button-group"; -@import "~bootstrap/scss/buttons"; -@import "~bootstrap/scss/card"; -@import "~bootstrap/scss/close"; -@import "~bootstrap/scss/code"; -@import "~bootstrap/scss/custom-forms"; -@import "~bootstrap/scss/dropdown"; -@import "~bootstrap/scss/forms"; -@import "~bootstrap/scss/grid"; -@import "~bootstrap/scss/images"; -@import "~bootstrap/scss/input-group"; -@import "~bootstrap/scss/list-group"; -@import "~bootstrap/scss/media"; -@import "~bootstrap/scss/modal"; -@import "~bootstrap/scss/nav"; -@import "~bootstrap/scss/navbar"; -@import "~bootstrap/scss/pagination"; -@import "~bootstrap/scss/popover"; -@import "~bootstrap/scss/progress"; -@import "~bootstrap/scss/spinners"; -@import "~bootstrap/scss/tables"; -@import "~bootstrap/scss/toasts"; -@import "~bootstrap/scss/tooltip"; - -// Utils -@import "~bootstrap/scss/utilities"; -@import "~bootstrap-vue/src/index"; - -// Custom BMC styles -@import "src/assets/styles/bmc/custom/index"; diff --git a/docs/.vuepress/styles/palette.styl b/docs/.vuepress/styles/palette.styl index d8b99f67..2a792757 100644 --- a/docs/.vuepress/styles/palette.styl +++ b/docs/.vuepress/styles/palette.styl @@ -1,21 +1,5 @@ // VuePress Theme overrides -// Needed for table component to render correctly. - -tr:nth-child(2n) - background-color transparent -table - border-collapse collapse - z-index 0 !important - width 100% - display table -th - border-right transparent - border-left transparent - text-align left -td - border none - // Change content to be left aligned .theme-default-content:not(.custom), .page-nav diff --git a/docs/guide/components/alert.md b/docs/guide/components/alert.md index 1ad965bd..1892f3f8 100644 --- a/docs/guide/components/alert.md +++ b/docs/guide/components/alert.md @@ -3,9 +3,7 @@ An alert is an inline message that contains a short description that a user cann [Learn more about Bootstrap-vue alert options](https://bootstrap-vue.js.org/docs/components/alert) -This is a warning message -This is an error message -This is an info message +![Alert examples](/alert.png) ```vue This is a warning message diff --git a/docs/guide/components/button.md b/docs/guide/components/button.md index 6916d438..3e61b797 100644 --- a/docs/guide/components/button.md +++ b/docs/guide/components/button.md @@ -4,7 +4,14 @@ Buttons are used to perform an action. The main buttons in the application are t [Learn more about Bootstrap-vue buttons](https://bootstrap-vue.js.org/docs/components/button) - +### Enabled buttons + +![Button examples](/button.png) + +### Disabled buttons + +![Disabled button examples](/button-disabled.png) + ```vue // Enabled Buttons diff --git a/docs/guide/components/table.md b/docs/guide/components/table.md index ddb1413f..af464e46 100644 --- a/docs/guide/components/table.md +++ b/docs/guide/components/table.md @@ -17,29 +17,8 @@ There are a few required properties to maintain consistency across the applicati - `show-empty` *(required if table data is generated dynamically)* - shows an empty message if there are no items in the table - `empty-text` *(required if table data is generated dynamically)* - the translated empty message -
- - - - - -
+![Basic table example](/table.png) +![Basic empty table example](/table-empty.png) ```vue