Skip to content

Commit e427f8e

Browse files
Merge branch 'master' into share-ace-console
2 parents 9cca97e + 34ae99b commit e427f8e

412 files changed

Lines changed: 10370 additions & 7473 deletions

File tree

Some content is hidden

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

docs/developer/plugin/development-plugin-resources.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,8 @@ To enable TypeScript support, create a `tsconfig.json` file at the root of your
6666
TypeScript code is automatically converted into JavaScript during development,
6767
but not in the distributable version of Kibana. If you use the
6868
{repo}blob/{branch}/packages/kbn-plugin-helpers[@kbn/plugin-helpers] to build your plugin, then your `.ts` and `.tsx` files will be permanently transpiled before your plugin is archived. If you have your own build process, make sure to run the TypeScript compiler on your source files and ship the compilation output so that your plugin will work with the distributable version of Kibana.
69+
70+
==== {kib} platform migration guide
71+
72+
{repo}blob/{branch}/src/core/MIGRATION.md#migrating-legacy-plugins-to-the-new-platform[This guide]
73+
provides an action plan for moving a legacy plugin to the new platform.

docs/management/advanced-options.asciidoc

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ for displayed decimal values.
88
. Go to *Management > {kib} > Advanced Settings*.
99
. Scroll or search for the setting you want to modify.
1010
. Enter a new value for the setting.
11+
. Click *Save changes*.
1112

1213

1314
[float]
@@ -34,7 +35,7 @@ removes it from {kib} permanently.
3435

3536
[float]
3637
[[kibana-general-settings]]
37-
=== General settings
38+
==== General
3839

3940
[horizontal]
4041
`csv:quoteValues`:: Set this property to `true` to quote exported values.
@@ -109,22 +110,22 @@ cluster alert notifications from Monitoring.
109110

110111
[float]
111112
[[kibana-accessibility-settings]]
112-
=== Accessibility settings
113+
==== Accessibility
113114

114115
[horizontal]
115116
`accessibility:disableAnimations`:: Turns off all unnecessary animations in the
116117
{kib} UI. Refresh the page to apply the changes.
117118

118119
[float]
119120
[[kibana-dashboard-settings]]
120-
=== Dashboard settings
121+
==== Dashboard
121122

122123
[horizontal]
123124
`xpackDashboardMode:roles`:: The roles that belong to <<xpack-dashboard-only-mode, dashboard only mode>>.
124125

125126
[float]
126127
[[kibana-discover-settings]]
127-
=== Discover settings
128+
==== Discover
128129

129130
[horizontal]
130131
`context:defaultSize`:: The number of surrounding entries to display in the context view. The default value is 5.
@@ -150,7 +151,7 @@ working on big documents.
150151

151152
[float]
152153
[[kibana-notification-settings]]
153-
=== Notifications settings
154+
==== Notifications
154155

155156
[horizontal]
156157
`notifications:banner`:: A custom banner intended for temporary notices to all users.
@@ -169,15 +170,15 @@ displays. The default value is 10000. Set this field to `Infinity` to disable wa
169170

170171
[float]
171172
[[kibana-reporting-settings]]
172-
=== Reporting settings
173+
==== Reporting
173174

174175
[horizontal]
175176
`xpackReporting:customPdfLogo`:: A custom image to use in the footer of the PDF.
176177

177178

178179
[float]
179180
[[kibana-rollups-settings]]
180-
=== Rollup settings
181+
==== Rollup
181182

182183
[horizontal]
183184
`rollups:enableIndexPatterns`:: Enables the creation of index patterns that
@@ -187,7 +188,7 @@ Refresh the page to apply the changes.
187188

188189
[float]
189190
[[kibana-search-settings]]
190-
=== Search settings
191+
==== Search
191192

192193
[horizontal]
193194
`courier:batchSearches`:: **Deprecated in 7.6. Starting in 8.0, this setting will be optimized internally.**
@@ -215,21 +216,21 @@ might increase the search time. This setting is off by default. Users must opt-i
215216

216217
[float]
217218
[[kibana-siem-settings]]
218-
=== SIEM settings
219+
==== SIEM
219220

220221
[horizontal]
221222
`siem:defaultAnomalyScore`:: The threshold above which Machine Learning job anomalies are displayed in the SIEM app.
222223
`siem:defaultIndex`:: A comma-delimited list of Elasticsearch indices from which the SIEM app collects events.
223-
`siem:enableNewsFeed`:: Enables the security news feed on the SIEM *Overview*
224+
`siem:enableNewsFeed`:: Enables the security news feed on the SIEM *Overview*
224225
page.
225-
`siem:newsFeedUrl`:: The URL from which the security news feed content is
226+
`siem:newsFeedUrl`:: The URL from which the security news feed content is
226227
retrieved.
227228
`siem:refreshIntervalDefaults`:: The default refresh interval for the SIEM time filter, in milliseconds.
228229
`siem:timeDefaults`:: The default period of time in the SIEM time filter.
229230

