Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into feat/hosts-kp…
Browse files Browse the repository at this point in the history
…i-search-strategy
  • Loading branch information
patrykkopycinski committed Sep 21, 2020
2 parents 845f947 + ba8213c commit 6d81c7e
Show file tree
Hide file tree
Showing 46 changed files with 827 additions and 831 deletions.
6 changes: 6 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ which also contains the timelion APIs and backend, look at the vis_type_timelion
To integrate with the telemetry services for usage collection of your feature, there are 2 steps:
|{kib-repo}blob/{branch}/src/plugins/vis_default_editor/README.md[visDefaultEditor]
|The default editor is used in most primary visualizations, e.x. Area, Data table, Pie, etc.
It acts as a container for a particular visualization and options tabs. Contains the default "Data" tab in public/components/sidebar/data_tab.tsx.
The plugin exposes the static DefaultEditorController class to consume.
|{kib-repo}blob/{branch}/src/plugins/vis_type_markdown/README.md[visTypeMarkdown]
|The markdown visualization that can be used to place text panels on dashboards.
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/charts/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"version": "kibana",
"server": true,
"ui": true,
"requiredBundles": ["kibanaUtils", "kibanaReact", "data"]
"requiredBundles": ["visDefaultEditor"]
}
109 changes: 58 additions & 51 deletions src/plugins/console/server/lib/spec_definitions/js/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,58 +157,65 @@ export const mappings = (specService: SpecDefinitionsService) => {

// dates
format: {
// outer array required to for an array of string values
__one_of: [
...[
'date',
'date_time',
'date_time_no_millis',
'ordinal_date',
'ordinal_date_time',
'ordinal_date_time_no_millis',
'time',
'time_no_millis',
't_time',
't_time_no_millis',
'week_date',
'week_date_time',
'week_date_time_no_millis',
].map(function (s) {
return ['basic_' + s, 'strict_' + s];
}),
...[
'date',
'date_hour',
'date_hour_minute',
'date_hour_minute_second',
'date_hour_minute_second_fraction',
'date_hour_minute_second_millis',
'date_optional_time',
'date_time',
'date_time_no_millis',
'hour',
'hour_minute',
'hour_minute_second',
'hour_minute_second_fraction',
'hour_minute_second_millis',
'ordinal_date',
'ordinal_date_time',
'ordinal_date_time_no_millis',
'time',
'time_no_millis',
't_time',
't_time_no_millis',
'week_date',
'week_date_time',
'weekDateTimeNoMillis',
'week_year',
'weekyearWeek',
'weekyearWeekDay',
'year',
'year_month',
'year_month_day',
'epoch_millis',
'epoch_second',
],
[
...[
'date',
'date_time',
'date_time_no_millis',
'ordinal_date',
'ordinal_date_time',
'ordinal_date_time_no_millis',
'time',
'time_no_millis',
't_time',
't_time_no_millis',
'week_date',
'week_date_time',
'week_date_time_no_millis',
].flatMap(function (s) {
return ['basic_' + s, 'strict_' + s];
}),
...[
'date',
'date_hour',
'date_hour_minute',
'date_hour_minute_second',
'date_hour_minute_second_fraction',
'date_hour_minute_second_millis',
'date_optional_time',
'date_time',
'date_time_no_millis',
'hour',
'hour_minute',
'hour_minute_second',
'hour_minute_second_fraction',
'hour_minute_second_millis',
'ordinal_date',
'ordinal_date_time',
'ordinal_date_time_no_millis',
'time',
'time_no_millis',
't_time',
't_time_no_millis',
'week_date',
'week_date_time',
'weekDateTimeNoMillis',
'weekyear',
'strict_weekyear',
'weekyear_week',
'strict_weekyear_week',
'strict_date_optional_time_nanos',
'weekyear_week_day',
'strict_weekyear_week_day',
'year',
'year_month',
'year_month_day',
'epoch_millis',
'epoch_second',
],
].sort(),
],
},

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/input_control_vis/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"kibanaVersion": "kibana",
"server": true,
"ui": true,
"requiredPlugins": ["data", "expressions", "visualizations"],
"requiredPlugins": ["data", "expressions", "visualizations", "visDefaultEditor"],
"requiredBundles": ["kibanaReact"]
}
4 changes: 2 additions & 2 deletions src/plugins/region_map/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"requiredBundles": [
"kibanaUtils",
"kibanaReact",
"charts"
"charts",
"visDefaultEditor"
]
}
4 changes: 2 additions & 2 deletions src/plugins/tile_map/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"requiredBundles": [
"kibanaUtils",
"kibanaReact",
"charts"
"charts",
"visDefaultEditor"
]
}
6 changes: 6 additions & 0 deletions src/plugins/vis_default_editor/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "visDefaultEditor",
"version": "kibana",
"ui": true,
"requiredBundles": ["kibanaUtils", "kibanaReact", "data"]
}
8 changes: 8 additions & 0 deletions src/plugins/vis_default_editor/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,11 @@ export * from './editor_size';
export * from './vis_options_props';
export * from './utils';
export { ISchemas, Schemas, Schema } from './schemas';

