From 7385e139b0c9efca7430458cee982e63e282f4ae Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Thu, 8 Dec 2022 06:13:13 -0600 Subject: prettier: re-format Prettier is enabled in openbmc-build-scripts on Markdown, JSON, and YAML files to have consistent formatting for these file types. Re-run the formatter on the whole repository. Change-Id: I2804ee3ab5ff6bcbf986b028db2fafec8e616779 Signed-off-by: Patrick Williams --- docs/customization/build.md | 76 +++++------- docs/customization/readme.md | 40 +++---- docs/customization/theme.md | 63 ++++++---- docs/guide/coding-standards/accessibility.md | 42 +++---- docs/guide/coding-standards/readme.md | 13 +- docs/guide/components/alerts/index.md | 6 +- docs/guide/components/buttons/index.md | 6 +- docs/guide/components/file-upload/readme.md | 10 +- docs/guide/components/info-tooltip/index.md | 7 +- docs/guide/components/page-section/index.md | 5 +- docs/guide/components/page-title/index.md | 8 +- docs/guide/components/readme.md | 3 +- docs/guide/components/status-icon/readme.md | 17 +-- docs/guide/components/table/index.md | 165 ++++++++++++-------------- docs/guide/components/toasts/index.md | 7 +- docs/guide/guidelines/colors.md | 25 ++-- docs/guide/guidelines/internationalization.md | 42 ++++--- docs/guide/guidelines/motion.md | 13 +- docs/guide/guidelines/typography.md | 2 +- docs/guide/quickstart/forms.md | 47 ++++---- docs/guide/quickstart/page-anatomy.md | 43 ++++--- docs/guide/quickstart/store-anatomy.md | 46 +++---- docs/guide/readme.md | 5 +- docs/guide/unit-testing/readme.md | 73 +++++++----- docs/readme.md | 2 +- 25 files changed, 394 insertions(+), 372 deletions(-) (limited to 'docs') diff --git a/docs/customization/build.md b/docs/customization/build.md index b10fd9db..4bdbd50a 100644 --- a/docs/customization/build.md +++ b/docs/customization/build.md @@ -26,19 +26,14 @@ VUE_APP_ENV_NAME=ibm ## Store -:::tip -[Vuex store modules](https://vuex.vuejs.org/guide/modules.html) contain the -application's API calls. -::: +:::tip [Vuex store modules](https://vuex.vuejs.org/guide/modules.html) contain +the application's API calls. ::: 1. If making customizations to the default store, add `CUSTOM_STORE=true` key value pair to the new .env file. -2. Create a `.js` file in `src/env/store` - :::danger - The filename needs to match the `VUE_APP_ENV_NAME` value defined in the - .env file. The store import in `src/main.js` will resolve to this new - file. - ::: +2. Create a `.js` file in `src/env/store` :::danger The filename needs + to match the `VUE_APP_ENV_NAME` value defined in the .env file. The store + import in `src/main.js` will resolve to this new file. ::: 3. Import the base store 4. Import environment specific store modules 5. Use the [Vuex](https://vuex.vuejs.org/api/#registermodule) `registerModule` @@ -58,24 +53,17 @@ export default store; ## Router -:::tip -[Vue Router](https://router.vuejs.org/guide/) determines which pages are -accessible in the UI. -::: +:::tip [Vue Router](https://router.vuejs.org/guide/) determines which pages are +accessible in the UI. ::: 1. If making customizations to the default router, add `CUSTOM_ROUTER=true` key value pair to the new .env file. -2. Create a `.js` file in `src/env/router` - :::danger - The filename needs to match the `VUE_APP_ENV_NAME` value defined in the - .env file. The routes import in `src/router/index.js` will resolve to this - new file. - ::: -3. Define new [routes](https://router.vuejs.org/api/#routes). - :::tip - Use static imports (over lazy-loading routes) to avoid creating separate - JS chunks. Static imports also helps to keep the total build size down. - ::: +2. Create a `.js` file in `src/env/router` :::danger The filename + needs to match the `VUE_APP_ENV_NAME` value defined in the .env file. The + routes import in `src/router/index.js` will resolve to this new file. ::: +3. Define new [routes](https://router.vuejs.org/api/#routes). :::tip Use static + imports (over lazy-loading routes) to avoid creating separate JS chunks. + Static imports also helps to keep the total build size down. ::: 4. Add default export ## App navigation @@ -88,13 +76,11 @@ in src/components/AppNavigation/AppNavigation.vue. 1. If making customizations to the app navigation, add `CUSTOM_APP_NAV=true` key value pair to the new .env file. -2. Create a `.js` file in `src/env/components/AppNavigation` - :::danger - The filename needs to match the `VUE_APP_ENV_NAME` value defined in the - .env file. The AppNavigationMixin import in +2. Create a `.js` file in `src/env/components/AppNavigation` :::danger + The filename needs to match the `VUE_APP_ENV_NAME` value defined in the .env + file. The AppNavigationMixin import in `src/components/AppNavigation/AppNavigation.vue` will resolve to this new - file. - ::: + file. ::: 3. Your custom mixin should follow a very similar structure to the default AppNavigationMixin.js file. It should include a data property named `navigationItems` that should be an array of of navigation objects. Each @@ -106,22 +92,20 @@ in src/components/AppNavigation/AppNavigation.vue. :::tip [Bootstrap theming](https://getbootstrap.com/docs/4.5/getting-started/theming/) -allows for easy visual customizations. -::: +allows for easy visual customizations. ::: 1. If making customizations to the default styles, add `CUSTOM_STYLES=true` key value pair to the new .env file. -2. Create a `_.scss` partial in `src/env/assets/styles` - :::danger - The filename needs to match the `VUE_APP_ENV_NAME` value defined in the - .env file. The webpack sass loader will attempt to import a file with this - name. +2. Create a `_.scss` partial in `src/env/assets/styles` :::danger The + filename needs to match the `VUE_APP_ENV_NAME` value defined in the .env + file. The webpack sass loader will attempt to import a file with this name. ::: -3. Add style customizations. Refer to [bootstrap documentation](https://getbootstrap.com/docs/4.5/getting-started/theming/) - for details about [color - overrides](https://getbootstrap.com/docs/4.5/getting-started/theming/#variable-defaults) - and [other customizable - options](https://getbootstrap.com/docs/4.5/getting-started/theming/#sass-options). +3. Add style customizations. Refer to + [bootstrap documentation](https://getbootstrap.com/docs/4.5/getting-started/theming/) + for details about + [color overrides](https://getbootstrap.com/docs/4.5/getting-started/theming/#variable-defaults) + and + [other customizable options](https://getbootstrap.com/docs/4.5/getting-started/theming/#sass-options). Example for adding custom colors @@ -145,9 +129,9 @@ $success: lime; ## Production build -Run npm build script with vue-cli `--mode` [option -flag](https://cli.vuejs.org/guide/mode-and-env.html#modes). This requires -[corresponding .env file to exist](#setup). +Run npm build script with vue-cli `--mode` +[option flag](https://cli.vuejs.org/guide/mode-and-env.html#modes). This +requires [corresponding .env file to exist](#setup). ``` npm run build -- --mode ibm diff --git a/docs/customization/readme.md b/docs/customization/readme.md index 64118060..9f808ea8 100644 --- a/docs/customization/readme.md +++ b/docs/customization/readme.md @@ -3,15 +3,14 @@ This section discusses the structure and purpose of the SCSS files and how to customize the application using Bootstrap theming. -[Read more about Bootstrap -Theming](https://getbootstrap.com/docs/4.0/getting-started/theming) +[Read more about Bootstrap Theming](https://getbootstrap.com/docs/4.0/getting-started/theming) ## SCSS Directory Structure ### `bmc` Directory -The `bmc` directory contains Sass helpers and default styles for customizing the OpenBMC -Web UI. +The `bmc` directory contains Sass helpers and default styles for customizing the +OpenBMC Web UI. ```{5} . @@ -84,9 +83,9 @@ variables that establish the custom theme of the application. #### `_colors.scss` -The `_colors.scss` file sets all the SASS variables and color maps for the OpenBMC -Web UI. Any color settings needed to meet company brand guidelines will happen -in this file. +The `_colors.scss` file sets all the SASS variables and color maps for the +OpenBMC Web UI. Any color settings needed to meet company brand guidelines will +happen in this file. ##### Sass Color Variables @@ -161,12 +160,9 @@ $theme-colors: ( ##### Color Resources -- [Learn more about Bootstrap - colors](https://getbootstrap.com/docs/4.0/getting-started/theming/#color) -- [Learn more about Bootstrap - variables](https://getbootstrap.com/docs/4.0/getting-started/theming/#css-variables) -- [View the color palette and hex values in the color - guidelines](/guide/guidelines/colors) +- [Learn more about Bootstrap colors](https://getbootstrap.com/docs/4.0/getting-started/theming/#color) +- [Learn more about Bootstrap variables](https://getbootstrap.com/docs/4.0/getting-started/theming/#css-variables) +- [View the color palette and hex values in the color guidelines](/guide/guidelines/colors) #### `_functions.scss` @@ -254,10 +250,8 @@ $exit-easing--expressive: cubic-bezier(0.4, 0.14, 1, 1); ##### Motion Resources -- [Including Animation In Your Design - System](https://www.smashingmagazine.com/2019/02/animation-design-system/) -- [Carbon Design System motion - guidelines](https://www.carbondesignsystem.com/guidelines/motion/basics/) +- [Including Animation In Your Design System](https://www.smashingmagazine.com/2019/02/animation-design-system/) +- [Carbon Design System motion guidelines](https://www.carbondesignsystem.com/guidelines/motion/basics/) #### `_variables.scss` @@ -307,10 +301,8 @@ components, and utility styles. The `obmc-custom.scss` file defines all of the presentational layer dependencies. -- [Read more about Bootstrap - options](https://getbootstrap.com/docs/4.0/getting-started/theming/#sass-options) -- [Read more about - Importing](https://getbootstrap.com/docs/4.0/getting-started/theming/#importing) +- [Read more about Bootstrap options](https://getbootstrap.com/docs/4.0/getting-started/theming/#sass-options) +- [Read more about Importing](https://getbootstrap.com/docs/4.0/getting-started/theming/#importing) ## Component / View Styles @@ -359,9 +351,9 @@ CSS styles correctly. ``` -:::tip -You might notice that there is an HTML element, `