230231
[float]
231232
[[kibana-timelion-settings]]
232-
=== Timelion settings
233+
==== Timelion
233234

234235
[horizontal]
235236
`timelion:default_columns`:: The default number of columns to use on a Timelion sheet.
@@ -252,7 +253,7 @@ this is the number of buckets to try to represent.
252253

253254
[float]
254255
[[kibana-visualization-settings]]
255-
=== Visualization settings
256+
==== Visualization
256257

257258
[horizontal]
258259
`visualization:colorMapping`:: Maps values to specified colors in visualizations.
@@ -273,7 +274,7 @@ If disabled, only visualizations that are considered production-ready are availa
273274

274275
[float]
275276
[[kibana-telemetry-settings]]
276-
=== Usage data settings
277+
==== Usage data
277278

278279
Helps improve the Elastic Stack by providing usage statistics for
279280
basic features. This data will not be shared outside of Elastic.

docs/setup/settings.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ us improve your user experience. Your data is never shared with anyone. Set to
447447
`false` to disable telemetry capabilities entirely. You can alternatively opt
448448
out through the *Advanced Settings* in {kib}.
449449

450-
`vega.enableExternalUrls:`:: *Default: false* Set this value to true to allow Vega to use any URL to access external data sources and images. If false, Vega can only get data from Elasticsearch.
450+
`vis_type_vega.enableExternalUrls:`:: *Default: false* Set this value to true to allow Vega to use any URL to access external data sources and images. If false, Vega can only get data from Elasticsearch.
451451

452452
`xpack.license_management.enabled`:: *Default: true* Set this value to false to
453453
disable the License Management user interface.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"@elastic/charts": "^17.0.2",
121121
"@elastic/datemath": "5.0.2",
122122
"@elastic/ems-client": "7.6.0",
123-
"@elastic/eui": "18.3.0",
123+
"@elastic/eui": "19.0.0",
124124
"@elastic/filesaver": "1.1.2",
125125
"@elastic/good": "8.1.1-kibana2",
126126
"@elastic/numeral": "2.3.5",

