Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-109197-bulkget-across-spaces
Browse files Browse the repository at this point in the history
kibanamachine authored Aug 25, 2021
2 parents 1215e2c + 90152ed commit 8d0bfa4
Showing 66 changed files with 4,728 additions and 3,231 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -93,6 +93,7 @@
"yarn": "^1.21.1"
},
"dependencies": {
"@babel/runtime": "^7.12.5",
"@elastic/apm-rum": "^5.9.1",
"@elastic/apm-rum-react": "^1.3.1",
"@elastic/charts": "34.2.1",
@@ -347,7 +348,7 @@
"react-moment-proptypes": "^1.7.0",
"react-monaco-editor": "^0.41.2",
"react-popper-tooltip": "^2.10.1",
"react-query": "^3.18.1",
"react-query": "^3.21.0",
"react-redux": "^7.2.0",
"react-resizable": "^1.7.5",
"react-resize-detector": "^4.2.0",
@@ -440,7 +441,6 @@
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "^7.12.7",
"@babel/register": "^7.12.10",
"@babel/runtime": "^7.12.5",
"@babel/traverse": "^7.12.12",
"@babel/types": "^7.12.12",
"@bazel/ibazel": "^0.15.10",
2 changes: 2 additions & 0 deletions packages/kbn-babel-preset/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -30,9 +30,11 @@ DEPS = [
"@npm//@babel/plugin-proposal-nullish-coalescing-operator",
"@npm//@babel/plugin-proposal-optional-chaining",
"@npm//@babel/plugin-proposal-private-methods",
"@npm//@babel/plugin-transform-runtime",
"@npm//@babel/preset-env",
"@npm//@babel/preset-react",
"@npm//@babel/preset-typescript",
"@npm//@babel/runtime",
"@npm//@emotion/babel-preset-css-prop",
"@npm//babel-plugin-add-module-exports",
"@npm//babel-plugin-styled-components",
8 changes: 8 additions & 0 deletions packages/kbn-babel-preset/common_preset.js
Original file line number Diff line number Diff line change
@@ -32,6 +32,14 @@ const plugins = [
// Proposal is on stage 4, and included in ECMA-262 (https://github.com/tc39/proposal-export-ns-from)
// Need this since we are using TypeScript 3.9+
require.resolve('@babel/plugin-proposal-private-methods'),

// It enables the @babel/runtime so we can decrease the bundle sizes of the produced outputs
[
require.resolve('@babel/plugin-transform-runtime'),
{
version: '^7.12.5',
},
],
];

module.exports = {
4 changes: 2 additions & 2 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ pageLoadAssetSize:
embeddableEnhanced: 41145
enterpriseSearch: 35741
esUiShared: 326654
expressions: 224136
features: 21723
fieldFormats: 92628
globalSearch: 29696
@@ -66,7 +65,6 @@ pageLoadAssetSize:
searchprofiler: 67080
security: 95864
securityOss: 30806
securitySolution: 217673
share: 99061
snapshotRestore: 79032
spaces: 57868
@@ -116,3 +114,5 @@ pageLoadAssetSize:
expressionShape: 34008
interactiveSetup: 18532
expressionTagcloud: 27505
securitySolution: 232514
expressions: 239290
5,292 changes: 2,713 additions & 2,579 deletions packages/kbn-pm/dist/index.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@

import {
EuiButton,
EuiCodeEditor,
EuiFieldNumber,
EuiFilePicker,
EuiFlexGroup,
@@ -16,7 +15,13 @@ import {
EuiSpacer,
EuiToolTip,
} from '@elastic/eui';
import { Meta, Story } from '@storybook/react';
import React, { useEffect, useState } from 'react';
import { CoreStart } from '../../../../../../../../src/core/public';
import {
CodeEditor,
createKibanaReactContext,
} from '../../../../../../../../src/plugins/kibana_react/public';
import { Cytoscape } from '../Cytoscape';
import { Centerer } from './centerer';
import exampleResponseHipsterStore from './example_response_hipster_store.json';
@@ -38,12 +43,29 @@ function getHeight() {
return window.innerHeight - 300;
}

export default {
const stories: Meta<{}> = {
title: 'app/ServiceMap/Example data',
component: Cytoscape,
decorators: [
(StoryComponent, { globals }) => {
const KibanaReactContext = createKibanaReactContext(({
uiSettings: {
get: () => globals.euiTheme && globals.euiTheme.includes('dark'),
},
} as unknown) as Partial<CoreStart>);

return (
<KibanaReactContext.Provider>
<StoryComponent />
</KibanaReactContext.Provider>
);
},
],
};

export function GenerateMap() {
export default stories;

export const GenerateMap: Story<{}> = () => {
const [size, setSize] = useState<number>(10);
const [json, setJson] = useState<string>('');
const [elements, setElements] = useState<any[]>(
@@ -89,20 +111,18 @@ export function GenerateMap() {
</Cytoscape>

{json && (
<EuiCodeEditor
mode="json"
theme="github"
width="100%"
<CodeEditor
languageId="json"
value={json}
setOptions={{ fontSize: '12px' }}
isReadOnly
height="200px"
options={{ fontFamily: 'monospace' }}
/>
)}
</div>
);
}
};

export function MapFromJSON() {
export const MapFromJSON: Story<{}> = () => {
const [json, setJson] = useState<string>(
getSessionJson() || JSON.stringify(exampleResponseTodo, null, 2)
);
@@ -126,15 +146,10 @@ export function MapFromJSON() {
<EuiForm isInvalid={error !== undefined} error={error}>
<EuiFlexGroup>
<EuiFlexItem>
<EuiCodeEditor
mode="json"
theme="github"
width="100%"
<CodeEditor
languageId="json"
value={json}
setOptions={{ fontSize: '12px' }}
onChange={(value) => {
setJson(value);
}}
options={{ fontFamily: 'monospace' }}
/>
</EuiFlexItem>
<EuiFlexItem>
@@ -179,9 +194,9 @@ export function MapFromJSON() {
</EuiForm>
</div>
);
}
};

export function TodoApp() {
export const TodoApp: Story<{}> = () => {
return (
<div>
<Cytoscape
@@ -192,9 +207,9 @@ export function TodoApp() {
</Cytoscape>
</div>
);
}
};

export function OpbeansAndBeats() {
export const OpbeansAndBeats: Story<{}> = () => {
return (
<div>
<Cytoscape
@@ -205,9 +220,9 @@ export function OpbeansAndBeats() {
</Cytoscape>
</div>
);
}
};

export function HipsterStore() {
export const HipsterStore: Story<{}> = () => {
return (
<div>
<Cytoscape
@@ -218,4 +233,4 @@ export function HipsterStore() {
</Cytoscape>
</div>
);
}
};
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ describe('CredentialItem', () => {
expect(wrapper.find(EuiCopy)).toHaveLength(0);
});

it('handles credential visible toggle click', () => {
it.skip('handles credential visible toggle click', () => {
const wrapper = shallow(<CredentialItem {...props} hideCopy />);
const button = wrapper.find(EuiButtonIcon).dive().find('button');
button.simulate('click');
@@ -61,7 +61,7 @@ describe('CredentialItem', () => {
expect(wrapper.find(EuiFieldText)).toHaveLength(1);
});

it('handles select all button click', () => {
it.skip('handles select all button click', () => {
const wrapper = shallow(<CredentialItem {...props} hideCopy />);
// Toggle isVisible before EuiFieldText is visible
const button = wrapper.find(EuiButtonIcon).dive().find('button');
Original file line number Diff line number Diff line change
@@ -97,12 +97,14 @@ export const validatePackagePolicy = (
>((varDefs, policyTemplate) => {
(policyTemplate.inputs || []).forEach((input) => {
const varDefKey = hasIntegrations ? `${policyTemplate.name}-${input.type}` : input.type;

if ((input.vars || []).length) {
varDefs[varDefKey] = keyBy(input.vars || [], 'name');
}
});
return varDefs;
}, {});

const streamsByDatasetAndInput = (packageInfo.data_streams || []).reduce<
Record<string, RegistryStream>
>((streams, dataStream) => {
@@ -149,6 +151,7 @@ export const validatePackagePolicy = (
if (input.streams.length) {
input.streams.forEach((stream) => {
const streamValidationResults: PackagePolicyConfigValidationResults = {};

const streamVarDefs =
streamVarDefsByDatasetAndInput[`${stream.data_stream.dataset}-${input.type}`];

@@ -157,7 +160,7 @@ export const validatePackagePolicy = (
streamValidationResults.vars = Object.entries(stream.vars).reduce(
(results, [name, configEntry]) => {
results[name] =
streamVarDefs[name] && input.enabled && stream.enabled
streamVarDefs && streamVarDefs[name] && input.enabled && stream.enabled
? validatePackagePolicyConfig(configEntry, streamVarDefs[name])
: null;
return results;
Loading

0 comments on commit 8d0bfa4

Please sign in to comment.