Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/sr-76279
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Sep 4, 2020
2 parents d318c56 + ee3c8d0 commit 13508f2
Show file tree
Hide file tree
Showing 1,299 changed files with 25,013 additions and 15,043 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ module.exports = {
'!src/core/server/mocks{,.ts}',
'!src/core/server/types{,.ts}',
'!src/core/server/test_utils{,.ts}',
'!src/core/server/utils', // ts alias
'!src/core/server/utils/**/*',
// for absolute imports until fixed in
// https://github.com/elastic/kibana/issues/36096
'!src/core/server/*.test.mocks{,.ts}',
Expand Down
22 changes: 20 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
/src/plugins/apm_oss/ @elastic/apm-ui
/src/apm.js @watson @vigneshshanmugam

# Client Side Monitoring (lives in APM directories but owned by Uptime)
/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum @elastic/uptime
/x-pack/plugins/apm/public/application/csmApp.tsx @elastic/uptime
/x-pack/plugins/apm/public/components/app/RumDashboard @elastic/uptime
/x-pack/plugins/apm/server/lib/rum_client @elastic/uptime
/x-pack/plugins/apm/server/routes/rum_client.ts @elastic/uptime

# Beats
/x-pack/legacy/plugins/beats_management/ @elastic/beats

Expand Down Expand Up @@ -209,8 +216,19 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/ @elastic/kibana-alerting-services

# Enterprise Search
/x-pack/plugins/enterprise_search/ @elastic/app-search-frontend @elastic/workplace-search-frontend
/x-pack/test/functional_enterprise_search/ @elastic/app-search-frontend @elastic/workplace-search-frontend
# Shared
/x-pack/plugins/enterprise_search/ @elastic/enterprise-search-frontend
/x-pack/test/functional_enterprise_search/ @elastic/enterprise-search-frontend
# App Search
/x-pack/plugins/enterprise_search/public/applications/app_search @elastic/app-search-frontend
/x-pack/plugins/enterprise_search/server/routes/app_search @elastic/app-search-frontend
/x-pack/plugins/enterprise_search/server/collectors/app_search @elastic/app-search-frontend
/x-pack/plugins/enterprise_search/server/saved_objects/app_search @elastic/app-search-frontend
# Workplace Search
/x-pack/plugins/enterprise_search/public/applications/workplace_search @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/routes/workplace_search @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/collectors/workplace_search @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/saved_objects/workplace_search @elastic/workplace-search-frontend

# Elasticsearch UI
/src/plugins/dev_tools/ @elastic/es-ui
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ apm.tsconfig.json
# release notes script output
report.csv
report.asciidoc

# TS incremental build cache
*.tsbuildinfo
7 changes: 7 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---
This product includes code in the function applyCubicBezierStyles that was
inspired by a public Codepen, which was available under a "MIT" license.

Copyright (c) 2020 by Guillaume (https://codepen.io/guillaumethomas/pen/xxbbBKO)
MIT License http://www.opensource.org/licenses/mit-license

---
This product includes code that is adapted from mapbox-gl-js, which is
available under a "BSD-3-Clause" license.
Expand Down
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.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [AppBase](./kibana-plugin-core-public.appbase.md) &gt; [capabilities](./kibana-plugin-core-public.appbase.capabilities.md)
[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [App](./kibana-plugin-core-public.app.md) &gt; [capabilities](./kibana-plugin-core-public.app.capabilities.md)

## AppBase.capabilities property
## App.capabilities property

Custom capabilities defined by the app.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [AppBase](./kibana-plugin-core-public.appbase.md) &gt; [category](./kibana-plugin-core-public.appbase.category.md)
[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [App](./kibana-plugin-core-public.app.md) &gt; [category](./kibana-plugin-core-public.app.category.md)

## AppBase.category property
## App.category property

The category definition of the product See [AppCategory](./kibana-plugin-core-public.appcategory.md) See DEFAULT\_APP\_CATEGORIES for more reference

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [AppBase](./kibana-plugin-core-public.appbase.md) &gt; [defaultPath](./kibana-plugin-core-public.appbase.defaultpath.md)
[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [App](./kibana-plugin-core-public.app.md) &gt; [defaultPath](./kibana-plugin-core-public.app.defaultpath.md)

## AppBase.defaultPath property
## App.defaultPath property

Allow to define the default path a user should be directed to when navigating to the app. When defined, this value will be used as a default for the `path` option when calling [navigateToApp](./kibana-plugin-core-public.applicationstart.navigatetoapp.md)<!-- -->\`<!-- -->, and will also be appended to the [application navLink](./kibana-plugin-core-public.chromenavlink.md) in the navigation bar.

Expand Down
Loading

0 comments on commit 13508f2

Please sign in to comment.