/** dummy plugin, we just want visDefaultEditor to have its own bundle */
export function plugin() {
return new (class VisDefaultEditor {
setup() {}
start() {}
})();
}
2 changes: 1 addition & 1 deletion src/plugins/vis_type_markdown/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"ui": true,
"server": true,
"requiredPlugins": ["expressions", "visualizations"],
"requiredBundles": ["kibanaUtils", "kibanaReact", "data", "charts", "visualizations", "expressions"]
"requiredBundles": ["kibanaUtils", "kibanaReact", "charts", "visualizations", "expressions", "visDefaultEditor"]
}
2 changes: 1 addition & 1 deletion src/plugins/vis_type_metric/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"server": true,
"ui": true,
"requiredPlugins": ["data", "visualizations", "charts", "expressions"],
"requiredBundles": ["kibanaUtils", "kibanaReact"]
"requiredBundles": ["kibanaUtils", "visDefaultEditor"]
}
4 changes: 2 additions & 2 deletions src/plugins/vis_type_table/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
],
"requiredBundles": [
"kibanaUtils",
"kibanaReact",
"share",
"charts"
"charts",
"visDefaultEditor"
]
}
2 changes: 1 addition & 1 deletion src/plugins/vis_type_tagcloud/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"ui": true,
"server": true,
"requiredPlugins": ["data", "expressions", "visualizations", "charts"],
"requiredBundles": ["kibanaUtils", "kibanaReact"]
"requiredBundles": ["kibanaUtils", "kibanaReact", "visDefaultEditor"]
}
2 changes: 1 addition & 1 deletion src/plugins/vis_type_timelion/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"server": true,
"ui": true,
"requiredPlugins": ["visualizations", "data", "expressions"],
"requiredBundles": ["kibanaUtils", "kibanaReact"]
"requiredBundles": ["kibanaUtils", "kibanaReact", "visDefaultEditor"]
}
2 changes: 1 addition & 1 deletion src/plugins/vis_type_vega/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"server": true,
"ui": true,
"requiredPlugins": ["data", "visualizations", "mapsLegacy", "expressions", "inspector"],
"requiredBundles": ["kibanaUtils", "kibanaReact"]
"requiredBundles": ["kibanaUtils", "kibanaReact", "visDefaultEditor"]
}
2 changes: 1 addition & 1 deletion src/plugins/vis_type_vislib/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"ui": true,
"requiredPlugins": ["charts", "data", "expressions", "visualizations", "kibanaLegacy"],
"optionalPlugins": ["visTypeXy"],
"requiredBundles": ["kibanaUtils", "kibanaReact"]
"requiredBundles": ["kibanaUtils", "visDefaultEditor"]
}
3 changes: 2 additions & 1 deletion src/plugins/visualize/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"kibanaUtils",
"kibanaReact",
"home",
"discover"
"discover",
"visDefaultEditor"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function JobsList({ data, status, onAddEnvironments }: Props) {
defaultMessage="To add anomaly detection to a new environment, create a machine learning job. Existing machine learning jobs can be managed in {mlJobsLink}."
values={{
mlJobsLink: (
<MLLink path="jobs">
<MLLink path="/jobs">
{i18n.translate(
'xpack.apm.settings.anomalyDetection.jobList.mlDescriptionText.mlJobsLinkText',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ test('MLLink produces the correct URL', async () => {
);

expect(href).toMatchInlineSnapshot(
`"/basepath/app/ml#/some/path?_g=(ml:(jobIds:!(something)),refreshInterval:(pause:!t,value:0),time:(from:now-5h,to:now-2h))"`
`"/basepath/app/ml#/some/path?_g=(ml:(jobIds:!(something)),refreshInterval:(pause:!t,value:0),time:(from:now-5h,to:now-2h))&mlManagement=(groupIds:!(apm))"`
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export function MLLink({ children, path = '', query = {}, external }: Props) {

const href = url.format({
pathname: core.http.basePath.prepend('/app/ml'),
hash: `${path}?_g=${rison.encode(risonQuery as RisonValue)}`,
hash: `${path}?_g=${rison.encode(
risonQuery as RisonValue
)}&mlManagement=${rison.encode({ groupIds: ['apm'] })}`,
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export async function aggregateLatencyMetrics() {
return;
}

const response = await destClient?.bulk({
const response = await (destClient as any)?.bulk({
refresh: 'wait_for',
body: flatten(
docs.map((doc) => [
Expand Down
37 changes: 37 additions & 0 deletions x-pack/plugins/apm/scripts/eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* 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.
*/
//eslint-disable-next-line import/no-extraneous-dependencies
const { CLIEngine } = require('eslint');
const { resolve } = require('path');
//eslint-disable-next-line import/no-extraneous-dependencies
const { argv } = require('yargs');

async function run() {
const fix = !!argv.fix;

const engine = new CLIEngine({
fix,
cache: true,
extensions: ['.js', '.jsx', '.ts', '.tsx'],
});

const report = engine.executeOnFiles(resolve(__dirname, '..'));

const formatter = engine.getFormatter();

return formatter(report.results);
}

run()
.then((text) => {
//eslint-disable-next-line no-console
console.log(text);
process.exit(0);
})
.catch((err) => {
console.error(err);
process.exit(1);
});
25 changes: 25 additions & 0 deletions x-pack/plugins/apm/scripts/jest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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.
*/
// eslint-disable-next-line import/no-extraneous-dependencies
require('@babel/register')({
extensions: ['.js'],
plugins: [],
presets: [
'@babel/typescript',
['@babel/preset-env', { targets: { node: 'current' } }],
],
});

// eslint-disable-next-line import/no-extraneous-dependencies
const { run } = require('jest');

process.env.NODE_ENV = process.env.NODE_ENV || 'test';

const config = require('../jest.config.js');

const argv = [...process.argv.slice(2), '--config', JSON.stringify(config)];

run(argv);
Loading

0 comments on commit 6d81c7e

Please sign in to comment.