Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into pr/64617
Browse files Browse the repository at this point in the history
# Conflicts:
#	.eslintignore
  • Loading branch information
spalger committed Apr 29, 2020
2 parents 99554fb + 30439f6 commit bba789e
Show file tree
Hide file tree
Showing 806 changed files with 32,624 additions and 22,580 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ target
/src/core/lib/kbn_internal_native_observable
/src/legacy/core_plugins/console/public/tests/webpackShims
/src/legacy/core_plugins/console/public/webpackShims
/src/legacy/core_plugins/vis_type_vislib/public/vislib/__tests__/lib/fixtures/mock_data
/src/legacy/plugin_discovery/plugin_pack/__tests__/fixtures/plugins/broken
/src/legacy/ui/public/flot-charts
/src/legacy/ui/public/utils/decode_geo_hash.js
Expand Down
98 changes: 98 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ module.exports = {
'examples/**/*',
'!(src|x-pack)/**/*.test.*',
'!(x-pack/)?test/**/*',
// next folder contains legacy browser tests which can't be migrated to jest
// which import np files
'!src/legacy/core_plugins/kibana/public/__tests__/**/*',
],
from: [
'(src|x-pack)/plugins/**/(public|server)/**/*',
Expand Down Expand Up @@ -739,6 +742,101 @@ module.exports = {
},
},

/**
* Lists overrides
*/
{
// typescript and javascript for front and back end
files: ['x-pack/plugins/lists/**/*.{js,ts,tsx}'],
plugins: ['eslint-plugin-node'],
env: {
mocha: true,
jest: true,
},
rules: {
'accessor-pairs': 'error',
'array-callback-return': 'error',
'no-array-constructor': 'error',
complexity: 'error',
'consistent-return': 'error',
'func-style': ['error', 'expression'],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
'node/no-deprecated-api': 'error',
'no-bitwise': 'error',
'no-continue': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-func-assign': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-regexp': 'error',
'no-inner-declarations': 'error',
'no-lone-blocks': 'error',
'no-multi-assign': 'error',
'no-misleading-character-class': 'error',
'no-new-symbol': 'error',
'no-obj-calls': 'error',
'no-param-reassign': ['error', { props: true }],
'no-process-exit': 'error',
'no-prototype-builtins': 'error',
'no-return-await': 'error',
'no-self-compare': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-this-before-super': 'error',
'no-undef': 'error',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-concat': 'error',
'no-useless-computed-key': 'error',
'no-useless-escape': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'one-var-declaration-per-line': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'require-atomic-updates': 'error',
'symbol-description': 'error',
'vars-on-top': 'error',
'@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'no-template-curly-in-string': 'error',
'sort-keys': 'error',
'prefer-destructuring': 'error',
},
},
/**
* Alerting Services overrides
*/
Expand Down
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/src/legacy/core_plugins/kibana/public/discover/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
/src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
/src/plugins/vis_type_vislib/ @elastic/kibana-app
/src/plugins/vis_type_xy/ @elastic/kibana-app
/src/plugins/vis_type_table/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
Expand Down Expand Up @@ -224,7 +224,7 @@
/x-pack/test/detection_engine_api_integration @elastic/siem
/x-pack/test/api_integration/apis/siem @elastic/siem
/x-pack/plugins/case @elastic/siem
/x-pack/plugins/lists @elastic/siem