`, used in the example. This is an anti-pattern in global `.scss` files. However, in a single file component that generates the markup it is acceptable. -::: +:::tip You might notice that there is an HTML element, `

`, used in the +example. This is an anti-pattern in global `.scss` files. However, in a single +file component that generates the markup it is acceptable. ::: [Learn more about single file components](https://vuejs.org/v2/guide/single-file-components.html) diff --git a/docs/customization/theme.md b/docs/customization/theme.md index 6dbce1a9..10e062d3 100644 --- a/docs/customization/theme.md +++ b/docs/customization/theme.md @@ -1,10 +1,12 @@ # Theme customization + Customization of the application requires knowledge of Sass and CSS. It also will require becoming familiar with the Bootstrap and Bootstrap-Vue component libraries. This section outlines the global options and variables that can be removed or updated to meet organizational brand guidelines. ## Environment specific builds + Any organization can create a build that meets their branding and other customization needs. This includes customization of the state store, routing, application navigation, and theming. @@ -12,59 +14,68 @@ application navigation, and theming. [Read more in the Build Customization section](/customization/build) ### Configuring environment specific builds + The complete instructions can be found in the `env` directory in a file called -env.md or by viewing the [Configuring environment specific builds -page](./env.md) +env.md or by viewing the +[Configuring environment specific builds page](./env.md) ## Bootstrap Sass Options + The Bootstrap Sass options are global styling toggles. The naming convention for these built-in variables is `enabled-*`. ### $enable-rounded + This option enables or disables the border-radius styles on various components. - Set to `false` to remove rounded corners on all container elements and buttons ### $enable-validation-icons + This option enables or disables background-image icons within textual inputs and some custom forms for validation states. - Set to `false` due to inability to style icons using CSS ### More information -- [View all the Bootstrap Sass - Options](https://getbootstrap.com/docs/4.2/getting-started/theming/#sass-options) + +- [View all the Bootstrap Sass Options](https://getbootstrap.com/docs/4.2/getting-started/theming/#sass-options) ## Bootstrap Sass Variables + These are global variables that Bootstrap defines in the `/node_modules/bootstrap/scss/variables.scss` helper file. Adding a variable listed in this file to the `/src/assets/styles/bmc/helpers/_variables.scss` file will override the Bootstrap defined value. ### $transition-base + This variable sets the base CSS transition style throughout the application. + - Set to `all $duration--moderate-02 $standard-easing--productive` ### $transition-fade + This variable sets the transition when showing and hiding elements. - Set to `opacity $duration--moderate-01 $standard-easing--productive` ### $transition-collapse + This variable sets the CSS transitions throughout the application when expanding and collapsing elements. - Set to `height $duration--slow-01 $standard-easing--expressive` ### More Information -- [Carbon Design System Motion - Guidelines](https://www.carbondesignsystem.com/guidelines/motion/basics/) -- [Including Animation In Your Design - System](https://www.smashingmagazine.com/2019/02/animation-design-system/) + +- [Carbon Design System Motion Guidelines](https://www.carbondesignsystem.com/guidelines/motion/basics/) +- [Including Animation In Your Design System](https://www.smashingmagazine.com/2019/02/animation-design-system/) ## OpenBMC Custom Sass Options ### $responsive-layout-bp + This variable determines when the primary navigation is hidden and when the hamburger menu is displayed. The breakpoint is defined using a Bootstrap function that only accepts a key from the Bootstrap `$grid-breakpoints` map. @@ -76,46 +87,52 @@ function that only accepts a key from the Bootstrap `$grid-breakpoints` map. - xl - Navigation displayed when the viewport is less than 1200px #### Responsive Resources -- [Bootstrap responsive - breakpoints](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints) -- [Bootstrap Sass - Mixins](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints) -- [Customizing the Bootstrap - Grid](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints) + +- [Bootstrap responsive breakpoints](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints) +- [Bootstrap Sass Mixins](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints) +- [Customizing the Bootstrap Grid](https://getbootstrap.com/docs/4.0/layout/overview/#responsive-breakpoints) ### $header-height + This variable determines the height of the OpenBMC Web UI header element. - Default value: 56px ### $navigation-width + This variable determines the width of the primary navigation menu when expanded. - Default value: 300px ### $container-bgd + This option sets the background of page containers. Changing the value of this variable will change the background color for the following elements: -- Login page + +- Login page - Primary navigation section - Quick links section on the overview page #### Value + - Default value: $gray-200 ### $primary-nav-hover + The semantic naming of this variable identifies its purpose. This color should always be slightly darker than the `$container-bgd` value. - Default value: $gray-300 ## Updating Colors + Supporting a different color palette is a simple process. The default color palette is supported using the Sass variables outlined in the color guidelines -and color maps outlined in the theme's overview. The following sections provide +and color maps outlined in the theme's overview. The following sections provide directions to update the settings to meet your organization's needs. ### Color + The OpenBMC Web UI uses Sass variables and maps to build its layout and components. Bootstrap variables and maps use the `!default` flag to allow for overrides. There are three Sass maps created to establish the color palette. @@ -123,6 +140,7 @@ These include the `color` map, `theme-color` map, and `gray` map. These maps are used by Bootstrap to build the application's CSS stylesheets. #### All Colors + The OpenBMC Web UI custom colors are available as Sass variables and a Sass map in `/src/assets/styles/bmc/helpers/_variables.scss`. The OpenBMC theme only requires a subset of the colors to create the look and feel of the application. @@ -137,6 +155,7 @@ keys for customization. Using these keys in Sass stylesheets or single-file components is discouraged. #### Theme Colors + The theme color variables and the `theme-color` map consist of a subset of the color variables. This smaller color palette creates a scheme that is not dependent on specific colors like blue or green. Several of the Bootstrap @@ -151,6 +170,7 @@ at the [color guidelines](/guide/guidelines/colors) to better understand default theme-colors map. #### Gray Colors + The gray color palette contains nine shades of gray that range from light to dark. Bootstrap sets a default gray color value for each color variable from 100-900 in increments of one hundred, for example, `$gray-100`, `$gray-200`, @@ -160,16 +180,16 @@ maps for all the default colors is scheduled to be delivered in a future patch. The OpenBMC Web UI color theme overrides all shades of the Bootstrap default gray variable values. -[Learn more about Bootstrap -colors](https://getbootstrap.com/docs/4.0/getting-started/theming/#color) +[Learn more about Bootstrap colors](https://getbootstrap.com/docs/4.0/getting-started/theming/#color) ### Bootstrap Color Functions + - `color(')` - `theme-color(')` - `gray(')` - #### Example + ```SCSS .some-selector { color: color("blue"); @@ -178,9 +198,10 @@ colors](https://getbootstrap.com/docs/4.0/getting-started/theming/#color) } ``` -[Learn more about using Bootstrap -functions](https://getbootstrap.com/docs/4.0/getting-started/theming/#functions) +[Learn more about using Bootstrap functions](https://getbootstrap.com/docs/4.0/getting-started/theming/#functions) + ## Adding a logo + The updated page header can include a small logo. The guidelines for adding a logo and the suggested logo dimensions are currently in progress. It may be challenging to meet all organization brand guidelines due to the minimal height diff --git a/docs/guide/coding-standards/accessibility.md b/docs/guide/coding-standards/accessibility.md index 0a9a1a75..63cc870f 100644 --- a/docs/guide/coding-standards/accessibility.md +++ b/docs/guide/coding-standards/accessibility.md @@ -2,18 +2,19 @@ It is important that the OpenBMC Web UI meet accessibility guidelines established by the [World Wide Web Consortium (W3C)](https://www.w3.org/). These -guidelines are known as the [Web Content Accessibility Guidelines -(WCAG)](https://www.w3.org/WAI/standards-guidelines/wcag/). Making the Web UI -accessible to as many users as possible is the right thing to do. In many -countries, it is also legally required. Organizations providing interfaces that -users with permanent or temporary disabilities can not use, may lose sales or be -susceptible to discriminatory lawsuits. +guidelines are known as the +[Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/WAI/standards-guidelines/wcag/). +Making the Web UI accessible to as many users as possible is the right thing to +do. In many countries, it is also legally required. Organizations providing +interfaces that users with permanent or temporary disabilities can not use, may +lose sales or be susceptible to discriminatory lawsuits. ## Accessibility Principles + These [principles](https://www.w3.org/WAI/fundamentals/accessibility-principles/) -reference a set of international standards from the [W3C Web Accessibility -Intitiative (WAI)](https://www.w3.org/WAI/). +reference a set of international standards from the +[W3C Web Accessibility Intitiative (WAI)](https://www.w3.org/WAI/). - [Perceiveable](https://www.w3.org/WAI/fundamentals/accessibility-principles/#perceivable) - [Operable](https://www.w3.org/WAI/fundamentals/accessibility-principles/#operable) @@ -21,6 +22,7 @@ Intitiative (WAI)](https://www.w3.org/WAI/). - [Robust](https://www.w3.org/WAI/fundamentals/accessibility-principles/#robust) ## Semantic HTML + Coding the UI using semantic markup is the most important step in creating an inclusive interface. The use of [WAI-ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) can help make an @@ -31,6 +33,7 @@ rules to follow: 2. No ARIA is better than Bad ARIA ## Testing + Assuring the Web UI meets accessibility guidelines requires a combination of automated and manual testing. Automated tests will test the application against common problems such as color contrast and ARIA use. Automated testing can be @@ -41,35 +44,32 @@ The OpenBMC Web UI developers should test their development pages using one of the tools listed in the tools section below. If using Chrome, the Lighthouse application comes bundled with the browser and also includes testing for performance and best practices. If there is an issue that is created when using -a Bootstrap-Vue component, we can [create an issue in the Bootstrap-vue -repo](https://github.com/bootstrap-vue/bootstrap-vue/issues/new/choose). +a Bootstrap-Vue component, we can +[create an issue in the Bootstrap-vue repo](https://github.com/bootstrap-vue/bootstrap-vue/issues/new/choose). Contributing to the Bootstrap-Vue open-source library, when possible, is strongly encouraged. ## Tools + - [Deque Axe](https://www.deque.com/axe/) -- [Firefox Accessibility - Inspector](https://developer.mozilla.org/en-US/docs/Tools/Accessibility_inspector) +- [Firefox Accessibility Inspector](https://developer.mozilla.org/en-US/docs/Tools/Accessibility_inspector) - [IBM Accessibility Tools](https://www.ibm.com/able/toolkit/tools) - [Lighthouse](https://developers.google.com/web/tools/lighthouse) ## Screen Readers + - [Jaws - (Windows only)](https://webaim.org/articles/jaws/) -- [Narrator - (Windows - only)](https://support.microsoft.com/en-us/windows/complete-guide-to-narrator-e4397a0d-ef4f-b386-d8ae-c172f109bdb1) +- [Narrator - (Windows only)](https://support.microsoft.com/en-us/windows/complete-guide-to-narrator-e4397a0d-ef4f-b386-d8ae-c172f109bdb1) - [NVDA (Windows only)](https://webaim.org/articles/nvda/) - [Voiceover (Mac only)](https://webaim.org/articles/voiceover/) ## Resources -- [Mozilla Developer Network - - Accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility) -- [Web Content Accessibility Guidelines - (WCAG)](https://www.w3.org/WAI/standards-guidelines/wcag/) + +- [Mozilla Developer Network - Accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility) +- [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/WAI/standards-guidelines/wcag/) - [WAI-ARIA Authoring Practices](https://www.w3.org/TR/wai-aria-practices/) -- [WAI-ARIA - Basics](https://developer.mozilla.org/en-US/docs/Learn/Accessibility/WAI-ARIA_basics) +- [WAI-ARIA Basics](https://developer.mozilla.org/en-US/docs/Learn/Accessibility/WAI-ARIA_basics) - [WebAIM Articles](https://webaim.org/articles/) - [A11Y Project](https://a11yproject.com/) - [IBM Accessibility](https://www.ibm.com/able/) - [Inclusive Components](https://inclusive-components.design/) - diff --git a/docs/guide/coding-standards/readme.md b/docs/guide/coding-standards/readme.md index a6ab3669..48d6cfc7 100644 --- a/docs/guide/coding-standards/readme.md +++ b/docs/guide/coding-standards/readme.md @@ -1,31 +1,36 @@ # JavaScript and SASS + This project uses the following libraries to determine the best practices and guidelines for both SCSS and JavaScript syntax. + - [ESLint](https://eslint.org/) - [Prettier](https://prettier.io/) - [ESLint Plugin for Vue](https://eslint.vuejs.org/) The guidelines we are following are: -- [Vue - Recommended](https://eslint.vuejs.org/rules/#priority-c-recommended-minimizing-arbitrary-choices-and-cognitive-overhead-for-vue-js-3-x) + +- [Vue Recommended](https://eslint.vuejs.org/rules/#priority-c-recommended-minimizing-arbitrary-choices-and-cognitive-overhead-for-vue-js-3-x) - [ESLint Recommended](https://eslint.org/docs/rules/) - [Prettier](https://prettier.io/docs/en/options.html) The rules are applied in the following order: + 1. Vue rules 1. ESLint recommended 1. Prettier ## Overrides + Any overrides to a rule are located in the ESLint configuration file, `.eslintrc.js`, located in the root directory. ## Running the lint test + To test all files for linting, run `npm run lint`. This command will evaluate the syntax of all files and update any code that that does not require manual review. -The linting script runs when code is committed, during pre-commit, and when the +The linting script runs when code is committed, during pre-commit, and when the CI tool runs after a push to Gerrit. There is a shell script named `format-code.sh` that installs node package dependencies and runs the test -script in your CI. \ No newline at end of file +script in your CI. diff --git a/docs/guide/components/alerts/index.md b/docs/guide/components/alerts/index.md index aa2c5e13..0ce5167c 100644 --- a/docs/guide/components/alerts/index.md +++ b/docs/guide/components/alerts/index.md @@ -1,11 +1,11 @@ # 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) +[Learn more about Bootstrap-vue alert options](https://bootstrap-vue.js.org/docs/components/alert) ![Alert examples](./alert.png) @@ -13,4 +13,4 @@ options](https://bootstrap-vue.js.org/docs/components/alert) This is a warning message This is an error message This is an info message -``` \ No newline at end of file +``` diff --git a/docs/guide/components/buttons/index.md b/docs/guide/components/buttons/index.md index 83b8e8a7..251316ff 100644 --- a/docs/guide/components/buttons/index.md +++ b/docs/guide/components/buttons/index.md @@ -6,10 +6,10 @@ can be themed by setting the `variant` prop on the component to one of the [theme-color map keys](/guide/guidelines/colors). To create a button that looks like a link, set the variant value to `link`. -[Learn more about Bootstrap-vue -buttons](https://bootstrap-vue.js.org/docs/components/button) +[Learn more about Bootstrap-vue buttons](https://bootstrap-vue.js.org/docs/components/button) ### Icon only buttons + Add `btn-icon-only` class to the button and add `title` attribute to get helper text on hover over the button. @@ -57,4 +57,4 @@ text on hover over the button. -``` \ No newline at end of file +``` diff --git a/docs/guide/components/file-upload/readme.md b/docs/guide/components/file-upload/readme.md index fb833648..e0819a85 100644 --- a/docs/guide/components/file-upload/readme.md +++ b/docs/guide/components/file-upload/readme.md @@ -4,12 +4,13 @@ component. The purpose of this component is to upload files to the BMC. To use this component: + 1. Import it into the single file component (SFC) 2. Add the `` tag 3. Add the optional `id` , `disabled`, `accept` and `state` prop as required -[Learn more about the Bootstrap-vue Form File -component](https://bootstrap-vue.org/docs/components/form-file) +[Learn more about the Bootstrap-vue Form File component](https://bootstrap-vue.org/docs/components/form-file) + ### Optional properties - `id`- Used to set the `id` attribute on the rendered content, and used as the @@ -23,10 +24,7 @@ component](https://bootstrap-vue.org/docs/components/form-file) ## Example of form file ```vue - + ``` diff --git a/docs/guide/components/info-tooltip/index.md b/docs/guide/components/info-tooltip/index.md index b6117924..4b6416c9 100644 --- a/docs/guide/components/info-tooltip/index.md +++ b/docs/guide/components/info-tooltip/index.md @@ -4,15 +4,12 @@ The `InfoTooltip` is a custom component that uses a Bootstrap-vue tooltip with an info icon. This custom component requires a title property containing the tooltip text to display to the user. -[Read more about the Bootstrap-vue tooltip -component](https://bootstrap-vue.org/docs/components/tooltip) +[Read more about the Bootstrap-vue tooltip component](https://bootstrap-vue.org/docs/components/tooltip) ## Example ```vue - + ``` ![Tooltip example](./info-tooltip.png) diff --git a/docs/guide/components/page-section/index.md b/docs/guide/components/page-section/index.md index 2a8a22ef..94113c58 100644 --- a/docs/guide/components/page-section/index.md +++ b/docs/guide/components/page-section/index.md @@ -4,10 +4,9 @@ The `` component will render semantic HTML. By adding a `:section-title` prop to the `` component, the localized text string will be rendered in an `h2` header element. -``` vue +```vue // Example: `src/views/AccessControl/Ldap/Ldap.vue` ``` -[View the page section component source -code](https://github.com/openbmc/webui-vue/blob/master/src/components/Global/PageSection.vue). \ No newline at end of file +[View the page section component source code](https://github.com/openbmc/webui-vue/blob/master/src/components/Global/PageSection.vue). diff --git a/docs/guide/components/page-title/index.md b/docs/guide/components/page-title/index.md index db43f29f..2f635e74 100644 --- a/docs/guide/components/page-title/index.md +++ b/docs/guide/components/page-title/index.md @@ -1,4 +1,5 @@ # Page title + The `` component will automatically render the page title that corresponds with the title property set in the route record's meta field in `src/router/routes.js`. @@ -19,10 +20,9 @@ Optional page descriptions can be included by using the description prop `:description` prop and passing in the i18n localized text string. Translations are found in the `src/locales` folder. -``` vue +```vue // Example: `src/views/AccessControl/Ldap/Ldap.vue` - + ``` -[View the page title component source -code](https://github.com/openbmc/webui-vue/blob/master/src/components/Global/PageTitle.vue). +[View the page title component source code](https://github.com/openbmc/webui-vue/blob/master/src/components/Global/PageTitle.vue). diff --git a/docs/guide/components/readme.md b/docs/guide/components/readme.md index aef688af..b200b305 100644 --- a/docs/guide/components/readme.md +++ b/docs/guide/components/readme.md @@ -1,4 +1,5 @@ # Overview + Vue components are the building blocks of the OpenBMC Web UI. It uses both Boostrap-Vue components, as well as custom components. Using these components assures consistency throughout the application. They also improve the developer @@ -7,4 +8,4 @@ HTML markup. If the feature you're working on includes a new layout pattern, rather than adding raw markup to the page, consider creating a component that other sections of the application can use as well. -[Learn more about Vue components](https://vuejs.org/v2/guide/components.html) \ No newline at end of file +[Learn more about Vue components](https://vuejs.org/v2/guide/components.html) diff --git a/docs/guide/components/status-icon/readme.md b/docs/guide/components/status-icon/readme.md index aef1f93c..e2041986 100644 --- a/docs/guide/components/status-icon/readme.md +++ b/docs/guide/components/status-icon/readme.md @@ -9,6 +9,7 @@ following statuses: - danger To use this component: + 1. Import it into the single file component (SFC) 2. Add the `` tag 3. Add the optional status prop and set the value to one of the statuses @@ -29,9 +30,7 @@ import StatusIcon from '@/components/Global/StatusIcon' ## Status icon with success status ```vue - + ``` ![StatusIcon success icon example](./success.png) @@ -39,9 +38,7 @@ import StatusIcon from '@/components/Global/StatusIcon' ## Status icon with info status ```vue - + ``` ![StatusIcon info icon example](./info.png) @@ -49,9 +46,7 @@ import StatusIcon from '@/components/Global/StatusIcon' ## Status icon with warning status ```vue - + ``` ![StatusIcon warning icon example](./warning.png) @@ -59,9 +54,7 @@ import StatusIcon from '@/components/Global/StatusIcon' ## Status icon with danger status ```vue - + ``` ![StatusIcon danger icon example](./danger.png) diff --git a/docs/guide/components/table/index.md b/docs/guide/components/table/index.md index 614ef60f..47bc51d8 100644 --- a/docs/guide/components/table/index.md +++ b/docs/guide/components/table/index.md @@ -1,17 +1,16 @@ # Table -All tables in the application are using the [BoostrapVue table -component](https://bootstrap-vue.org/docs/components/table). +All tables in the application are using the +[BoostrapVue table component](https://bootstrap-vue.org/docs/components/table). To use the component, include the `` tag in the template. The component is registered globally so does not need to be imported in each SFC. ## Basic table -There are a few required properties to maintain consistency across the -application. The full list of options can be viewed on the [Bootstrap-vue table -component's documentation -page](https://bootstrap-vue.org/docs/components/table#comp-ref-b-table-props). +There are a few required properties to maintain consistency across the +application. The full list of options can be viewed on the +[Bootstrap-vue table component's documentation page](https://bootstrap-vue.org/docs/components/table#comp-ref-b-table-props). ### Required properties @@ -20,12 +19,13 @@ page](https://bootstrap-vue.org/docs/components/table#comp-ref-b-table-props). - `hover` - enables table row hover state - `responsive` or `stacked` - makes the table responsive (enables horizontal scrolling or stacked view) at the defined breakpoint -- `show-empty` *(required if table data is generated dynamically)* - shows an +- `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 +- `empty-text` _(required if table data is generated dynamically)_ - the translated empty message -![Basic table example](./table.png) ![Basic empty table +![Basic table example](./table.png) +![Basic empty table example](./table-empty.png) ```vue @@ -41,36 +41,36 @@ example](./table-empty.png) ``` @@ -85,7 +85,6 @@ columns and add the following props to the `` component: ![Table sort example](./table-sort.png) - ```vue