Skip to content

Commit

Permalink
Merge branch 'master' into chore/cypress-context
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jan 7, 2021
2 parents a6b61a1 + d03b20a commit 878677a
Show file tree
Hide file tree
Showing 166 changed files with 3,268 additions and 842 deletions.
8 changes: 6 additions & 2 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ Content is fetched from the remote (https://feeds.elastic.co and https://feeds-s
|Create choropleth maps. Display the results of a term-aggregation as e.g. countries, zip-codes, states.
|{kib-repo}blob/{branch}/src/plugins/runtime_fields/README.mdx[runtimeFields]
|The runtime fields plugin provides types and constants for OSS and xpack runtime field related code.
|{kib-repo}blob/{branch}/src/plugins/saved_objects/README.md[savedObjects]
|The savedObjects plugin exposes utilities to manipulate saved objects on the client side.
Expand Down Expand Up @@ -483,8 +487,8 @@ Elastic.
|Welcome to the Kibana rollup plugin! This plugin provides Kibana support for Elasticsearch's rollup feature. Please refer to the Elasticsearch documentation to understand rollup indices and how to create rollup jobs.
|{kib-repo}blob/{branch}/x-pack/plugins/runtime_fields/README.md[runtimeFields]
|Welcome to the home of the runtime field editor and everything related to runtime fields!
|{kib-repo}blob/{branch}/x-pack/plugins/runtime_field_editor/README.md[runtimeFieldEditor]
|Welcome to the home of the runtime field editor!
|{kib-repo}blob/{branch}/x-pack/plugins/saved_objects_tagging/README.md[savedObjectsTagging]
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,16 @@
"@loaders.gl/json": "^2.3.1",
"@slack/webhook": "^5.0.0",
"@storybook/addons": "^6.0.16",
"@turf/along": "6.0.1",
"@turf/area": "6.0.1",
"@turf/bbox": "6.0.1",
"@turf/bbox-polygon": "6.0.1",
"@turf/boolean-contains": "6.0.1",
"@turf/center-of-mass": "6.0.1",
"@turf/circle": "6.0.1",
"@turf/distance": "6.0.1",
"@turf/helpers": "6.0.1",
"@turf/length": "^6.0.2",
"JSONStream": "1.3.5",
"abort-controller": "^3.0.0",
"abortcontroller-polyfill": "^1.4.0",
Expand Down Expand Up @@ -399,11 +408,6 @@
"@testing-library/react": "^11.0.4",
"@testing-library/react-hooks": "^3.4.1",
"@testing-library/user-event": "^12.1.6",
"@turf/bbox": "6.0.1",
"@turf/bbox-polygon": "6.0.1",
"@turf/boolean-contains": "6.0.1",
"@turf/distance": "6.0.1",
"@turf/helpers": "6.0.1",
"@types/accept": "3.1.1",
"@types/angular": "^1.6.56",
"@types/angular-mocks": "^1.7.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pageLoadAssetSize:
visualizations: 295025
visualize: 57431
watcher: 43598
runtimeFields: 41752
runtimeFields: 10000
stackAlerts: 29684
presentationUtil: 28545
runtimeFieldEditor: 46986
3 changes: 2 additions & 1 deletion src/dev/run_find_plugins_without_ts_refs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import Path from 'path';
import Fs from 'fs';
import JSON5 from 'json5';
import { get } from 'lodash';
import { run } from '@kbn/dev-utils';
import { getPluginDeps, findPlugins } from './plugin_discovery';
Expand Down Expand Up @@ -88,7 +89,7 @@ function isMigratedToTsProjectRefs(dir: string): boolean {
try {
const path = Path.join(dir, 'tsconfig.json');
const content = Fs.readFileSync(path, { encoding: 'utf8' });
return get(JSON.parse(content), 'compilerOptions.composite', false);
return get(JSON5.parse(content), 'compilerOptions.composite', false);
} catch (e) {
return false;
}
Expand Down
18 changes: 18 additions & 0 deletions src/plugins/apm_oss/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
// have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636
"server/tutorial/index_pattern.json"
],
"references": [{ "path": "../../core/tsconfig.json" }, { "path": "../home/tsconfig.json" }]
}
4 changes: 4 additions & 0 deletions src/plugins/runtime_fields/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Runtime Fields