# Security Intelligence And Analytics
/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics
/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics
6 changes: 3 additions & 3 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"visTypeMetric": "src/plugins/vis_type_metric",
"visTypeTable": "src/plugins/vis_type_table",
"visTypeTagCloud": "src/plugins/vis_type_tagcloud",
"visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
"visTypeTimeseries": "src/plugins/vis_type_timeseries",
"visTypeVega": "src/plugins/vis_type_vega",
"visTypeVislib": "src/legacy/core_plugins/vis_type_vislib",
"visTypeXy": "src/legacy/core_plugins/vis_type_xy",
"visTypeVislib": "src/plugins/vis_type_vislib",
"visTypeXy": "src/plugins/vis_type_xy",
"visualizations": "src/plugins/visualizations",
"visualize": "src/plugins/visualize"
},
Expand Down
4 changes: 2 additions & 2 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ files:
include:
- 'src/legacy/core_plugins/metrics/**/*.s+(a|c)ss'
- 'src/legacy/core_plugins/timelion/**/*.s+(a|c)ss'
- 'src/legacy/core_plugins/vis_type_vislib/**/*.s+(a|c)ss'
- 'src/legacy/core_plugins/vis_type_xy/**/*.s+(a|c)ss'
- 'src/plugins/vis_type_vislib/**/*.s+(a|c)ss'
- 'src/plugins/vis_type_xy/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
- 'x-pack/plugins/triggers_actions_ui/**/*.s+(a|c)ss'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export interface SavedObjectsCoreFieldMapping
| [enabled](./kibana-plugin-core-server.savedobjectscorefieldmapping.enabled.md) | <code>boolean</code> | |
| [fields](./kibana-plugin-core-server.savedobjectscorefieldmapping.fields.md) | <code>{</code><br/><code> [subfield: string]: {</code><br/><code> type: string;</code><br/><code> };</code><br/><code> }</code> | |
| [index](./kibana-plugin-core-server.savedobjectscorefieldmapping.index.md) | <code>boolean</code> | |
| [null\_value](./kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md) | <code>number &#124; boolean &#124; string</code> | |
| [type](./kibana-plugin-core-server.savedobjectscorefieldmapping.type.md) | <code>string</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [SavedObjectsCoreFieldMapping](./kibana-plugin-core-server.savedobjectscorefieldmapping.md) &gt; [null\_value](./kibana-plugin-core-server.savedobjectscorefieldmapping.null_value.md)

## SavedObjectsCoreFieldMapping.null\_value property

<b>Signature:</b>

```typescript
null_value?: number | boolean | string;
```
7 changes: 7 additions & 0 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,14 @@ This setting does not have an effect when loading a saved search.
Highlighting slows requests when
working on big documents.

[float]
[[kibana-ml-settings]]
==== Machine learning

[horizontal]
`ml:fileDataVisualizerMaxFileSize`:: Sets the file size limit when importing
data in the {data-viz}. The default value is `100MB`. The highest supported
value for this setting is `1GB`.


[float]
Expand Down
6 changes: 0 additions & 6 deletions docs/settings/ml-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@ instance. If `xpack.ml.enabled` is set to `true` in `elasticsearch.yml`, however
you can still use the {ml} APIs. To disable {ml} entirely, see the
{ref}/ml-settings.html[{es} {ml} settings].

[[data-visualizer-settings]]
==== {data-viz} settings

`xpack.ml.file_data_visualizer.max_file_size`::
Sets the file size limit when importing data in the {data-viz}. The default
value is `100MB`. The highest supported value for this setting is `1GB`.