packages/kbn-config-schema/src/types/duration_type.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('#defaultValue', () => {
101101
source: duration({ defaultValue: 600 }),
102102
target: duration({ defaultValue: siblingRef('source') }),
103103
fromContext: duration({ defaultValue: contextRef('val') }),
104-
}).validate(undefined, { val: momentDuration(700, 'ms') })
104+
}).validate({}, { val: momentDuration(700, 'ms') })
105105
).toMatchInlineSnapshot(`
106106
Object {
107107
"fromContext": "PT0.7S",
@@ -115,7 +115,7 @@ Object {
115115
source: duration({ defaultValue: '1h' }),
116116
target: duration({ defaultValue: siblingRef('source') }),
117117
fromContext: duration({ defaultValue: contextRef('val') }),
118-
}).validate(undefined, { val: momentDuration(2, 'hour') })
118+
}).validate({}, { val: momentDuration(2, 'hour') })
119119
).toMatchInlineSnapshot(`
120120
Object {
121121
"fromContext": "PT2H",
@@ -129,7 +129,7 @@ Object {
129129
source: duration({ defaultValue: momentDuration(1, 'hour') }),
130130
target: duration({ defaultValue: siblingRef('source') }),
131131
fromContext: duration({ defaultValue: contextRef('val') }),
132-
}).validate(undefined, { val: momentDuration(2, 'hour') })
132+
}).validate({}, { val: momentDuration(2, 'hour') })
133133
).toMatchInlineSnapshot(`
134134
Object {
135135
"fromContext": "PT2H",

packages/kbn-config-schema/src/types/maybe_type.test.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,41 @@ test('includes namespace in failure', () => {
6060
const type = schema.maybe(schema.string());
6161
expect(() => type.validate(null, {}, 'foo-namespace')).toThrowErrorMatchingSnapshot();
6262
});
63+
64+
describe('maybe + object', () => {
65+
test('returns undefined if undefined object', () => {
66+
const type = schema.maybe(schema.object({}));
67+
expect(type.validate(undefined)).toEqual(undefined);
68+
});
69+
70+
test('returns undefined if undefined object with no defaults', () => {
71+
const type = schema.maybe(
72+
schema.object({
73+
type: schema.string(),
74+
id: schema.string(),
75+
})
76+
);
77+
78+
expect(type.validate(undefined)).toEqual(undefined);
79+
});
80+
81+
test('returns empty object if maybe keys', () => {
82+
const type = schema.object({
83+
name: schema.maybe(schema.string()),
84+
});
85+
expect(type.validate({})).toEqual({});
86+
});
87+
88+
test('returns empty object if maybe nested object', () => {
89+
const type = schema.object({
90+
name: schema.maybe(
91+
schema.object({
92+
type: schema.string(),
93+
id: schema.string(),
94+
})
95+
),
96+
});
97+
98+
expect(type.validate({})).toEqual({});
99+
});
100+
});

packages/kbn-config-schema/src/types/maybe_type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class MaybeType<V> extends Type<V | undefined> {
2525
type
2626
.getSchema()
2727
.optional()
28-
.default()
28+
.default(() => undefined, 'undefined')
2929
);
3030
}
3131
}

packages/kbn-config-schema/src/types/object_type.test.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ test('returns value by default', () => {
3030
expect(type.validate(value)).toEqual({ name: 'test' });
3131
});
3232

33+
test('returns empty object if undefined', () => {
34+
const type = schema.object({});
35+
expect(type.validate(undefined)).toEqual({});
36+
});
37+
3338
test('properly parse the value if input is a string', () => {
3439
const type = schema.object({
3540
name: schema.string(),
@@ -112,21 +117,36 @@ test('undefined object within object', () => {
112117
}),
113118
});
114119

120+
expect(type.validate(undefined)).toEqual({
121+
foo: {
122+
bar: 'hello world',
123+
},
124+
});
125+
115126
expect(type.validate({})).toEqual({
116127
foo: {
117128
bar: 'hello world',
118129
},
119130
});
131+
132+
expect(type.validate({ foo: {} })).toEqual({
133+
foo: {
134+
bar: 'hello world',
135+
},
136+
});
120137
});
121138

122-
test('object within object with required', () => {
139+
test('object within object with key without defaultValue', () => {
123140
const type = schema.object({
124141
foo: schema.object({
125142
bar: schema.string(),
126143
}),
127144
});
128145
const value = { foo: {} };
129146

147+
expect(() => type.validate(undefined)).toThrowErrorMatchingInlineSnapshot(
148+
`"[foo.bar]: expected value of type [string] but got [undefined]"`
149+
);
130150
expect(() => type.validate(value)).toThrowErrorMatchingInlineSnapshot(
131151
`"[foo.bar]: expected value of type [string] but got [undefined]"`
132152
);

packages/kbn-config-schema/src/types/object_type.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ export type ObjectResultType<P extends Props> = Readonly<{ [K in keyof P]: TypeO
3333
export type ObjectTypeOptions<P extends Props = any> = TypeOptions<
3434
{ [K in keyof P]: TypeOf<P[K]> }
3535
> & {
36+
/** Should uknown keys not be defined in the schema be allowed. Defaults to `false` */
3637
allowUnknowns?: boolean;
3738
};
3839

3940
export class ObjectType<P extends Props = any> extends Type<ObjectResultType<P>> {
4041
private props: Record<string, AnySchema>;
4142

42-
constructor(props: P, options: ObjectTypeOptions<P> = {}) {
43+
constructor(props: P, { allowUnknowns = false, ...typeOptions }: ObjectTypeOptions<P> = {}) {
4344
const schemaKeys = {} as Record<string, AnySchema>;
4445
for (const [key, value] of Object.entries(props)) {
4546
schemaKeys[key] = value.getSchema();
4647
}
47-
const { allowUnknowns, ...typeOptions } = options;
4848
const schema = internals
4949
.object()
5050
.keys(schemaKeys)
51-
.optional()
5251
.default()
52+
.optional()
5353
.unknown(Boolean(allowUnknowns));
5454

5555
super(schema, typeOptions);

packages/kbn-optimizer/src/optimizer/kibana_platform_plugins.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export function findKibanaPlatformPlugins(scanDirs: string[], paths: string[]) {
4444
absolute: true,
4545
}
4646
)
47-
.map(path => readKibanaPlatformPlugin(path));
47+
.map(path =>
48+
// absolute paths returned from globby are using normalize or something so the path separators are `/` even on windows, Path.resolve solves this
49+
readKibanaPlatformPlugin(Path.resolve(path))
50+
);
4851
}
4952

5053
function readKibanaPlatformPlugin(manifestPath: string): KibanaPlatformPlugin {

0 commit comments

Comments
 (0)