Skip to content

Commit 9a5061a

Browse files
Merge branch 'master' into uptime_remove-redundant-adapter-function
2 parents ba8cd06 + e3535b1 commit 9a5061a

File tree

304 files changed

+17798
-14807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+17798
-14807
lines changed

.i18nrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"src/plugins/management"
2828
],
2929
"advancedSettings": "src/plugins/advanced_settings",
30+
"kibana_legacy": "src/plugins/kibana_legacy",
3031
"kibana_react": "src/legacy/core_plugins/kibana_react",
3132
"kibana-react": "src/plugins/kibana_react",
3233
"kibana_utils": "src/plugins/kibana_utils",

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ A high level overview of our contributing guidelines.
2727
- [Instrumenting with Elastic APM](#instrumenting-with-elastic-apm)
2828
- [Debugging Unit Tests](#debugging-unit-tests)
2929
- [Unit Testing Plugins](#unit-testing-plugins)
30+
- [Automated Accessibility Testing](#automated-accessibility-testing)
3031
- [Cross-browser compatibility](#cross-browser-compatibility)
3132
- [Testing compatibility locally](#testing-compatibility-locally)
3233
- [Running Browser Automation Tests](#running-browser-automation-tests)
@@ -553,6 +554,23 @@ yarn test:mocha
553554
yarn test:browser --dev # remove the --dev flag to run them once and close
554555
```
555556

557+
### Automated Accessibility Testing
558+
559+
To run the tests locally:
560+
561+
1. In one terminal window run `node scripts/functional_tests_server --config test/accessibility/config.ts`
562+
2. In another terminal window run `node scripts/functional_test_runner.js --config test/accessibility/config.ts`
563+
564+
To run the x-pack tests, swap the config file out for `x-pack/test/accessibility/config.ts`.
565+
566+
After the server is up, you can go to this instance of Kibana at `localhost:5620`.
567+
568+
The testing is done using [axe](https://github.com/dequelabs/axe-core). The same thing that runs in CI,
569+
can be run locally using their browser plugins:
570+
571+
- [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)
572+
- [Firefox](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/)
573+
556574
### Cross-browser Compatibility
557575

558576
#### Testing Compatibility Locally

STYLEGUIDE.md

Lines changed: 83 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ recommended for the development of all Kibana plugins.
66
Besides the content in this style guide, the following style guides may also apply
77
to all development within the Kibana project. Please make sure to also read them:
88

9-
- [Accessibility style guide](style_guides/accessibility_guide.md)
9+
- [Accessibility style guide](https://elastic.github.io/eui/#/guidelines/accessibility)
1010
- [SASS style guide](https://elastic.github.io/eui/#/guidelines/sass)
1111

1212
## General
@@ -45,10 +45,7 @@ This part contains style guide rules around general (framework agnostic) HTML us
4545
Use camel case for the values of attributes such as `id` and `data-test-subj` selectors.
4646

4747
```html
48-
<button
49-
id="veryImportantButton"
50-
data-test-subj="clickMeButton"
51-
>
48+
<button id="veryImportantButton" data-test-subj="clickMeButton">
5249
Click me
5350
</button>
5451
```
@@ -74,6 +71,59 @@ It's important that when you write CSS/SASS selectors using classes, IDs, and at
7471
capitalization in the CSS matches that used in the HTML. HTML and CSS follow different case sensitivity rules, and we can avoid subtle gotchas by ensuring we use the
7572
same capitalization in both of them.
7673
74+
### How to generate ids?
75+
76+
When labeling elements (and for some other accessibility tasks) you will often need
77+
ids. Ids must be unique within the page i.e. no duplicate ids in the rendered DOM
78+
at any time.
79+
80+
Since we have some components that are used multiple times on the page, you must
81+
make sure every instance of that component has a unique `id`. To make the generation
82+
of those `id`s easier, you can use the `htmlIdGenerator` service in the `@elastic/eui`.
83+
84+
A React component could use it as follows:
85+
86+
```jsx
87+
import { htmlIdGenerator } from '@elastic/eui';
88+
89+
render() {
90+
// Create a new generator that will create ids deterministic
91+
const htmlId = htmlIdGenerator();
92+
return (<div>
93+
<label htmlFor={htmlId('agg')}>Aggregation</label>
94+
<input id={htmlId('agg')}/>
95+
</div>);
96+
}
97+
```
98+
99+
Each id generator you create by calling `htmlIdGenerator()` will generate unique but
100+
deterministic ids. As you can see in the above example, that single generator
101+
created the same id in the label's `htmlFor` as well as the input's `id`.
102+
103+
A single generator instance will create the same id when passed the same argument
104+
to the function multiple times. But two different generators will produce two different
105+
ids for the same argument to the function, as you can see in the following example:
106+
107+
```js
108+
const generatorOne = htmlIdGenerator();
109+
const generatorTwo = htmlIdGenerator();
110+
111+
// Those statements are always true:
112+
// Same generator
113+
generatorOne('foo') === generatorOne('foo');
114+
generatorOne('foo') !== generatorOne('bar');
115+
116+
// Different generator
117+
generatorOne('foo') !== generatorTwo('foo');
118+
```
119+
120+
This allows multiple instances of a single React component to now have different ids.
121+
If you include the above React component multiple times in the same page,
122+
each component instance will have a unique id, because each render method will use a different
123+
id generator.
124+
125+
You can also use this service outside of React.
126+
77127
## API endpoints
78128
79129
The following style guide rules are targeting development of server side API endpoints.
@@ -90,7 +140,8 @@ API routes must start with the `/api/` path segment, and should be followed by t
90140
91141
Kibana uses `snake_case` for the entire API, just like Elasticsearch. All urls, paths, query string parameters, values, and bodies should be `snake_case` formatted.
92142
93-
*Right:*
143+
_Right:_
144+
94145
```
95146
POST /api/kibana/index_patterns
96147
{
@@ -108,19 +159,19 @@ The following style guide rules apply for working with TypeScript/JavaScript fil
108159
109160
### TypeScript vs. JavaScript
110161
111-
Whenever possible, write code in TypeScript instead of JavaScript, especially if it's new code.
162+
Whenever possible, write code in TypeScript instead of JavaScript, especially if it's new code.
112163
Check out [TYPESCRIPT.md](TYPESCRIPT.md) for help with this process.
113164
114165
### Prefer modern JavaScript/TypeScript syntax
115166
116167
You should prefer modern language features in a lot of cases, e.g.:
117168
118-
* Prefer `class` over `prototype` inheritance
119-
* Prefer arrow function over function expressions
120-
* Prefer arrow function over storing `this` (no `const self = this;`)
121-
* Prefer template strings over string concatenation
122-
* Prefer the spread operator for copying arrays (`[...arr]`) over `arr.slice()`
123-
* Use optional chaining (`?.`) and nullish Coalescing (`??`) over `lodash.get` (and similar utilities)
169+
- Prefer `class` over `prototype` inheritance
170+
- Prefer arrow function over function expressions
171+
- Prefer arrow function over storing `this` (no `const self = this;`)
172+
- Prefer template strings over string concatenation
173+
- Prefer the spread operator for copying arrays (`[...arr]`) over `arr.slice()`
174+
- Use optional chaining (`?.`) and nullish Coalescing (`??`) over `lodash.get` (and similar utilities)
124175
125176
### Avoid mutability and state
126177
@@ -131,7 +182,7 @@ Instead, create new variables, and shallow copies of objects and arrays:
131182
```js
132183
// good
133184
function addBar(foos, foo) {
134-
const newFoo = {...foo, name: 'bar'};
185+
const newFoo = { ...foo, name: 'bar' };
135186
return [...foos, newFoo];
136187
}
137188

@@ -250,8 +301,8 @@ const second = arr[1];
250301
251302
### Magic numbers/strings
252303
253-
These are numbers (or other values) simply used in line in your code. *Do not
254-
use these*, give them a variable name so they can be understood and changed
304+
These are numbers (or other values) simply used in line in your code. _Do not
305+
use these_, give them a variable name so they can be understood and changed
255306
easily.
256307
257308
```js
@@ -325,19 +376,18 @@ import inSibling from '../foo/child';
325376
Don't do this. Everything should be wrapped in a module that can be depended on
326377
by other modules. Even things as simple as a single value should be a module.
327378
328-
329379
### Only use ternary operators for small, simple code
330380
331-
And *never* use multiple ternaries together, because they make it more
381+
And _never_ use multiple ternaries together, because they make it more
332382
difficult to reason about how different values flow through the conditions
333383
involved. Instead, structure the logic for maximum readability.
334384
335385
```js
336386
// good, a situation where only 1 ternary is needed
337-
const foo = (a === b) ? 1 : 2;
387+
const foo = a === b ? 1 : 2;
338388

339389
// bad
340-
const foo = (a === b) ? 1 : (a === c) ? 2 : 3;
390+
const foo = a === b ? 1 : a === c ? 2 : 3;
341391
```
342392
343393
### Use descriptive conditions
@@ -475,13 +525,12 @@ setTimeout(() => {
475525
476526
Use slashes for both single line and multi line comments. Try to write
477527
comments that explain higher level mechanisms or clarify difficult
478-
segments of your code. *Don't use comments to restate trivial things*.
528+
segments of your code. _Don't use comments to restate trivial things_.
479529
480-
*Exception:* Comment blocks describing a function and its arguments
530+
_Exception:_ Comment blocks describing a function and its arguments
481531
(docblock) should start with `/**`, contain a single `*` at the beginning of
482532
each line, and end with `*/`.
483533
484-
485534
```js
486535
// good
487536

@@ -546,11 +595,17 @@ You can read more about these two ngReact methods [here](https://github.com/ngRe
546595
Using `react-component` means adding a bunch of components into angular, while `reactDirective` keeps them isolated, and is also a more succinct syntax.
547596
548597
**Good:**
598+
549599
```html
550-
<hello-component fname="person.fname" lname="person.lname" watch-depth="reference"></hello-component>
600+
<hello-component
601+
fname="person.fname"
602+
lname="person.lname"
603+
watch-depth="reference"
604+
></hello-component>
551605
```
552606
553607
**Bad:**
608+
554609
```html
555610
<react-component name="HelloComponent" props="person" watch-depth="reference" />
556611
```
@@ -564,9 +619,9 @@ Name action functions in the form of a strong verb and passed properties in the
564619
<pagerButton onPageNext={action.turnToNextPage} />
565620
```
566621
567-
## Attribution
622+
## Attribution
568623
569-
Parts of the JavaScript style guide were initially forked from the
570-
[node style guide](https://github.com/felixge/node-style-guide) created by [Felix Geisendörfer](http://felixge.de/) which is
571-
licensed under the [CC BY-SA 3.0](http://creativecommons.org/licenses/by-sa/3.0/)
624+
Parts of the JavaScript style guide were initially forked from the
625+
[node style guide](https://github.com/felixge/node-style-guide) created by [Felix Geisendörfer](http://felixge.de/) which is
626+
licensed under the [CC BY-SA 3.0](http://creativecommons.org/licenses/by-sa/3.0/)
572627
license.

docs/api/spaces-management/get_all.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ The API returns the following:
4242
"color": "#aabbcc",
4343
"disabledFeatures": ["apm"],
4444
"initials": "MK",
45-
"imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU",
45+
"imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU"
4646
},
4747
{
4848
"id": "sales",
4949
"name": "Sales",
5050
"initials": "MK",
5151
"disabledFeatures": ["discover", "timelion"],
5252
"imageUrl": ""
53-
},
53+
}
5454
]
5555
--------------------------------------------------

docs/development/core/public/kibana-plugin-public.simplesavedobject._constructor_.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Constructs a new instance of the `SimpleSavedObject` class
99
<b>Signature:</b>
1010

1111
```typescript
12-
constructor(client: SavedObjectsClient, { id, type, version, attributes, error, references, migrationVersion }: SavedObjectType<T>);
12+
constructor(client: SavedObjectsClientContract, { id, type, version, attributes, error, references, migrationVersion }: SavedObjectType<T>);
1313
```
1414

1515
## Parameters
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| client | <code>SavedObjectsClient</code> | |
19+
| client | <code>SavedObjectsClientContract</code> | |
2020
| { id, type, version, attributes, error, references, migrationVersion } | <code>SavedObjectType&lt;T&gt;</code> | |
2121

docs/management/advanced-options.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ into the document when displaying it.
6969
`metrics:max_buckets`:: The maximum numbers of buckets that a single
7070
data source can return. This might arise when the user selects a
7171
short interval (for example, 1s) for a long time period (1 year).
72+
`pageNavigation`:: The style of navigation menu for Kibana.
73+
Choices are Individual, the legacy style where every plugin is represented in the nav,
74+
and Grouped, a new format that bundles related plugins together in nested navigation.
7275
`query:allowLeadingWildcards`:: Allows a wildcard (*) as the first character
7376
in a query clause. Only applies when experimental query features are
7477
enabled in the query bar. To disallow leading wildcards in Lucene queries,

docs/maps/connect-to-ems.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ If you are using Kibana's out-of-the-box settings, **Elastic Maps** is already c
88

99
EMS requests are made to the following domains:
1010

11-
* catalogue.maps.elastic.co
1211
* tiles.maps.elastic.co
1312
* vector.maps.elastic.co
1413

docs/setup/install/targz.asciidoc

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[[targz]]
2-
=== Install Kibana with `.tar.gz`
2+
=== Install {kib} from archive on Linux or MacOS
33

44
Kibana is provided for Linux and Darwin as a `.tar.gz` package. These packages
55
are the easiest formats to use when trying out Kibana.
66

7-
These packages are free to use under the Elastic license. They contain open
8-
source and free commercial features and access to paid commercial features.
9-
{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the
10-
paid commercial features. See the
11-
https://www.elastic.co/subscriptions[Subscriptions] page for information about
7+
These packages are free to use under the Elastic license. They contain open
8+
source and free commercial features and access to paid commercial features.
9+
{stack-ov}/license-management.html[Start a 30-day trial] to try out all of the
10+
paid commercial features. See the
11+
https://www.elastic.co/subscriptions[Subscriptions] page for information about
1212
Elastic license levels.
1313

1414
The latest stable version of Kibana can be found on the
@@ -47,6 +47,27 @@ endif::[]
4747
[[install-darwin64]]
4848
==== Download and install the Darwin package
4949

50+
[IMPORTANT]
51+
.macOS Gatekeeper warnings
52+
====
53+
Apple's rollout of stricter notarization requirements affected the notarization
54+
of the {version} {kib} artifacts. If macOS Catalina displays a dialog when you
55+
first run {kib} that interrupts it, you will need to take an action to allow it
56+
to run.
57+
58+
To prevent Gatekeeper checks on the {kib} files, run the following command on the
59+
downloaded `.tar.gz` archive or the directory to which was extracted:
60+
[source,sh]
61+
----
62+
xattr -d -r com.apple.quarantine <archive-or-directory>
63+
----
64+
65+
Alternatively, you can add a security override if a Gatekeeper popup appears by
66+
following the instructions in the _How to open an app that hasn’t been notarized
67+
or is from an unidentified developer_ section of
68+
https://support.apple.com/en-us/HT202491[Safely open apps on your Mac].
69+
====
70+
5071
ifeval::["{release-state}"=="unreleased"]
5172

5273
Version {version} of Kibana has not yet been released.
@@ -68,9 +89,9 @@ cd kibana-{version}-darwin-x86_64/ <2>
6889
`kibana-{version}-darwin-x86_64.tar.gz: OK`.
6990
<2> This directory is known as `$KIBANA_HOME`.
7091

71-
Alternatively, you can download the following package, which contains only
92+
Alternatively, you can download the following package, which contains only
7293
features that are available under the Apache 2.0 license:
73-
https://artifacts.elastic.co/downloads/kibana/kibana-oss-{version}-darwin-x86_64.tar.gz
94+
https://artifacts.elastic.co/downloads/kibana/kibana-oss-{version}-darwin-x86_64.tar.gz
7495

7596
endif::[]
7697

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"@elastic/eui": "18.3.0",
124124
"@elastic/filesaver": "1.1.2",
125125
"@elastic/good": "8.1.1-kibana2",
126-
"@elastic/numeral": "2.3.3",
126+
"@elastic/numeral": "2.3.5",
127127
"@elastic/request-crypto": "^1.0.2",
128128
"@elastic/ui-ace": "0.2.3",
129129
"@hapi/wreck": "^15.0.1",

0 commit comments

Comments
 (0)