The runtime fields plugin provides types and constants for OSS and xpack runtime field related code.
20 changes: 20 additions & 0 deletions src/plugins/runtime_fields/common/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export const RUNTIME_FIELD_TYPES = ['keyword', 'long', 'double', 'date', 'ip', 'boolean'] as const;
21 changes: 21 additions & 0 deletions src/plugins/runtime_fields/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export * from './constants';
export * from './types';
29 changes: 29 additions & 0 deletions src/plugins/runtime_fields/common/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { RUNTIME_FIELD_TYPES } from './constants';

export type RuntimeType = typeof RUNTIME_FIELD_TYPES[number];
export interface RuntimeField {
name: string;
type: RuntimeType;
script: {
source: string;
};
}
6 changes: 6 additions & 0 deletions src/plugins/runtime_fields/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "runtimeFields",
"version": "kibana",
"server": false,
"ui": true
}
28 changes: 28 additions & 0 deletions src/plugins/runtime_fields/public/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export * from '../common';

export function plugin() {
return {
setup() {},
start() {},
stop() {},
};
}
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"exclude": [
"src/**/__fixtures__/**/*",
"src/core/**/*",
"src/plugins/apm_oss/**/*",
"src/plugins/bfetch/**/*",
"src/plugins/data/**/*",
"src/plugins/dev_tools/**/*",
Expand All @@ -28,7 +29,7 @@
"src/plugins/telemetry_collection_manager/**/*",
"src/plugins/ui_actions/**/*",
"src/plugins/url_forwarding/**/*",
"src/plugins/usage_collection/**/*",
"src/plugins/usage_collection/**/*"
// In the build we actually exclude **/public/**/* from this config so that
// we can run the TSC on both this and the .browser version of this config
// file, but if we did it during development IDEs would not be able to find
Expand All @@ -37,6 +38,7 @@
],
"references": [
{ "path": "./src/core/tsconfig.json" },
{ "path": "./src/plugins/apm_oss/tsconfig.json" },
{ "path": "./src/plugins/bfetch/tsconfig.json" },
{ "path": "./src/plugins/data/tsconfig.json" },
{ "path": "./src/plugins/dev_tools/tsconfig.json" },
Expand All @@ -58,6 +60,6 @@
{ "path": "./src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "./src/plugins/ui_actions/tsconfig.json" },
{ "path": "./src/plugins/url_forwarding/tsconfig.json" },
{ "path": "./src/plugins/usage_collection/tsconfig.json" },
{ "path": "./src/plugins/usage_collection/tsconfig.json" }
]
}
3 changes: 2 additions & 1 deletion tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"include": [],
"references": [
{ "path": "./src/core/tsconfig.json" },
{ "path": "./src/plugins/apm_oss/tsconfig.json" },
{ "path": "./src/plugins/bfetch/tsconfig.json" },
{ "path": "./src/plugins/data/tsconfig.json" },
{ "path": "./src/plugins/dev_tools/tsconfig.json" },
Expand All @@ -23,6 +24,6 @@
{ "path": "./src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "./src/plugins/ui_actions/tsconfig.json" },
{ "path": "./src/plugins/url_forwarding/tsconfig.json" },
{ "path": "./src/plugins/usage_collection/tsconfig.json" },
{ "path": "./src/plugins/usage_collection/tsconfig.json" }
]
}
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"xpack.remoteClusters": "plugins/remote_clusters",
"xpack.reporting": ["plugins/reporting"],
"xpack.rollupJobs": ["plugins/rollup"],
"xpack.runtimeFields": "plugins/runtime_fields",
"xpack.runtimeFields": "plugins/runtime_field_editor",
"xpack.searchProfiler": "plugins/searchprofiler",
"xpack.security": "plugins/security",
"xpack.server": "legacy/server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

