Skip to content

Commit 79b4cde

Browse files
Merge branch 'master' into alerting/webhook-basic-auth-optional
2 parents 6847827 + e3535b1 commit 79b4cde

File tree

431 files changed

+18510
-15438
lines changed

Some content is hidden

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

431 files changed

+18510
-15438
lines changed

.github/workflows/pr-project-assigner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
name: Assign a PR to project based on label
99
steps:
1010
- name: Assign to project
11-
uses: elastic/github-actions/[email protected].1
11+
uses: elastic/github-actions/[email protected].2
1212
id: project_assigner
1313
with:
1414
issue-mappings: |

.github/workflows/project-assigner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
name: Assign issue or PR to project based on label
99
steps:
1010
- name: Assign to project
11-
uses: elastic/github-actions/[email protected].1
11+
uses: elastic/github-actions/[email protected].2
1212
id: project_assigner
1313
with:
1414
issue-mappings: '[{"label": "Team:AppArch", "projectName": "kibana-app-arch", "columnId": 6173895}, {"label": "Feature:Lens", "projectName": "Lens", "columnId": 6219363}, {"label": "Team:Canvas", "projectName": "canvas", "columnId": 6187593}]'

.i18nrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
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",
3334
"navigation": "src/plugins/navigation",
3435
"newsfeed": "src/plugins/newsfeed",
3536
"regionMap": "src/legacy/core_plugins/region_map",
37+
"savedObjects": "src/plugins/saved_objects",
3638
"server": "src/legacy/server",
3739
"statusPage": "src/legacy/core_plugins/status_page",
3840
"telemetry": "src/legacy/core_plugins/telemetry",

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

52 KB
Loading

docs/management/advanced-options.asciidoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[advanced-options]]
2-
== Setting advanced options
2+
== Advanced Settings
33

4-
The *Advanced Settings* page enables you to directly edit settings that control the behavior of the Kibana application.
4+
The *Advanced Settings* UI enables you to edit settings that control the behavior of Kibana.
55
For example, you can change the format used to display dates, specify the default index pattern, and set the precision
66
for displayed decimal values.
77

@@ -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,
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
[role="xpack"]
22
[[index-lifecycle-policies]]
3-
== Index lifecycle policies
3+
== Index Lifecycle Policies
44

5-
If you're working with time series data, you don't want to continually dump
6-
everything into a single index. Instead, you might periodically roll over the
7-
data to a new index to keep it from growing so big it's slow and expensive.
8-
As the index ages and you query it less frequently, you’ll likely move it to
5+
If you're working with time series data, you don't want to continually dump
6+
everything into a single index. Instead, you might periodically roll over the
7+
data to a new index to keep it from growing so big it's slow and expensive.
8+
As the index ages and you query it less frequently, you’ll likely move it to
99
less expensive hardware and reduce the number of shards and replicas.
1010

11-
To automatically move an index through its lifecycle, you can create a policy
12-
to define actions to perform on the index as it ages. Index lifecycle policies
13-
are especially useful when working with {beats-ref}/beats-reference.html[Beats]
14-
data shippers, which continually
15-
send operational data, such as metrics and logs, to Elasticsearch. You can
16-
automate a rollover to a new index when the existing index reaches a specified
17-
size or age. This ensures that all indices have a similar size instead of having
18-
daily indices where size can vary based on the number of Beats and the number
11+
To automatically move an index through its lifecycle, you can create a policy
12+
to define actions to perform on the index as it ages. Index lifecycle policies
13+
are especially useful when working with {beats-ref}/beats-reference.html[Beats]
14+
data shippers, which continually
15+
send operational data, such as metrics and logs, to Elasticsearch. You can
16+
automate a rollover to a new index when the existing index reaches a specified
17+
size or age. This ensures that all indices have a similar size instead of having
18+
daily indices where size can vary based on the number of Beats and the number
1919
of events sent.
2020

21-
{kib}’s *Index Lifecycle Policies* walks you through the process for creating
22-
and configuring a policy. Before using this feature, you should be familiar
21+
{kib}’s *Index Lifecycle Policies* walks you through the process for creating
22+
and configuring a policy. Before using this feature, you should be familiar
2323
with index lifecycle management:
2424

25-
* For an introduction, see
26-
{ref}/getting-started-index-lifecycle-management.html[Getting started with index
27-
lifecycle management].
28-
* To dig into the concepts and technical details, see
25+
* For an introduction, refer to
26+
{ref}/getting-started-index-lifecycle-management.html[Getting started with index
27+
lifecycle management].
28+
* To dig into the concepts and technical details, see
2929
{ref}/index-lifecycle-management.html[Managing the index lifecycle].
3030
* To check out the APIs, see {ref}/index-lifecycle-management-api.html[Index lifecycle management API].

0 commit comments

Comments
 (0)