Skip to content

Commit

Permalink
Merge branch 'master' into open-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Sep 4, 2020
2 parents 55a9a69 + 74499c4 commit 328c3e7
Show file tree
Hide file tree
Showing 416 changed files with 7,398 additions and 6,982 deletions.
2 changes: 1 addition & 1 deletion docs/apm/apm-app-users.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Here are two examples:
| Allow the use of the the {beat_kib_app}

| Spaces
| `Read` or `All` on Dashboards, Visualize, and Discover
| `Read` or `All` on Dashboards and Discover
| Allow the user to view, edit, and create dashboards, as well as browse data.
|====

Expand Down
167 changes: 167 additions & 0 deletions docs/canvas/canvas-elements.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
[role="xpack"]
[[add-canvas-elements]]
=== Add elements

Create a story about your data by adding elements to your workpad that include images, text, charts, and more. You can create your own elements and connect them to your data sources, add saved objects, and add your own images.

[float]
[[create-canvas-element]]
==== Create an element

Choose the type of element you want to use, then connect it to your own data.

. Click *Add element*, then select the element you want to use.
+
[role="screenshot"]
image::images/canvas-element-select.gif[Canvas elements]

. To familiarize yourself with the element, use the preconfigured data demo data.
+
By default, most of the elements you create use demo data until you change the data source. The demo data includes a small data set that you can use to experiment with your element.

. To connect the element to your data, select *Data*, then select one of the following data sources:

* *{es} SQL* — Access your data in {es} using SQL syntax. For information about SQL syntax, refer to {ref}/sql-spec.html[SQL language].

* *{es} documents* &mdash; Access your data in {es} without using aggregations. To use, select an index and fields, and optionally enter a query using the <<lucene-query,Lucene Query Syntax>>. Use the *{es} documents* data source when you have low volume datasets, to view raw documents, or to plot exact, non-aggregated values on a chart.

* *Timelion* &mdash; Access your time series data using <<timelion,Timelion>> queries. To use Timelion queries, you can enter a query using the <<lucene-query,Lucene Query Syntax>>.

Each element can display a different data source. Pages and workpads often contain multiple data sources.

[float]
[[canvas-add-object]]
==== Add a saved object

Add <<managing-saved-objects,saved objects>> to your workpad, such as maps and visualizations.

. Click *Add element > Add from Visualize Library*.

. Select the saved object you want to add.
+
[role="screenshot"]
image::images/canvas-map-embed.gif[]

. To use the customization options, click the panel menu, then select one of the following options:

* *Edit map* &mdash; Opens <<maps,Maps>> or <<create-panels,Dashboard>> so that you can edit the original saved object.

* *Edit panel title* &mdash; Adds a title to the saved object.

* *Customize time range* &mdash; Exposes a time filter dedicated to the saved object.

* *Inspect* &mdash; Allows you to drill down into the element data.

[float]
[[canvas-add-image]]
==== Add your own image

To personalize your workpad, add your own logos and graphics.

. Click *Add element > Manage assets*.

. On the *Manage workpad assets* window, drag and drop your images.

. To add the image to the workpad, click the *Create image element* icon.
+
[role="screenshot"]
image::images/canvas-add-image.gif[]

[float]
[[move-canvas-elements]]
==== Organize elements

Move and resize your elements to meet your design needs.

* To move, click and hold the element, then drag to the new location.

* To move by 1 pixel, select the element, press and hold Shift, then use your arrow keys.

* To move by 10 pixels, select the element, then use your arrow keys.

* To resize, click and drag the resize handles to the new dimensions.

[float]
[[format-canvas-elements]]
==== Format elements

For consistency and readability across your workpad pages, align, distribute, and reorder elements.

To align two or more elements:

. Press and hold Shift, then select the elements you want to align.

. Click *Edit > Alignment*, then select the alignment option.

To distribute three or more elements:

. Press and hold Shift, then select the elements you want to distribute.

. Click *Edit > Distribution*, then select the distribution option.

To reorder elements:

. Select the element you want to reorder.

. Click *Edit > Order*, then select the order option.

[float]
[[data-display]]
==== Change the element display options

Each element has its own display options to fit your design needs.

To choose the display options, click *Display*, then make your changes.

To define the appearance of the container and border:

. Next to *Element style*, click *+*, then select *Container style*.

. Expand *Container style*.

. Change the *Appearance* and *Border* options.

To apply CSS overrides:

. Next to *Element style*, click *+*, then select *CSS*.

. Enter the *CSS*.
+
For example, to center the Markdown element, enter:
+
[source,text]
--------------------------------------------------
.canvasRenderEl h1 {
text.align: center;
}
--------------------------------------------------

. Click *Apply stylesheet*.

[float]
[[save-elements]]
==== Save elements

To use the elements across all workpads, save the elements.

When you're ready to save your element, select the element, then click *Edit > Save as new element*.