import { mount } from 'enzyme';
import React from 'react';
import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context';
import { MockUrlParamsContextProvider } from '../../../../../context/url_params_context/mock_url_params_context_provider';
import { mockMoment, toJson } from '../../../../../utils/testHelpers';
import { ErrorGroupList } from '../index';
import props from './props.json';
import { MockApmPluginContextWrapper } from '../../../../context/apm_plugin/mock_apm_plugin_context';
import { MockUrlParamsContextProvider } from '../../../../context/url_params_context/mock_url_params_context_provider';
import { mockMoment, toJson } from '../../../../utils/testHelpers';
import { ErrorGroupList } from './index';
import props from './__fixtures__/props.json';
import { MemoryRouter } from 'react-router-dom';

jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
import React from 'react';
import { createMemoryHistory } from 'history';
import * as fetcherHook from '../../../../../../hooks/use_fetcher';
import { SelectableUrlList } from '../SelectableUrlList';
import { render } from '../../../utils/test_helper';
import * as fetcherHook from '../../../../../hooks/use_fetcher';
import { SelectableUrlList } from './SelectableUrlList';
import { render } from '../../utils/test_helper';

describe('SelectableUrlList', () => {
it('it uses search term value from url', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { formatToSec } from '../KeyUXMetrics';
import { formatToSec } from './KeyUXMetrics';

describe('FormatToSec', () => {
test('it returns the expected value', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
import React from 'react';
import { render } from '@testing-library/react';
import * as fetcherHook from '../../../../../hooks/use_fetcher';
import { KeyUXMetrics } from '../KeyUXMetrics';
import * as fetcherHook from '../../../../hooks/use_fetcher';
import { KeyUXMetrics } from './KeyUXMetrics';

describe('KeyUXMetrics', () => {
it('renders metrics with correct formats', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import { render } from 'enzyme';
import React from 'react';

import { EmbeddedMap } from '../EmbeddedMap';
import { KibanaContextProvider } from '../../../../../../../../../src/plugins/kibana_react/public';
import { embeddablePluginMock } from '../../../../../../../../../src/plugins/embeddable/public/mocks';
import { EmbeddedMap } from './EmbeddedMap';
import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public';
import { embeddablePluginMock } from '../../../../../../../../src/plugins/embeddable/public/mocks';

describe('Embedded Map', () => {
test('it renders', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { render, shallow } from 'enzyme';
import React from 'react';

import { MapToolTip } from '../MapToolTip';
import { MapToolTip } from './MapToolTip';

describe('Map Tooltip', () => {
test('it shallow renders', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { renderHook } from '@testing-library/react-hooks';
import { mockLayerList } from './__mocks__/regions_layer.mock';
import { useLayerList } from '../useLayerList';
import { useLayerList } from './useLayerList';

describe('useLayerList', () => {
test('it returns the region layer', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { getFormattedBuckets } from '../index';
import { getFormattedBuckets } from './index';

describe('Distribution', () => {
it('getFormattedBuckets', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { Transaction } from '../../../../../../../../typings/es_schemas/ui/transaction';
import { getAgentMarks } from '../get_agent_marks';
import { Transaction } from '../../../../../../../typings/es_schemas/ui/transaction';
import { getAgentMarks } from './get_agent_marks';

describe('getAgentMarks', () => {
it('should sort the marks by time', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { IWaterfallError } from '../../Waterfall/waterfall_helpers/waterfall_helpers';
import { getErrorMarks } from '../get_error_marks';
import { IWaterfallError } from '../Waterfall/waterfall_helpers/waterfall_helpers';
import { getErrorMarks } from './get_error_marks';

describe('getErrorMarks', () => {
describe('returns empty array', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { FETCH_STATUS } from '../../../hooks/use_fetcher';
import * as useLocalUIFilters from '../../../hooks/useLocalUIFilters';
import * as useDynamicIndexPatternHooks from '../../../hooks/use_dynamic_index_pattern';
import { SessionStorageMock } from '../../../services/__test__/SessionStorageMock';
import { SessionStorageMock } from '../../../services/__mocks__/SessionStorageMock';
import { MockUrlParamsContextProvider } from '../../../context/url_params_context/mock_url_params_context_provider';
import * as hook from './use_anomaly_detection_jobs_fetcher';

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

import { shallow } from 'enzyme';
import React from 'react';
import { ImpactBar } from '..';
import { ImpactBar } from '.';

describe('ImpactBar component', () => {
it('should render with default values', () => {
Expand Down
Loading

0 comments on commit 878677a

Please sign in to comment.