Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 64080-no-data
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Apr 24, 2020
2 parents 1c66505 + cbf006c commit 5dfae65
Show file tree
Hide file tree
Showing 625 changed files with 7,678 additions and 8,737 deletions.
52 changes: 37 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,31 +185,40 @@ module.exports = {
zones: [
{
target: [
'src/legacy/**/*',
'x-pack/**/*',
'!x-pack/**/*.test.*',
'!x-pack/test/**/*',
'(src|x-pack)/legacy/**/*',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'src/core/(public|server)/**/*',
'examples/**/*',
],
from: [
'src/core/public/**/*',
'!src/core/public/index.ts',
'!src/core/public/mocks.ts',
'!src/core/public/*.test.mocks.ts',
'!src/core/public/index.ts', // relative import
'!src/core/public/mocks{,.ts}',
'!src/core/server/types{,.ts}',
'!src/core/public/utils/**/*',
'!src/core/public/*.test.mocks{,.ts}',

'src/core/server/**/*',
'!src/core/server/index.ts',
'!src/core/server/mocks.ts',
'!src/core/server/types.ts',
'!src/core/server/test_utils.ts',
'!src/core/server/index.ts', // relative import
'!src/core/server/mocks{,.ts}',
'!src/core/server/types{,.ts}',
'!src/core/server/test_utils',
// for absolute imports until fixed in
// https://github.com/elastic/kibana/issues/36096
'!src/core/server/types',
'!src/core/server/*.test.mocks.ts',

'!src/core/server/*.test.mocks{,.ts}',
],
allowSameFolder: true,
errorMessage:
'Plugins may only import from top-level public and server modules in core.',
},
{
target: [
'(src|x-pack)/legacy/**/*',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'examples/**/*',
'!(src|x-pack)/**/*.test.*',
'!(x-pack/)?test/**/*',
],
from: [
'(src|x-pack)/plugins/**/(public|server)/**/*',
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,ts,tsx}',
],
Expand Down Expand Up @@ -730,6 +739,19 @@ module.exports = {
},
},

/**
* Alerting Services overrides
*/
{
// typescript only for front and back end
files: [
'x-pack/{,legacy/}plugins/{alerting,alerting_builtins,actions,task_manager,event_log}/**/*.{ts,tsx}',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
},
},

/**
* Lens overrides
*/
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/src/plugins/vis_type_timelion/ @elastic/kibana-app
/src/plugins/dashboard/ @elastic/kibana-app
/src/plugins/discover/ @elastic/kibana-app
/src/plugins/input_control_vis/ @elastic/kibana-app
/src/plugins/visualize/ @elastic/kibana-app
/src/plugins/vis_type_timeseries/ @elastic/kibana-app
/src/plugins/vis_type_metric/ @elastic/kibana-app
Expand Down
4 changes: 2 additions & 2 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"esUi": "src/plugins/es_ui_shared",
"devTools": "src/plugins/dev_tools",
"expressions": "src/plugins/expressions",
"inputControl": "src/legacy/core_plugins/input_control_vis",
"inputControl": "src/plugins/input_control_vis",
"inspector": "src/plugins/inspector",
"inspectorViews": "src/legacy/core_plugins/inspector_views",
"interpreter": "src/legacy/core_plugins/interpreter",
Expand Down Expand Up @@ -51,7 +51,7 @@
"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"],
"visTypeVega": "src/legacy/core_plugins/vis_type_vega",
"visTypeVega": "src/plugins/vis_type_vega",
"visTypeVislib": "src/legacy/core_plugins/vis_type_vislib",
"visTypeXy": "src/legacy/core_plugins/vis_type_xy",
"visualizations": "src/plugins/visualizations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<b>Signature:</b>