[role="screenshot"]
image::images/canvas_save_element.png[]

To save a group of elements, press and hold Shift, select the elements you want to save, then click *Edit > Save as new element*.

To access your saved elements, click *Add element > My elements*.

[float]
[[delete-elements]]
==== Delete elements

When you no longer need an element, delete it from your workpad.

. Select the element you want to delete.

. Click *Edit > Delete*.
+
[role="screenshot"]
image::images/canvas_element_options.png[]
101 changes: 91 additions & 10 deletions docs/developer/contributing/development-accessibility-tests.asciidoc
Original file line number Diff line number Diff line change
@@ -1,23 +1,104 @@
[[development-accessibility-tests]]
== Automated Accessibility Testing


To write an accessibility test, use the provided accessibility service `getService('a11y')`. Accessibility tests are fairly straightforward to write as https://github.com/dequelabs/axe-core[axe] does most of the heavy lifting. Navigate to the UI that you need to test, then call `testAppSnapshot();` from the service imported earlier to make sure axe finds no failures. Navigate through every portion of the UI for the best coverage.

An example test might look like this:
[source,js]
----
export default function ({ getService, getPageObjects }) {
const { common, home } = getPageObjects(['common', 'home']);
const a11y = getService('a11y'); /* this is the wrapping service around axe */
describe('Kibana Home', () => {
before(async () => {
await common.navigateToApp('home'); /* navigates to the page we want to test */
});
it('Kibana Home view', async () => {
await retry.waitFor(
'home page visible',
async () => await testSubjects.exists('homeApp')
); /* confirm you're on the correct page and that it's loaded */
await a11y.testAppSnapshot(); /* this expects that there are no failures found by axe */
});
/**
* If these tests were added by our QA team, tests that fail that require significant app code
* changes to be fixed will be skipped with a corresponding issue label with more info
*/
// Skipped due to https://github.com/elastic/kibana/issues/99999
it.skip('all plugins view page meets a11y requirements', async () => {
await home.clickAllKibanaPlugins();
await a11y.testAppSnapshot();
});
/**
* Testing all the versions and different views of of a page is important to get good
* coverage. Things like empty states, different license levels, different permissions, and
* loaded data can all significantly change the UI which necessitates their own test.
*/
it('Add Kibana sample data page', async () => {
await common.navigateToUrl('home', '/tutorial_directory/sampleData', {
useActualUrl: true,
});
await a11y.testAppSnapshot();
});
});
}
----

=== Running tests
To run the tests locally:

[arabic]
. In one terminal window run
`node scripts/functional_tests_server --config test/accessibility/config.ts`
. In another terminal window run
`node scripts/functional_test_runner.js --config test/accessibility/config.ts`
. In one terminal window run:
+
[source,shell]
-----------
node scripts/functional_tests_server --config test/accessibility/config.ts
-----------

. When the server prints that it is ready, in another terminal window run:
+
[source,shell]
-----------
node scripts/functional_test_runner.js --config test/accessibility/config.ts
-----------

To run the x-pack tests, swap the config file out for
`x-pack/test/accessibility/config.ts`.

After the server is up, you can go to this instance of {kib} at
`localhost:5620`.

The testing is done using https://github.com/dequelabs/axe-core[axe].
The same thing that runs in CI, can be run locally using their browser
plugins:
You can run the same thing that runs CI using browser plugins:

* https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US[Chrome]
* https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/[Firefox]
* https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/[Firefox]

=== Anatomy of a failure

Failures can seem confusing if you've never seen one before. Here is a breakdown of what a failure coming from CI might look like:
[source,bash]
----
1) Dashboard
create dashboard button:
Error: a11y report:
VIOLATION
[aria-hidden-focus]: Ensures aria-hidden elements do not contain focusable elements
Help: https://dequeuniversity.com/rules/axe/3.5/aria-hidden-focus?application=axeAPI
Elements:
- #example
at Accessibility.testAxeReport (test/accessibility/services/a11y/a11y.ts:90:15)
at Accessibility.testAppSnapshot (test/accessibility/services/a11y/a11y.ts:58:18)
at process._tickCallback (internal/process/next_tick.js:68:7)
----


* "Dashboard" and "create dashboard button" are the names of the test suite and specific test that failed.
* Always in brackets, "[aria-hidden-focus]" is the name of the axe rule that failed, followed by a short description.
* "Help: <url>" links to the axe documentation for that rule, including severity, remediation tips, and good and bad code examples.
* "Elements:" points to where in the DOM the failure originated (using CSS selector syntax). In this example, the problem came from an element with the ID `example`. If the selector is too complicated to find the source of the problem, use the browser plugins mentioned earlier to locate it. If you have a general idea where the issue is coming from, you can also try adding unique IDs to the page to narrow down the location.
* The stack trace points to the internals of axe. The stack trace is there in case the test failure is a bug in axe and not in your code, although this is unlikely.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 328c3e7

Please sign in to comment.