2 changes: 1 addition & 1 deletion docs/user/ml/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ image::user/ml/images/ml-data-visualizer-sample.jpg[{data-viz} for sample flight
experimental[] You can also upload a CSV, NDJSON, or log file. The *{data-viz}*
identifies the file format and field mappings. You can then optionally import
that data into an {es} index. To change the default file size limit, see
<<data-visualizer-settings>>.
<<kibana-ml-settings>>.

You need the following permissions to use the {data-viz} with file upload:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('logLegacyThirdPartyPluginDeprecationWarning', () => {
expect(log.warn).toHaveBeenCalledTimes(1);
expect(log.warn.mock.calls[0]).toMatchInlineSnapshot(`
Array [
"Some installed third party plugin(s) [plugin] are using the legacy plugin format and will no longer work in a future Kibana release. Please refer to https://www.elastic.co/guide/en/kibana/master/breaking-changes-8.0.html for a list of breaking changes and https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md for documentation on how to migrate legacy plugins.",
"Some installed third party plugin(s) [plugin] are using the legacy plugin format and will no longer work in a future Kibana release. Please refer to https://ela.st/kibana-breaking-changes-8-0 for a list of breaking changes and https://ela.st/kibana-platform-migration for documentation on how to migrate legacy plugins.",
]
`);
});
Expand All @@ -65,7 +65,7 @@ describe('logLegacyThirdPartyPluginDeprecationWarning', () => {
expect(log.warn).toHaveBeenCalledTimes(1);
expect(log.warn.mock.calls[0]).toMatchInlineSnapshot(`
Array [
"Some installed third party plugin(s) [pluginA, pluginB, pluginC] are using the legacy plugin format and will no longer work in a future Kibana release. Please refer to https://www.elastic.co/guide/en/kibana/master/breaking-changes-8.0.html for a list of breaking changes and https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md for documentation on how to migrate legacy plugins.",
"Some installed third party plugin(s) [pluginA, pluginB, pluginC] are using the legacy plugin format and will no longer work in a future Kibana release. Please refer to https://ela.st/kibana-breaking-changes-8-0 for a list of breaking changes and https://ela.st/kibana-platform-migration for documentation on how to migrate legacy plugins.",
]
`);
});
Expand Down
7 changes: 4 additions & 3 deletions src/core/server/legacy/plugins/log_legacy_plugins_warning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import { LegacyPluginSpec } from '../types';

const internalPaths = ['/src/legacy/core_plugins', '/x-pack'];

const breakingChangesUrl =
'https://www.elastic.co/guide/en/kibana/master/breaking-changes-8.0.html';
const migrationGuideUrl = 'https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md';
// Use shortened URLs so destinations can be updated if/when documentation moves
// All platform team members have access to edit these
const breakingChangesUrl = 'https://ela.st/kibana-breaking-changes-8-0';
const migrationGuideUrl = 'https://ela.st/kibana-platform-migration';

export const logLegacyThirdPartyPluginDeprecationWarning = ({
specs,
Expand Down
6 changes: 4 additions & 2 deletions src/core/server/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import { of } from 'rxjs';
import { duration } from 'moment';
import { PluginInitializerContext, CoreSetup, CoreStart } from '.';
import { PluginInitializerContext, CoreSetup, CoreStart, StartServicesAccessor } from '.';
import { CspConfig } from './csp';
import { loggingServiceMock } from './logging/logging_service.mock';
import { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.mock';
Expand Down Expand Up @@ -100,7 +100,9 @@ function pluginInitializerContextMock<T>(config: T = {} as T) {
return mock;
}

type CoreSetupMockType = MockedKeys<CoreSetup> & jest.Mocked<Pick<CoreSetup, 'getStartServices'>>;
type CoreSetupMockType = MockedKeys<CoreSetup> & {
getStartServices: jest.MockedFunction<StartServicesAccessor<any, any>>;
};

function createCoreSetupMock({
pluginStartDeps = {},
Expand Down
1 change: 1 addition & 0 deletions src/core/server/saved_objects/mappings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export interface IndexMappingMeta {
*/
export interface SavedObjectsCoreFieldMapping {
type: string;
null_value?: number | boolean | string;
index?: boolean;
enabled?: boolean;
fields?: {
Expand Down
2 changes: 2 additions & 0 deletions src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1840,6 +1840,8 @@ export interface SavedObjectsCoreFieldMapping {
// (undocumented)
index?: boolean;
// (undocumented)
null_value?: number | boolean | string;
// (undocumented)
type: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ kibana_vars=(
xpack.security.session.idleTimeout
xpack.security.session.lifespan
xpack.security.loginAssistanceMessage
xpack.security.loginHelp
telemetry.allowChangingOptInStatus
telemetry.enabled
telemetry.optIn
Expand Down
1 change: 0 additions & 1 deletion src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export const TEMPORARILY_IGNORED_PATHS = [
'src/legacy/core_plugins/tile_map/public/__tests__/shadedCircleMarkers.png',
'src/legacy/core_plugins/tile_map/public/__tests__/shadedGeohashGrid.png',
'src/fixtures/config_upgrade_from_4.0.0_to_4.0.1-snapshot.json',
'src/legacy/core_plugins/vis_type_vislib/public/vislib/__tests__/lib/fixtures/mock_data/terms/_seriesMultiple.js',
'src/core/server/core_app/assets/favicons/android-chrome-192x192.png',
'src/core/server/core_app/assets/favicons/android-chrome-256x256.png',
'src/core/server/core_app/assets/favicons/android-chrome-512x512.png',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ import {
setData,
setSavedObjects,
setNotifications,
setKibanaMapFactory,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../../plugins/vis_type_vega/public/services';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { setInjectedVarFunc } from '../../../../../../plugins/maps_legacy/public/kibana_services';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { ServiceSettings } from '../../../../../../plugins/maps_legacy/public/map/service_settings';
import { getKibanaMapFactoryProvider } from '../../../../../../plugins/maps_legacy/public';

const THRESHOLD = 0.1;
const PIXEL_DIFF = 30;
Expand All @@ -77,6 +79,18 @@ describe('VegaVisualizations', () => {
let vegaVisualizationDependencies;
let vegaVisType;

const coreSetupMock = {
notifications: {
toasts: {},
},
uiSettings: {
get: () => {},
},
injectedMetadata: {
getInjectedVar: () => {},
},
};
setKibanaMapFactory(getKibanaMapFactoryProvider(coreSetupMock));
setInjectedVars({
emsTileLayerId: {},
enableExternalUrls: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
import _ from 'lodash';
import $ from 'jquery';

import { Vis } from '../../../vis';
import { Vis } from '../../../../../../plugins/vis_type_vislib/public/vislib/vis';

// TODO: Remove when converted to jest mocks
import {
ColorsService,
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
} from '../../../../../../../../plugins/charts/public/services';
import { ColorsService } from '../../../../../../plugins/charts/public/services';

const $visCanvas = $('<div>')
.attr('id', 'vislib-vis-fixtures')
Expand Down Expand Up @@ -72,17 +69,6 @@ const getDeps = () => {
};
};

export const getMockUiState = () => {
const map = new Map();

return (() => ({
get: (...args) => map.get(...args),
set: (...args) => map.set(...args),
setSilent: (...args) => map.set(...args),
on: () => undefined,
}))();
};

export function getVis(visLibParams, element) {
return new Vis(
element || $visCanvas.new(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import d3 from 'd3';
import _ from 'lodash';
import expect from '@kbn/expect';

import { ChartTitle } from '../../lib/chart_title';
import { VisConfig } from '../../lib/vis_config';
import { getMockUiState } from './fixtures/_vis_fixture';
import { ChartTitle } from '../../../../../../../plugins/vis_type_vislib/public/vislib/lib/chart_title';
import { VisConfig } from '../../../../../../../plugins/vis_type_vislib/public/vislib/lib/vis_config';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';

describe('Vislib ChartTitle Class Test Suite', function() {
let mockUiState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import d3 from 'd3';
import expect from '@kbn/expect';

// Data
import data from './fixtures/mock_data/date_histogram/_series';
import data from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mock_data/date_histogram/_series';

import { getVis, getMockUiState } from './fixtures/_vis_fixture';
import { getMockUiState } from '../../../../../../../plugins/vis_type_vislib/public/fixtures/mocks';
import { getVis } from '../_vis_fixture';

describe('Vislib Dispatch Class Test Suite', function() {
function destroyVis(vis) {
Expand Down
Loading

0 comments on commit bba789e

Please sign in to comment.