```typescript
baseFormattersPublic: (import("../../common").IFieldFormatType | typeof DateFormat)[]
baseFormattersPublic: (import("../../common").FieldFormatInstanceType | typeof DateFormat)[]
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
```typescript
setup(core: CoreSetup, { usageCollection }: DataPluginSetupDependencies): {
fieldFormats: {
register: (customFieldFormat: import("../common").IFieldFormatType) => number;
register: (customFieldFormat: import("../common").FieldFormatInstanceType) => number;
};
search: ISearchSetup;
};
Expand All @@ -26,7 +26,7 @@ setup(core: CoreSetup, { usageCollection }: DataPluginSetupDependencies): {

`{
fieldFormats: {
register: (customFieldFormat: import("../common").IFieldFormatType) => number;
register: (customFieldFormat: import("../common").FieldFormatInstanceType) => number;
};
search: ISearchSetup;
}`
Expand Down
Binary file added docs/images/report-automate-csv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/report-automate-pdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 26 additions & 16 deletions docs/user/reporting/automating-report-generation.asciidoc
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
[role="xpack"]
[[automating-report-generation]]
== Automating report generation
You can automatically generate reports with {watcher}, or by submitting
HTTP `POST` requests from a script.
Automatically generate PDF and CSV reports by submitting HTTP `POST` requests using {watcher} or a script.

include::report-intervals.asciidoc[]

[float]
=== Get the POST URL
=== Create a POST URL

Generating a report either through {watcher} or a script requires capturing the **POST
URL**, which is the URL to queue a report for generation.
Create the POST
URL that triggers a report to generate.

To get the URL for triggering PDF report generation during a given time period:
To create the POST URL for PDF reports:

. Load the saved object in *Visualize* or *Dashboard*.
. To specify a relative or absolute time period, use the time filter.
. In the {kib} toolbar, click *Share*.
. Select *PDF Reports*.
. Click **Copy POST URL**.
. Go to *Visualize* or *Dashboard*, then open the visualization or dashboard.
+
To specify a relative or absolute time period, use the time filter.

To get the URL for triggering CSV report generation during a given time period:
. From the {kib} toolbar, click *Share*, then select *PDF Reports*.

. Click *Copy POST URL*.
+
[role="screenshot"]
image::images/report-automate-pdf.png[Generate Visualize and Dashboard reports]


To create the POST URL for CSV reports:

. Load the saved search in *Discover*.
. To specify a relative or absolute time period, use the time filter.
. In the {kib} toolbar, click *Share*.
. Select *CSV Reports*.
. Click **Copy POST URL**.
+
To specify a relative or absolute time period, use the time filter.

. From the {kib} toolbar, click *Share*, then select *CSV Reports*.

. Click *Copy POST URL*.
+
[role="screenshot"]
image::images/report-automate-csv.png[Generate Discover reports]

[float]
=== Use Watcher
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"glob-all": "^3.2.1",
"globby": "^8.0.1",
"h2o2": "^8.1.2",
"handlebars": "4.5.3",
"handlebars": "4.7.6",
"hapi": "^17.5.3",
"hapi-auth-cookie": "^9.0.0",
"history": "^4.9.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-filter-imports": "^3.0.0",
"babel-plugin-styled-components": "^1.10.6",
"babel-plugin-transform-define": "^1.3.1"
"babel-plugin-transform-define": "^1.3.1",
"babel-plugin-transform-imports": "^2.0.0"
}
}
19 changes: 19 additions & 0 deletions packages/kbn-babel-preset/webpack_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,24 @@ module.exports = () => {
},
],
],
// NOTE: we can enable this by default for everything as soon as we only have one instance
// of lodash across the entire project. For now we are just enabling it for siem
// as they are extensively using the lodash v4
overrides: [
{
test: [/x-pack[\/\\]legacy[\/\\]plugins[\/\\]siem[\/\\]public/],
plugins: [
[
require.resolve('babel-plugin-transform-imports'),
{
'lodash/?(((\\w*)?/?)*)': {
transform: 'lodash/${1}/${member}',
preventFullImport: false,
},
},
],
],
},
],
};
};
5 changes: 4 additions & 1 deletion packages/kbn-optimizer/src/worker/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) {

module: {
// no parse rules for a few known large packages which have no require() statements
// or which have require() statements that should be ignored because the file is
// already bundled with all its necessary depedencies
noParse: [
/[\///]node_modules[\///]elasticsearch-browser[\///]/,
/[\///]node_modules[\///]lodash[\///]index\.js/,
/[\///]node_modules[\///]lodash[\///]index\.js$/,
/[\///]node_modules[\///]vega-lib[\///]build[\///]vega\.js$/,
],

rules: [
Expand Down
1 change: 1 addition & 0 deletions src/core/public/http/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
*/

export { HttpService } from './http_service';
export { HttpFetchError } from './http_fetch_error';
export * from './types';
1 change: 1 addition & 0 deletions src/core/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export {
export {
HttpHeadersInit,
HttpRequestInit,
HttpFetchError,
HttpFetchOptions,
HttpFetchOptionsWithPath,
HttpFetchQuery,
Expand Down
17 changes: 17 additions & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,23 @@ export type HandlerFunction<T extends object> = (context: T, ...args: any[]) =>
// @public
export type HandlerParameters<T extends HandlerFunction<any>> = T extends (context: any, ...args: infer U) => any ? U : never;

// @internal (undocumented)
export class HttpFetchError extends Error implements IHttpFetchError {
constructor(message: string, name: string, request: Request, response?: Response | undefined, body?: any);
// (undocumented)
readonly body?: any;
// (undocumented)
readonly name: string;
// (undocumented)
readonly req: Request;
// (undocumented)
readonly request: Request;
// (undocumented)
readonly res?: Response;
// (undocumented)
readonly response?: Response | undefined;
}

// @public
export interface HttpFetchOptions extends HttpRequestInit {
asResponse?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/core/server/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export { elasticsearchServiceMock } from './elasticsearch/elasticsearch_service.
export { httpServiceMock } from './http/http_service.mock';
export { loggingServiceMock } from './logging/logging_service.mock';
export { savedObjectsRepositoryMock } from './saved_objects/service/lib/repository.mock';
export { savedObjectsServiceMock } from './saved_objects/saved_objects_service.mock';
export { typeRegistryMock as savedObjectsTypeRegistryMock } from './saved_objects/saved_objects_type_registry.mock';
export { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock';
export { metricsServiceMock } from './metrics/metrics_service.mock';
Expand Down
1 change: 1 addition & 0 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default {
'<rootDir>/src/dev/jest/mocks/file_mock.js',
'\\.(css|less|scss)$': '<rootDir>/src/dev/jest/mocks/style_mock.js',
'\\.ace\\.worker.js$': '<rootDir>/src/dev/jest/mocks/ace_worker_module_mock.js',
'^(!!)?file-loader!': '<rootDir>/src/dev/jest/mocks/file_mock.js',
},
setupFiles: [
'<rootDir>/src/dev/jest/setup/babel_polyfill.js',
Expand Down
2 changes: 0 additions & 2 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ export const TEMPORARILY_IGNORED_PATHS = [
'webpackShims/elasticsearch-browser.js',
'webpackShims/moment-timezone.js',
'webpackShims/ui-bootstrap.js',
'x-pack/legacy/plugins/graph/public/graphClientWorkspace.js',
'x-pack/legacy/plugins/graph/public/angular-venn-simple.js',
'x-pack/legacy/plugins/index_management/public/lib/editSettings.js',
'x-pack/legacy/plugins/license_management/public/store/reducers/licenseManagement.js',
'x-pack/legacy/plugins/monitoring/public/components/sparkline/__mocks__/plugins/xpack_main/jquery_flot.js',
Expand Down
44 changes: 0 additions & 44 deletions src/legacy/core_plugins/input_control_vis/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/legacy/core_plugins/input_control_vis/package.json

This file was deleted.

Loading

0 comments on commit 5dfae65

Please sign in to comment.