Skip to content

Commit 58d4cc1

Browse files
Merge branch 'master' into remote_clusters/flaky_tests
2 parents b00755a + 18c3f75 commit 58d4cc1

58 files changed

Lines changed: 830 additions & 908 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.

src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/__snapshots__/index.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/index.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ describe('MetricsAxisOptions component', () => {
9595
schemas: { metrics: [{ name: 'metric' }] },
9696
},
9797
setState: jest.fn(),
98+
serialize: jest.fn(),
9899
},
99100
stateParams: {
100101
valueAxes: [axis],

src/legacy/core_plugins/vis_type_vislib/public/components/options/metrics_axes/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ function MetricsAxisOptions(props: ValidationVisOptionsProps<BasicVislibParams>)
299299
}, [stateParams.seriesParams]);
300300

301301
useEffect(() => {
302-
vis.setState({ type: visType } as any);
302+
vis.setState({ ...vis.serialize(), type: visType });
303303
}, [vis, visType]);
304304

305305
return isTabSelected ? (

x-pack/legacy/plugins/canvas/.storybook/webpack.config.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
const path = require('path');
88
const webpack = require('webpack');
9+
const { stringifyRequest } = require('loader-utils');
910
const CopyWebpackPlugin = require('copy-webpack-plugin');
1011
const { DLL_OUTPUT, KIBANA_ROOT } = require('./constants');
1112

@@ -73,7 +74,20 @@ module.exports = async ({ config }) => {
7374
path: path.resolve(KIBANA_ROOT, 'src/optimize/postcss.config.js'),
7475
},
7576
},
76-
{ loader: 'sass-loader' },
77+
{
78+
loader: 'sass-loader',
79+
options: {
80+
prependData(loaderContext) {
81+
return `@import ${stringifyRequest(
82+
loaderContext,
83+
path.resolve(KIBANA_ROOT, 'src/legacy/ui/public/styles/_styling_constants.scss')
84+
)};\n`;
85+
},
86+
sassOptions: {
87+
includePaths: [path.resolve(KIBANA_ROOT, 'node_modules')],
88+
},
89+
},
90+
},
7791
],
7892
});
7993

@@ -86,8 +100,9 @@ module.exports = async ({ config }) => {
86100
loader: 'css-loader',
87101
options: {
88102
importLoaders: 2,
89-
modules: true,
90-
localIdentName: '[name]__[local]___[hash:base64:5]',
103+
modules: {
104+
localIdentName: '[name]__[local]___[hash:base64:5]',
105+
},
91106
},
92107
},
93108
{
@@ -159,7 +174,11 @@ module.exports = async ({ config }) => {
159174
// what require() calls it will execute within the bundle
160175
JSON.stringify({ type, modules: extensions[type] || [] }),
161176
].join('');
162-
})
177+
}),
178+
179+
// Mock out libs used by a few componets to avoid loading in kibana_legacy and platform
180+
new webpack.NormalModuleReplacementPlugin(/lib\/notify/, path.resolve(__dirname, '../tasks/mocks/uiNotify')),
181+
new webpack.NormalModuleReplacementPlugin(/lib\/download_workpad/, path.resolve(__dirname, '../tasks/mocks/downloadWorkpad')),
163182
);
164183

165184
// Tell Webpack about relevant extensions
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
export const downloadWorkpad = async workpadId => console.log(`Download workpad ${workpadId}`);
7+
8+
export const downloadRenderedWorkpad = async renderedWorkpad =>
9+
console.log(`Download workpad ${renderedWorkpad.id}`);
10+
11+
export const downloadRuntime = async basePath => console.log(`Download run time at ${basePath}`);
12+
13+
export const downloadZippedRuntime = async data => console.log(`Downloading data ${data}`);

