Skip to content

Commit

Permalink
Merge branch 'master' into remote_clusters/flaky_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Apr 8, 2020
2 parents b00755a + 18c3f75 commit 58d4cc1
Show file tree
Hide file tree
Showing 58 changed files with 830 additions and 908 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ describe('MetricsAxisOptions component', () => {
schemas: { metrics: [{ name: 'metric' }] },
},
setState: jest.fn(),
serialize: jest.fn(),
},
stateParams: {
valueAxes: [axis],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function MetricsAxisOptions(props: ValidationVisOptionsProps<BasicVislibParams>)
}, [stateParams.seriesParams]);

useEffect(() => {
vis.setState({ type: visType } as any);
vis.setState({ ...vis.serialize(), type: visType });
}, [vis, visType]);

return isTabSelected ? (
Expand Down
27 changes: 23 additions & 4 deletions x-pack/legacy/plugins/canvas/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

const path = require('path');
const webpack = require('webpack');
const { stringifyRequest } = require('loader-utils');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { DLL_OUTPUT, KIBANA_ROOT } = require('./constants');

Expand Down Expand Up @@ -73,7 +74,20 @@ module.exports = async ({ config }) => {
path: path.resolve(KIBANA_ROOT, 'src/optimize/postcss.config.js'),
},
},
{ loader: 'sass-loader' },
{
loader: 'sass-loader',
options: {
prependData(loaderContext) {
return `@import ${stringifyRequest(
loaderContext,
path.resolve(KIBANA_ROOT, 'src/legacy/ui/public/styles/_styling_constants.scss')
)};\n`;
},
sassOptions: {
includePaths: [path.resolve(KIBANA_ROOT, 'node_modules')],
},
},
},
],
});

Expand All @@ -86,8 +100,9 @@ module.exports = async ({ config }) => {
loader: 'css-loader',
options: {
importLoaders: 2,
modules: true,
localIdentName: '[name]__[local]___[hash:base64:5]',
modules: {
localIdentName: '[name]__[local]___[hash:base64:5]',
},
},
},
{
Expand Down Expand Up @@ -159,7 +174,11 @@ module.exports = async ({ config }) => {
// what require() calls it will execute within the bundle
JSON.stringify({ type, modules: extensions[type] || [] }),
].join('');
})
}),

// Mock out libs used by a few componets to avoid loading in kibana_legacy and platform
new webpack.NormalModuleReplacementPlugin(/lib\/notify/, path.resolve(__dirname, '../tasks/mocks/uiNotify')),
new webpack.NormalModuleReplacementPlugin(/lib\/download_workpad/, path.resolve(__dirname, '../tasks/mocks/downloadWorkpad')),
);

// Tell Webpack about relevant extensions
Expand Down
13 changes: 13 additions & 0 deletions x-pack/legacy/plugins/canvas/tasks/mocks/downloadWorkpad.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
export const downloadWorkpad = async workpadId => console.log(`Download workpad ${workpadId}`);

export const downloadRenderedWorkpad = async renderedWorkpad =>
console.log(`Download workpad ${renderedWorkpad.id}`);

export const downloadRuntime = async basePath => console.log(`Download run time at ${basePath}`);

export const downloadZippedRuntime = async data => console.log(`Downloading data ${data}`);
Original file line number Diff line number Diff line change
Expand Up @@ -450,25 +450,31 @@ export const getResult = (): RuleAlertType => ({
lists: [
{
field: 'source.ip',
boolean_operator: 'and',
values: [
{
name: '127.0.0.1',
type: 'value',
},
],
values_operator: 'included',
values_type: 'exists',
},
{
field: 'host.name',
boolean_operator: 'and not',
values_operator: 'excluded',
values_type: 'match',
values: [
{
name: 'rock01',
type: 'value',
},
],
and: [
{
name: 'mothra',
type: 'value',
field: 'host.id',
values_operator: 'included',
values_type: 'match_all',
values: [
{
name: '123',
},
{
name: '678',
},
],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,31 @@ export const getOutputRuleAlertForRest = (): Omit<
lists: [
{
field: 'source.ip',
boolean_operator: 'and',
values: [
{
name: '127.0.0.1',
type: 'value',
},
],
values_operator: 'included',
values_type: 'exists',
},
{
field: 'host.name',
boolean_operator: 'and not',
values_operator: 'excluded',
values_type: 'match',
values: [
{
name: 'rock01',
type: 'value',
},
],
and: [
{
name: 'mothra',
type: 'value',
field: 'host.id',
values_operator: 'included',
values_type: 'match_all',
values: [
{
name: '123',
},
{
name: '678',
},
],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,31 @@ export const ruleOutput: RulesSchema = {
lists: [
{
field: 'source.ip',
boolean_operator: 'and',
values: [
{
name: '127.0.0.1',
type: 'value',
},
],
values_operator: 'included',
values_type: 'exists',
},
{
field: 'host.name',
boolean_operator: 'and not',
values_operator: 'excluded',
values_type: 'match',
values: [
{
name: 'rock01',
type: 'value',
},
],
and: [
{
name: 'mothra',
type: 'value',
field: 'host.id',
values_operator: 'included',
values_type: 'match_all',
values: [
{
name: '123',
},
{
name: '678',
},
],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1561,25 +1561,31 @@ describe('add prepackaged rules schema', () => {
lists: [
{
field: 'source.ip',
boolean_operator: 'and',
values: [
{
name: '127.0.0.1',
type: 'value',
},
],
values_operator: 'included',
values_type: 'exists',
},
{
field: 'host.name',
boolean_operator: 'and not',
values_operator: 'excluded',
values_type: 'match',
values: [
{
name: 'rock01',
type: 'value',
},
],
and: [
{
name: 'mothra',
type: 'value',
field: 'host.id',
values_operator: 'included',
values_type: 'match_all',
values: [
{
name: '123',
},
{
name: '678',
},
],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1526,25 +1526,31 @@ describe('create rules schema', () => {
lists: [
{
field: 'source.ip',
boolean_operator: 'and',
values: [
{
name: '127.0.0.1',
type: 'value',
},
],
values_operator: 'included',
values_type: 'exists',
},
{
field: 'host.name',
boolean_operator: 'and not',
values_operator: 'excluded',
values_type: 'match',
values: [
{
name: 'rock01',
type: 'value',
},
],
and: [
{
name: 'mothra',
type: 'value',
field: 'host.id',
values_operator: 'included',
values_type: 'match_all',
values: [
{
name: '123',
},
{
name: '678',
},
],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1747,25 +1747,31 @@ describe('import rules schema', () => {
lists: [
{
field: 'source.ip',
boolean_operator: 'and',
values: [
{
name: '127.0.0.1',
type: 'value',
},
],
values_operator: 'included',
values_type: 'exists',
},
{
field: 'host.name',
boolean_operator: 'and not',
values_operator: 'excluded',
values_type: 'match',
values: [
{
name: 'rock01',
type: 'value',
},
],
and: [
{
name: 'mothra',
type: 'value',
field: 'host.id',
values_operator: 'included',
values_type: 'match_all',
values: [
{
name: '123',
},
{
name: '678',
},
],
},
],
},
Expand Down
Loading

0 comments on commit 58d4cc1

Please sign in to comment.