Skip to content

Commit b2c1ee3

Browse files
Merge branch 'master' of github.com:elastic/kibana into fix/form-lib-memoize
# Conflicts: # x-pack/plugins/security_solution/public/cases/components/add_comment/index.tsx # x-pack/plugins/security_solution/public/cases/components/create/index.tsx # x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_markdown.tsx
2 parents 839779b + 3c9fa99 commit b2c1ee3

File tree

423 files changed

+6286
-2301
lines changed

Some content is hidden

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

423 files changed

+6286
-2301
lines changed

.eslintrc.js

Lines changed: 228 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,31 @@ const ELASTIC_LICENSE_HEADER = `
4949
*/
5050
`;
5151

52+
const SAFER_LODASH_SET_HEADER = `
53+
/*
54+
* Elasticsearch B.V licenses this file to you under the MIT License.
55+
* See \`packages/elastic-safer-lodash-set/LICENSE\` for more information.
56+
*/
57+
`;
58+
59+
const SAFER_LODASH_SET_LODASH_HEADER = `
60+
/*
61+
* This file is forked from the lodash project (https://lodash.com/),
62+
* and may include modifications made by Elasticsearch B.V.
63+
* Elasticsearch B.V. licenses this file to you under the MIT License.
64+
* See \`packages/elastic-safer-lodash-set/LICENSE\` for more information.
65+
*/
66+
`;
67+
68+
const SAFER_LODASH_SET_DEFINITELYTYPED_HEADER = `
69+
/*
70+
* This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped),
71+
* and may include modifications made by Elasticsearch B.V.
72+
* Elasticsearch B.V. licenses this file to you under the MIT License.
73+
* See \`packages/elastic-safer-lodash-set/LICENSE\` for more information.
74+
*/
75+
`;
76+
5277
const allMochaRulesOff = {};
5378
Object.keys(require('eslint-plugin-mocha').rules).forEach((k) => {
5479
allMochaRulesOff['mocha/' + k] = 'off';
@@ -143,7 +168,12 @@ module.exports = {
143168
'@kbn/eslint/disallow-license-headers': [
144169
'error',
145170
{
146-
licenses: [ELASTIC_LICENSE_HEADER],
171+
licenses: [
172+
ELASTIC_LICENSE_HEADER,
173+
SAFER_LODASH_SET_HEADER,
174+
SAFER_LODASH_SET_LODASH_HEADER,
175+
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
176+
],
147177
},
148178
],
149179
},
@@ -174,7 +204,82 @@ module.exports = {
174204
'@kbn/eslint/disallow-license-headers': [
175205
'error',
176206
{
177-
licenses: [APACHE_2_0_LICENSE_HEADER],
207+
licenses: [
208+
APACHE_2_0_LICENSE_HEADER,
209+
SAFER_LODASH_SET_HEADER,
210+
SAFER_LODASH_SET_LODASH_HEADER,
211+
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
212+
],
213+
},
214+
],
215+
},
216+
},
217+
218+
/**
219+
* safer-lodash-set package requires special license headers
220+
*/
221+
{
222+
files: ['packages/elastic-safer-lodash-set/**/*.{js,mjs,ts,tsx}'],
223+
rules: {
224+
'@kbn/eslint/require-license-header': [
225+
'error',
226+
{
227+
license: SAFER_LODASH_SET_LODASH_HEADER,
228+
},
229+
],
230+
'@kbn/eslint/disallow-license-headers': [
231+
'error',
232+
{
233+
licenses: [
234+
ELASTIC_LICENSE_HEADER,
235+
APACHE_2_0_LICENSE_HEADER,
236+
SAFER_LODASH_SET_HEADER,
237+
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
238+
],
239+
},
240+
],
241+
},
242+
},
243+
{
244+
files: ['packages/elastic-safer-lodash-set/test/*.{js,mjs,ts,tsx}'],
245+
rules: {
246+
'@kbn/eslint/require-license-header': [
247+
'error',
248+
{
249+
license: SAFER_LODASH_SET_HEADER,
250+
},
251+
],
252+
'@kbn/eslint/disallow-license-headers': [
253+
'error',
254+
{
255+
licenses: [
256+
ELASTIC_LICENSE_HEADER,
257+
APACHE_2_0_LICENSE_HEADER,
258+
SAFER_LODASH_SET_LODASH_HEADER,
259+
SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
260+
],
261+
},
262+
],
263+
},
264+
},
265+
{
266+
files: ['packages/elastic-safer-lodash-set/**/*.d.ts'],
267+
rules: {
268+
'@kbn/eslint/require-license-header': [
269+
'error',
270+
{
271+
license: SAFER_LODASH_SET_DEFINITELYTYPED_HEADER,
272+
},
273+
],
274+
'@kbn/eslint/disallow-license-headers': [
275+
'error',
276+
{
277+
licenses: [
278+
ELASTIC_LICENSE_HEADER,
279+
APACHE_2_0_LICENSE_HEADER,
280+
SAFER_LODASH_SET_HEADER,
281+
SAFER_LODASH_SET_LODASH_HEADER,
282+
],
178283
},
179284
],
180285
},
@@ -541,9 +646,129 @@ module.exports = {
541646
* Harden specific rules
542647
*/
543648
{
544-
files: ['test/harden/*.js'],
649+
files: ['test/harden/*.js', 'packages/elastic-safer-lodash-set/test/*.js'],
545650
rules: allMochaRulesOff,
546651
},
652+
{
653+
files: ['**/*.{js,mjs,ts,tsx}'],
654+
rules: {
655+
'no-restricted-imports': [
656+
2,
657+
{
658+
paths: [
659+
{
660+
name: 'lodash',
661+
importNames: ['set', 'setWith'],
662+
message: 'Please use @elastic/safer-lodash-set instead',
663+
},
664+
{
665+
name: 'lodash.set',
666+
message: 'Please use @elastic/safer-lodash-set instead',
667+
},
668+
{
669+
name: 'lodash.setwith',
670+
message: 'Please use @elastic/safer-lodash-set instead',
671+
},
672+
{
673+
name: 'lodash/set',
674+
message: 'Please use @elastic/safer-lodash-set instead',
675+
},
676+
{
677+
name: 'lodash/setWith',
678+
message: 'Please use @elastic/safer-lodash-set instead',
679+
},
680+
{
681+
name: 'lodash/fp',
682+
importNames: ['set', 'setWith', 'assoc', 'assocPath'],
683+
message: 'Please use @elastic/safer-lodash-set instead',
684+
},
685+
{
686+
name: 'lodash/fp/set',
687+
message: 'Please use @elastic/safer-lodash-set instead',
688+
},
689+
{
690+
name: 'lodash/fp/setWith',
691+
message: 'Please use @elastic/safer-lodash-set instead',
692+
},
693+
{
694+
name: 'lodash/fp/assoc',
695+
message: 'Please use @elastic/safer-lodash-set instead',
696+
},
697+
{
698+
name: 'lodash/fp/assocPath',
699+
message: 'Please use @elastic/safer-lodash-set instead',
700+
},
701+
],
702+
},
703+
],
704+
'no-restricted-modules': [
705+
2,
706+
{
707+
paths: [
708+
{
709+
name: 'lodash.set',
710+
message: 'Please use @elastic/safer-lodash-set instead',
711+
},
712+
{
713+
name: 'lodash.setwith',
714+
message: 'Please use @elastic/safer-lodash-set instead',
715+
},
716+
{
717+
name: 'lodash/set',
718+
message: 'Please use @elastic/safer-lodash-set instead',
719+
},
720+
{
721+
name: 'lodash/setWith',
722+
message: 'Please use @elastic/safer-lodash-set instead',
723+
},
724+
],
725+
},
726+
],
727+
'no-restricted-properties': [
728+
2,
729+
{
730+
object: 'lodash',
731+
property: 'set',
732+
message: 'Please use @elastic/safer-lodash-set instead',
733+
},
734+
{
735+
object: '_',
736+
property: 'set',
737+
message: 'Please use @elastic/safer-lodash-set instead',
738+
},
739+
{
740+
object: 'lodash',
741+
property: 'setWith',
742+
message: 'Please use @elastic/safer-lodash-set instead',
743+
},
744+
{
745+
object: '_',
746+
property: 'setWith',
747+
message: 'Please use @elastic/safer-lodash-set instead',
748+
},
749+
{
750+
object: 'lodash',
751+
property: 'assoc',
752+
message: 'Please use @elastic/safer-lodash-set instead',
753+
},
754+
{
755+
object: '_',
756+
property: 'assoc',
757+
message: 'Please use @elastic/safer-lodash-set instead',
758+
},
759+
{
760+
object: 'lodash',
761+
property: 'assocPath',
762+
message: 'Please use @elastic/safer-lodash-set instead',
763+
},
764+
{
765+
object: '_',
766+
property: 'assocPath',
767+
message: 'Please use @elastic/safer-lodash-set instead',
768+
},
769+
],
770+
},
771+
},
547772

548773
/**
549774
* APM overrides

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.plugin.setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
<b>Signature:</b>
88

99
```typescript
10-
setup(core: CoreSetup, { expressions, uiActions }: DataSetupDependencies): DataPublicPluginSetup;
10+
setup(core: CoreSetup, { expressions, uiActions, usageCollection }: DataSetupDependencies): DataPublicPluginSetup;
1111
```
1212

1313
## Parameters
1414

1515
| Parameter | Type | Description |
1616
| --- | --- | --- |
1717
| core | <code>CoreSetup</code> | |
18-
| { expressions, uiActions } | <code>DataSetupDependencies</code> | |
18+
| { expressions, uiActions, usageCollection } | <code>DataSetupDependencies</code> | |
1919

2020
<b>Returns:</b>
2121

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchinterceptordeps.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ export interface SearchInterceptorDeps
1818
| [http](./kibana-plugin-plugins-data-public.searchinterceptordeps.http.md) | <code>CoreStart['http']</code> | |
1919
| [toasts](./kibana-plugin-plugins-data-public.searchinterceptordeps.toasts.md) | <code>ToastsStart</code> | |
2020
| [uiSettings](./kibana-plugin-plugins-data-public.searchinterceptordeps.uisettings.md) | <code>CoreStart['uiSettings']</code> | |
21+
| [usageCollector](./kibana-plugin-plugins-data-public.searchinterceptordeps.usagecollector.md) | <code>SearchUsageCollector</code> | |
2122

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchInterceptorDeps](./kibana-plugin-plugins-data-public.searchinterceptordeps.md) &gt; [usageCollector](./kibana-plugin-plugins-data-public.searchinterceptordeps.usagecollector.md)
4+
5+
## SearchInterceptorDeps.usageCollector property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
usageCollector?: SearchUsageCollector;
11+
```

docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchsetup.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ export interface ISearchSetup
1414

1515
| Property | Type | Description |
1616
| --- | --- | --- |
17-
| [registerSearchStrategy](./kibana-plugin-plugins-data-server.isearchsetup.registersearchstrategy.md) | <code>(name: string, strategy: ISearchStrategy) =&gt; void</code> | Extension point exposed for other plugins to register their own search strategies. |
17+
| [registerSearchStrategy](./kibana-plugin-plugins-data-server.isearchsetup.registersearchstrategy.md) | <code>TRegisterSearchStrategy</code> | Extension point exposed for other plugins to register their own search strategies. |
18+
| [usage](./kibana-plugin-plugins-data-server.isearchsetup.usage.md) | <code>SearchUsage</code> | Used internally for telemetry |
1819

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [ISearchSetup](./kibana-plugin-plugins-data-server.isearchsetup.md) &gt; [usage](./kibana-plugin-plugins-data-server.isearchsetup.usage.md)
4+
5+
## ISearchSetup.usage property
6+
7+
Used internally for telemetry
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
usage: SearchUsage;
13+
```

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
"@elastic/good": "8.1.1-kibana2",
133133
"@elastic/numeral": "^2.5.0",
134134
"@elastic/request-crypto": "1.1.4",
135+
"@elastic/safer-lodash-set": "0.0.0",
135136
"@elastic/ui-ace": "0.2.3",
136137
"@hapi/good-squeeze": "5.2.1",
137138
"@hapi/wreck": "^15.0.2",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.tmp
2+
node_modules
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tsconfig.json
2+
scripts
3+
test
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Elasticsearch BV
4+
Copyright (c) Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>
5+
Copyright (c) JS Foundation and other contributors <https://js.foundation/>
6+
7+
Lodash is based on Underscore.js, copyright Jeremy Ashkenas,
8+
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
9+
10+
This software consists of voluntary contributions made by many
11+
individuals. For exact contribution history, see the revision history
12+
available at the following locations:
13+
- https://github.com/lodash/lodash
14+
- https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash
15+
- https://github.com/elastic/kibana/tree/master/packages/elastic-safer-lodash-set
16+
17+
Permission is hereby granted, free of charge, to any person obtaining
18+
a copy of this software and associated documentation files (the
19+
"Software"), to deal in the Software without restriction, including
20+
without limitation the rights to use, copy, modify, merge, publish,
21+
distribute, sublicense, and/or sell copies of the Software, and to
22+
permit persons to whom the Software is furnished to do so, subject to
23+
the following conditions:
24+
25+
The above copyright notice and this permission notice shall be
26+
included in all copies or substantial portions of the Software.
27+
28+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)