x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -450,25 +450,31 @@ export const getResult = (): RuleAlertType => ({
450450
lists: [
451451
{
452452
field: 'source.ip',
453-
boolean_operator: 'and',
454-
values: [
455-
{
456-
name: '127.0.0.1',
457-
type: 'value',
458-
},
459-
],
453+
values_operator: 'included',
454+
values_type: 'exists',
460455
},
461456
{
462457
field: 'host.name',
463-
boolean_operator: 'and not',
458+
values_operator: 'excluded',
459+
values_type: 'match',
464460
values: [
465461
{
466462
name: 'rock01',
467-
type: 'value',
468463
},
464+
],
465+
and: [
469466
{
470-
name: 'mothra',
471-
type: 'value',
467+
field: 'host.id',
468+
values_operator: 'included',
469+
values_type: 'match_all',
470+
values: [
471+
{
472+
name: '123',
473+
},
474+
{
475+
name: '678',
476+
},
477+
],
472478
},
473479
],
474480
},

x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/utils.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,25 +141,31 @@ export const getOutputRuleAlertForRest = (): Omit<
141141
lists: [
142142
{
143143
field: 'source.ip',
144-
boolean_operator: 'and',
145-
values: [
146-
{
147-
name: '127.0.0.1',
148-
type: 'value',
149-
},
150-
],
144+
values_operator: 'included',
145+
values_type: 'exists',
151146
},
152147
{
153148
field: 'host.name',
154-
boolean_operator: 'and not',
149+
values_operator: 'excluded',
150+
values_type: 'match',
155151
values: [
156152
{
157153
name: 'rock01',
158-
type: 'value',
159154
},
155+
],
156+
and: [
160157
{
161-
name: 'mothra',
162-
type: 'value',
158+
field: 'host.id',
159+
values_operator: 'included',
160+
values_type: 'match_all',
161+
values: [
162+
{
163+
name: '123',
164+
},
165+
{
166+
name: '678',
167+
},
168+
],
163169
},
164170
],
165171
},

x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/validate.test.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,31 @@ export const ruleOutput: RulesSchema = {
7474
lists: [
7575
{
7676
field: 'source.ip',
77-
boolean_operator: 'and',
78-
values: [
79-
{
80-
name: '127.0.0.1',
81-
type: 'value',
82-
},
83-
],
77+
values_operator: 'included',
78+
values_type: 'exists',
8479
},
8580
{
8681
field: 'host.name',
87-
boolean_operator: 'and not',
82+
values_operator: 'excluded',
83+
values_type: 'match',
8884
values: [
8985
{
9086
name: 'rock01',
91-
type: 'value',
9287
},
88+
],
89+
and: [
9390
{
94-
name: 'mothra',
95-
type: 'value',
91+
field: 'host.id',
92+
values_operator: 'included',
93+
values_type: 'match_all',
94+
values: [
95+
{
96+
name: '123',
97+
},
98+
{
99+
name: '678',
100+
},
101+
],
96102
},
97103
],
98104
},

x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.test.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,25 +1561,31 @@ describe('add prepackaged rules schema', () => {
15611561
lists: [
15621562
{
15631563
field: 'source.ip',
1564-
boolean_operator: 'and',
1565-
values: [
1566-
{
1567-
name: '127.0.0.1',
1568-
type: 'value',
1569-
},
1570-
],
1564+
values_operator: 'included',
1565+
values_type: 'exists',
15711566
},
15721567
{
15731568
field: 'host.name',
1574-
boolean_operator: 'and not',
1569+
values_operator: 'excluded',
1570+
values_type: 'match',
15751571
values: [
15761572
{
15771573
name: 'rock01',
1578-
type: 'value',
15791574
},
1575+
],
1576+
and: [
15801577
{
1581-
name: 'mothra',
1582-
type: 'value',
1578+
field: 'host.id',
1579+
values_operator: 'included',
1580+
values_type: 'match_all',
1581+
values: [
1582+
{
1583+
name: '123',
1584+
},
1585+
{
1586+
name: '678',
1587+
},
1588+
],
15831589
},
15841590
],
15851591
},

x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.test.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,25 +1526,31 @@ describe('create rules schema', () => {
15261526
lists: [
15271527
{
15281528
field: 'source.ip',
1529-
boolean_operator: 'and',
1530-
values: [
1531-
{
1532-
name: '127.0.0.1',
1533-
type: 'value',
1534-
},
1535-
],
1529+
values_operator: 'included',
1530+
values_type: 'exists',
15361531
},
15371532
{
15381533
field: 'host.name',
1539-
boolean_operator: 'and not',
1534+
values_operator: 'excluded',
1535+
values_type: 'match',
15401536
values: [
15411537
{
15421538
name: 'rock01',
1543-
type: 'value',
15441539
},
1540+
],
1541+
and: [
15451542
{
1546-
name: 'mothra',
1547-
type: 'value',
1543+
field: 'host.id',
1544+
values_operator: 'included',
1545+
values_type: 'match_all',
1546+
values: [
1547+
{
1548+
name: '123',
1549+
},
1550+
{
1551+
name: '678',
1552+
},
1553+
],
15481554
},
15491555
],
15501556
},

0 commit comments

Comments
 (0)