diff --git a/.backportrc.json b/.backportrc.json index 731f49183dba5..0894909d2aac4 100644 --- a/.backportrc.json +++ b/.backportrc.json @@ -3,6 +3,7 @@ "targetBranchChoices": [ { "name": "master", "checked": true }, { "name": "7.x", "checked": true }, + "7.8", "7.7", "7.6", "7.5", diff --git a/.eslintignore b/.eslintignore index 53b3d80720439..362b3e42d48e5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -26,10 +26,10 @@ target /src/plugins/vis_type_timelion/public/webpackShims/jquery.flot.* /x-pack/legacy/plugins/**/__tests__/fixtures/** /x-pack/plugins/apm/e2e/cypress/**/snapshots.js -/x-pack/legacy/plugins/canvas/canvas_plugin -/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts -/x-pack/legacy/plugins/canvas/shareable_runtime/build -/x-pack/legacy/plugins/canvas/storybook +/x-pack/plugins/canvas/canvas_plugin +/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts +/x-pack/plugins/canvas/shareable_runtime/build +/x-pack/plugins/canvas/storybook /x-pack/plugins/monitoring/public/lib/jquery_flot /x-pack/legacy/plugins/infra/common/graphql/types.ts /x-pack/legacy/plugins/infra/public/graphql/types.ts diff --git a/.eslintrc.js b/.eslintrc.js index 9e3ab7cef8002..dde0ce010d4d4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -89,7 +89,7 @@ module.exports = { }, }, { - files: ['x-pack/legacy/plugins/canvas/**/*.{js,ts,tsx}'], + files: ['x-pack/plugins/canvas/**/*.{js,ts,tsx}'], rules: { 'react-hooks/exhaustive-deps': 'off', 'jsx-a11y/click-events-have-key-events': 'off', @@ -193,6 +193,11 @@ module.exports = { { basePath: __dirname, zones: [ + { + target: ['(src|x-pack)/**/*', '!src/core/**/*'], + from: ['src/core/utils/**/*'], + errorMessage: `Plugins may only import from src/core/server and src/core/public.`, + }, { target: [ '(src|x-pack)/legacy/**/*', @@ -888,7 +893,7 @@ module.exports = { * Canvas overrides */ { - files: ['x-pack/legacy/plugins/canvas/**/*.js'], + files: ['x-pack/plugins/canvas/**/*.js'], rules: { radix: 'error', @@ -932,12 +937,12 @@ module.exports = { }, { files: [ - 'x-pack/legacy/plugins/canvas/gulpfile.js', - 'x-pack/legacy/plugins/canvas/scripts/*.js', - 'x-pack/legacy/plugins/canvas/tasks/*.js', - 'x-pack/legacy/plugins/canvas/tasks/**/*.js', - 'x-pack/legacy/plugins/canvas/__tests__/**/*.js', - 'x-pack/legacy/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js', + 'x-pack/plugins/canvas/gulpfile.js', + 'x-pack/plugins/canvas/scripts/*.js', + 'x-pack/plugins/canvas/tasks/*.js', + 'x-pack/plugins/canvas/tasks/**/*.js', + 'x-pack/plugins/canvas/__tests__/**/*.js', + 'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js', ], rules: { 'import/no-extraneous-dependencies': [ @@ -950,7 +955,7 @@ module.exports = { }, }, { - files: ['x-pack/legacy/plugins/canvas/canvas_plugin_src/**/*.js'], + files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'], globals: { canvas: true, $: true }, rules: { 'import/no-unresolved': [ @@ -962,13 +967,13 @@ module.exports = { }, }, { - files: ['x-pack/legacy/plugins/canvas/public/**/*.js'], + files: ['x-pack/plugins/canvas/public/**/*.js'], env: { browser: true, }, }, { - files: ['x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/**/*.js'], + files: ['x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/**/*.js'], env: { jquery: true, }, diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 280cb6fbd1b1d..638e86ef375fe 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -77,7 +77,7 @@ /x-pack/legacy/plugins/beats_management/ @elastic/beats # Canvas -/x-pack/legacy/plugins/canvas/ @elastic/kibana-canvas +/x-pack/plugins/canvas/ @elastic/kibana-canvas # Observability UIs /x-pack/legacy/plugins/infra/ @elastic/logs-metrics-ui diff --git a/.sass-lint.yml b/.sass-lint.yml index 44b4d49384136..c8985108dabf2 100644 --- a/.sass-lint.yml +++ b/.sass-lint.yml @@ -5,14 +5,14 @@ files: - '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/canvas/**/*.s+(a|c)ss' - 'x-pack/plugins/triggers_actions_ui/**/*.s+(a|c)ss' - 'x-pack/plugins/lens/**/*.s+(a|c)ss' - 'x-pack/plugins/cross_cluster_replication/**/*.s+(a|c)ss' - 'x-pack/legacy/plugins/maps/**/*.s+(a|c)ss' - 'x-pack/plugins/maps/**/*.s+(a|c)ss' ignore: - - 'x-pack/legacy/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss' + - 'x-pack/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss' rules: quotes: - 2 diff --git a/docs/apm/spans.asciidoc b/docs/apm/spans.asciidoc index 2eed339160fc4..c35fb115d2db4 100644 --- a/docs/apm/spans.asciidoc +++ b/docs/apm/spans.asciidoc @@ -1,38 +1,53 @@ [role="xpack"] [[spans]] -=== Span timeline +=== Trace sample timeline -TIP: A {apm-overview-ref-v}/transaction-spans.html[span] is the duration of a single event. -Spans are automatically captured by APM agents, and you can also define custom spans. -Each span has a type and is defined by a different color in the timeline/waterfall visualization. - -The span timeline visualization is a bird's-eye view of what your application was doing while it was trying to respond to the request that came in. +The trace sample timeline visualization is a bird's-eye view of what your application was doing while it was trying to respond to a request. This makes it useful for visualizing where the selected transaction spent most of its time. [role="screenshot"] image::apm/images/apm-transaction-sample.png[Example of distributed trace colors in the APM app in Kibana] View a span in detail by clicking on it in the timeline waterfall. -When you click on an SQL Select database query, +For example, when you click on an SQL Select database query, the information displayed includes the actual SQL that was executed, how long it took, and the percentage of the trace's total time. You also get a stack trace, which shows the SQL query in your code. Finally, APM knows which files are your code and which are just modules or libraries that you've installed. These library frames will be minimized by default in order to show you the most relevant stack trace. +TIP: A {apm-overview-ref-v}/transaction-spans.html[span] is the duration of a single event. +Spans are automatically captured by APM agents, and you can also define custom spans. +Each span has a type and is defined by a different color in the timeline/waterfall visualization. + [role="screenshot"] image::apm/images/apm-span-detail.png[Example view of a span detail in the APM app in Kibana] -If your span timeline is colorful, it's indicative of a <<distributed-tracing,distributed trace>>. +[float] +[[distributed-tracing]] +==== Distributed tracing + +If your trace sample timeline is colorful, it's indicative of a distributed trace. Services in a distributed trace are separated by color and listed in the order they occur. [role="screenshot"] image::apm/images/apm-services-trace.png[Example of distributed trace colors in the APM app in Kibana] -Don't forget; a distributed trace includes more than one transaction. +As application architectures are shifting from monolithic to more distributed, service-based architectures, +distributed tracing has become a crucial feature of modern application performance monitoring. +It allows you to trace requests through your service architecture automatically, and visualize those traces in one single view in the APM app. +From initial web requests to your front-end service, to queries made to your back-end services, +this makes finding possible bottlenecks throughout your application much easier and faster. + +[role="screenshot"] +image::apm/images/apm-distributed-tracing.png[Example view of the distributed tracing in APM app in Kibana] + +Don't forget; by definition, a distributed trace includes more than one transaction. When viewing these distributed traces in the timeline waterfall, you'll see this image:apm/images/transaction-icon.png[APM icon] icon, which indicates the next transaction in the trace. These transactions can be expanded and viewed in detail by clicking on them. After exploring these traces, you can return to the full trace by clicking *View full trace*. + +TIP: Distributed tracing is supported by all APM agents, and there's no additional configuration needed. diff --git a/docs/apm/traces.asciidoc b/docs/apm/traces.asciidoc index 8eef3d9bed4db..52b4b618de466 100644 --- a/docs/apm/traces.asciidoc +++ b/docs/apm/traces.asciidoc @@ -4,7 +4,7 @@ TIP: Traces link together related transactions to show an end-to-end performance of how a request was served and which services were part of it. -In addition to the Traces overview, you can view your application traces in the <<spans,span timeline waterfall>>. +In addition to the Traces overview, you can view your application traces in the <<spans,trace sample timeline waterfall>>. The *Traces* overview displays the entry transaction for all traces in your application. If you're using <<distributed-tracing>>, this view is key to finding the critical paths within your application. @@ -17,25 +17,3 @@ If there's a particular endpoint you're worried about, you can click on it to vi [role="screenshot"] image::apm/images/apm-traces.png[Example view of the Traces overview in APM app in Kibana] - -[float] -[[distributed-tracing]] -==== Distributed tracing - -Elastic APM supports distributed tracing. -Distributed tracing is a key feature of modern application performance monitoring as application architectures are shifting from monolithic to more distributed, -service-based architectures. - -Distributed tracing allows APM users to automatically trace requests all the way through the service architecture, -and visualize those traces in one single view in the APM app. -This is accomplished by tracing all of the requests, from the initial web request to your front-end service, -to queries made to your back-end services. -This makes finding possible bottlenecks throughout your application much easier and faster. - -By definition, a distributed trace includes more than one transaction. -You can use the <<spans,span timeline visualization>> to view a waterfall display of all of the transactions from individual services that are connected in a trace. - -[role="screenshot"] -image::apm/images/apm-distributed-tracing.png[Example view of the distributed tracing in APM app in Kibana] - -TIP: Distributed tracing is supported by all APM agents, and there's no additional configuration needed. \ No newline at end of file diff --git a/docs/apm/transactions.asciidoc b/docs/apm/transactions.asciidoc index 2e1022e6d684c..8012c9108ca5e 100644 --- a/docs/apm/transactions.asciidoc +++ b/docs/apm/transactions.asciidoc @@ -95,7 +95,7 @@ It's the requests on the right, the ones taking longer than average, that we pro When you select one of these buckets, you're presented with up to ten trace samples. -Each sample has a span timeline waterfall that shows what a typical request in that bucket was doing. +Each sample has a trace timeline waterfall that shows what a typical request in that bucket was doing. By investigating this timeline waterfall, we can hopefully determine _why_ this request was slow and then implement a fix. [role="screenshot"] diff --git a/docs/development/core/public/kibana-plugin-core-public.appcategory.id.md b/docs/development/core/public/kibana-plugin-core-public.appcategory.id.md new file mode 100644 index 0000000000000..0342a1d9ee95b --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.appcategory.id.md @@ -0,0 +1,13 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [AppCategory](./kibana-plugin-core-public.appcategory.md) > [id](./kibana-plugin-core-public.appcategory.id.md) + +## AppCategory.id property + +Unique identifier for the categories + +<b>Signature:</b> + +```typescript +id: string; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.appcategory.md b/docs/development/core/public/kibana-plugin-core-public.appcategory.md index b115baa1be1a3..d91727a1bbf29 100644 --- a/docs/development/core/public/kibana-plugin-core-public.appcategory.md +++ b/docs/development/core/public/kibana-plugin-core-public.appcategory.md @@ -18,6 +18,7 @@ export interface AppCategory | --- | --- | --- | | [ariaLabel](./kibana-plugin-core-public.appcategory.arialabel.md) | <code>string</code> | If the visual label isn't appropriate for screen readers, can override it here | | [euiIconType](./kibana-plugin-core-public.appcategory.euiicontype.md) | <code>string</code> | Define an icon to be used for the category If the category is only 1 item, and no icon is defined, will default to the product icon Defaults to initials if no icon is defined | +| [id](./kibana-plugin-core-public.appcategory.id.md) | <code>string</code> | Unique identifier for the categories | | [label](./kibana-plugin-core-public.appcategory.label.md) | <code>string</code> | Label used for cateogry name. Also used as aria-label if one isn't set. | | [order](./kibana-plugin-core-public.appcategory.order.md) | <code>number</code> | The order that categories will be sorted in Prefer large steps between categories to allow for further editing (Default categories are in steps of 1000) | diff --git a/docs/development/core/public/kibana-plugin-core-public.assertnever.md b/docs/development/core/public/kibana-plugin-core-public.assertnever.md new file mode 100644 index 0000000000000..8fefd4450d49b --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.assertnever.md @@ -0,0 +1,24 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [assertNever](./kibana-plugin-core-public.assertnever.md) + +## assertNever() function + +Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking + +<b>Signature:</b> + +```typescript +export declare function assertNever(x: never): never; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| x | <code>never</code> | | + +<b>Returns:</b> + +`never` + diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.getnavtype_.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.getnavtype_.md new file mode 100644 index 0000000000000..09864be43996d --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.getnavtype_.md @@ -0,0 +1,17 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [ChromeStart](./kibana-plugin-core-public.chromestart.md) > [getNavType$](./kibana-plugin-core-public.chromestart.getnavtype_.md) + +## ChromeStart.getNavType$() method + +Get the navigation type TODO \#64541 Can delete + +<b>Signature:</b> + +```typescript +getNavType$(): Observable<NavType>; +``` +<b>Returns:</b> + +`Observable<NavType>` + diff --git a/docs/development/core/public/kibana-plugin-core-public.chromestart.md b/docs/development/core/public/kibana-plugin-core-public.chromestart.md index c179e089d7cfd..b4eadc93fe78d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.chromestart.md +++ b/docs/development/core/public/kibana-plugin-core-public.chromestart.md @@ -58,6 +58,7 @@ core.chrome.setHelpExtension(elem => { | [getHelpExtension$()](./kibana-plugin-core-public.chromestart.gethelpextension_.md) | Get an observable of the current custom help conttent | | [getIsNavDrawerLocked$()](./kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md) | Get an observable of the current locked state of the nav drawer. | | [getIsVisible$()](./kibana-plugin-core-public.chromestart.getisvisible_.md) | Get an observable of the current visibility state of the chrome. | +| [getNavType$()](./kibana-plugin-core-public.chromestart.getnavtype_.md) | Get the navigation type TODO \#64541 Can delete | | [removeApplicationClass(className)](./kibana-plugin-core-public.chromestart.removeapplicationclass.md) | Remove a className added with <code>addApplicationClass()</code>. If className is unknown it is ignored. | | [setAppTitle(appTitle)](./kibana-plugin-core-public.chromestart.setapptitle.md) | Sets the current app's title | | [setBadge(badge)](./kibana-plugin-core-public.chromestart.setbadge.md) | Override the current badge | diff --git a/docs/development/core/public/kibana-plugin-core-public.deepfreeze.md b/docs/development/core/public/kibana-plugin-core-public.deepfreeze.md new file mode 100644 index 0000000000000..7c879b659a852 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.deepfreeze.md @@ -0,0 +1,24 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [deepFreeze](./kibana-plugin-core-public.deepfreeze.md) + +## deepFreeze() function + +Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively + +<b>Signature:</b> + +```typescript +export declare function deepFreeze<T extends Freezable>(object: T): RecursiveReadonly<T>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| object | <code>T</code> | | + +<b>Returns:</b> + +`RecursiveReadonly<T>` + diff --git a/docs/development/core/public/kibana-plugin-core-public.freezable.md b/docs/development/core/public/kibana-plugin-core-public.freezable.md new file mode 100644 index 0000000000000..fee87dde25c28 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.freezable.md @@ -0,0 +1,14 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [Freezable](./kibana-plugin-core-public.freezable.md) + +## Freezable type + + +<b>Signature:</b> + +```typescript +export declare type Freezable = { + [k: string]: any; +} | any[]; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.getflattenedobject.md b/docs/development/core/public/kibana-plugin-core-public.getflattenedobject.md new file mode 100644 index 0000000000000..3ef9b6bf703eb --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.getflattenedobject.md @@ -0,0 +1,30 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [getFlattenedObject](./kibana-plugin-core-public.getflattenedobject.md) + +## getFlattenedObject() function + +Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from `rootValue`<!-- -->. + +example: getFlattenedObject(<!-- -->{ a: { b: 1, c: \[2,3\] } }<!-- -->) // =<!-- -->> { 'a.b': 1, 'a.c': \[2,3\] } + +<b>Signature:</b> + +```typescript +export declare function getFlattenedObject(rootValue: Record<string, any>): { + [key: string]: any; +}; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| rootValue | <code>Record<string, any></code> | | + +<b>Returns:</b> + +`{ + [key: string]: any; +}` + diff --git a/docs/development/core/public/kibana-plugin-core-public.isrelativeurl.md b/docs/development/core/public/kibana-plugin-core-public.isrelativeurl.md new file mode 100644 index 0000000000000..3c2ffa6340a97 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.isrelativeurl.md @@ -0,0 +1,24 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [isRelativeUrl](./kibana-plugin-core-public.isrelativeurl.md) + +## isRelativeUrl() function + +Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\* + +<b>Signature:</b> + +```typescript +export declare function isRelativeUrl(candidatePath: string): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| candidatePath | <code>string</code> | | + +<b>Returns:</b> + +`boolean` + diff --git a/docs/development/core/public/kibana-plugin-core-public.md b/docs/development/core/public/kibana-plugin-core-public.md index adc87de2b9e7e..eafc81447ee03 100644 --- a/docs/development/core/public/kibana-plugin-core-public.md +++ b/docs/development/core/public/kibana-plugin-core-public.md @@ -27,6 +27,16 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- --> | [AppNavLinkStatus](./kibana-plugin-core-public.appnavlinkstatus.md) | Status of the application's navLink. | | [AppStatus](./kibana-plugin-core-public.appstatus.md) | Accessibility status of an application. | +## Functions + +| Function | Description | +| --- | --- | +| [assertNever(x)](./kibana-plugin-core-public.assertnever.md) | Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking | +| [deepFreeze(object)](./kibana-plugin-core-public.deepfreeze.md) | Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively | +| [getFlattenedObject(rootValue)](./kibana-plugin-core-public.getflattenedobject.md) | Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from <code>rootValue</code>.<!-- -->example: getFlattenedObject(<!-- -->{ a: { b: 1, c: \[2,3\] } }<!-- -->) // =<!-- -->> { 'a.b': 1, 'a.c': \[2,3\] } | +| [isRelativeUrl(candidatePath)](./kibana-plugin-core-public.isrelativeurl.md) | Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\* | +| [modifyUrl(url, urlModifier)](./kibana-plugin-core-public.modifyurl.md) | Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url.<!-- -->Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hash<!-- -->Why? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints | + ## Interfaces | Interface | Description | @@ -118,6 +128,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- --> | [ToastOptions](./kibana-plugin-core-public.toastoptions.md) | Options available for [IToasts](./kibana-plugin-core-public.itoasts.md) APIs. | | [UiSettingsParams](./kibana-plugin-core-public.uisettingsparams.md) | UiSettings parameters defined by the plugins. | | [UiSettingsState](./kibana-plugin-core-public.uisettingsstate.md) | | +| [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) | We define our own typings because the current version of @<!-- -->types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string". | | [UserProvidedValues](./kibana-plugin-core-public.userprovidedvalues.md) | Describes the values explicitly set by user. | ## Type Aliases @@ -139,6 +150,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- --> | [ChromeHelpExtensionMenuLink](./kibana-plugin-core-public.chromehelpextensionmenulink.md) | | | [ChromeNavLinkUpdateableFields](./kibana-plugin-core-public.chromenavlinkupdateablefields.md) | | | [FatalErrorsStart](./kibana-plugin-core-public.fatalerrorsstart.md) | FatalErrors stop the Kibana Public Core and displays a fatal error screen with details about the Kibana build and the error. | +| [Freezable](./kibana-plugin-core-public.freezable.md) | | | [HandlerContextType](./kibana-plugin-core-public.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md) to represent the type of the context. | | [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-core-public.icontextcontainer.md) | | [HandlerParameters](./kibana-plugin-core-public.handlerparameters.md) | Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-core-public.handlerfunction.md)<!-- -->, excluding the [HandlerContextType](./kibana-plugin-core-public.handlercontexttype.md)<!-- -->. | @@ -146,6 +158,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- --> | [IContextProvider](./kibana-plugin-core-public.icontextprovider.md) | A function that returns a context value for a specific key of given context type. | | [IToasts](./kibana-plugin-core-public.itoasts.md) | Methods for adding and removing global toast messages. See [ToastsApi](./kibana-plugin-core-public.toastsapi.md)<!-- -->. | | [MountPoint](./kibana-plugin-core-public.mountpoint.md) | A function that should mount DOM content inside the provided container element and return a handler to unmount it. | +| [NavType](./kibana-plugin-core-public.navtype.md) | | | [PluginInitializer](./kibana-plugin-core-public.plugininitializer.md) | The <code>plugin</code> export at the root of a plugin's <code>public</code> directory should conform to this interface. | | [PluginOpaqueId](./kibana-plugin-core-public.pluginopaqueid.md) | | | [PublicUiSettingsParams](./kibana-plugin-core-public.publicuisettingsparams.md) | A sub-set of [UiSettingsParams](./kibana-plugin-core-public.uisettingsparams.md) exposed to the client-side. | diff --git a/docs/development/core/public/kibana-plugin-core-public.modifyurl.md b/docs/development/core/public/kibana-plugin-core-public.modifyurl.md new file mode 100644 index 0000000000000..b174f733a5c64 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.modifyurl.md @@ -0,0 +1,31 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [modifyUrl](./kibana-plugin-core-public.modifyurl.md) + +## modifyUrl() function + +Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url. + +Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hash + +Why? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints + +<b>Signature:</b> + +```typescript +export declare function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void): string; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| url | <code>string</code> | | +| urlModifier | <code>(urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void</code> | | + +<b>Returns:</b> + +`string` + +The modified and reformatted url + diff --git a/docs/development/core/public/kibana-plugin-core-public.navtype.md b/docs/development/core/public/kibana-plugin-core-public.navtype.md new file mode 100644 index 0000000000000..8f1d9a4351754 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.navtype.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [NavType](./kibana-plugin-core-public.navtype.md) + +## NavType type + +<b>Signature:</b> + +```typescript +export declare type NavType = 'modern' | 'legacy'; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.auth.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.auth.md new file mode 100644 index 0000000000000..238dd66885896 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.auth.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [auth](./kibana-plugin-core-public.urlmeaningfulparts.auth.md) + +## URLMeaningfulParts.auth property + +<b>Signature:</b> + +```typescript +auth?: string | null; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hash.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hash.md new file mode 100644 index 0000000000000..161e7dc7ebfae --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hash.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [hash](./kibana-plugin-core-public.urlmeaningfulparts.hash.md) + +## URLMeaningfulParts.hash property + +<b>Signature:</b> + +```typescript +hash?: string | null; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hostname.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hostname.md new file mode 100644 index 0000000000000..f1884718337b5 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.hostname.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [hostname](./kibana-plugin-core-public.urlmeaningfulparts.hostname.md) + +## URLMeaningfulParts.hostname property + +<b>Signature:</b> + +```typescript +hostname?: string | null; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.md new file mode 100644 index 0000000000000..2816d4c7df541 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.md @@ -0,0 +1,27 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) + +## URLMeaningfulParts interface + +We define our own typings because the current version of @<!-- -->types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string". + +<b>Signature:</b> + +```typescript +export interface URLMeaningfulParts +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [auth](./kibana-plugin-core-public.urlmeaningfulparts.auth.md) | <code>string | null</code> | | +| [hash](./kibana-plugin-core-public.urlmeaningfulparts.hash.md) | <code>string | null</code> | | +| [hostname](./kibana-plugin-core-public.urlmeaningfulparts.hostname.md) | <code>string | null</code> | | +| [pathname](./kibana-plugin-core-public.urlmeaningfulparts.pathname.md) | <code>string | null</code> | | +| [port](./kibana-plugin-core-public.urlmeaningfulparts.port.md) | <code>string | null</code> | | +| [protocol](./kibana-plugin-core-public.urlmeaningfulparts.protocol.md) | <code>string | null</code> | | +| [query](./kibana-plugin-core-public.urlmeaningfulparts.query.md) | <code>ParsedQuery</code> | | +| [slashes](./kibana-plugin-core-public.urlmeaningfulparts.slashes.md) | <code>boolean | null</code> | | + diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.pathname.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.pathname.md new file mode 100644 index 0000000000000..5ad21f004481c --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.pathname.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [pathname](./kibana-plugin-core-public.urlmeaningfulparts.pathname.md) + +## URLMeaningfulParts.pathname property + +<b>Signature:</b> + +```typescript +pathname?: string | null; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.port.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.port.md new file mode 100644 index 0000000000000..2e70da2f17421 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.port.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [port](./kibana-plugin-core-public.urlmeaningfulparts.port.md) + +## URLMeaningfulParts.port property + +<b>Signature:</b> + +```typescript +port?: string | null; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.protocol.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.protocol.md new file mode 100644 index 0000000000000..cedc7f0b878e3 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.protocol.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [protocol](./kibana-plugin-core-public.urlmeaningfulparts.protocol.md) + +## URLMeaningfulParts.protocol property + +<b>Signature:</b> + +```typescript +protocol?: string | null; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.query.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.query.md new file mode 100644 index 0000000000000..a9541efe0882a --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.query.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [query](./kibana-plugin-core-public.urlmeaningfulparts.query.md) + +## URLMeaningfulParts.query property + +<b>Signature:</b> + +```typescript +query: ParsedQuery; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.slashes.md b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.slashes.md new file mode 100644 index 0000000000000..cb28a25f9e162 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.urlmeaningfulparts.slashes.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [URLMeaningfulParts](./kibana-plugin-core-public.urlmeaningfulparts.md) > [slashes](./kibana-plugin-core-public.urlmeaningfulparts.slashes.md) + +## URLMeaningfulParts.slashes property + +<b>Signature:</b> + +```typescript +slashes?: boolean | null; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.assertnever.md b/docs/development/core/server/kibana-plugin-core-server.assertnever.md new file mode 100644 index 0000000000000..c13c88df9b9bf --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.assertnever.md @@ -0,0 +1,24 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [assertNever](./kibana-plugin-core-server.assertnever.md) + +## assertNever() function + +Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking + +<b>Signature:</b> + +```typescript +export declare function assertNever(x: never): never; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| x | <code>never</code> | | + +<b>Returns:</b> + +`never` + diff --git a/docs/development/core/server/kibana-plugin-core-server.deepfreeze.md b/docs/development/core/server/kibana-plugin-core-server.deepfreeze.md new file mode 100644 index 0000000000000..946050bff0585 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.deepfreeze.md @@ -0,0 +1,24 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [deepFreeze](./kibana-plugin-core-server.deepfreeze.md) + +## deepFreeze() function + +Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively + +<b>Signature:</b> + +```typescript +export declare function deepFreeze<T extends Freezable>(object: T): RecursiveReadonly<T>; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| object | <code>T</code> | | + +<b>Returns:</b> + +`RecursiveReadonly<T>` + diff --git a/docs/development/core/server/kibana-plugin-core-server.freezable.md b/docs/development/core/server/kibana-plugin-core-server.freezable.md new file mode 100644 index 0000000000000..32ba89e8370c1 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.freezable.md @@ -0,0 +1,14 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [Freezable](./kibana-plugin-core-server.freezable.md) + +## Freezable type + + +<b>Signature:</b> + +```typescript +export declare type Freezable = { + [k: string]: any; +} | any[]; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.getflattenedobject.md b/docs/development/core/server/kibana-plugin-core-server.getflattenedobject.md new file mode 100644 index 0000000000000..2e7850ca579f6 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.getflattenedobject.md @@ -0,0 +1,30 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [getFlattenedObject](./kibana-plugin-core-server.getflattenedobject.md) + +## getFlattenedObject() function + +Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from `rootValue`<!-- -->. + +example: getFlattenedObject(<!-- -->{ a: { b: 1, c: \[2,3\] } }<!-- -->) // =<!-- -->> { 'a.b': 1, 'a.c': \[2,3\] } + +<b>Signature:</b> + +```typescript +export declare function getFlattenedObject(rootValue: Record<string, any>): { + [key: string]: any; +}; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| rootValue | <code>Record<string, any></code> | | + +<b>Returns:</b> + +`{ + [key: string]: any; +}` + diff --git a/docs/development/core/server/kibana-plugin-core-server.isrelativeurl.md b/docs/development/core/server/kibana-plugin-core-server.isrelativeurl.md new file mode 100644 index 0000000000000..bff9eb05419be --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.isrelativeurl.md @@ -0,0 +1,24 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [isRelativeUrl](./kibana-plugin-core-server.isrelativeurl.md) + +## isRelativeUrl() function + +Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\* + +<b>Signature:</b> + +```typescript +export declare function isRelativeUrl(candidatePath: string): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| candidatePath | <code>string</code> | | + +<b>Returns:</b> + +`boolean` + diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md index a91a5bec988b7..14e01fda3d287 100644 --- a/docs/development/core/server/kibana-plugin-core-server.md +++ b/docs/development/core/server/kibana-plugin-core-server.md @@ -41,8 +41,13 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- --> | Function | Description | | --- | --- | +| [assertNever(x)](./kibana-plugin-core-server.assertnever.md) | Can be used in switch statements to ensure we perform exhaustive checks, see https://www.typescriptlang.org/docs/handbook/advanced-types.html\#exhaustiveness-checking | +| [deepFreeze(object)](./kibana-plugin-core-server.deepfreeze.md) | Apply Object.freeze to a value recursively and convert the return type to Readonly variant recursively | | [exportSavedObjectsToStream({ types, objects, search, savedObjectsClient, exportSizeLimit, includeReferencesDeep, excludeExportDetails, namespace, })](./kibana-plugin-core-server.exportsavedobjectstostream.md) | Generates sorted saved object stream to be used for export. See the [options](./kibana-plugin-core-server.savedobjectsexportoptions.md) for more detailed information. | +| [getFlattenedObject(rootValue)](./kibana-plugin-core-server.getflattenedobject.md) | Flattens a deeply nested object to a map of dot-separated paths pointing to all primitive values \*\*and arrays\*\* from <code>rootValue</code>.<!-- -->example: getFlattenedObject(<!-- -->{ a: { b: 1, c: \[2,3\] } }<!-- -->) // =<!-- -->> { 'a.b': 1, 'a.c': \[2,3\] } | | [importSavedObjectsFromStream({ readStream, objectLimit, overwrite, savedObjectsClient, supportedTypes, namespace, })](./kibana-plugin-core-server.importsavedobjectsfromstream.md) | Import saved objects from given stream. See the [options](./kibana-plugin-core-server.savedobjectsimportoptions.md) for more detailed information. | +| [isRelativeUrl(candidatePath)](./kibana-plugin-core-server.isrelativeurl.md) | Determine if a url is relative. Any url including a protocol, hostname, or port is not considered relative. This means that absolute \*paths\* are considered to be relative \*urls\* | +| [modifyUrl(url, urlModifier)](./kibana-plugin-core-server.modifyurl.md) | Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url.<!-- -->Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hash<!-- -->Why? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints | | [resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, savedObjectsClient, supportedTypes, namespace, })](./kibana-plugin-core-server.resolvesavedobjectsimporterrors.md) | Resolve and return saved object import errors. See the [options](./kibana-plugin-core-server.savedobjectsresolveimporterrorsoptions.md) for more detailed informations. | ## Interfaces @@ -186,6 +191,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- --> | [UiSettingsParams](./kibana-plugin-core-server.uisettingsparams.md) | UiSettings parameters defined by the plugins. | | [UiSettingsServiceSetup](./kibana-plugin-core-server.uisettingsservicesetup.md) | | | [UiSettingsServiceStart](./kibana-plugin-core-server.uisettingsservicestart.md) | | +| [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) | We define our own typings because the current version of @<!-- -->types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string". | | [UserProvidedValues](./kibana-plugin-core-server.userprovidedvalues.md) | Describes the values explicitly set by user. | | [UuidServiceSetup](./kibana-plugin-core-server.uuidservicesetup.md) | APIs to access the application's instance uuid. | @@ -212,6 +218,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- --> | [ConfigPath](./kibana-plugin-core-server.configpath.md) | | | [DestructiveRouteMethod](./kibana-plugin-core-server.destructiveroutemethod.md) | Set of HTTP methods changing the state of the server. | | [ElasticsearchClientConfig](./kibana-plugin-core-server.elasticsearchclientconfig.md) | | +| [Freezable](./kibana-plugin-core-server.freezable.md) | | | [GetAuthHeaders](./kibana-plugin-core-server.getauthheaders.md) | Get headers to authenticate a user against Elasticsearch. | | [GetAuthState](./kibana-plugin-core-server.getauthstate.md) | Gets authentication state for a request. Returned by <code>auth</code> interceptor. | | [HandlerContextType](./kibana-plugin-core-server.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-core-server.handlerfunction.md) to represent the type of the context. | diff --git a/docs/development/core/server/kibana-plugin-core-server.modifyurl.md b/docs/development/core/server/kibana-plugin-core-server.modifyurl.md new file mode 100644 index 0000000000000..fc0bc354a3ca3 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.modifyurl.md @@ -0,0 +1,31 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [modifyUrl](./kibana-plugin-core-server.modifyurl.md) + +## modifyUrl() function + +Takes a URL and a function that takes the meaningful parts of the URL as a key-value object, modifies some or all of the parts, and returns the modified parts formatted again as a url. + +Url Parts sent: - protocol - slashes (does the url have the //) - auth - hostname (just the name of the host, no port or auth information) - port - pathname (the path after the hostname, no query or hash, starts with a slash if there was a path) - query (always an object, even when no query on original url) - hash + +Why? - The default url library in node produces several conflicting properties on the "parsed" output. Modifying any of these might lead to the modifications being ignored (depending on which property was modified) - It's not always clear whether to use path/pathname, host/hostname, so this tries to add helpful constraints + +<b>Signature:</b> + +```typescript +export declare function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void): string; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| url | <code>string</code> | | +| urlModifier | <code>(urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void</code> | | + +<b>Returns:</b> + +`string` + +The modified and reformatted url + diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.auth.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.auth.md new file mode 100644 index 0000000000000..0422738669a70 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.auth.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [auth](./kibana-plugin-core-server.urlmeaningfulparts.auth.md) + +## URLMeaningfulParts.auth property + +<b>Signature:</b> + +```typescript +auth?: string | null; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hash.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hash.md new file mode 100644 index 0000000000000..13a3f4a9c95c8 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hash.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [hash](./kibana-plugin-core-server.urlmeaningfulparts.hash.md) + +## URLMeaningfulParts.hash property + +<b>Signature:</b> + +```typescript +hash?: string | null; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hostname.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hostname.md new file mode 100644 index 0000000000000..6631f6f6744c5 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.hostname.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [hostname](./kibana-plugin-core-server.urlmeaningfulparts.hostname.md) + +## URLMeaningfulParts.hostname property + +<b>Signature:</b> + +```typescript +hostname?: string | null; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.md new file mode 100644 index 0000000000000..257f7b4b634ab --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.md @@ -0,0 +1,27 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) + +## URLMeaningfulParts interface + +We define our own typings because the current version of @<!-- -->types/node declares properties to be optional "hostname?: string". Although, parse call returns "hostname: null \| string". + +<b>Signature:</b> + +```typescript +export interface URLMeaningfulParts +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [auth](./kibana-plugin-core-server.urlmeaningfulparts.auth.md) | <code>string | null</code> | | +| [hash](./kibana-plugin-core-server.urlmeaningfulparts.hash.md) | <code>string | null</code> | | +| [hostname](./kibana-plugin-core-server.urlmeaningfulparts.hostname.md) | <code>string | null</code> | | +| [pathname](./kibana-plugin-core-server.urlmeaningfulparts.pathname.md) | <code>string | null</code> | | +| [port](./kibana-plugin-core-server.urlmeaningfulparts.port.md) | <code>string | null</code> | | +| [protocol](./kibana-plugin-core-server.urlmeaningfulparts.protocol.md) | <code>string | null</code> | | +| [query](./kibana-plugin-core-server.urlmeaningfulparts.query.md) | <code>ParsedQuery</code> | | +| [slashes](./kibana-plugin-core-server.urlmeaningfulparts.slashes.md) | <code>boolean | null</code> | | + diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.pathname.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.pathname.md new file mode 100644 index 0000000000000..8fee8c8e146ca --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.pathname.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [pathname](./kibana-plugin-core-server.urlmeaningfulparts.pathname.md) + +## URLMeaningfulParts.pathname property + +<b>Signature:</b> + +```typescript +pathname?: string | null; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.port.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.port.md new file mode 100644 index 0000000000000..dcf3517d92ba2 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.port.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [port](./kibana-plugin-core-server.urlmeaningfulparts.port.md) + +## URLMeaningfulParts.port property + +<b>Signature:</b> + +```typescript +port?: string | null; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.protocol.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.protocol.md new file mode 100644 index 0000000000000..914dcd4e8a8a5 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.protocol.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [protocol](./kibana-plugin-core-server.urlmeaningfulparts.protocol.md) + +## URLMeaningfulParts.protocol property + +<b>Signature:</b> + +```typescript +protocol?: string | null; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.query.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.query.md new file mode 100644 index 0000000000000..358adcfd3d180 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.query.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [query](./kibana-plugin-core-server.urlmeaningfulparts.query.md) + +## URLMeaningfulParts.query property + +<b>Signature:</b> + +```typescript +query: ParsedQuery; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.slashes.md b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.slashes.md new file mode 100644 index 0000000000000..d5b598167f2f2 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.urlmeaningfulparts.slashes.md @@ -0,0 +1,11 @@ +<!-- Do not edit this file. It is automatically generated by API Documenter. --> + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [URLMeaningfulParts](./kibana-plugin-core-server.urlmeaningfulparts.md) > [slashes](./kibana-plugin-core-server.urlmeaningfulparts.slashes.md) + +## URLMeaningfulParts.slashes property + +<b>Signature:</b> + +```typescript +slashes?: boolean | null; +``` diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index 51910169e8673..cafd50d92376f 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -68,6 +68,9 @@ into the document when displaying it. `metrics:max_buckets`:: The maximum numbers of buckets that a single data source can return. This might arise when the user selects a short interval (for example, 1s) for a long time period (1 year). +`pageNavigation`:: The style of navigation menu for Kibana. +Choices are Legacy, the legacy style where every plugin is represented in the nav, +and Modern, a new format that bundles related plugins together in flyaway nested navigation. `query:allowLeadingWildcards`:: Allows a wildcard (*) as the first character in a query clause. Only applies when experimental query features are enabled in the query bar. To disallow leading wildcards in Lucene queries, diff --git a/docs/visualize/timelion.asciidoc b/docs/visualize/timelion.asciidoc index a7520227977bc..852c3e1ecdeca 100644 --- a/docs/visualize/timelion.asciidoc +++ b/docs/visualize/timelion.asciidoc @@ -50,10 +50,10 @@ To compare the two data sets, add another series with data from the previous hou .es(index=metricbeat-*, timefield='@timestamp', metric='avg:system.cpu.user.pct'), - .es(offset=-1h, <1> - index=metricbeat-*, - timefield='@timestamp', - metric='avg:system.cpu.user.pct') +.es(offset=-1h, <1> + index=metricbeat-*, + timefield='@timestamp', + metric='avg:system.cpu.user.pct') ---------------------------------- <1> `offset` offsets the data retrieval by a date expression. In this example, `-1h` offsets the data back by one hour. @@ -119,11 +119,11 @@ To differentiate between the current hour data and the last hour data, change th metric='avg:system.cpu.user.pct') .label('last hour') .lines(fill=1,width=0.5), <1> - .es(index=metricbeat-*, - timefield='@timestamp', - metric='avg:system.cpu.user.pct') - .label('current hour') - .title('CPU usage over time') +.es(index=metricbeat-*, + timefield='@timestamp', + metric='avg:system.cpu.user.pct') + .label('current hour') + .title('CPU usage over time') ---------------------------------- <1> `.lines()` changes the appearance of the chart lines. In this example, `.lines(fill=1,width=0.5)` sets the fill level to `1`, and the border width to `0.5`. @@ -169,7 +169,20 @@ Change the position and style of the legend: [source,text] ---------------------------------- -.es(offset=-1h,index=metricbeat-*, timefield='@timestamp', metric='avg:system.cpu.user.pct').label('last hour').lines(fill=1,width=0.5).color(gray), .es(index=metricbeat-*, timefield='@timestamp', metric='avg:system.cpu.user.pct').label('current hour').title('CPU usage over time').color(#1E90FF).legend(columns=2, position=nw) <1> +.es(offset=-1h, + index=metricbeat-*, + timefield='@timestamp', + metric='avg:system.cpu.user.pct') + .label('last hour') + .lines(fill=1,width=0.5) + .color(gray), +.es(index=metricbeat-*, + timefield='@timestamp', + metric='avg:system.cpu.user.pct') + .label('current hour') + .title('CPU usage over time') + .color(#1E90FF) + .legend(columns=2, position=nw) <1> ---------------------------------- <1> `.legend()` sets the position and style of the legend. In this example, `.legend(columns=2, position=nw)` places the legend in the north west position of the visualization with two columns. @@ -192,7 +205,9 @@ To start tracking the inbound and outbound network traffic, enter the following [source,text] ---------------------------------- -.es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.in.bytes) +.es(index=metricbeat*, + timefield=@timestamp, + metric=max:system.network.in.bytes) ---------------------------------- [role="screenshot"] @@ -207,7 +222,10 @@ Change how the data is displayed so that you can easily monitor the inbound traf [source,text] ---------------------------------- -.es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.in.bytes).derivative() <1> +.es(index=metricbeat*, + timefield=@timestamp, + metric=max:system.network.in.bytes) + .derivative() <1> ---------------------------------- <1> `.derivative` plots the change in values over time. @@ -220,7 +238,15 @@ Add a similar calculation for outbound traffic: [source,text] ---------------------------------- -.es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.in.bytes).derivative(), .es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.out.bytes).derivative().multiply(-1) <1> +.es(index=metricbeat*, + timefield=@timestamp, + metric=max:system.network.in.bytes) + .derivative(), +.es(index=metricbeat*, + timefield=@timestamp, + metric=max:system.network.out.bytes) + .derivative() + .multiply(-1) <1> ---------------------------------- <1> `.multiply()` multiplies the data series by a number, the result of a data series, or a list of data series. For this example, `.multiply(-1)` converts the outbound network traffic to a negative value since the outbound network traffic is leaving your machine. @@ -237,7 +263,17 @@ To make the visualization easier to analyze, change the data metric from bytes t [source,text] ---------------------------------- -.es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.in.bytes).derivative().divide(1048576), .es(index=metricbeat*, timefield=@timestamp, metric=max:system.network.out.bytes).derivative().multiply(-1).divide(1048576) <1> +.es(index=metricbeat*, + timefield=@timestamp, + metric=max:system.network.in.bytes) + .derivative() + .divide(1048576), +.es(index=metricbeat*, + timefield=@timestamp, + metric=max:system.network.out.bytes) + .derivative() + .multiply(-1) + .divide(1048576) <1> ---------------------------------- <1> `.divide()` accepts the same input as `.multiply()`, then divides the data series by the defined divisor. @@ -271,8 +307,8 @@ Customize and format the visualization using functions: .divide(1048576) .lines(fill=2, width=1) <3> .color(blue) <4> - .label("Outbound traffic") - .legend(columns=2, position=nw) <5> + .label("Outbound traffic") + .legend(columns=2, position=nw) <5> ---------------------------------- <1> `.label()` adds custom labels to the visualization. @@ -309,7 +345,9 @@ To chart the maximum value of `system.memory.actual.used.bytes`, enter the follo [source,text] ---------------------------------- -.es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes') +.es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes') ---------------------------------- [role="screenshot"] @@ -338,17 +376,17 @@ To track the amount of memory used, create two thresholds: null) .label('warning') .color('#FFCC11'), - .es(index=metricbeat-*, - timefield='@timestamp', - metric='max:system.memory.actual.used.bytes') - .if(gt, - 11375000000, - .es(index=metricbeat-*, - timefield='@timestamp', - metric='max:system.memory.actual.used.bytes'), - null) - .label('severe') - .color('red') +.es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes') + .if(gt, + 11375000000, + .es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes'), + null) + .label('severe') + .color('red') ---------------------------------- <1> Timelion conditional logic for the _greater than_ operator. In this example, the warning threshold is 11.3GB (`11300000000`), and the severe threshold is 11.375GB (`11375000000`). If the threshold values are too high or low for your machine, adjust the values accordingly. @@ -366,7 +404,33 @@ To determine the trend, create a new data series: [source,text] ---------------------------------- -.es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes'), .es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes').if(gt,11300000000,.es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes'),null).label('warning').color('#FFCC11'), .es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes').if(gt,11375000000,.es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes'),null).label('severe').color('red'), .es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes').mvavg(10) <1> +.es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes'), +.es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes') + .if(gt,11300000000, + .es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes'), + null) + .label('warning') + .color('#FFCC11'), +.es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes') + .if(gt,11375000000, + .es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes'), + null). + label('severe') + .color('red'), +.es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes') + .mvavg(10) <1> ---------------------------------- <1> `mvavg()` calculates the moving average over a specified period of time. In this example, `.mvavg(10)` creates a moving average with a window of 10 data points. @@ -396,30 +460,30 @@ Customize and format the visualization using functions: .es(index=metricbeat-*, timefield='@timestamp', metric='max:system.memory.actual.used.bytes'), - null) - .label('warning') - .color('#FFCC11') <3> - .lines(width=5), <4> - .es(index=metricbeat-*, - timefield='@timestamp', - metric='max:system.memory.actual.used.bytes') - .if(gt, - 11375000000, - .es(index=metricbeat-*, - timefield='@timestamp', - metric='max:system.memory.actual.used.bytes'), - null) - .label('severe') - .color('red') - .lines(width=5), + null) + .label('warning') + .color('#FFCC11') <3> + .lines(width=5), <4> +.es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes') + .if(gt, + 11375000000, .es(index=metricbeat-*, timefield='@timestamp', - metric='max:system.memory.actual.used.bytes') - .mvavg(10) - .label('mvavg') - .lines(width=2) - .color(#5E5E5E) - .legend(columns=4, position=nw) <5> + metric='max:system.memory.actual.used.bytes'), + null) + .label('severe') + .color('red') + .lines(width=5), +.es(index=metricbeat-*, + timefield='@timestamp', + metric='max:system.memory.actual.used.bytes') + .mvavg(10) + .label('mvavg') + .lines(width=2) + .color(#5E5E5E) + .legend(columns=4, position=nw) <5> ---------------------------------- <1> `.label()` adds custom labels to the visualization. diff --git a/package.json b/package.json index 30d488eb04992..8a92b46489308 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "test:ftr:server": "node scripts/functional_tests_server", "test:ftr:runner": "node scripts/functional_test_runner", "test:coverage": "grunt test:coverage", - "typespec": "typings-tester --config x-pack/legacy/plugins/canvas/public/lib/aeroelastic/tsconfig.json x-pack/legacy/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts", + "typespec": "typings-tester --config x-pack/plugins/canvas/public/lib/aeroelastic/tsconfig.json x-pack/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts", "checkLicenses": "node scripts/check_licenses --dev", "build": "node scripts/build --all-platforms", "start": "node scripts/kibana --dev", @@ -125,7 +125,7 @@ "@elastic/charts": "19.2.0", "@elastic/datemath": "5.0.3", "@elastic/ems-client": "7.8.0", - "@elastic/eui": "22.3.0", + "@elastic/eui": "22.3.1", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/numeral": "2.4.0", diff --git a/packages/kbn-dev-utils/src/precommit_hook/cli.ts b/packages/kbn-dev-utils/src/precommit_hook/cli.ts new file mode 100644 index 0000000000000..a83e8c2b193d9 --- /dev/null +++ b/packages/kbn-dev-utils/src/precommit_hook/cli.ts @@ -0,0 +1,50 @@ +/* + * 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 Path from 'path'; +import { chmod, writeFile } from 'fs'; +import { promisify } from 'util'; + +import { run } from '../run'; +import { REPO_ROOT } from '../repo_root'; +import { SCRIPT_SOURCE } from './script_source'; +import { getGitDir } from './get_git_dir'; + +const chmodAsync = promisify(chmod); +const writeFileAsync = promisify(writeFile); + +run( + async ({ log }) => { + try { + const gitDir = await getGitDir(); + const installPath = Path.resolve(REPO_ROOT, gitDir, 'hooks/pre-commit'); + + log.info(`Registering Kibana pre-commit git hook...`); + await writeFileAsync(installPath, SCRIPT_SOURCE); + await chmodAsync(installPath, 0o755); + log.success(`Kibana pre-commit git hook was installed successfully.`); + } catch (e) { + log.error(`Kibana pre-commit git hook was not installed as an error occur.`); + throw e; + } + }, + { + description: 'Register git hooks in the local repo', + } +); diff --git a/packages/kbn-interpreter/tasks/build/server_code_transformer.js b/packages/kbn-dev-utils/src/precommit_hook/get_git_dir.ts similarity index 56% rename from packages/kbn-interpreter/tasks/build/server_code_transformer.js rename to packages/kbn-dev-utils/src/precommit_hook/get_git_dir.ts index 4bd9220993c62..5ca7d67d0d4ea 100644 --- a/packages/kbn-interpreter/tasks/build/server_code_transformer.js +++ b/packages/kbn-dev-utils/src/precommit_hook/get_git_dir.ts @@ -17,27 +17,16 @@ * under the License. */ -const { extname } = require('path'); +import execa from 'execa'; -const { transform } = require('@babel/core'); +import { REPO_ROOT } from '../repo_root'; -exports.createServerCodeTransformer = sourceMaps => { - return (content, path) => { - switch (extname(path)) { - case '.js': - const { code = '' } = transform(content.toString('utf8'), { - filename: path, - ast: false, - code: true, - sourceMaps: sourceMaps ? 'inline' : false, - babelrc: false, - presets: [require.resolve('@kbn/babel-preset/webpack_preset')], - }); - - return code; - - default: - return content.toString('utf8'); - } - }; -}; +// Retrieves the correct location for the .git dir for +// every git setup (including git worktree) +export async function getGitDir() { + return ( + await execa('git', ['rev-parse', '--git-common-dir'], { + cwd: REPO_ROOT, + }) + ).stdout.trim(); +} diff --git a/packages/kbn-dev-utils/src/precommit_hook/script_source.ts b/packages/kbn-dev-utils/src/precommit_hook/script_source.ts new file mode 100644 index 0000000000000..61b4552f6eaef --- /dev/null +++ b/packages/kbn-dev-utils/src/precommit_hook/script_source.ts @@ -0,0 +1,117 @@ +/* + * 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 os from 'os'; + +import normalizePath from 'normalize-path'; + +const HOME_DIR = normalizePath(os.homedir()); + +export const SCRIPT_SOURCE = `#!/usr/bin/env bash +# +# ** THIS IS AN AUTO-GENERATED FILE ** +# ** PLEASE DO NOT CHANGE IT MANUALLY ** +# +# GENERATED BY \`node scripts/register_git_hook\` +# IF YOU WANNA CHANGE SOMETHING IN THIS SCRIPT +# PLEASE RE-RUN 'yarn kbn bootstrap' or 'node scripts/register_git_hook' + +# pre-commit script takes zero arguments: https://git-scm.com/docs/githooks#_pre_commit + +set -euo pipefail + +# Make it possible to terminate pre commit hook +# using ctrl-c so nothing else would happen or be +# sent to the output. +# +# The correct exit code on that situation +# according the linux documentation project is 130 +# https://www.tldp.org/LDP/abs/html/exitcodes.html +trap "exit 130" INT + +has_node() { + command -v node >/dev/null 2>&1 +} + +has_nvm() { + command -v nvm >/dev/null 2>&1 +} + +try_load_node_from_nvm_paths () { + # If nvm is not loaded, load it + has_node || { + NVM_SH="${HOME_DIR}/.nvm/nvm.sh" + + if [ "${process.platform}" == "darwin" ] && [ -s "$(brew --prefix nvm)/nvm.sh" ]; then + NVM_SH="$(brew --prefix nvm)/nvm.sh" + fi + + export NVM_DIR="${HOME_DIR}/.nvm" + + [ -s "$NVM_SH" ] && \. "$NVM_SH" + + # If nvm has been loaded correctly, use project .nvmrc + has_nvm && nvm use + } +} + +extend_user_path() { + if [ "${process.platform}" == "win32" ]; then + export PATH="$PATH:/c/Program Files/nodejs" + else + export PATH="$PATH:/usr/local/bin:/usr/local" + try_load_node_from_nvm_paths + fi +} + +# Extend path with common path locations for node +# in order to make the hook working on git GUI apps +extend_user_path + +# Check if we have node js bin in path +has_node || { + echo "Can't found node bin in the PATH. Please update the PATH to proceed." + echo "If your PATH already has the node bin, maybe you are using some git GUI app." + echo "Can't found node bin in the PATH. Please update the PATH to proceed." + echo "If your PATH already has the node bin, maybe you are using some git GUI app not launched from the shell." + echo "In order to proceed, you need to config the PATH used by the application that are launching your git GUI app." + echo "If you are running macOS, you can do that using:" + echo "'sudo launchctl config user path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'" + + exit 1 +} + +execute_precommit_hook() { + node scripts/precommit_hook || return 1 + + PRECOMMIT_FILE="./.git/hooks/pre-commit.local" + if [ -x "\${PRECOMMIT_FILE}" ]; then + echo "Executing local precommit hook found in \${PRECOMMIT_FILE}" + "$PRECOMMIT_FILE" || return 1 + fi +} + +execute_precommit_hook || { + echo "Pre-commit hook failed (add --no-verify to bypass)"; + echo ' For eslint failures you can try running \`node scripts/precommit_hook --fix\`'; + exit 1; +} + +exit 0 +`; diff --git a/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js b/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js deleted file mode 100644 index 519e529c20bf5..0000000000000 --- a/packages/kbn-interpreter/tasks/build/server_code_transformer.test.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 { readFileSync } from 'fs'; -import { resolve } from 'path'; -import { createServerCodeTransformer } from './server_code_transformer'; - -const JS_FIXTURE_PATH = resolve(__dirname, '__fixtures__/sample.js'); -const JS_FIXTURE = readFileSync(JS_FIXTURE_PATH); - -describe('js support', () => { - it('transpiles js file', () => { - const transformer = createServerCodeTransformer(); - expect(transformer(JS_FIXTURE, JS_FIXTURE_PATH)).toMatchInlineSnapshot(` -"\\"use strict\\"; - -var _util = _interopRequireDefault(require(\\"util\\")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint-disable */ -console.log(_util.default.format('hello world'));" -`); - }); - - it('throws errors for js syntax errors', () => { - const transformer = createServerCodeTransformer(); - expect(() => transformer(Buffer.from(`export default 'foo`), JS_FIXTURE_PATH)).toThrowError( - /Unterminated string constant/ - ); - }); -}); diff --git a/packages/kbn-ui-shared-deps/package.json b/packages/kbn-ui-shared-deps/package.json index ae883a5032fe7..8259f251a9be3 100644 --- a/packages/kbn-ui-shared-deps/package.json +++ b/packages/kbn-ui-shared-deps/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@elastic/charts": "19.2.0", - "@elastic/eui": "22.3.0", + "@elastic/eui": "22.3.1", "@kbn/i18n": "1.0.0", "abortcontroller-polyfill": "^1.4.0", "angular": "^1.7.9", diff --git a/renovate.json5 b/renovate.json5 index 61b2485ecf44b..c4efa86366bf4 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -771,6 +771,14 @@ '@types/podium', ], }, + { + groupSlug: 'pretty-ms', + groupName: 'pretty-ms related packages', + packageNames: [ + 'pretty-ms', + '@types/pretty-ms', + ], + }, { groupSlug: 'proper-lockfile', groupName: 'proper-lockfile related packages', @@ -864,6 +872,14 @@ '@types/sinon', ], }, + { + groupSlug: 'stats-lite', + groupName: 'stats-lite related packages', + packageNames: [ + 'stats-lite', + '@types/stats-lite', + ], + }, { groupSlug: 'storybook', groupName: 'storybook related packages', diff --git a/scripts/register_git_hook.js b/scripts/register_git_hook.js index 8e03f17967f3f..af3f54619bcec 100644 --- a/scripts/register_git_hook.js +++ b/scripts/register_git_hook.js @@ -17,5 +17,5 @@ * under the License. */ -require('../src/setup_node_env'); -require('../src/dev/run_register_git_hook'); +require('../src/setup_node_env/prebuilt_dev_only_entry'); +require('@kbn/dev-utils/target/precommit_hook/cli'); diff --git a/src/cli/cluster/cluster_manager.ts b/src/cli/cluster/cluster_manager.ts index 97dec3eead303..3b3e4d78320d2 100644 --- a/src/cli/cluster/cluster_manager.ts +++ b/src/cli/cluster/cluster_manager.ts @@ -268,7 +268,7 @@ export class ClusterManager { fromRoot('x-pack/plugins/siem/cypress'), fromRoot('x-pack/plugins/apm/e2e'), fromRoot('x-pack/plugins/apm/scripts'), - fromRoot('x-pack/legacy/plugins/canvas/canvas_plugin_src'), // prevents server from restarting twice for Canvas plugin changes, + fromRoot('x-pack/plugins/canvas/canvas_plugin_src'), // prevents server from restarting twice for Canvas plugin changes, 'plugins/java_languageserver', ]; diff --git a/src/core/MIGRATION.md b/src/core/MIGRATION.md index 80f12dd78214d..02d46b1583b59 100644 --- a/src/core/MIGRATION.md +++ b/src/core/MIGRATION.md @@ -990,6 +990,9 @@ ls -lh plugins/my_plugin/target/public/ you might see at least one js bundle - `my_plugin.plugin.js`. This is the only artifact loaded by the platform during bootstrap in the browser. The rule of thumb is to keep its size as small as possible. Other lazily loaded parts of your plugin present in the same folder as separate chunks under `{number}.plugin.js` names. If you want to investigate what your plugin bundle consists of you need to run `@kbn/optimizer` with `--profile` flag to get generated [webpack stats file](https://webpack.js.org/api/stats/). +```bash +node scripts/build_kibana_platform_plugins.js --dist --no-examples --profile +``` Many OSS tools are allowing you to analyze generated stats file - [an official tool](http://webpack.github.io/analyse/#modules) from webpack authors - [webpack-visualizer](https://chrisbateman.github.io/webpack-visualizer/) diff --git a/src/core/public/chrome/chrome_service.mock.ts b/src/core/public/chrome/chrome_service.mock.ts index 89007461b63e6..4a79dd8869c1c 100644 --- a/src/core/public/chrome/chrome_service.mock.ts +++ b/src/core/public/chrome/chrome_service.mock.ts @@ -23,7 +23,8 @@ import { ChromeBreadcrumb, ChromeService, InternalChromeStart, -} from './chrome_service'; + NavType, +} from './'; const createStartContractMock = () => { const startContract: DeeplyMockedKeys<InternalChromeStart> = { @@ -72,6 +73,7 @@ const createStartContractMock = () => { setHelpExtension: jest.fn(), setHelpSupportUrl: jest.fn(), getIsNavDrawerLocked$: jest.fn(), + getNavType$: jest.fn(), }; startContract.navLinks.getAll.mockReturnValue([]); startContract.getBrand$.mockReturnValue(new BehaviorSubject({} as ChromeBrand)); @@ -81,6 +83,7 @@ const createStartContractMock = () => { startContract.getBreadcrumbs$.mockReturnValue(new BehaviorSubject([{} as ChromeBreadcrumb])); startContract.getHelpExtension$.mockReturnValue(new BehaviorSubject(undefined)); startContract.getIsNavDrawerLocked$.mockReturnValue(new BehaviorSubject(false)); + startContract.getNavType$.mockReturnValue(new BehaviorSubject('modern' as NavType)); return startContract; }; diff --git a/src/core/public/chrome/chrome_service.test.ts b/src/core/public/chrome/chrome_service.test.ts index a765ed47ea712..327be61cc63e3 100644 --- a/src/core/public/chrome/chrome_service.test.ts +++ b/src/core/public/chrome/chrome_service.test.ts @@ -17,18 +17,18 @@ * under the License. */ -import * as Rx from 'rxjs'; -import { take, toArray } from 'rxjs/operators'; import { shallow } from 'enzyme'; import React from 'react'; - +import * as Rx from 'rxjs'; +import { take, toArray } from 'rxjs/operators'; +import { App } from '../application'; import { applicationServiceMock } from '../application/application_service.mock'; +import { docLinksServiceMock } from '../doc_links/doc_links_service.mock'; import { httpServiceMock } from '../http/http_service.mock'; import { injectedMetadataServiceMock } from '../injected_metadata/injected_metadata_service.mock'; import { notificationServiceMock } from '../notifications/notifications_service.mock'; -import { docLinksServiceMock } from '../doc_links/doc_links_service.mock'; +import { uiSettingsServiceMock } from '../ui_settings/ui_settings_service.mock'; import { ChromeService } from './chrome_service'; -import { App } from '../application'; class FakeApp implements App { public title = `${this.id} App`; @@ -51,6 +51,7 @@ function defaultStartDeps(availableApps?: App[]) { http: httpServiceMock.createStartContract(), injectedMetadata: injectedMetadataServiceMock.createStartContract(), notifications: notificationServiceMock.createStartContract(), + uiSettings: uiSettingsServiceMock.createStartContract(), }; if (availableApps) { diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index 3d9eeff09ecce..3fc22caaefb04 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -17,27 +17,26 @@ * under the License. */ +import { Breadcrumb as EuiBreadcrumb, IconType } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import React from 'react'; -import { BehaviorSubject, Observable, ReplaySubject, combineLatest, of, merge } from 'rxjs'; +import { BehaviorSubject, combineLatest, merge, Observable, of, ReplaySubject } from 'rxjs'; import { flatMap, map, takeUntil } from 'rxjs/operators'; import { parse } from 'url'; - -import { i18n } from '@kbn/i18n'; -import { IconType, Breadcrumb as EuiBreadcrumb } from '@elastic/eui'; - -import { InjectedMetadataStart } from '../injected_metadata'; -import { NotificationsStart } from '../notifications'; import { InternalApplicationStart } from '../application'; +import { DocLinksStart } from '../doc_links'; import { HttpStart } from '../http'; - +import { InjectedMetadataStart } from '../injected_metadata'; +import { NotificationsStart } from '../notifications'; +import { IUiSettingsClient } from '../ui_settings'; +import { KIBANA_ASK_ELASTIC_LINK } from './constants'; +import { ChromeDocTitle, DocTitleService } from './doc_title'; +import { ChromeNavControls, NavControlsService } from './nav_controls'; import { ChromeNavLinks, NavLinksService } from './nav_links'; import { ChromeRecentlyAccessed, RecentlyAccessedService } from './recently_accessed'; -import { NavControlsService, ChromeNavControls } from './nav_controls'; -import { DocTitleService, ChromeDocTitle } from './doc_title'; -import { LoadingIndicator, Header } from './ui'; -import { DocLinksStart } from '../doc_links'; +import { Header, LoadingIndicator } from './ui'; +import { NavType } from './ui/header'; import { ChromeHelpExtensionMenuLink } from './ui/header/header_help_menu'; -import { KIBANA_ASK_ELASTIC_LINK } from './constants'; export { ChromeNavControls, ChromeRecentlyAccessed, ChromeDocTitle }; const IS_LOCKED_KEY = 'core.chrome.isLocked'; @@ -84,6 +83,7 @@ interface StartDeps { http: HttpStart; injectedMetadata: InjectedMetadataStart; notifications: NotificationsStart; + uiSettings: IUiSettingsClient; } /** @internal */ @@ -136,6 +136,7 @@ export class ChromeService { http, injectedMetadata, notifications, + uiSettings, }: StartDeps): Promise<InternalChromeStart> { this.initVisibility(application); @@ -160,6 +161,10 @@ export class ChromeService { const getIsNavDrawerLocked$ = isNavDrawerLocked$.pipe(takeUntil(this.stop$)); + // TODO #64541 + // Can delete + const getNavType$ = uiSettings.get$('pageNavigation').pipe(takeUntil(this.stop$)); + if (!this.params.browserSupportsCsp && injectedMetadata.getCspConfig().warnLegacyBrowsers) { notifications.toasts.addWarning( i18n.translate('core.chrome.legacyBrowserWarning', { @@ -197,6 +202,7 @@ export class ChromeService { navControlsRight$={navControls.getRight$()} onIsLockedUpdate={setIsNavDrawerLocked} isLocked$={getIsNavDrawerLocked$} + navType$={getNavType$} /> </React.Fragment> ), @@ -257,6 +263,8 @@ export class ChromeService { setHelpSupportUrl: (url: string) => helpSupportUrl$.next(url), getIsNavDrawerLocked$: () => getIsNavDrawerLocked$, + + getNavType$: () => getNavType$, }; } @@ -403,6 +411,13 @@ export interface ChromeStart { * Get an observable of the current locked state of the nav drawer. */ getIsNavDrawerLocked$(): Observable<boolean>; + + /** + * Get the navigation type + * TODO #64541 + * Can delete + */ + getNavType$(): Observable<NavType>; } /** @internal */ diff --git a/src/core/public/chrome/index.ts b/src/core/public/chrome/index.ts index 4a500836990a7..cc1e0851f5944 100644 --- a/src/core/public/chrome/index.ts +++ b/src/core/public/chrome/index.ts @@ -33,6 +33,7 @@ export { ChromeHelpExtensionMenuDocumentationLink, ChromeHelpExtensionMenuGitHubLink, } from './ui/header/header_help_menu'; +export { NavType } from './ui'; export { ChromeNavLink, ChromeNavLinks, ChromeNavLinkUpdateableFields } from './nav_links'; export { ChromeRecentlyAccessed, ChromeRecentlyAccessedHistoryItem } from './recently_accessed'; export { ChromeNavControl, ChromeNavControls } from './nav_controls'; diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap new file mode 100644 index 0000000000000..14d5b2e8fdcbb --- /dev/null +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -0,0 +1,4506 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CollapsibleNav renders links grouped by category 1`] = ` +<CollapsibleNav + homeHref="/" + id="collapsible-nav" + isLocked={false} + isOpen={true} + navLinks={ + Array [ + Object { + "category": Object { + "euiIconType": "logoKibana", + "id": "kibana", + "label": "Kibana", + "order": 1000, + }, + "data-test-subj": "discover", + "href": "discover", + "isActive": true, + "key": "discover", + "label": "discover", + "onClick": [Function], + }, + Object { + "category": Object { + "euiIconType": "logoSecurity", + "id": "security", + "label": "Security", + "order": 3000, + }, + "data-test-subj": "siem", + "href": "siem", + "isActive": true, + "key": "siem", + "label": "siem", + "onClick": [Function], + }, + Object { + "category": Object { + "euiIconType": "logoObservability", + "id": "observability", + "label": "Observability", + "order": 2000, + }, + "data-test-subj": "metrics", + "href": "metrics", + "isActive": true, + "key": "metrics", + "label": "metrics", + "onClick": [Function], + }, + Object { + "category": Object { + "id": "management", + "label": "Management", + "order": 5000, + }, + "data-test-subj": "monitoring", + "href": "monitoring", + "isActive": true, + "key": "monitoring", + "label": "monitoring", + "onClick": [Function], + }, + Object { + "category": Object { + "euiIconType": "logoKibana", + "id": "kibana", + "label": "Kibana", + "order": 1000, + }, + "data-test-subj": "visualize", + "href": "visualize", + "isActive": true, + "key": "visualize", + "label": "visualize", + "onClick": [Function], + }, + Object { + "category": Object { + "euiIconType": "logoKibana", + "id": "kibana", + "label": "Kibana", + "order": 1000, + }, + "data-test-subj": "dashboard", + "href": "dashboard", + "isActive": true, + "key": "dashboard", + "label": "dashboard", + "onClick": [Function], + }, + Object { + "category": undefined, + "data-test-subj": "canvas", + "href": "canvas", + "isActive": true, + "key": "canvas", + "label": "canvas", + "onClick": [Function], + }, + Object { + "category": Object { + "euiIconType": "logoObservability", + "id": "observability", + "label": "Observability", + "order": 2000, + }, + "data-test-subj": "logs", + "href": "logs", + "isActive": true, + "key": "logs", + "label": "logs", + "onClick": [Function], + }, + ] + } + onIsLockedUpdate={[Function]} + onIsOpenUpdate={[Function]} + recentNavLinks={ + Array [ + Object { + "aria-label": "recent 1", + "href": "recent 1", + "label": "recent 1", + "title": "recent 1", + }, + Object { + "aria-label": "recent 2", + "href": "recent 2", + "label": "recent 2", + "title": "recent 2", + }, + ] + } + storage={ + StubBrowserStorage { + "keys": Array [], + "size": 0, + "sizeLimit": 5000000, + "values": Array [], + } + } +> + <EuiCollapsibleNav + aria-label="Primary" + data-test-subj="collapsibleNav" + id="collapsible-nav" + isDocked={false} + isOpen={true} + onClose={[Function]} + > + <EuiWindowEvent + event="keydown" + handler={[Function]} + /> + <EuiOverlayMask + onClick={[Function]} + > + <Portal + containerInfo={ + <div + class="euiOverlayMask" + /> + } + /> + </EuiOverlayMask> + <EuiFocusTrap + clickOutsideDisables={true} + disabled={false} + > + <EuiOutsideClickDetector + isDisabled={false} + onOutsideClick={[Function]} + > + <OutsideEventDetector + handleEvent={[Function]} + onMouseDown={[Function]} + onMouseUp={[Function]} + onTouchEnd={[Function]} + onTouchStart={[Function]} + > + <div + onMouseDown={[Function]} + onMouseUp={[Function]} + onTouchEnd={[Function]} + onTouchStart={[Function]} + > + <FocusLock + as="div" + autoFocus={true} + disabled={false} + lockProps={ + Object { + "style": undefined, + } + } + noFocusGuards={false} + persistentFocus={false} + returnFocus={true} + > + <div + data-focus-guard={true} + key="guard-first" + style={ + Object { + "height": "0px", + "left": "1px", + "overflow": "hidden", + "padding": 0, + "position": "fixed", + "top": "1px", + "width": "1px", + } + } + tabIndex={0} + /> + <div + data-focus-guard={true} + key="guard-nearest" + style={ + Object { + "height": "0px", + "left": "1px", + "overflow": "hidden", + "padding": 0, + "position": "fixed", + "top": "1px", + "width": "1px", + } + } + tabIndex={1} + /> + <div + data-focus-lock-disabled={false} + onBlur={[Function]} + onFocus={[Function]} + > + <SideEffect(FocusWatcher) + autoFocus={true} + disabled={false} + observed={ + <div + data-focus-lock-disabled="false" + > + <nav + aria-label="Primary" + class="euiCollapsibleNav" + data-test-subj="collapsibleNav" + id="collapsible-nav" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + class="euiCollapsibleNavGroup euiCollapsibleNavGroup--light eui-yScroll" + id="mockId" + style="max-height: 40vh;" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Pinned links" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + href="/" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="home" + /> + <span + class="euiListGroupItem__label" + title="Home" + > + Home + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + <hr + class="euiHorizontalRule euiHorizontalRule--full" + /> + <div + class="euiFlexItem eui-yScroll" + > + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Recently viewed links" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <a + aria-label="recent 1" + class="euiListGroupItem__button" + href="recent 1" + title="recent 1" + > + <span + class="euiListGroupItem__label" + title="recent 1" + > + recent 1 + </span> + </a> + </li> + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <a + aria-label="recent 2" + class="euiListGroupItem__button" + href="recent 2" + title="recent 2" + > + <span + class="euiListGroupItem__label" + title="recent 2" + > + recent 2 + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-kibana" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + aria-hidden="true" + data-euiicon-type="logoKibana" + /> + </div> + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Kibana + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Primary navigation links, Kibana" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="discover" + > + <span + class="euiListGroupItem__label" + title="discover" + > + discover + </span> + </a> + </li> + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="visualize" + > + <span + class="euiListGroupItem__label" + title="visualize" + > + visualize + </span> + </a> + </li> + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="dashboard" + > + <span + class="euiListGroupItem__label" + title="dashboard" + > + dashboard + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-observability" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + aria-hidden="true" + data-euiicon-type="logoObservability" + /> + </div> + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Observability + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Primary navigation links, Observability" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="metrics" + > + <span + class="euiListGroupItem__label" + title="metrics" + > + metrics + </span> + </a> + </li> + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="logs" + > + <span + class="euiListGroupItem__label" + title="logs" + > + logs + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-security" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + aria-hidden="true" + data-euiicon-type="logoSecurity" + /> + </div> + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Security + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Primary navigation links, Security" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="siem" + > + <span + class="euiListGroupItem__label" + title="siem" + > + siem + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-management" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Management + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Primary navigation links, Management" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="monitoring" + > + <span + class="euiListGroupItem__label" + title="monitoring" + > + monitoring + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiCollapsibleNavGroup" + id="mockId" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + class="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="canvas" + > + <span + class="euiListGroupItem__label" + title="canvas" + > + canvas + </span> + </a> + </li> + </ul> + </div> + </div> + <div + class="euiCollapsibleNavGroup eui-showFor--l eui-showFor--xl" + id="mockId" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + class="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <li + class="euiListGroupItem euiListGroupItem--xSmall euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <button + aria-label="Dock primary navigation" + class="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + type="button" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="lockOpen" + /> + <span + class="euiListGroupItem__label" + title="Dock navigation" + > + Dock navigation + </span> + </button> + </li> + </ul> + </div> + </div> + </div> + <button + class="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--xSmall euiCollapsibleNav__closeButton" + type="button" + > + <span + class="euiButtonEmpty__content" + > + <div + aria-hidden="true" + class="euiButtonEmpty__icon" + data-euiicon-type="cross" + /> + <span + class="euiButtonEmpty__text" + > + <span + class="euiCollapsibleNav__closeButtonLabel" + > + close + </span> + </span> + </span> + </button> + </nav> + </div> + } + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + > + <FocusWatcher + autoFocus={true} + disabled={false} + observed={ + <div + data-focus-lock-disabled="false" + > + <nav + aria-label="Primary" + class="euiCollapsibleNav" + data-test-subj="collapsibleNav" + id="collapsible-nav" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + class="euiCollapsibleNavGroup euiCollapsibleNavGroup--light eui-yScroll" + id="mockId" + style="max-height: 40vh;" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Pinned links" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + href="/" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="home" + /> + <span + class="euiListGroupItem__label" + title="Home" + > + Home + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + <hr + class="euiHorizontalRule euiHorizontalRule--full" + /> + <div + class="euiFlexItem eui-yScroll" + > + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Recently viewed links" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <a + aria-label="recent 1" + class="euiListGroupItem__button" + href="recent 1" + title="recent 1" + > + <span + class="euiListGroupItem__label" + title="recent 1" + > + recent 1 + </span> + </a> + </li> + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <a + aria-label="recent 2" + class="euiListGroupItem__button" + href="recent 2" + title="recent 2" + > + <span + class="euiListGroupItem__label" + title="recent 2" + > + recent 2 + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-kibana" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + aria-hidden="true" + data-euiicon-type="logoKibana" + /> + </div> + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Kibana + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Primary navigation links, Kibana" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="discover" + > + <span + class="euiListGroupItem__label" + title="discover" + > + discover + </span> + </a> + </li> + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="visualize" + > + <span + class="euiListGroupItem__label" + title="visualize" + > + visualize + </span> + </a> + </li> + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="dashboard" + > + <span + class="euiListGroupItem__label" + title="dashboard" + > + dashboard + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-observability" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + aria-hidden="true" + data-euiicon-type="logoObservability" + /> + </div> + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Observability + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Primary navigation links, Observability" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="metrics" + > + <span + class="euiListGroupItem__label" + title="metrics" + > + metrics + </span> + </a> + </li> + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="logs" + > + <span + class="euiListGroupItem__label" + title="logs" + > + logs + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-security" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + aria-hidden="true" + data-euiicon-type="logoSecurity" + /> + </div> + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Security + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Primary navigation links, Security" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="siem" + > + <span + class="euiListGroupItem__label" + title="siem" + > + siem + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-management" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Management + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Primary navigation links, Management" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="monitoring" + > + <span + class="euiListGroupItem__label" + title="monitoring" + > + monitoring + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + </div> + </div> + <div + class="euiCollapsibleNavGroup" + id="mockId" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + class="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="canvas" + > + <span + class="euiListGroupItem__label" + title="canvas" + > + canvas + </span> + </a> + </li> + </ul> + </div> + </div> + <div + class="euiCollapsibleNavGroup eui-showFor--l eui-showFor--xl" + id="mockId" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + class="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <li + class="euiListGroupItem euiListGroupItem--xSmall euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <button + aria-label="Dock primary navigation" + class="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + type="button" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="lockOpen" + /> + <span + class="euiListGroupItem__label" + title="Dock navigation" + > + Dock navigation + </span> + </button> + </li> + </ul> + </div> + </div> + </div> + <button + class="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--xSmall euiCollapsibleNav__closeButton" + type="button" + > + <span + class="euiButtonEmpty__content" + > + <div + aria-hidden="true" + class="euiButtonEmpty__icon" + data-euiicon-type="cross" + /> + <span + class="euiButtonEmpty__text" + > + <span + class="euiCollapsibleNav__closeButtonLabel" + > + close + </span> + </span> + </span> + </button> + </nav> + </div> + } + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + /> + </SideEffect(FocusWatcher)> + <nav + aria-label="Primary" + className="euiCollapsibleNav" + data-test-subj="collapsibleNav" + id="collapsible-nav" + > + <EuiFlexItem + grow={false} + style={ + Object { + "flexShrink": 0, + } + } + > + <div + className="euiFlexItem euiFlexItem--flexGrowZero" + style={ + Object { + "flexShrink": 0, + } + } + > + <EuiCollapsibleNavGroup + background="light" + className="eui-yScroll" + style={ + Object { + "maxHeight": "40vh", + } + } + > + <div + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--light eui-yScroll" + id="mockId" + style={ + Object { + "maxHeight": "40vh", + } + } + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + aria-label="Pinned links" + color="text" + gutterSize="none" + listItems={ + Array [ + Object { + "href": "/", + "iconType": "home", + "label": "Home", + "onClick": [Function], + }, + ] + } + maxWidth="none" + size="s" + > + <ul + aria-label="Pinned links" + className="euiListGroup" + style={ + Object { + "maxWidth": "none", + } + } + > + <EuiListGroupItem + color="text" + href="/" + iconType="home" + key="title-0" + label="Home" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + href="/" + onClick={[Function]} + > + <EuiIcon + className="euiListGroupItem__icon" + type="home" + > + <div + className="euiListGroupItem__icon" + data-euiicon-type="home" + /> + </EuiIcon> + <span + className="euiListGroupItem__label" + title="Home" + > + Home + </span> + </a> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </EuiCollapsibleNavGroup> + </div> + </EuiFlexItem> + <EuiHorizontalRule + margin="none" + > + <hr + className="euiHorizontalRule euiHorizontalRule--full" + /> + </EuiHorizontalRule> + <EuiFlexItem + className="eui-yScroll" + > + <div + className="euiFlexItem eui-yScroll" + > + <EuiCollapsibleNavGroup + initialIsOpen={true} + isCollapsible={true} + key="recentlyViewed" + onToggle={[Function]} + title="Recently viewed" + > + <EuiAccordion + arrowDisplay="right" + buttonClassName="euiCollapsibleNavGroup__heading" + buttonContent={ + <ForwardRef + alignItems="center" + gutterSize="m" + responsive={false} + > + <EuiFlexItem> + <EuiTitle + size="xxs" + > + <h3 + className="euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </EuiTitle> + </EuiFlexItem> + </ForwardRef> + } + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + id="mockId" + initialIsOpen={true} + onToggle={[Function]} + paddingSize="none" + > + <div + className="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + onToggle={[Function]} + > + <div + className="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded={true} + className="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + onClick={[Function]} + type="button" + > + <span + className="euiAccordion__iconWrapper" + > + <EuiIcon + className="euiAccordion__icon euiAccordion__icon-isOpen" + size="m" + type="arrowRight" + > + <div + className="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + size="m" + /> + </EuiIcon> + </span> + <span + className="euiIEFlexWrapFix" + > + <EuiFlexGroup + alignItems="center" + gutterSize="m" + responsive={false} + > + <div + className="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <EuiFlexItem> + <div + className="euiFlexItem" + > + <EuiTitle + size="xxs" + > + <h3 + className="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </EuiTitle> + </div> + </EuiFlexItem> + </div> + </EuiFlexGroup> + </span> + </button> + </div> + <div + className="euiAccordion__childWrapper" + id="mockId" + > + <EuiResizeObserver + onResize={[Function]} + > + <div> + <div + className="" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + aria-label="Recently viewed links" + color="subdued" + gutterSize="none" + listItems={ + Array [ + Object { + "aria-label": "recent 1", + "href": "recent 1", + "label": "recent 1", + "title": "recent 1", + }, + Object { + "aria-label": "recent 2", + "href": "recent 2", + "label": "recent 2", + "title": "recent 2", + }, + ] + } + maxWidth="none" + size="s" + > + <ul + aria-label="Recently viewed links" + className="euiListGroup" + style={ + Object { + "maxWidth": "none", + } + } + > + <EuiListGroupItem + aria-label="recent 1" + color="subdued" + href="recent 1" + key="title-0" + label="recent 1" + showToolTip={false} + size="s" + title="recent 1" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <a + aria-label="recent 1" + className="euiListGroupItem__button" + href="recent 1" + title="recent 1" + > + <span + className="euiListGroupItem__label" + title="recent 1" + > + recent 1 + </span> + </a> + </li> + </EuiListGroupItem> + <EuiListGroupItem + aria-label="recent 2" + color="subdued" + href="recent 2" + key="title-1" + label="recent 2" + showToolTip={false} + size="s" + title="recent 2" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <a + aria-label="recent 2" + className="euiListGroupItem__button" + href="recent 2" + title="recent 2" + > + <span + className="euiListGroupItem__label" + title="recent 2" + > + recent 2 + </span> + </a> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </div> + </EuiResizeObserver> + </div> + </div> + </EuiAccordion> + </EuiCollapsibleNavGroup> + <EuiCollapsibleNavGroup + data-test-subj="collapsibleNavGroup-kibana" + iconType="logoKibana" + initialIsOpen={true} + isCollapsible={true} + key="kibana" + onToggle={[Function]} + title="Kibana" + > + <EuiAccordion + arrowDisplay="right" + buttonClassName="euiCollapsibleNavGroup__heading" + buttonContent={ + <ForwardRef + alignItems="center" + gutterSize="m" + responsive={false} + > + <EuiFlexItem + grow={false} + > + <EuiIcon + aria-hidden="true" + size="l" + type="logoKibana" + /> + </EuiFlexItem> + <EuiFlexItem> + <EuiTitle + size="xxs" + > + <h3 + className="euiCollapsibleNavGroup__title" + id="mockId__title" + > + Kibana + </h3> + </EuiTitle> + </EuiFlexItem> + </ForwardRef> + } + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-kibana" + id="mockId" + initialIsOpen={true} + onToggle={[Function]} + paddingSize="none" + > + <div + className="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-kibana" + onToggle={[Function]} + > + <div + className="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded={true} + className="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + onClick={[Function]} + type="button" + > + <span + className="euiAccordion__iconWrapper" + > + <EuiIcon + className="euiAccordion__icon euiAccordion__icon-isOpen" + size="m" + type="arrowRight" + > + <div + className="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + size="m" + /> + </EuiIcon> + </span> + <span + className="euiIEFlexWrapFix" + > + <EuiFlexGroup + alignItems="center" + gutterSize="m" + responsive={false} + > + <div + className="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <EuiFlexItem + grow={false} + > + <div + className="euiFlexItem euiFlexItem--flexGrowZero" + > + <EuiIcon + aria-hidden="true" + size="l" + type="logoKibana" + > + <div + aria-hidden="true" + data-euiicon-type="logoKibana" + size="l" + /> + </EuiIcon> + </div> + </EuiFlexItem> + <EuiFlexItem> + <div + className="euiFlexItem" + > + <EuiTitle + size="xxs" + > + <h3 + className="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Kibana + </h3> + </EuiTitle> + </div> + </EuiFlexItem> + </div> + </EuiFlexGroup> + </span> + </button> + </div> + <div + className="euiAccordion__childWrapper" + id="mockId" + > + <EuiResizeObserver + onResize={[Function]} + > + <div> + <div + className="" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + aria-label="Primary navigation links, Kibana" + color="subdued" + gutterSize="none" + listItems={ + Array [ + Object { + "data-test-subj": "collapsibleNavAppLink", + "href": "discover", + "isActive": true, + "isDisabled": undefined, + "label": "discover", + "onClick": [Function], + }, + Object { + "data-test-subj": "collapsibleNavAppLink", + "href": "visualize", + "isActive": true, + "isDisabled": undefined, + "label": "visualize", + "onClick": [Function], + }, + Object { + "data-test-subj": "collapsibleNavAppLink", + "href": "dashboard", + "isActive": true, + "isDisabled": undefined, + "label": "dashboard", + "onClick": [Function], + }, + ] + } + maxWidth="none" + size="s" + > + <ul + aria-label="Primary navigation links, Kibana" + className="euiListGroup" + style={ + Object { + "maxWidth": "none", + } + } + > + <EuiListGroupItem + color="subdued" + data-test-subj="collapsibleNavAppLink" + href="discover" + isActive={true} + key="title-0" + label="discover" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="discover" + onClick={[Function]} + > + <span + className="euiListGroupItem__label" + title="discover" + > + discover + </span> + </a> + </li> + </EuiListGroupItem> + <EuiListGroupItem + color="subdued" + data-test-subj="collapsibleNavAppLink" + href="visualize" + isActive={true} + key="title-1" + label="visualize" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="visualize" + onClick={[Function]} + > + <span + className="euiListGroupItem__label" + title="visualize" + > + visualize + </span> + </a> + </li> + </EuiListGroupItem> + <EuiListGroupItem + color="subdued" + data-test-subj="collapsibleNavAppLink" + href="dashboard" + isActive={true} + key="title-2" + label="dashboard" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="dashboard" + onClick={[Function]} + > + <span + className="euiListGroupItem__label" + title="dashboard" + > + dashboard + </span> + </a> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </div> + </EuiResizeObserver> + </div> + </div> + </EuiAccordion> + </EuiCollapsibleNavGroup> + <EuiCollapsibleNavGroup + data-test-subj="collapsibleNavGroup-observability" + iconType="logoObservability" + initialIsOpen={true} + isCollapsible={true} + key="observability" + onToggle={[Function]} + title="Observability" + > + <EuiAccordion + arrowDisplay="right" + buttonClassName="euiCollapsibleNavGroup__heading" + buttonContent={ + <ForwardRef + alignItems="center" + gutterSize="m" + responsive={false} + > + <EuiFlexItem + grow={false} + > + <EuiIcon + aria-hidden="true" + size="l" + type="logoObservability" + /> + </EuiFlexItem> + <EuiFlexItem> + <EuiTitle + size="xxs" + > + <h3 + className="euiCollapsibleNavGroup__title" + id="mockId__title" + > + Observability + </h3> + </EuiTitle> + </EuiFlexItem> + </ForwardRef> + } + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-observability" + id="mockId" + initialIsOpen={true} + onToggle={[Function]} + paddingSize="none" + > + <div + className="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-observability" + onToggle={[Function]} + > + <div + className="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded={true} + className="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + onClick={[Function]} + type="button" + > + <span + className="euiAccordion__iconWrapper" + > + <EuiIcon + className="euiAccordion__icon euiAccordion__icon-isOpen" + size="m" + type="arrowRight" + > + <div + className="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + size="m" + /> + </EuiIcon> + </span> + <span + className="euiIEFlexWrapFix" + > + <EuiFlexGroup + alignItems="center" + gutterSize="m" + responsive={false} + > + <div + className="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <EuiFlexItem + grow={false} + > + <div + className="euiFlexItem euiFlexItem--flexGrowZero" + > + <EuiIcon + aria-hidden="true" + size="l" + type="logoObservability" + > + <div + aria-hidden="true" + data-euiicon-type="logoObservability" + size="l" + /> + </EuiIcon> + </div> + </EuiFlexItem> + <EuiFlexItem> + <div + className="euiFlexItem" + > + <EuiTitle + size="xxs" + > + <h3 + className="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Observability + </h3> + </EuiTitle> + </div> + </EuiFlexItem> + </div> + </EuiFlexGroup> + </span> + </button> + </div> + <div + className="euiAccordion__childWrapper" + id="mockId" + > + <EuiResizeObserver + onResize={[Function]} + > + <div> + <div + className="" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + aria-label="Primary navigation links, Observability" + color="subdued" + gutterSize="none" + listItems={ + Array [ + Object { + "data-test-subj": "collapsibleNavAppLink", + "href": "metrics", + "isActive": true, + "isDisabled": undefined, + "label": "metrics", + "onClick": [Function], + }, + Object { + "data-test-subj": "collapsibleNavAppLink", + "href": "logs", + "isActive": true, + "isDisabled": undefined, + "label": "logs", + "onClick": [Function], + }, + ] + } + maxWidth="none" + size="s" + > + <ul + aria-label="Primary navigation links, Observability" + className="euiListGroup" + style={ + Object { + "maxWidth": "none", + } + } + > + <EuiListGroupItem + color="subdued" + data-test-subj="collapsibleNavAppLink" + href="metrics" + isActive={true} + key="title-0" + label="metrics" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="metrics" + onClick={[Function]} + > + <span + className="euiListGroupItem__label" + title="metrics" + > + metrics + </span> + </a> + </li> + </EuiListGroupItem> + <EuiListGroupItem + color="subdued" + data-test-subj="collapsibleNavAppLink" + href="logs" + isActive={true} + key="title-1" + label="logs" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="logs" + onClick={[Function]} + > + <span + className="euiListGroupItem__label" + title="logs" + > + logs + </span> + </a> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </div> + </EuiResizeObserver> + </div> + </div> + </EuiAccordion> + </EuiCollapsibleNavGroup> + <EuiCollapsibleNavGroup + data-test-subj="collapsibleNavGroup-security" + iconType="logoSecurity" + initialIsOpen={true} + isCollapsible={true} + key="security" + onToggle={[Function]} + title="Security" + > + <EuiAccordion + arrowDisplay="right" + buttonClassName="euiCollapsibleNavGroup__heading" + buttonContent={ + <ForwardRef + alignItems="center" + gutterSize="m" + responsive={false} + > + <EuiFlexItem + grow={false} + > + <EuiIcon + aria-hidden="true" + size="l" + type="logoSecurity" + /> + </EuiFlexItem> + <EuiFlexItem> + <EuiTitle + size="xxs" + > + <h3 + className="euiCollapsibleNavGroup__title" + id="mockId__title" + > + Security + </h3> + </EuiTitle> + </EuiFlexItem> + </ForwardRef> + } + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-security" + id="mockId" + initialIsOpen={true} + onToggle={[Function]} + paddingSize="none" + > + <div + className="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-security" + onToggle={[Function]} + > + <div + className="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded={true} + className="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + onClick={[Function]} + type="button" + > + <span + className="euiAccordion__iconWrapper" + > + <EuiIcon + className="euiAccordion__icon euiAccordion__icon-isOpen" + size="m" + type="arrowRight" + > + <div + className="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + size="m" + /> + </EuiIcon> + </span> + <span + className="euiIEFlexWrapFix" + > + <EuiFlexGroup + alignItems="center" + gutterSize="m" + responsive={false} + > + <div + className="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <EuiFlexItem + grow={false} + > + <div + className="euiFlexItem euiFlexItem--flexGrowZero" + > + <EuiIcon + aria-hidden="true" + size="l" + type="logoSecurity" + > + <div + aria-hidden="true" + data-euiicon-type="logoSecurity" + size="l" + /> + </EuiIcon> + </div> + </EuiFlexItem> + <EuiFlexItem> + <div + className="euiFlexItem" + > + <EuiTitle + size="xxs" + > + <h3 + className="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Security + </h3> + </EuiTitle> + </div> + </EuiFlexItem> + </div> + </EuiFlexGroup> + </span> + </button> + </div> + <div + className="euiAccordion__childWrapper" + id="mockId" + > + <EuiResizeObserver + onResize={[Function]} + > + <div> + <div + className="" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + aria-label="Primary navigation links, Security" + color="subdued" + gutterSize="none" + listItems={ + Array [ + Object { + "data-test-subj": "collapsibleNavAppLink", + "href": "siem", + "isActive": true, + "isDisabled": undefined, + "label": "siem", + "onClick": [Function], + }, + ] + } + maxWidth="none" + size="s" + > + <ul + aria-label="Primary navigation links, Security" + className="euiListGroup" + style={ + Object { + "maxWidth": "none", + } + } + > + <EuiListGroupItem + color="subdued" + data-test-subj="collapsibleNavAppLink" + href="siem" + isActive={true} + key="title-0" + label="siem" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="siem" + onClick={[Function]} + > + <span + className="euiListGroupItem__label" + title="siem" + > + siem + </span> + </a> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </div> + </EuiResizeObserver> + </div> + </div> + </EuiAccordion> + </EuiCollapsibleNavGroup> + <EuiCollapsibleNavGroup + data-test-subj="collapsibleNavGroup-management" + initialIsOpen={true} + isCollapsible={true} + key="management" + onToggle={[Function]} + title="Management" + > + <EuiAccordion + arrowDisplay="right" + buttonClassName="euiCollapsibleNavGroup__heading" + buttonContent={ + <ForwardRef + alignItems="center" + gutterSize="m" + responsive={false} + > + <EuiFlexItem> + <EuiTitle + size="xxs" + > + <h3 + className="euiCollapsibleNavGroup__title" + id="mockId__title" + > + Management + </h3> + </EuiTitle> + </EuiFlexItem> + </ForwardRef> + } + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-management" + id="mockId" + initialIsOpen={true} + onToggle={[Function]} + paddingSize="none" + > + <div + className="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + data-test-subj="collapsibleNavGroup-management" + onToggle={[Function]} + > + <div + className="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded={true} + className="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + onClick={[Function]} + type="button" + > + <span + className="euiAccordion__iconWrapper" + > + <EuiIcon + className="euiAccordion__icon euiAccordion__icon-isOpen" + size="m" + type="arrowRight" + > + <div + className="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + size="m" + /> + </EuiIcon> + </span> + <span + className="euiIEFlexWrapFix" + > + <EuiFlexGroup + alignItems="center" + gutterSize="m" + responsive={false} + > + <div + className="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <EuiFlexItem> + <div + className="euiFlexItem" + > + <EuiTitle + size="xxs" + > + <h3 + className="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Management + </h3> + </EuiTitle> + </div> + </EuiFlexItem> + </div> + </EuiFlexGroup> + </span> + </button> + </div> + <div + className="euiAccordion__childWrapper" + id="mockId" + > + <EuiResizeObserver + onResize={[Function]} + > + <div> + <div + className="" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + aria-label="Primary navigation links, Management" + color="subdued" + gutterSize="none" + listItems={ + Array [ + Object { + "data-test-subj": "collapsibleNavAppLink", + "href": "monitoring", + "isActive": true, + "isDisabled": undefined, + "label": "monitoring", + "onClick": [Function], + }, + ] + } + maxWidth="none" + size="s" + > + <ul + aria-label="Primary navigation links, Management" + className="euiListGroup" + style={ + Object { + "maxWidth": "none", + } + } + > + <EuiListGroupItem + color="subdued" + data-test-subj="collapsibleNavAppLink" + href="monitoring" + isActive={true} + key="title-0" + label="monitoring" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--subdued euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="monitoring" + onClick={[Function]} + > + <span + className="euiListGroupItem__label" + title="monitoring" + > + monitoring + </span> + </a> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </div> + </EuiResizeObserver> + </div> + </div> + </EuiAccordion> + </EuiCollapsibleNavGroup> + <EuiCollapsibleNavGroup + key="0" + > + <div + className="euiCollapsibleNavGroup" + id="mockId" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + flush={true} + > + <ul + className="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <EuiListGroupItem + color="text" + data-test-subj="collapsibleNavAppLink" + href="canvas" + isActive={true} + label="canvas" + onClick={[Function]} + size="s" + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isActive euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + data-test-subj="collapsibleNavAppLink" + href="canvas" + onClick={[Function]} + > + <span + className="euiListGroupItem__label" + title="canvas" + > + canvas + </span> + </a> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </EuiCollapsibleNavGroup> + <EuiShowFor + sizes={ + Array [ + "l", + "xl", + ] + } + > + <EuiCollapsibleNavGroup + className="eui-showFor--l eui-showFor--xl" + key=".0" + > + <div + className="euiCollapsibleNavGroup eui-showFor--l eui-showFor--xl" + id="mockId" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + flush={true} + > + <ul + className="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <EuiListGroupItem + aria-label="Dock primary navigation" + buttonRef={ + Object { + "current": <button + aria-label="Dock primary navigation" + class="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + type="button" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="lockOpen" + /> + <span + class="euiListGroupItem__label" + title="Dock navigation" + > + Dock navigation + </span> + </button>, + } + } + color="subdued" + data-test-subj="collapsible-nav-lock" + iconType="lockOpen" + label="Dock navigation" + onClick={[Function]} + size="xs" + > + <li + className="euiListGroupItem euiListGroupItem--xSmall euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <button + aria-label="Dock primary navigation" + className="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + disabled={false} + onClick={[Function]} + type="button" + > + <EuiIcon + className="euiListGroupItem__icon" + type="lockOpen" + > + <div + className="euiListGroupItem__icon" + data-euiicon-type="lockOpen" + /> + </EuiIcon> + <span + className="euiListGroupItem__label" + title="Dock navigation" + > + Dock navigation + </span> + </button> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </EuiCollapsibleNavGroup> + </EuiShowFor> + </div> + </EuiFlexItem> + <EuiButtonEmpty + className="euiCollapsibleNav__closeButton" + iconType="cross" + onClick={[Function]} + size="xs" + > + <button + className="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--xSmall euiCollapsibleNav__closeButton" + onClick={[Function]} + type="button" + > + <span + className="euiButtonEmpty__content" + > + <EuiIcon + aria-hidden="true" + className="euiButtonEmpty__icon" + size="m" + type="cross" + > + <div + aria-hidden="true" + className="euiButtonEmpty__icon" + data-euiicon-type="cross" + size="m" + /> + </EuiIcon> + <span + className="euiButtonEmpty__text" + > + <span + className="euiCollapsibleNav__closeButtonLabel" + > + <EuiI18n + default="close" + token="euiCollapsibleNav.closeButtonLabel" + > + close + </EuiI18n> + </span> + </span> + </span> + </button> + </EuiButtonEmpty> + </nav> + </div> + <div + data-focus-guard={true} + style={ + Object { + "height": "0px", + "left": "1px", + "overflow": "hidden", + "padding": 0, + "position": "fixed", + "top": "1px", + "width": "1px", + } + } + tabIndex={0} + /> + </FocusLock> + </div> + </OutsideEventDetector> + </EuiOutsideClickDetector> + </EuiFocusTrap> + </EuiCollapsibleNav> +</CollapsibleNav> +`; + +exports[`CollapsibleNav renders the default nav 1`] = ` +<CollapsibleNav + homeHref="/" + id="collapsible-nav" + isLocked={false} + isOpen={false} + navLinks={Array []} + onIsLockedUpdate={[Function]} + onIsOpenUpdate={[Function]} + recentNavLinks={Array []} + storage={ + StubBrowserStorage { + "keys": Array [], + "size": 0, + "sizeLimit": 5000000, + "values": Array [], + } + } +> + <EuiCollapsibleNav + aria-label="Primary" + data-test-subj="collapsibleNav" + id="collapsible-nav" + isDocked={false} + isOpen={false} + onClose={[Function]} + /> +</CollapsibleNav> +`; + +exports[`CollapsibleNav renders the default nav 2`] = ` +<CollapsibleNav + homeHref="/" + id="collapsible-nav" + isLocked={false} + isOpen={true} + navLinks={Array []} + onIsLockedUpdate={[Function]} + onIsOpenUpdate={[Function]} + recentNavLinks={Array []} + storage={ + StubBrowserStorage { + "keys": Array [], + "size": 0, + "sizeLimit": 5000000, + "values": Array [], + } + } +> + <EuiCollapsibleNav + aria-label="Primary" + data-test-subj="collapsibleNav" + id="collapsible-nav" + isDocked={false} + isOpen={true} + onClose={[Function]} + > + <EuiWindowEvent + event="keydown" + handler={[Function]} + /> + <EuiOverlayMask + onClick={[Function]} + > + <Portal + containerInfo={ + <div + class="euiOverlayMask" + /> + } + /> + </EuiOverlayMask> + <EuiFocusTrap + clickOutsideDisables={true} + disabled={false} + > + <EuiOutsideClickDetector + isDisabled={false} + onOutsideClick={[Function]} + > + <OutsideEventDetector + handleEvent={[Function]} + onMouseDown={[Function]} + onMouseUp={[Function]} + onTouchEnd={[Function]} + onTouchStart={[Function]} + > + <div + onMouseDown={[Function]} + onMouseUp={[Function]} + onTouchEnd={[Function]} + onTouchStart={[Function]} + > + <FocusLock + as="div" + autoFocus={true} + disabled={false} + lockProps={ + Object { + "style": undefined, + } + } + noFocusGuards={false} + persistentFocus={false} + returnFocus={true} + > + <div + data-focus-guard={true} + key="guard-first" + style={ + Object { + "height": "0px", + "left": "1px", + "overflow": "hidden", + "padding": 0, + "position": "fixed", + "top": "1px", + "width": "1px", + } + } + tabIndex={0} + /> + <div + data-focus-guard={true} + key="guard-nearest" + style={ + Object { + "height": "0px", + "left": "1px", + "overflow": "hidden", + "padding": 0, + "position": "fixed", + "top": "1px", + "width": "1px", + } + } + tabIndex={1} + /> + <div + data-focus-lock-disabled={false} + onBlur={[Function]} + onFocus={[Function]} + > + <SideEffect(FocusWatcher) + autoFocus={true} + disabled={false} + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + > + <FocusWatcher + autoFocus={true} + disabled={false} + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + /> + </SideEffect(FocusWatcher)> + <nav + aria-label="Primary" + className="euiCollapsibleNav" + data-test-subj="collapsibleNav" + id="collapsible-nav" + > + <EuiFlexItem + grow={false} + style={ + Object { + "flexShrink": 0, + } + } + > + <div + className="euiFlexItem euiFlexItem--flexGrowZero" + style={ + Object { + "flexShrink": 0, + } + } + > + <EuiCollapsibleNavGroup + background="light" + className="eui-yScroll" + style={ + Object { + "maxHeight": "40vh", + } + } + > + <div + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--light eui-yScroll" + id="mockId" + style={ + Object { + "maxHeight": "40vh", + } + } + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + aria-label="Pinned links" + color="text" + gutterSize="none" + listItems={ + Array [ + Object { + "href": "/", + "iconType": "home", + "label": "Home", + "onClick": [Function], + }, + ] + } + maxWidth="none" + size="s" + > + <ul + aria-label="Pinned links" + className="euiListGroup" + style={ + Object { + "maxWidth": "none", + } + } + > + <EuiListGroupItem + color="text" + href="/" + iconType="home" + key="title-0" + label="Home" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + href="/" + onClick={[Function]} + > + <EuiIcon + className="euiListGroupItem__icon" + type="home" + > + <div + className="euiListGroupItem__icon" + data-euiicon-type="home" + /> + </EuiIcon> + <span + className="euiListGroupItem__label" + title="Home" + > + Home + </span> + </a> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </EuiCollapsibleNavGroup> + </div> + </EuiFlexItem> + <EuiHorizontalRule + margin="none" + > + <hr + className="euiHorizontalRule euiHorizontalRule--full" + /> + </EuiHorizontalRule> + <EuiFlexItem + className="eui-yScroll" + > + <div + className="euiFlexItem eui-yScroll" + > + <EuiCollapsibleNavGroup + initialIsOpen={true} + isCollapsible={true} + key="recentlyViewed" + onToggle={[Function]} + title="Recently viewed" + > + <EuiAccordion + arrowDisplay="right" + buttonClassName="euiCollapsibleNavGroup__heading" + buttonContent={ + <ForwardRef + alignItems="center" + gutterSize="m" + responsive={false} + > + <EuiFlexItem> + <EuiTitle + size="xxs" + > + <h3 + className="euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </EuiTitle> + </EuiFlexItem> + </ForwardRef> + } + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + id="mockId" + initialIsOpen={true} + onToggle={[Function]} + paddingSize="none" + > + <div + className="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + onToggle={[Function]} + > + <div + className="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded={true} + className="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + onClick={[Function]} + type="button" + > + <span + className="euiAccordion__iconWrapper" + > + <EuiIcon + className="euiAccordion__icon euiAccordion__icon-isOpen" + size="m" + type="arrowRight" + > + <div + className="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + size="m" + /> + </EuiIcon> + </span> + <span + className="euiIEFlexWrapFix" + > + <EuiFlexGroup + alignItems="center" + gutterSize="m" + responsive={false} + > + <div + className="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <EuiFlexItem> + <div + className="euiFlexItem" + > + <EuiTitle + size="xxs" + > + <h3 + className="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </EuiTitle> + </div> + </EuiFlexItem> + </div> + </EuiFlexGroup> + </span> + </button> + </div> + <div + className="euiAccordion__childWrapper" + id="mockId" + > + <EuiResizeObserver + onResize={[Function]} + > + <div> + <div + className="" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiText + color="subdued" + size="s" + style={ + Object { + "padding": "0 8px 8px", + } + } + > + <div + className="euiText euiText--small" + style={ + Object { + "padding": "0 8px 8px", + } + } + > + <EuiTextColor + color="subdued" + component="div" + > + <div + className="euiTextColor euiTextColor--subdued" + > + <p> + No recently viewed items + </p> + </div> + </EuiTextColor> + </div> + </EuiText> + </div> + </div> + </div> + </EuiResizeObserver> + </div> + </div> + </EuiAccordion> + </EuiCollapsibleNavGroup> + <EuiShowFor + sizes={ + Array [ + "l", + "xl", + ] + } + > + <EuiCollapsibleNavGroup + className="eui-showFor--l eui-showFor--xl" + key=".0" + > + <div + className="euiCollapsibleNavGroup eui-showFor--l eui-showFor--xl" + id="mockId" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + flush={true} + > + <ul + className="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <EuiListGroupItem + aria-label="Dock primary navigation" + buttonRef={ + Object { + "current": <button + aria-label="Dock primary navigation" + class="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + type="button" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="lockOpen" + /> + <span + class="euiListGroupItem__label" + title="Dock navigation" + > + Dock navigation + </span> + </button>, + } + } + color="subdued" + data-test-subj="collapsible-nav-lock" + iconType="lockOpen" + label="Dock navigation" + onClick={[Function]} + size="xs" + > + <li + className="euiListGroupItem euiListGroupItem--xSmall euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <button + aria-label="Dock primary navigation" + className="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + disabled={false} + onClick={[Function]} + type="button" + > + <EuiIcon + className="euiListGroupItem__icon" + type="lockOpen" + > + <div + className="euiListGroupItem__icon" + data-euiicon-type="lockOpen" + /> + </EuiIcon> + <span + className="euiListGroupItem__label" + title="Dock navigation" + > + Dock navigation + </span> + </button> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </EuiCollapsibleNavGroup> + </EuiShowFor> + </div> + </EuiFlexItem> + <EuiButtonEmpty + className="euiCollapsibleNav__closeButton" + iconType="cross" + onClick={[Function]} + size="xs" + > + <button + className="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--xSmall euiCollapsibleNav__closeButton" + onClick={[Function]} + type="button" + > + <span + className="euiButtonEmpty__content" + > + <EuiIcon + aria-hidden="true" + className="euiButtonEmpty__icon" + size="m" + type="cross" + > + <div + aria-hidden="true" + className="euiButtonEmpty__icon" + data-euiicon-type="cross" + size="m" + /> + </EuiIcon> + <span + className="euiButtonEmpty__text" + > + <span + className="euiCollapsibleNav__closeButtonLabel" + > + <EuiI18n + default="close" + token="euiCollapsibleNav.closeButtonLabel" + > + close + </EuiI18n> + </span> + </span> + </span> + </button> + </EuiButtonEmpty> + </nav> + </div> + <div + data-focus-guard={true} + style={ + Object { + "height": "0px", + "left": "1px", + "overflow": "hidden", + "padding": 0, + "position": "fixed", + "top": "1px", + "width": "1px", + } + } + tabIndex={0} + /> + </FocusLock> + </div> + </OutsideEventDetector> + </EuiOutsideClickDetector> + </EuiFocusTrap> + </EuiCollapsibleNav> +</CollapsibleNav> +`; + +exports[`CollapsibleNav renders the default nav 3`] = ` +<CollapsibleNav + homeHref="/" + id="collapsible-nav" + isLocked={true} + isOpen={true} + navLinks={Array []} + onIsLockedUpdate={[Function]} + onIsOpenUpdate={[Function]} + recentNavLinks={Array []} + storage={ + StubBrowserStorage { + "keys": Array [], + "size": 0, + "sizeLimit": 5000000, + "values": Array [], + } + } +> + <EuiCollapsibleNav + aria-label="Primary" + data-test-subj="collapsibleNav" + id="collapsible-nav" + isDocked={true} + isOpen={true} + onClose={[Function]} + > + <EuiWindowEvent + event="keydown" + handler={[Function]} + /> + <EuiFocusTrap + clickOutsideDisables={true} + disabled={true} + > + <EuiOutsideClickDetector + isDisabled={true} + onOutsideClick={[Function]} + > + <OutsideEventDetector + handleEvent={[Function]} + onMouseDown={[Function]} + onMouseUp={[Function]} + onTouchEnd={[Function]} + onTouchStart={[Function]} + > + <div + onMouseDown={[Function]} + onMouseUp={[Function]} + onTouchEnd={[Function]} + onTouchStart={[Function]} + > + <FocusLock + as="div" + autoFocus={true} + disabled={true} + lockProps={ + Object { + "style": undefined, + } + } + noFocusGuards={false} + persistentFocus={false} + returnFocus={true} + > + <div + data-focus-guard={true} + key="guard-first" + style={ + Object { + "height": "0px", + "left": "1px", + "overflow": "hidden", + "padding": 0, + "position": "fixed", + "top": "1px", + "width": "1px", + } + } + tabIndex={-1} + /> + <div + data-focus-guard={true} + key="guard-nearest" + style={ + Object { + "height": "0px", + "left": "1px", + "overflow": "hidden", + "padding": 0, + "position": "fixed", + "top": "1px", + "width": "1px", + } + } + tabIndex={-1} + /> + <div + data-focus-lock-disabled="disabled" + onBlur={[Function]} + onFocus={[Function]} + > + <SideEffect(FocusWatcher) + autoFocus={true} + disabled={true} + observed={ + <div + data-focus-lock-disabled="disabled" + > + <nav + aria-label="Primary" + class="euiCollapsibleNav euiCollapsibleNav--isDocked" + data-test-subj="collapsibleNav" + id="collapsible-nav" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + class="euiCollapsibleNavGroup euiCollapsibleNavGroup--light eui-yScroll" + id="mockId" + style="max-height: 40vh;" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Pinned links" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + href="/" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="home" + /> + <span + class="euiListGroupItem__label" + title="Home" + > + Home + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + <hr + class="euiHorizontalRule euiHorizontalRule--full" + /> + <div + class="euiFlexItem eui-yScroll" + > + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <div + class="euiText euiText--small" + style="padding: 0px 8px 8px;" + > + <div + class="euiTextColor euiTextColor--subdued" + > + <p> + No recently viewed items + </p> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + <div + class="euiCollapsibleNavGroup eui-showFor--l eui-showFor--xl" + id="mockId" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + class="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <li + class="euiListGroupItem euiListGroupItem--xSmall euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <button + aria-label="Undock primary navigation" + class="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + type="button" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="lock" + /> + <span + class="euiListGroupItem__label" + title="Undock navigation" + > + Undock navigation + </span> + </button> + </li> + </ul> + </div> + </div> + </div> + <button + class="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--xSmall euiCollapsibleNav__closeButton" + type="button" + > + <span + class="euiButtonEmpty__content" + > + <div + aria-hidden="true" + class="euiButtonEmpty__icon" + data-euiicon-type="cross" + /> + <span + class="euiButtonEmpty__text" + > + <span + class="euiCollapsibleNav__closeButtonLabel" + > + close + </span> + </span> + </span> + </button> + </nav> + </div> + } + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + > + <FocusWatcher + autoFocus={true} + disabled={true} + observed={ + <div + data-focus-lock-disabled="disabled" + > + <nav + aria-label="Primary" + class="euiCollapsibleNav euiCollapsibleNav--isDocked" + data-test-subj="collapsibleNav" + id="collapsible-nav" + > + <div + class="euiFlexItem euiFlexItem--flexGrowZero" + > + <div + class="euiCollapsibleNavGroup euiCollapsibleNavGroup--light eui-yScroll" + id="mockId" + style="max-height: 40vh;" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + aria-label="Pinned links" + class="euiListGroup" + style="max-width: none;" + > + <li + class="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isClickable" + > + <a + class="euiListGroupItem__button" + href="/" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="home" + /> + <span + class="euiListGroupItem__label" + title="Home" + > + Home + </span> + </a> + </li> + </ul> + </div> + </div> + </div> + <hr + class="euiHorizontalRule euiHorizontalRule--full" + /> + <div + class="euiFlexItem eui-yScroll" + > + <div + class="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + > + <div + class="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded="true" + class="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + type="button" + > + <span + class="euiAccordion__iconWrapper" + > + <div + class="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + /> + </span> + <span + class="euiIEFlexWrapFix" + > + <div + class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <div + class="euiFlexItem" + > + <h3 + class="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </div> + </div> + </span> + </button> + </div> + <div + class="euiAccordion__childWrapper" + id="mockId" + > + <div> + <div + class="" + > + <div + class="euiCollapsibleNavGroup__children" + > + <div + class="euiText euiText--small" + style="padding: 0px 8px 8px;" + > + <div + class="euiTextColor euiTextColor--subdued" + > + <p> + No recently viewed items + </p> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + <div + class="euiCollapsibleNavGroup eui-showFor--l eui-showFor--xl" + id="mockId" + > + <div + class="euiCollapsibleNavGroup__children" + > + <ul + class="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <li + class="euiListGroupItem euiListGroupItem--xSmall euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <button + aria-label="Undock primary navigation" + class="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + type="button" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="lock" + /> + <span + class="euiListGroupItem__label" + title="Undock navigation" + > + Undock navigation + </span> + </button> + </li> + </ul> + </div> + </div> + </div> + <button + class="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--xSmall euiCollapsibleNav__closeButton" + type="button" + > + <span + class="euiButtonEmpty__content" + > + <div + aria-hidden="true" + class="euiButtonEmpty__icon" + data-euiicon-type="cross" + /> + <span + class="euiButtonEmpty__text" + > + <span + class="euiCollapsibleNav__closeButtonLabel" + > + close + </span> + </span> + </span> + </button> + </nav> + </div> + } + onActivation={[Function]} + onDeactivation={[Function]} + persistentFocus={false} + /> + </SideEffect(FocusWatcher)> + <nav + aria-label="Primary" + className="euiCollapsibleNav euiCollapsibleNav--isDocked" + data-test-subj="collapsibleNav" + id="collapsible-nav" + > + <EuiFlexItem + grow={false} + style={ + Object { + "flexShrink": 0, + } + } + > + <div + className="euiFlexItem euiFlexItem--flexGrowZero" + style={ + Object { + "flexShrink": 0, + } + } + > + <EuiCollapsibleNavGroup + background="light" + className="eui-yScroll" + style={ + Object { + "maxHeight": "40vh", + } + } + > + <div + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--light eui-yScroll" + id="mockId" + style={ + Object { + "maxHeight": "40vh", + } + } + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + aria-label="Pinned links" + color="text" + gutterSize="none" + listItems={ + Array [ + Object { + "href": "/", + "iconType": "home", + "label": "Home", + "onClick": [Function], + }, + ] + } + maxWidth="none" + size="s" + > + <ul + aria-label="Pinned links" + className="euiListGroup" + style={ + Object { + "maxWidth": "none", + } + } + > + <EuiListGroupItem + color="text" + href="/" + iconType="home" + key="title-0" + label="Home" + onClick={[Function]} + showToolTip={false} + size="s" + wrapText={false} + > + <li + className="euiListGroupItem euiListGroupItem--small euiListGroupItem--text euiListGroupItem-isClickable" + > + <a + className="euiListGroupItem__button" + href="/" + onClick={[Function]} + > + <EuiIcon + className="euiListGroupItem__icon" + type="home" + > + <div + className="euiListGroupItem__icon" + data-euiicon-type="home" + /> + </EuiIcon> + <span + className="euiListGroupItem__label" + title="Home" + > + Home + </span> + </a> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </EuiCollapsibleNavGroup> + </div> + </EuiFlexItem> + <EuiHorizontalRule + margin="none" + > + <hr + className="euiHorizontalRule euiHorizontalRule--full" + /> + </EuiHorizontalRule> + <EuiFlexItem + className="eui-yScroll" + > + <div + className="euiFlexItem eui-yScroll" + > + <EuiCollapsibleNavGroup + initialIsOpen={true} + isCollapsible={true} + key="recentlyViewed" + onToggle={[Function]} + title="Recently viewed" + > + <EuiAccordion + arrowDisplay="right" + buttonClassName="euiCollapsibleNavGroup__heading" + buttonContent={ + <ForwardRef + alignItems="center" + gutterSize="m" + responsive={false} + > + <EuiFlexItem> + <EuiTitle + size="xxs" + > + <h3 + className="euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </EuiTitle> + </EuiFlexItem> + </ForwardRef> + } + className="euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + id="mockId" + initialIsOpen={true} + onToggle={[Function]} + paddingSize="none" + > + <div + className="euiAccordion euiAccordion-isOpen euiCollapsibleNavGroup euiCollapsibleNavGroup--withHeading" + onToggle={[Function]} + > + <div + className="euiAccordion__triggerWrapper" + > + <button + aria-controls="mockId" + aria-expanded={true} + className="euiAccordion__button euiAccordion__buttonReverse euiCollapsibleNavGroup__heading" + onClick={[Function]} + type="button" + > + <span + className="euiAccordion__iconWrapper" + > + <EuiIcon + className="euiAccordion__icon euiAccordion__icon-isOpen" + size="m" + type="arrowRight" + > + <div + className="euiAccordion__icon euiAccordion__icon-isOpen" + data-euiicon-type="arrowRight" + size="m" + /> + </EuiIcon> + </span> + <span + className="euiIEFlexWrapFix" + > + <EuiFlexGroup + alignItems="center" + gutterSize="m" + responsive={false} + > + <div + className="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--alignItemsCenter euiFlexGroup--directionRow" + > + <EuiFlexItem> + <div + className="euiFlexItem" + > + <EuiTitle + size="xxs" + > + <h3 + className="euiTitle euiTitle--xxsmall euiCollapsibleNavGroup__title" + id="mockId__title" + > + Recently viewed + </h3> + </EuiTitle> + </div> + </EuiFlexItem> + </div> + </EuiFlexGroup> + </span> + </button> + </div> + <div + className="euiAccordion__childWrapper" + id="mockId" + > + <EuiResizeObserver + onResize={[Function]} + > + <div> + <div + className="" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiText + color="subdued" + size="s" + style={ + Object { + "padding": "0 8px 8px", + } + } + > + <div + className="euiText euiText--small" + style={ + Object { + "padding": "0 8px 8px", + } + } + > + <EuiTextColor + color="subdued" + component="div" + > + <div + className="euiTextColor euiTextColor--subdued" + > + <p> + No recently viewed items + </p> + </div> + </EuiTextColor> + </div> + </EuiText> + </div> + </div> + </div> + </EuiResizeObserver> + </div> + </div> + </EuiAccordion> + </EuiCollapsibleNavGroup> + <EuiShowFor + sizes={ + Array [ + "l", + "xl", + ] + } + > + <EuiCollapsibleNavGroup + className="eui-showFor--l eui-showFor--xl" + key=".0" + > + <div + className="euiCollapsibleNavGroup eui-showFor--l eui-showFor--xl" + id="mockId" + > + <div + className="euiCollapsibleNavGroup__children" + > + <EuiListGroup + flush={true} + > + <ul + className="euiListGroup euiListGroup-flush euiListGroup--gutterSmall euiListGroup-maxWidthDefault" + > + <EuiListGroupItem + aria-label="Undock primary navigation" + buttonRef={ + Object { + "current": <button + aria-label="Undock primary navigation" + class="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + type="button" + > + <div + class="euiListGroupItem__icon" + data-euiicon-type="lock" + /> + <span + class="euiListGroupItem__label" + title="Undock navigation" + > + Undock navigation + </span> + </button>, + } + } + color="subdued" + data-test-subj="collapsible-nav-lock" + iconType="lock" + label="Undock navigation" + onClick={[Function]} + size="xs" + > + <li + className="euiListGroupItem euiListGroupItem--xSmall euiListGroupItem--subdued euiListGroupItem-isClickable" + > + <button + aria-label="Undock primary navigation" + className="euiListGroupItem__button" + data-test-subj="collapsible-nav-lock" + disabled={false} + onClick={[Function]} + type="button" + > + <EuiIcon + className="euiListGroupItem__icon" + type="lock" + > + <div + className="euiListGroupItem__icon" + data-euiicon-type="lock" + /> + </EuiIcon> + <span + className="euiListGroupItem__label" + title="Undock navigation" + > + Undock navigation + </span> + </button> + </li> + </EuiListGroupItem> + </ul> + </EuiListGroup> + </div> + </div> + </EuiCollapsibleNavGroup> + </EuiShowFor> + </div> + </EuiFlexItem> + <EuiButtonEmpty + className="euiCollapsibleNav__closeButton" + iconType="cross" + onClick={[Function]} + size="xs" + > + <button + className="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--xSmall euiCollapsibleNav__closeButton" + onClick={[Function]} + type="button" + > + <span + className="euiButtonEmpty__content" + > + <EuiIcon + aria-hidden="true" + className="euiButtonEmpty__icon" + size="m" + type="cross" + > + <div + aria-hidden="true" + className="euiButtonEmpty__icon" + data-euiicon-type="cross" + size="m" + /> + </EuiIcon> + <span + className="euiButtonEmpty__text" + > + <span + className="euiCollapsibleNav__closeButtonLabel" + > + <EuiI18n + default="close" + token="euiCollapsibleNav.closeButtonLabel" + > + close + </EuiI18n> + </span> + </span> + </span> + </button> + </EuiButtonEmpty> + </nav> + </div> + <div + data-focus-guard={true} + style={ + Object { + "height": "0px", + "left": "1px", + "overflow": "hidden", + "padding": 0, + "position": "fixed", + "top": "1px", + "width": "1px", + } + } + tabIndex={-1} + /> + </FocusLock> + </div> + </OutsideEventDetector> + </EuiOutsideClickDetector> + </EuiFocusTrap> + </EuiCollapsibleNav> +</CollapsibleNav> +`; diff --git a/src/core/public/chrome/ui/header/_index.scss b/src/core/public/chrome/ui/header/_index.scss index f19728a52dd70..5c5e7f18b60a4 100644 --- a/src/core/public/chrome/ui/header/_index.scss +++ b/src/core/public/chrome/ui/header/_index.scss @@ -1,25 +1,12 @@ -@import '@elastic/eui/src/components/header/variables'; -@import '@elastic/eui/src/components/nav_drawer/variables'; - -.chrHeaderWrapper { +// TODO #64541 +// Delete this block +.chrHeaderWrapper:not(.headerWrapper) { width: 100%; position: fixed; top: 0; z-index: 10; } -.chrHeaderWrapper ~ .app-wrapper:not(.hidden-chrome) { - top: $euiHeaderChildSize; - left: $euiHeaderChildSize; - - // HOTFIX: Temporary fix for flyouts not inside portals - // SASSTODO: Find an actual solution - .euiFlyout { - top: $euiHeaderChildSize; - height: calc(100% - #{$euiHeaderChildSize}); - } -} - .chrHeaderHelpMenu__version { text-transform: none; } @@ -29,19 +16,8 @@ margin-right: $euiSize; } -// Mobile header is smaller -@include euiBreakpoint('xs', 's') { - .chrHeaderWrapper ~ .app-wrapper:not(.hidden-chrome) { - left: 0; - } -} - -@include euiBreakpoint('xl') { - .chrHeaderWrapper--navIsLocked { - ~ .app-wrapper:not(.hidden-chrome) { - // Shrink the content from the left so it's no longer overlapped by the nav drawer (ALWAYS) - left: $euiNavDrawerWidthExpanded !important; // sass-lint:disable-line no-important - transition: left $euiAnimSpeedFast $euiAnimSlightResistance; - } +.header__toggleNavButtonSection { + .euiBody--collapsibleNavIsDocked & { + display: none; } } diff --git a/src/core/public/chrome/ui/header/collapsible_nav.test.tsx b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx new file mode 100644 index 0000000000000..4a9d3071b93be --- /dev/null +++ b/src/core/public/chrome/ui/header/collapsible_nav.test.tsx @@ -0,0 +1,136 @@ +/* + * 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 { mount, ReactWrapper } from 'enzyme'; +import React from 'react'; +import sinon from 'sinon'; +import { CollapsibleNav } from './collapsible_nav'; +import { AppCategory } from '../../../../types'; +import { DEFAULT_APP_CATEGORIES } from '../../..'; +import { StubBrowserStorage } from 'test_utils/stub_browser_storage'; + +jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ + htmlIdGenerator: () => () => 'mockId', +})); + +const { kibana, observability, security, management } = DEFAULT_APP_CATEGORIES; + +function mockLink(label: string, category?: AppCategory) { + return { + key: label, + label, + href: label, + isActive: true, + onClick: () => {}, + category, + 'data-test-subj': label, + }; +} + +function mockRecentNavLink(label: string) { + return { + href: label, + label, + title: label, + 'aria-label': label, + }; +} + +function mockProps() { + return { + id: 'collapsible-nav', + homeHref: '/', + isLocked: false, + isOpen: false, + navLinks: [], + recentNavLinks: [], + storage: new StubBrowserStorage(), + onIsOpenUpdate: () => {}, + onIsLockedUpdate: () => {}, + }; +} + +describe('CollapsibleNav', () => { + // this test is mostly an "EUI works as expected" sanity check + it('renders the default nav', () => { + const onLock = sinon.spy(); + const component = mount(<CollapsibleNav {...mockProps()} onIsLockedUpdate={onLock} />); + expect(component).toMatchSnapshot(); + + component.setProps({ isOpen: true }); + expect(component).toMatchSnapshot(); + + component.setProps({ isLocked: true }); + expect(component).toMatchSnapshot(); + + // limit the find to buttons because jest also renders data-test-subj on a JSX wrapper element + component.find('button[data-test-subj="collapsible-nav-lock"]').simulate('click'); + expect(onLock.callCount).toEqual(1); + }); + + it('renders links grouped by category', () => { + // just a test of category functionality, categories are not accurate + const navLinks = [ + mockLink('discover', kibana), + mockLink('siem', security), + mockLink('metrics', observability), + mockLink('monitoring', management), + mockLink('visualize', kibana), + mockLink('dashboard', kibana), + mockLink('canvas'), // links should be able to be rendered top level as well + mockLink('logs', observability), + ]; + const recentNavLinks = [mockRecentNavLink('recent 1'), mockRecentNavLink('recent 2')]; + const component = mount( + <CollapsibleNav + {...mockProps()} + isOpen={true} + navLinks={navLinks} + recentNavLinks={recentNavLinks} + /> + ); + expect(component).toMatchSnapshot(); + }); + + it('remembers collapsible section state', () => { + function expectNavLinksCount(component: ReactWrapper, count: number) { + expect( + component.find('.euiAccordion-isOpen a[data-test-subj="collapsibleNavAppLink"]').length + ).toEqual(count); + } + + const navLinks = [ + mockLink('discover', kibana), + mockLink('siem', security), + mockLink('metrics', observability), + mockLink('monitoring', management), + mockLink('visualize', kibana), + mockLink('dashboard', kibana), + mockLink('logs', observability), + ]; + const component = mount(<CollapsibleNav {...mockProps()} isOpen={true} navLinks={navLinks} />); + expectNavLinksCount(component, 7); + component.find('[data-test-subj="collapsibleNavGroup-kibana"] button').simulate('click'); + expectNavLinksCount(component, 4); + component.setProps({ isOpen: false }); + expectNavLinksCount(component, 0); // double check the nav closed + component.setProps({ isOpen: true }); + expectNavLinksCount(component, 4); + }); +}); diff --git a/src/core/public/chrome/ui/header/collapsible_nav.tsx b/src/core/public/chrome/ui/header/collapsible_nav.tsx new file mode 100644 index 0000000000000..274195f1917a5 --- /dev/null +++ b/src/core/public/chrome/ui/header/collapsible_nav.tsx @@ -0,0 +1,281 @@ +/* + * 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 { + EuiCollapsibleNav, + EuiCollapsibleNavGroup, + EuiFlexItem, + EuiHorizontalRule, + EuiListGroup, + EuiListGroupItem, + EuiShowFor, + EuiText, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { groupBy, sortBy } from 'lodash'; +import React, { useRef } from 'react'; +import { AppCategory } from '../../../../types'; +import { OnIsLockedUpdate } from './'; +import { NavLink, RecentNavLink } from './nav_link'; + +function getAllCategories(allCategorizedLinks: Record<string, NavLink[]>) { + const allCategories = {} as Record<string, AppCategory | undefined>; + + for (const [key, value] of Object.entries(allCategorizedLinks)) { + allCategories[key] = value[0].category; + } + + return allCategories; +} + +function getOrderedCategories( + mainCategories: Record<string, NavLink[]>, + categoryDictionary: ReturnType<typeof getAllCategories> +) { + return sortBy( + Object.keys(mainCategories), + categoryName => categoryDictionary[categoryName]?.order + ); +} + +function getCategoryLocalStorageKey(id: string) { + return `core.navGroup.${id}`; +} + +function getIsCategoryOpen(id: string, storage: Storage) { + const value = storage.getItem(getCategoryLocalStorageKey(id)) ?? 'true'; + + return value === 'true'; +} + +function setIsCategoryOpen(id: string, isOpen: boolean, storage: Storage) { + storage.setItem(getCategoryLocalStorageKey(id), `${isOpen}`); +} + +interface Props { + isLocked: boolean; + isOpen: boolean; + navLinks: NavLink[]; + recentNavLinks: RecentNavLink[]; + homeHref: string; + id: string; + storage?: Storage; + onIsLockedUpdate: OnIsLockedUpdate; + onIsOpenUpdate: (isOpen?: boolean) => void; +} + +export function CollapsibleNav({ + isLocked, + isOpen, + navLinks, + recentNavLinks, + onIsLockedUpdate, + onIsOpenUpdate, + homeHref, + id, + storage = window.localStorage, +}: Props) { + const lockRef = useRef<HTMLButtonElement>(null); + const groupedNavLinks = groupBy(navLinks, link => link?.category?.id); + const { undefined: unknowns = [], ...allCategorizedLinks } = groupedNavLinks; + const categoryDictionary = getAllCategories(allCategorizedLinks); + const orderedCategories = getOrderedCategories(allCategorizedLinks, categoryDictionary); + + return ( + <EuiCollapsibleNav + data-test-subj="collapsibleNav" + id={id} + aria-label={i18n.translate('core.ui.primaryNav.screenReaderLabel', { + defaultMessage: 'Primary', + })} + isOpen={isOpen} + isDocked={isLocked} + onClose={onIsOpenUpdate} + > + {/* Pinned items */} + <EuiFlexItem grow={false} style={{ flexShrink: 0 }}> + <EuiCollapsibleNavGroup + background="light" + className="eui-yScroll" + style={{ maxHeight: '40vh' }} + > + <EuiListGroup + aria-label={i18n.translate('core.ui.primaryNav.pinnedLinksAriaLabel', { + defaultMessage: 'Pinned links', + })} + listItems={[ + { + label: 'Home', + iconType: 'home', + href: homeHref, + onClick: () => onIsOpenUpdate(false), + }, + ]} + maxWidth="none" + color="text" + gutterSize="none" + size="s" + /> + </EuiCollapsibleNavGroup> + </EuiFlexItem> + + <EuiHorizontalRule margin="none" /> + + <EuiFlexItem className="eui-yScroll"> + {/* Recently viewed */} + <EuiCollapsibleNavGroup + key="recentlyViewed" + title={i18n.translate('core.ui.recentlyViewed', { defaultMessage: 'Recently viewed' })} + isCollapsible={true} + initialIsOpen={getIsCategoryOpen('recentlyViewed', storage)} + onToggle={isCategoryOpen => setIsCategoryOpen('recentlyViewed', isCategoryOpen, storage)} + > + {recentNavLinks.length > 0 ? ( + <EuiListGroup + aria-label={i18n.translate('core.ui.recentlyViewedAriaLabel', { + defaultMessage: 'Recently viewed links', + })} + listItems={recentNavLinks.map(link => { + // TODO #64541 + // Can remove icon from recent links completely + const { iconType, ...linkWithoutIcon } = link; + return linkWithoutIcon; + })} + maxWidth="none" + color="subdued" + gutterSize="none" + size="s" + /> + ) : ( + <EuiText size="s" color="subdued" style={{ padding: '0 8px 8px' }}> + <p> + {i18n.translate('core.ui.EmptyRecentlyViewed', { + defaultMessage: 'No recently viewed items', + })} + </p> + </EuiText> + )} + </EuiCollapsibleNavGroup> + + {/* Kibana, Observability, Security, and Management sections */} + {orderedCategories.map((categoryName, i) => { + const category = categoryDictionary[categoryName]!; + const links = allCategorizedLinks[categoryName].map( + ({ label, href, isActive, isDisabled, onClick }: NavLink) => ({ + label, + href, + isActive, + isDisabled, + 'data-test-subj': 'collapsibleNavAppLink', + onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => { + onIsOpenUpdate(false); + onClick(e); + }, + }) + ); + + return ( + <EuiCollapsibleNavGroup + key={category.id} + iconType={category.euiIconType} + title={category.label} + isCollapsible={true} + initialIsOpen={getIsCategoryOpen(category.id, storage)} + onToggle={isCategoryOpen => setIsCategoryOpen(category.id, isCategoryOpen, storage)} + data-test-subj={`collapsibleNavGroup-${category.id}`} + > + <EuiListGroup + aria-label={i18n.translate('core.ui.primaryNavSection.screenReaderLabel', { + defaultMessage: 'Primary navigation links, {category}', + values: { category: category.label }, + })} + listItems={links} + maxWidth="none" + color="subdued" + gutterSize="none" + size="s" + /> + </EuiCollapsibleNavGroup> + ); + })} + + {/* Things with no category (largely for custom plugins) */} + {unknowns.map(({ label, href, icon, isActive, isDisabled, onClick }, i) => ( + <EuiCollapsibleNavGroup key={i}> + <EuiListGroup flush> + <EuiListGroupItem + color="text" + size="s" + label={label} + href={href} + icon={icon} + isActive={isActive} + isDisabled={isDisabled} + data-test-subj="collapsibleNavAppLink" + onClick={(e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => { + onIsOpenUpdate(false); + onClick(e); + }} + /> + </EuiListGroup> + </EuiCollapsibleNavGroup> + ))} + + {/* Docking button only for larger screens that can support it*/} + <EuiShowFor sizes={['l', 'xl']}> + <EuiCollapsibleNavGroup> + <EuiListGroup flush> + <EuiListGroupItem + data-test-subj="collapsible-nav-lock" + buttonRef={lockRef} + size="xs" + color="subdued" + label={ + isLocked + ? i18n.translate('core.ui.primaryNavSection.undockLabel', { + defaultMessage: 'Undock navigation', + }) + : i18n.translate('core.ui.primaryNavSection.dockLabel', { + defaultMessage: 'Dock navigation', + }) + } + aria-label={ + isLocked + ? i18n.translate('core.ui.primaryNavSection.undockAriaLabel', { + defaultMessage: 'Undock primary navigation', + }) + : i18n.translate('core.ui.primaryNavSection.dockAriaLabel', { + defaultMessage: 'Dock primary navigation', + }) + } + onClick={() => { + onIsLockedUpdate(!isLocked); + if (lockRef.current) { + lockRef.current.focus(); + } + }} + iconType={isLocked ? 'lock' : 'lockOpen'} + /> + </EuiListGroup> + </EuiCollapsibleNavGroup> + </EuiShowFor> + </EuiFlexItem> + </EuiCollapsibleNav> + ); +} diff --git a/src/core/public/chrome/ui/header/header.tsx b/src/core/public/chrome/ui/header/header.tsx index 66b34c3db7bad..fb94ef46cdc2c 100644 --- a/src/core/public/chrome/ui/header/header.tsx +++ b/src/core/public/chrome/ui/header/header.tsx @@ -25,8 +25,8 @@ import { EuiIcon, // @ts-ignore EuiNavDrawer, - // @ts-ignore EuiShowFor, + htmlIdGenerator, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { Component, createRef } from 'react'; @@ -43,13 +43,14 @@ import { InternalApplicationStart } from '../../../application/types'; import { HttpStart } from '../../../http'; import { ChromeHelpExtension } from '../../chrome_service'; import { HeaderBadge } from './header_badge'; -import { OnIsLockedUpdate } from './'; +import { NavType, OnIsLockedUpdate } from './'; import { HeaderBreadcrumbs } from './header_breadcrumbs'; import { HeaderHelpMenu } from './header_help_menu'; import { HeaderNavControls } from './header_nav_controls'; -import { euiNavLink } from './nav_link'; +import { createNavLink, createRecentNavLink } from './nav_link'; import { HeaderLogo } from './header_logo'; import { NavDrawer } from './nav_drawer'; +import { CollapsibleNav } from './collapsible_nav'; export interface HeaderProps { kibanaVersion: string; @@ -70,6 +71,7 @@ export interface HeaderProps { navControlsRight$: Rx.Observable<readonly ChromeNavControl[]>; basePath: HttpStart['basePath']; isLocked$: Rx.Observable<boolean>; + navType$: Rx.Observable<NavType>; onIsLockedUpdate: OnIsLockedUpdate; } @@ -83,11 +85,14 @@ interface State { navControlsRight: readonly ChromeNavControl[]; currentAppId: string | undefined; isLocked: boolean; + navType: NavType; + isOpen: boolean; } export class Header extends Component<HeaderProps, State> { private subscription?: Rx.Subscription; private navDrawerRef = createRef<EuiNavDrawer>(); + private toggleCollapsibleNavRef = createRef<HTMLButtonElement>(); constructor(props: HeaderProps) { super(props); @@ -105,6 +110,8 @@ export class Header extends Component<HeaderProps, State> { navControlsRight: [], currentAppId: '', isLocked, + navType: 'modern', + isOpen: false, }; } @@ -120,7 +127,8 @@ export class Header extends Component<HeaderProps, State> { this.props.navControlsLeft$, this.props.navControlsRight$, this.props.application.currentAppId$, - this.props.isLocked$ + this.props.isLocked$, + this.props.navType$ ) ).subscribe({ next: ([ @@ -129,7 +137,7 @@ export class Header extends Component<HeaderProps, State> { forceNavigation, navLinks, recentlyAccessed, - [navControlsLeft, navControlsRight, currentAppId, isLocked], + [navControlsLeft, navControlsRight, currentAppId, isLocked, navType], ]) => { this.setState({ appTitle, @@ -141,6 +149,7 @@ export class Header extends Component<HeaderProps, State> { navControlsRight, currentAppId, isLocked, + navType, }); }, }); @@ -176,7 +185,7 @@ export class Header extends Component<HeaderProps, State> { kibanaVersion, } = this.props; const navLinks = this.state.navLinks.map(link => - euiNavLink( + createNavLink( link, this.props.legacyMode, this.state.currentAppId, @@ -184,26 +193,54 @@ export class Header extends Component<HeaderProps, State> { this.props.application.navigateToApp ) ); + const recentNavLinks = this.state.recentlyAccessed.map(link => + createRecentNavLink(link, this.state.navLinks, this.props.basePath) + ); if (!isVisible) { return null; } const className = classnames( - 'chrHeaderWrapper', + 'chrHeaderWrapper', // TODO #64541 - delete this + 'hide-for-sharing', { 'chrHeaderWrapper--navIsLocked': this.state.isLocked, - }, - 'hide-for-sharing' + headerWrapper: this.state.navType === 'modern', + } ); - + const navId = htmlIdGenerator()(); return ( <header className={className} data-test-subj="headerGlobalNav"> - <EuiHeader> + <EuiHeader position="fixed"> <EuiHeaderSection grow={false}> - <EuiShowFor sizes={['xs', 's']}> - <EuiHeaderSectionItem border="right">{this.renderMenuTrigger()}</EuiHeaderSectionItem> - </EuiShowFor> + {this.state.navType === 'modern' ? ( + <EuiHeaderSectionItem border="right" className="header__toggleNavButtonSection"> + <EuiHeaderSectionItemButton + data-test-subj="toggleNavButton" + aria-label={i18n.translate('core.ui.primaryNav.toggleNavAriaLabel', { + defaultMessage: 'Toggle primary navigation', + })} + onClick={() => { + this.setState({ isOpen: !this.state.isOpen }); + }} + aria-expanded={this.state.isOpen} + aria-pressed={this.state.isOpen} + aria-controls={navId} + ref={this.toggleCollapsibleNavRef} + > + <EuiIcon type="menu" size="m" /> + </EuiHeaderSectionItemButton> + </EuiHeaderSectionItem> + ) : ( + // TODO #64541 + // Delete this block + <EuiShowFor sizes={['xs', 's']}> + <EuiHeaderSectionItem border="right"> + {this.renderMenuTrigger()} + </EuiHeaderSectionItem> + </EuiShowFor> + )} <EuiHeaderSectionItem border="right"> <HeaderLogo @@ -235,15 +272,33 @@ export class Header extends Component<HeaderProps, State> { <HeaderNavControls side="right" navControls={navControlsRight} /> </EuiHeaderSection> </EuiHeader> - <NavDrawer - isLocked={this.state.isLocked} - onIsLockedUpdate={this.props.onIsLockedUpdate} - navLinks={navLinks} - chromeNavLinks={this.state.navLinks} - recentlyAccessedItems={this.state.recentlyAccessed} - basePath={this.props.basePath} - ref={this.navDrawerRef} - /> + {this.state.navType === 'modern' ? ( + <CollapsibleNav + id={navId} + isLocked={this.state.isLocked} + onIsLockedUpdate={this.props.onIsLockedUpdate} + navLinks={navLinks} + recentNavLinks={recentNavLinks} + isOpen={this.state.isOpen} + homeHref={this.props.homeHref} + onIsOpenUpdate={(isOpen = !this.state.isOpen) => { + this.setState({ isOpen }); + if (this.toggleCollapsibleNavRef.current) { + this.toggleCollapsibleNavRef.current.focus(); + } + }} + /> + ) : ( + // TODO #64541 + // Delete this block + <NavDrawer + isLocked={this.state.isLocked} + onIsLockedUpdate={this.props.onIsLockedUpdate} + navLinks={navLinks} + recentNavLinks={recentNavLinks} + ref={this.navDrawerRef} + /> + )} </header> ); } diff --git a/src/core/public/chrome/ui/header/header_logo.tsx b/src/core/public/chrome/ui/header/header_logo.tsx index 793b8646dabf7..960ec637178e1 100644 --- a/src/core/public/chrome/ui/header/header_logo.tsx +++ b/src/core/public/chrome/ui/header/header_logo.tsx @@ -93,7 +93,7 @@ export function HeaderLogo({ href, forceNavigation, navLinks }: Props) { return ( <EuiHeaderLogo data-test-subj="logo" - iconType="logoKibana" + iconType="logoElastic" onClick={e => onClick(e, forceNavigation, navLinks)} href={href} aria-label={i18n.translate('core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel', { diff --git a/src/core/public/chrome/ui/header/index.ts b/src/core/public/chrome/ui/header/index.ts index 49e002a66d939..a492273a65ba8 100644 --- a/src/core/public/chrome/ui/header/index.ts +++ b/src/core/public/chrome/ui/header/index.ts @@ -18,6 +18,7 @@ */ export { Header, HeaderProps } from './header'; +export { OnIsLockedUpdate, NavType } from './types'; export { ChromeHelpExtensionMenuLink, ChromeHelpExtensionMenuCustomLink, @@ -25,4 +26,3 @@ export { ChromeHelpExtensionMenuDocumentationLink, ChromeHelpExtensionMenuGitHubLink, } from './header_help_menu'; -export type OnIsLockedUpdate = (isLocked: boolean) => void; diff --git a/src/core/public/chrome/ui/header/nav_drawer.tsx b/src/core/public/chrome/ui/header/nav_drawer.tsx index c57faec1e428d..7faee8edea43b 100644 --- a/src/core/public/chrome/ui/header/nav_drawer.tsx +++ b/src/core/public/chrome/ui/header/nav_drawer.tsx @@ -22,22 +22,18 @@ import { i18n } from '@kbn/i18n'; // @ts-ignore import { EuiNavDrawer, EuiHorizontalRule, EuiNavDrawerGroup } from '@elastic/eui'; import { OnIsLockedUpdate } from './'; -import { ChromeNavLink, ChromeRecentlyAccessedHistoryItem } from '../../..'; -import { HttpStart } from '../../../http'; -import { NavLink } from './nav_link'; +import { NavLink, RecentNavLink } from './nav_link'; import { RecentLinks } from './recent_links'; export interface Props { isLocked?: boolean; onIsLockedUpdate?: OnIsLockedUpdate; navLinks: NavLink[]; - chromeNavLinks: ChromeNavLink[]; - recentlyAccessedItems: ChromeRecentlyAccessedHistoryItem[]; - basePath: HttpStart['basePath']; + recentNavLinks: RecentNavLink[]; } function navDrawerRenderer( - { isLocked, onIsLockedUpdate, navLinks, chromeNavLinks, recentlyAccessedItems, basePath }: Props, + { isLocked, onIsLockedUpdate, navLinks, recentNavLinks }: Props, ref: React.Ref<HTMLElement> ) { return ( @@ -50,11 +46,7 @@ function navDrawerRenderer( defaultMessage: 'Primary', })} > - {RecentLinks({ - recentlyAccessedItems, - navLinks: chromeNavLinks, - basePath, - })} + {RecentLinks({ recentNavLinks })} <EuiHorizontalRule margin="none" /> <EuiNavDrawerGroup data-test-subj="navDrawerAppsMenu" diff --git a/src/core/public/chrome/ui/header/nav_link.tsx b/src/core/public/chrome/ui/header/nav_link.tsx index d97ef477c2ee0..22708c796d7dc 100644 --- a/src/core/public/chrome/ui/header/nav_link.tsx +++ b/src/core/public/chrome/ui/header/nav_link.tsx @@ -18,11 +18,13 @@ */ import React from 'react'; +import { i18n } from '@kbn/i18n'; import { EuiImage } from '@elastic/eui'; -import { ChromeNavLink, CoreStart } from '../../../'; +import { AppCategory } from 'src/core/types'; +import { ChromeNavLink, CoreStart, ChromeRecentlyAccessedHistoryItem } from '../../../'; import { HttpStart } from '../../../http'; -function isModifiedEvent(event: MouseEvent) { +function isModifiedEvent(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) { return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); } @@ -30,15 +32,36 @@ function LinkIcon({ url }: { url: string }) { return <EuiImage size="s" alt="" aria-hidden={true} url={url} />; } -export type NavLink = ReturnType<typeof euiNavLink>; +export interface NavLink { + key: string; + label: string; + href: string; + isActive: boolean; + onClick(event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void; + category?: AppCategory; + isDisabled?: boolean; + iconType?: string; + icon?: JSX.Element; + order?: number; + 'data-test-subj': string; +} -export function euiNavLink( +/** + * Create a link that's actually ready to be passed into EUI + * + * @param navLink + * @param legacyMode + * @param currentAppId + * @param basePath + * @param navigateToApp + */ +export function createNavLink( navLink: ChromeNavLink, legacyMode: boolean, currentAppId: string | undefined, basePath: HttpStart['basePath'], navigateToApp: CoreStart['application']['navigateToApp'] -) { +): NavLink { const { legacy, url, @@ -64,7 +87,7 @@ export function euiNavLink( key: id, label: tooltip ?? title, href, // Use href and onClick to support "open in new tab" and SPA navigation in the same link - onClick(event: MouseEvent) { + onClick(event) { if ( !legacyMode && // ignore when in legacy mode !legacy && // ignore links to legacy apps @@ -85,3 +108,76 @@ export function euiNavLink( 'data-test-subj': 'navDrawerAppsMenuLink', }; } + +// Providing a buffer between the limit and the cut off index +// protects from truncating just the last couple (6) characters +const TRUNCATE_LIMIT: number = 64; +const TRUNCATE_AT: number = 58; + +function truncateRecentItemLabel(label: string): string { + if (label.length > TRUNCATE_LIMIT) { + label = `${label.substring(0, TRUNCATE_AT)}…`; + } + + return label; +} + +/** + * @param {string} url - a relative or root relative url. If a relative path is given then the + * absolute url returned will depend on the current page where this function is called from. For example + * if you are on page "http://www.mysite.com/shopping/kids" and you pass this function "adults", you would get + * back "http://www.mysite.com/shopping/adults". If you passed this function a root relative path, or one that + * starts with a "/", for example "/account/cart", you would get back "http://www.mysite.com/account/cart". + * @return {string} the relative url transformed into an absolute url + */ +function relativeToAbsolute(url: string) { + const a = document.createElement('a'); + a.setAttribute('href', url); + return a.href; +} + +export interface RecentNavLink { + href: string; + label: string; + title: string; + 'aria-label': string; + iconType?: string; +} + +/** + * Add saved object type info to recently links + * + * Recent nav links are similar to normal nav links but are missing some Kibana Platform magic and + * because of legacy reasons have slightly different properties. + * @param recentLink + * @param navLinks + * @param basePath + */ +export function createRecentNavLink( + recentLink: ChromeRecentlyAccessedHistoryItem, + navLinks: ChromeNavLink[], + basePath: HttpStart['basePath'] +) { + const { link, label } = recentLink; + const href = relativeToAbsolute(basePath.prepend(link)); + const navLink = navLinks.find(nl => href.startsWith(nl.baseUrl ?? nl.subUrlBase)); + let titleAndAriaLabel = label; + + if (navLink) { + titleAndAriaLabel = i18n.translate('core.ui.recentLinks.linkItem.screenReaderLabel', { + defaultMessage: '{recentlyAccessedItemLinklabel}, type: {pageType}', + values: { + recentlyAccessedItemLinklabel: label, + pageType: navLink.title, + }, + }); + } + + return { + href, + label: truncateRecentItemLabel(label), + title: titleAndAriaLabel, + 'aria-label': titleAndAriaLabel, + iconType: navLink?.euiIconType, + }; +} diff --git a/src/core/public/chrome/ui/header/recent_links.tsx b/src/core/public/chrome/ui/header/recent_links.tsx index 57cb1d9541bcd..019cdce0b43c6 100644 --- a/src/core/public/chrome/ui/header/recent_links.tsx +++ b/src/core/public/chrome/ui/header/recent_links.tsx @@ -21,73 +21,13 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; // @ts-ignore import { EuiNavDrawerGroup } from '@elastic/eui'; -import { ChromeNavLink, ChromeRecentlyAccessedHistoryItem } from '../../..'; -import { HttpStart } from '../../../http'; - -// Providing a buffer between the limit and the cut off index -// protects from truncating just the last couple (6) characters -const TRUNCATE_LIMIT: number = 64; -const TRUNCATE_AT: number = 58; - -export function truncateRecentItemLabel(label: string): string { - if (label.length > TRUNCATE_LIMIT) { - label = `${label.substring(0, TRUNCATE_AT)}…`; - } - - return label; -} - -/** - * @param {string} url - a relative or root relative url. If a relative path is given then the - * absolute url returned will depend on the current page where this function is called from. For example - * if you are on page "http://www.mysite.com/shopping/kids" and you pass this function "adults", you would get - * back "http://www.mysite.com/shopping/adults". If you passed this function a root relative path, or one that - * starts with a "/", for example "/account/cart", you would get back "http://www.mysite.com/account/cart". - * @return {string} the relative url transformed into an absolute url - */ -function relativeToAbsolute(url: string) { - const a = document.createElement('a'); - a.setAttribute('href', url); - return a.href; -} - -function prepareForEUI( - recentlyAccessed: ChromeRecentlyAccessedHistoryItem[], - navLinks: ChromeNavLink[], - basePath: HttpStart['basePath'] -) { - return recentlyAccessed.map(({ link, label }) => { - const href = relativeToAbsolute(basePath.prepend(link)); - const navLink = navLinks.find(nl => href.startsWith(nl.baseUrl ?? nl.subUrlBase)); - let titleAndAriaLabel = label; - - if (navLink) { - titleAndAriaLabel = i18n.translate('core.ui.recentLinks.linkItem.screenReaderLabel', { - defaultMessage: '{recentlyAccessedItemLinklabel}, type: {pageType}', - values: { - recentlyAccessedItemLinklabel: label, - pageType: navLink.title, - }, - }); - } - - return { - href, - label: truncateRecentItemLabel(label), - title: titleAndAriaLabel, - 'aria-label': titleAndAriaLabel, - iconType: navLink?.euiIconType, - }; - }); -} +import { RecentNavLink } from './nav_link'; interface Props { - recentlyAccessedItems: ChromeRecentlyAccessedHistoryItem[]; - navLinks: ChromeNavLink[]; - basePath: HttpStart['basePath']; + recentNavLinks: RecentNavLink[]; } -export function RecentLinks({ recentlyAccessedItems, navLinks, basePath }: Props) { +export function RecentLinks({ recentNavLinks }: Props) { return ( <EuiNavDrawerGroup listItems={[ @@ -96,12 +36,12 @@ export function RecentLinks({ recentlyAccessedItems, navLinks, basePath }: Props defaultMessage: 'Recently viewed', }), iconType: 'recentlyViewedApp', - isDisabled: recentlyAccessedItems.length === 0, + isDisabled: recentNavLinks.length === 0, flyoutMenu: { title: i18n.translate('core.ui.chrome.sideGlobalNav.viewRecentItemsFlyoutTitle', { defaultMessage: 'Recent items', }), - listItems: prepareForEUI(recentlyAccessedItems, navLinks, basePath), + listItems: recentNavLinks, }, }, ]} diff --git a/src/dev/register_git_hook/index.js b/src/core/public/chrome/ui/header/types.ts similarity index 88% rename from src/dev/register_git_hook/index.js rename to src/core/public/chrome/ui/header/types.ts index 6089256423ff6..1d7d1983e8f71 100644 --- a/src/dev/register_git_hook/index.js +++ b/src/core/public/chrome/ui/header/types.ts @@ -17,4 +17,5 @@ * under the License. */ -export { registerPrecommitGitHook } from './register_git_hook'; +export type OnIsLockedUpdate = (isLocked: boolean) => void; +export type NavType = 'modern' | 'legacy'; diff --git a/src/core/public/chrome/ui/index.ts b/src/core/public/chrome/ui/index.ts index 460e19b7d9780..4f6ad90cb96a3 100644 --- a/src/core/public/chrome/ui/index.ts +++ b/src/core/public/chrome/ui/index.ts @@ -25,4 +25,5 @@ export { ChromeHelpExtensionMenuDiscussLink, ChromeHelpExtensionMenuDocumentationLink, ChromeHelpExtensionMenuGitHubLink, + NavType, } from './header'; diff --git a/src/core/public/core_system.ts b/src/core/public/core_system.ts index 59f0142bb8890..e58114b69dcc1 100644 --- a/src/core/public/core_system.ts +++ b/src/core/public/core_system.ts @@ -240,6 +240,7 @@ export class CoreSystem { http, injectedMetadata, notifications, + uiSettings, }); application.registerMountContext(this.coreContext.coreId, 'core', () => ({ diff --git a/src/core/public/index.ts b/src/core/public/index.ts index b4f64125a03ef..3b2d9ed3c0b02 100644 --- a/src/core/public/index.ts +++ b/src/core/public/index.ts @@ -54,6 +54,7 @@ import { ChromeStart, ChromeRecentlyAccessed, ChromeRecentlyAccessedHistoryItem, + NavType, } from './chrome'; import { FatalErrorsSetup, FatalErrorsStart, FatalErrorInfo } from './fatal_errors'; import { HttpSetup, HttpStart } from './http'; @@ -77,7 +78,17 @@ import { } from './context'; export { CoreContext, CoreSystem } from './core_system'; -export { RecursiveReadonly, DEFAULT_APP_CATEGORIES } from '../utils'; +export { + RecursiveReadonly, + DEFAULT_APP_CATEGORIES, + getFlattenedObject, + URLMeaningfulParts, + modifyUrl, + isRelativeUrl, + Freezable, + deepFreeze, + assertNever, +} from '../utils'; export { AppCategory, UiSettingsParams, @@ -344,4 +355,5 @@ export { PluginOpaqueId, IUiSettingsClient, UiSettingsState, + NavType, }; diff --git a/src/core/public/overlays/flyout/__snapshots__/flyout_service.test.tsx.snap b/src/core/public/overlays/flyout/__snapshots__/flyout_service.test.tsx.snap index 6b4b22b8541bc..fa83b34e06b81 100644 --- a/src/core/public/overlays/flyout/__snapshots__/flyout_service.test.tsx.snap +++ b/src/core/public/overlays/flyout/__snapshots__/flyout_service.test.tsx.snap @@ -13,12 +13,7 @@ Array [ Array [ <mockConstructor> <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <MountWrapper className="kbnOverlayMountWrapper" @@ -31,19 +26,14 @@ Array [ ] `; -exports[`FlyoutService openFlyout() renders a flyout to the DOM 2`] = `"<div><div data-focus-guard=\\"true\\" tabindex=\\"0\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div><div data-focus-guard=\\"true\\" tabindex=\\"1\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div><div data-focus-lock-disabled=\\"false\\"><div role=\\"dialog\\" class=\\"euiFlyout euiFlyout--medium\\" tabindex=\\"0\\"><button class=\\"euiButtonIcon euiButtonIcon--text euiFlyout__closeButton\\" type=\\"button\\" aria-label=\\"Closes this dialog\\" data-test-subj=\\"euiFlyoutCloseButton\\"><div data-euiicon-type=\\"cross\\" class=\\"euiButtonIcon__icon\\" aria-hidden=\\"true\\"></div></button><div class=\\"kbnOverlayMountWrapper\\"><span>Flyout content</span></div></div></div><div data-focus-guard=\\"true\\" tabindex=\\"0\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div></div>"`; +exports[`FlyoutService openFlyout() renders a flyout to the DOM 2`] = `"<div><div data-focus-guard=\\"true\\" tabindex=\\"0\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div><div data-focus-guard=\\"true\\" tabindex=\\"1\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div><div data-focus-lock-disabled=\\"false\\"><div role=\\"dialog\\" class=\\"euiFlyout euiFlyout--medium\\" tabindex=\\"0\\"><button class=\\"euiButtonIcon euiButtonIcon--text euiFlyout__closeButton\\" type=\\"button\\" aria-label=\\"Close this dialog\\" data-test-subj=\\"euiFlyoutCloseButton\\"><div data-euiicon-type=\\"cross\\" class=\\"euiButtonIcon__icon\\" aria-hidden=\\"true\\"></div></button><div class=\\"kbnOverlayMountWrapper\\"><span>Flyout content</span></div></div></div><div data-focus-guard=\\"true\\" tabindex=\\"0\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div></div>"`; exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 1`] = ` Array [ Array [ <mockConstructor> <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <MountWrapper className="kbnOverlayMountWrapper" @@ -56,12 +46,7 @@ Array [ Array [ <mockConstructor> <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <MountWrapper className="kbnOverlayMountWrapper" @@ -74,4 +59,4 @@ Array [ ] `; -exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 2`] = `"<div><div data-focus-guard=\\"true\\" tabindex=\\"0\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div><div data-focus-guard=\\"true\\" tabindex=\\"1\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div><div data-focus-lock-disabled=\\"false\\"><div role=\\"dialog\\" class=\\"euiFlyout euiFlyout--medium\\" tabindex=\\"0\\"><button class=\\"euiButtonIcon euiButtonIcon--text euiFlyout__closeButton\\" type=\\"button\\" aria-label=\\"Closes this dialog\\" data-test-subj=\\"euiFlyoutCloseButton\\"><div data-euiicon-type=\\"cross\\" class=\\"euiButtonIcon__icon\\" aria-hidden=\\"true\\"></div></button><div class=\\"kbnOverlayMountWrapper\\"><span>Flyout content 2</span></div></div></div><div data-focus-guard=\\"true\\" tabindex=\\"0\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div></div>"`; +exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 2`] = `"<div><div data-focus-guard=\\"true\\" tabindex=\\"0\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div><div data-focus-guard=\\"true\\" tabindex=\\"1\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div><div data-focus-lock-disabled=\\"false\\"><div role=\\"dialog\\" class=\\"euiFlyout euiFlyout--medium\\" tabindex=\\"0\\"><button class=\\"euiButtonIcon euiButtonIcon--text euiFlyout__closeButton\\" type=\\"button\\" aria-label=\\"Close this dialog\\" data-test-subj=\\"euiFlyoutCloseButton\\"><div data-euiicon-type=\\"cross\\" class=\\"euiButtonIcon__icon\\" aria-hidden=\\"true\\"></div></button><div class=\\"kbnOverlayMountWrapper\\"><span>Flyout content 2</span></div></div></div><div data-focus-guard=\\"true\\" tabindex=\\"0\\" style=\\"width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;\\"></div></div>"`; diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index af06b207889c2..225ef611c0298 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -16,6 +16,7 @@ import { Location } from 'history'; import { LocationDescriptorObject } from 'history'; import { MaybePromise } from '@kbn/utility-types'; import { Observable } from 'rxjs'; +import { ParsedQuery } from 'query-string'; import { PublicUiSettingsParams as PublicUiSettingsParams_2 } from 'src/core/server/types'; import React from 'react'; import * as Rx from 'rxjs'; @@ -54,6 +55,7 @@ export interface AppBase { export interface AppCategory { ariaLabel?: string; euiIconType?: string; + id: string; label: string; order?: number; } @@ -174,6 +176,9 @@ export type AppUpdatableFields = Pick<AppBase, 'status' | 'navLinkStatus' | 'too // @public export type AppUpdater = (app: AppBase) => Partial<AppUpdatableFields> | undefined; +// @public +export function assertNever(x: never): never; + // @public export interface Capabilities { [key: string]: Record<string, boolean | Record<string, boolean>>; @@ -339,6 +344,7 @@ export interface ChromeStart { getHelpExtension$(): Observable<ChromeHelpExtension | undefined>; getIsNavDrawerLocked$(): Observable<boolean>; getIsVisible$(): Observable<boolean>; + getNavType$(): Observable<NavType>; navControls: ChromeNavControls; navLinks: ChromeNavLinks; recentlyAccessed: ChromeRecentlyAccessed; @@ -434,25 +440,33 @@ export class CoreSystem { stop(): void; } +// @public +export function deepFreeze<T extends Freezable>(object: T): RecursiveReadonly<T>; + // @internal (undocumented) export const DEFAULT_APP_CATEGORIES: Readonly<{ - analyze: { + kibana: { + id: string; label: string; + euiIconType: string; order: number; }; observability: { + id: string; label: string; euiIconType: string; order: number; }; security: { + id: string; label: string; order: number; euiIconType: string; }; management: { + id: string; label: string; - euiIconType: string; + order: number; }; }>; @@ -584,6 +598,16 @@ export interface FatalErrorsSetup { // @public export type FatalErrorsStart = FatalErrorsSetup; +// @public (undocumented) +export type Freezable = { + [k: string]: any; +} | any[]; + +// @public +export function getFlattenedObject(rootValue: Record<string, any>): { + [key: string]: any; +}; + // @public export type HandlerContextType<T extends HandlerFunction<any>> = T extends HandlerFunction<infer U> ? U : never; @@ -795,6 +819,9 @@ export interface ImageValidation { }; } +// @public +export function isRelativeUrl(candidatePath: string): boolean; + // @public export type IToasts = Pick<ToastsApi, 'get$' | 'add' | 'remove' | 'addSuccess' | 'addWarning' | 'addDanger' | 'addError' | 'addInfo'>; @@ -857,9 +884,17 @@ export interface LegacyNavLink { url: string; } +// @public +export function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void): string; + // @public export type MountPoint<T extends HTMLElement = HTMLElement> = (element: T) => UnmountCallback; +// Warning: (ae-missing-release-tag) "NavType" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export type NavType = 'modern' | 'legacy'; + // @public (undocumented) export interface NotificationsSetup { // (undocumented) @@ -1356,6 +1391,26 @@ export type UiSettingsType = 'undefined' | 'json' | 'markdown' | 'number' | 'sel // @public export type UnmountCallback = () => void; +// @public +export interface URLMeaningfulParts { + // (undocumented) + auth?: string | null; + // (undocumented) + hash?: string | null; + // (undocumented) + hostname?: string | null; + // (undocumented) + pathname?: string | null; + // (undocumented) + port?: string | null; + // (undocumented) + protocol?: string | null; + // (undocumented) + query: ParsedQuery; + // (undocumented) + slashes?: boolean | null; +} + // @public export interface UserProvidedValues<T = any> { // (undocumented) diff --git a/src/core/public/rendering/_base.scss b/src/core/public/rendering/_base.scss index ff28fc75e367d..8032bc458822f 100644 --- a/src/core/public/rendering/_base.scss +++ b/src/core/public/rendering/_base.scss @@ -1,3 +1,6 @@ +@import '@elastic/eui/src/components/header/variables'; +@import '@elastic/eui/src/components/nav_drawer/variables'; + /** * stretch the root element of the Kibana application to set the base-size that * flexed children should keep. Only works when paired with root styles applied @@ -9,7 +12,9 @@ min-height: 100%; } -.app-wrapper { +// TODO #64541 +// Delete this block +.chrHeaderWrapper:not(.headerWrapper) ~ .app-wrapper { display: flex; flex-flow: column nowrap; position: absolute; @@ -20,6 +25,22 @@ z-index: 5; margin: 0 auto; + &:not(.hidden-chrome) { + top: $euiHeaderChildSize; + left: $euiHeaderChildSize; + + // HOTFIX: Temporary fix for flyouts not inside portals + // SASSTODO: Find an actual solution + .euiFlyout { + top: $euiHeaderChildSize; + height: calc(100% - #{$euiHeaderChildSize}); + } + + @include euiBreakpoint('xs', 's') { + left: 0; + } + } + /** * 1. Dirty, but we need to override the .kbnGlobalNav-isOpen state * when we're looking at the log-in screen. @@ -33,6 +54,32 @@ } } +// TODO #64541 +// Delete this block +@include euiBreakpoint('xl') { + .chrHeaderWrapper--navIsLocked:not(.headerWrapper) { + ~ .app-wrapper:not(.hidden-chrome) { + // Shrink the content from the left so it's no longer overlapped by the nav drawer (ALWAYS) + left: $euiNavDrawerWidthExpanded !important; // sass-lint:disable-line no-important + transition: left $euiAnimSpeedFast $euiAnimSlightResistance; + } + } +} + +// TODO #64541 +// Remove .headerWrapper and header conditionals +.headerWrapper ~ .app-wrapper, +:not(header) ~ .app-wrapper { + display: flex; + flex-flow: column nowrap; + margin: 0 auto; + min-height: calc(100vh - #{$euiHeaderHeightCompensation}); + + &.hidden-chrome { + min-height: 100vh; + } +} + .app-wrapper-panel { display: flex; flex-grow: 1; diff --git a/src/core/server/core_app/assets/favicons/android-chrome-192x192.png b/src/core/server/core_app/assets/favicons/android-chrome-192x192.png index 54b274dbc8eb1..18a86e5b95c46 100644 Binary files a/src/core/server/core_app/assets/favicons/android-chrome-192x192.png and b/src/core/server/core_app/assets/favicons/android-chrome-192x192.png differ diff --git a/src/core/server/core_app/assets/favicons/android-chrome-256x256.png b/src/core/server/core_app/assets/favicons/android-chrome-256x256.png index 4fb79e35a8fbd..8238d772ce40b 100644 Binary files a/src/core/server/core_app/assets/favicons/android-chrome-256x256.png and b/src/core/server/core_app/assets/favicons/android-chrome-256x256.png differ diff --git a/src/core/server/core_app/assets/favicons/android-chrome-512x512.png b/src/core/server/core_app/assets/favicons/android-chrome-512x512.png deleted file mode 100644 index 5095b839b77a2..0000000000000 Binary files a/src/core/server/core_app/assets/favicons/android-chrome-512x512.png and /dev/null differ diff --git a/src/core/server/core_app/assets/favicons/apple-touch-icon.png b/src/core/server/core_app/assets/favicons/apple-touch-icon.png index 11a714394b172..1ffeb0852a170 100644 Binary files a/src/core/server/core_app/assets/favicons/apple-touch-icon.png and b/src/core/server/core_app/assets/favicons/apple-touch-icon.png differ diff --git a/src/core/server/core_app/assets/favicons/favicon-16x16.png b/src/core/server/core_app/assets/favicons/favicon-16x16.png index 1ff8f0caa2dfc..631f5b7c7d74b 100644 Binary files a/src/core/server/core_app/assets/favicons/favicon-16x16.png and b/src/core/server/core_app/assets/favicons/favicon-16x16.png differ diff --git a/src/core/server/core_app/assets/favicons/favicon-32x32.png b/src/core/server/core_app/assets/favicons/favicon-32x32.png index 709b651e15eba..bf94dfa995f37 100644 Binary files a/src/core/server/core_app/assets/favicons/favicon-32x32.png and b/src/core/server/core_app/assets/favicons/favicon-32x32.png differ diff --git a/src/core/server/core_app/assets/favicons/favicon.ico b/src/core/server/core_app/assets/favicons/favicon.ico index 9d0ed69fb63e4..db30798a6cf32 100644 Binary files a/src/core/server/core_app/assets/favicons/favicon.ico and b/src/core/server/core_app/assets/favicons/favicon.ico differ diff --git a/src/core/server/core_app/assets/favicons/manifest.json b/src/core/server/core_app/assets/favicons/manifest.json index 17b3c4b2d9e52..de65106f489b7 100644 --- a/src/core/server/core_app/assets/favicons/manifest.json +++ b/src/core/server/core_app/assets/favicons/manifest.json @@ -1,5 +1,6 @@ { "name": "", + "short_name": "", "icons": [ { "src": "/android-chrome-192x192.png", diff --git a/src/core/server/core_app/assets/favicons/mstile-144x144.png b/src/core/server/core_app/assets/favicons/mstile-144x144.png deleted file mode 100644 index be839dad41365..0000000000000 Binary files a/src/core/server/core_app/assets/favicons/mstile-144x144.png and /dev/null differ diff --git a/src/core/server/core_app/assets/favicons/mstile-150x150.png b/src/core/server/core_app/assets/favicons/mstile-150x150.png index 0a2078511231b..82769c1ef242b 100644 Binary files a/src/core/server/core_app/assets/favicons/mstile-150x150.png and b/src/core/server/core_app/assets/favicons/mstile-150x150.png differ diff --git a/src/core/server/core_app/assets/favicons/mstile-310x150.png b/src/core/server/core_app/assets/favicons/mstile-310x150.png deleted file mode 100644 index 8c4d4ec7af840..0000000000000 Binary files a/src/core/server/core_app/assets/favicons/mstile-310x150.png and /dev/null differ diff --git a/src/core/server/core_app/assets/favicons/mstile-310x310.png b/src/core/server/core_app/assets/favicons/mstile-310x310.png deleted file mode 100644 index 82701d9bb35da..0000000000000 Binary files a/src/core/server/core_app/assets/favicons/mstile-310x310.png and /dev/null differ diff --git a/src/core/server/core_app/assets/favicons/mstile-70x70.png b/src/core/server/core_app/assets/favicons/mstile-70x70.png deleted file mode 100644 index 794a22ab1ee6f..0000000000000 Binary files a/src/core/server/core_app/assets/favicons/mstile-70x70.png and /dev/null differ diff --git a/src/core/server/core_app/assets/favicons/safari-pinned-tab.svg b/src/core/server/core_app/assets/favicons/safari-pinned-tab.svg index 839ee14d59444..38a64142be0b7 100644 --- a/src/core/server/core_app/assets/favicons/safari-pinned-tab.svg +++ b/src/core/server/core_app/assets/favicons/safari-pinned-tab.svg @@ -2,34 +2,33 @@ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg version="1.0" xmlns="http://www.w3.org/2000/svg" - width="700.000000pt" height="700.000000pt" viewBox="0 0 700.000000 700.000000" + width="305.000000pt" height="305.000000pt" viewBox="0 0 305.000000 305.000000" preserveAspectRatio="xMidYMid meet"> <metadata> Created by potrace 1.11, written by Peter Selinger 2001-2013 </metadata> -<g transform="translate(0.000000,700.000000) scale(0.100000,-0.100000)" +<g transform="translate(0.000000,305.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none"> -<path d="M879 6997 c-7 -14 -6 -6288 0 -6285 5 2 58 59 117 128 165 191 703 -811 733 845 27 31 297 342 540 624 74 86 140 161 145 167 6 6 34 37 61 70 28 -32 84 97 125 144 41 47 98 113 126 146 28 32 118 136 199 229 81 94 157 181 -169 195 27 32 148 171 161 186 6 6 33 37 60 70 28 32 68 79 91 104 22 25 76 -88 119 140 44 52 85 100 91 105 6 6 53 60 105 120 51 61 96 112 99 115 4 4 -150 173 216 250 33 38 312 361 343 395 14 17 53 61 86 100 33 38 72 83 86 100 -36 41 568 655 633 730 28 32 58 66 66 75 8 9 40 45 70 81 30 35 57 66 60 69 3 -3 62 70 130 150 69 80 171 199 229 265 57 66 127 147 156 180 29 33 89 103 -135 155 45 52 92 106 104 120 25 31 144 167 169 194 9 11 17 22 17 26 0 5 --5439 13 -5441 7z"/> -<path d="M3940 3238 c-52 -61 -108 -127 -125 -146 -16 -20 -40 -47 -53 -60 --12 -14 -40 -46 -61 -71 -22 -25 -48 -55 -58 -67 -10 -12 -41 -48 -69 -80 -28 --32 -116 -133 -195 -225 -79 -91 -164 -189 -189 -218 -25 -29 -54 -63 -65 -75 --11 -12 -45 -51 -75 -86 -30 -35 -89 -103 -130 -150 -41 -47 -100 -115 -130 --150 -30 -35 -89 -103 -130 -150 -41 -48 -156 -180 -255 -295 -99 -115 -231 --267 -294 -339 -63 -72 -137 -158 -165 -190 -28 -33 -58 -67 -66 -76 -8 -8 --69 -79 -135 -155 -129 -151 -164 -191 -180 -209 -6 -6 -55 -63 -110 -126 -54 --63 -101 -117 -104 -120 -4 -3 -19 -21 -35 -40 -16 -19 -56 -66 -90 -104 -33 --38 -66 -77 -73 -86 -12 -17 122 -17 2523 -17 l2536 -1 -6 22 c-4 11 -15 61 --26 111 -11 50 -24 106 -29 125 -131 506 -300 922 -558 1381 -126 222 -371 -574 -531 762 -138 162 -159 186 -287 317 -143 147 -285 279 -425 396 -98 81 --300 234 -309 234 -3 -1 -49 -51 -101 -112z"/> +<path d="M1611 2890 c-148 -40 -291 -131 -388 -246 l-42 -50 -57 -295 -56 +-294 68 -139 69 -139 328 -149 329 -148 31 26 c18 15 170 148 339 296 l306 +269 7 82 c29 348 -182 660 -525 777 -96 33 -306 38 -409 10z"/> +<path d="M771 2660 c-160 -33 -279 -170 -288 -333 -3 -45 0 -87 9 -112 l13 +-40 224 -52 c124 -30 227 -50 231 -46 4 5 28 122 54 261 55 288 58 263 -39 +301 -63 24 -147 32 -204 21z"/> +<path d="M386 2038 c-116 -64 -215 -186 -251 -312 -22 -76 -17 -239 10 -306 +46 -114 136 -216 237 -270 l59 -32 82 75 c45 40 188 169 317 286 129 117 236 +216 238 221 2 4 -23 64 -56 132 l-58 123 -250 58 c-137 32 -253 57 -259 57 -5 +0 -36 -15 -69 -32z"/> +<path d="M2268 1632 l-327 -287 69 -129 68 -130 254 -59 253 -59 60 30 c113 +56 207 161 255 287 33 86 34 233 2 328 -24 67 -84 158 -138 209 -33 31 -143 +98 -158 97 -6 0 -158 -129 -338 -287z"/> +<path d="M843 1331 c-175 -158 -324 -295 -331 -303 -19 -23 -26 -171 -13 -258 +70 -446 501 -735 936 -625 33 8 103 36 155 62 77 39 111 64 181 133 54 53 90 +98 97 120 6 19 34 156 62 303 l51 268 -74 142 -75 142 -318 145 c-176 80 -327 +149 -336 152 -13 5 -99 -67 -335 -281z"/> +<path d="M2036 721 c-26 -138 -46 -258 -43 -266 4 -8 30 -27 59 -42 47 -25 64 +-28 148 -28 82 0 103 4 151 26 77 36 130 87 169 161 28 53 35 76 38 144 3 46 +-1 96 -7 115 l-11 34 -212 49 c-117 27 -220 51 -228 53 -13 4 -24 -41 -64 +-246z"/> </g> </svg> diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 86192245bd2d1..cf999875b18f8 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -288,7 +288,17 @@ export { MetricsServiceSetup, } from './metrics'; -export { RecursiveReadonly } from '../utils'; +export { + RecursiveReadonly, + DEFAULT_APP_CATEGORIES, + getFlattenedObject, + URLMeaningfulParts, + modifyUrl, + isRelativeUrl, + Freezable, + deepFreeze, + assertNever, +} from '../utils'; export { SavedObject, diff --git a/src/core/server/legacy/plugins/get_nav_links.test.ts b/src/core/server/legacy/plugins/get_nav_links.test.ts index 44d080ec37a25..5e84f27acabd5 100644 --- a/src/core/server/legacy/plugins/get_nav_links.test.ts +++ b/src/core/server/legacy/plugins/get_nav_links.test.ts @@ -133,6 +133,7 @@ describe('getNavLinks', () => { id: 'app-a', title: 'AppA', category: { + id: 'foo', label: 'My Category', }, order: 42, @@ -151,6 +152,7 @@ describe('getNavLinks', () => { id: 'app-a', title: 'AppA', category: { + id: 'foo', label: 'My Category', }, order: 42, @@ -211,6 +213,7 @@ describe('getNavLinks', () => { id: 'link-a', title: 'AppA', category: { + id: 'foo', label: 'My Second Cat', }, order: 72, @@ -232,6 +235,7 @@ describe('getNavLinks', () => { id: 'link-a', title: 'AppA', category: { + id: 'foo', label: 'My Second Cat', }, order: 72, diff --git a/src/core/server/metrics/integration_tests/server_collector.test.ts b/src/core/server/metrics/integration_tests/server_collector.test.ts index dd5c256cf1600..3b982a06cf06c 100644 --- a/src/core/server/metrics/integration_tests/server_collector.test.ts +++ b/src/core/server/metrics/integration_tests/server_collector.test.ts @@ -185,18 +185,22 @@ describe('ServerMetricsCollector', () => { let metrics = await collector.collect(); expect(metrics.concurrent_connections).toEqual(0); - sendGet('/').end(() => null); + // supertest requests are executed when calling `.then` (or awaiting them). + // however in this test we need to send the request now and await for it later in the code. + // also using `.end` is not possible as it would execute the request twice. + // so the only option is this noop `.then`. + const res1 = sendGet('/').then(res => res); await waitForHits(1); metrics = await collector.collect(); expect(metrics.concurrent_connections).toEqual(1); - sendGet('/').end(() => null); + const res2 = sendGet('/').then(res => res); await waitForHits(2); metrics = await collector.collect(); expect(metrics.concurrent_connections).toEqual(2); waitSubject.next('go'); - await delay(requestWaitDelay); + await Promise.all([res1, res2]); metrics = await collector.collect(); expect(metrics.concurrent_connections).toEqual(0); }); diff --git a/src/core/server/rendering/views/template.tsx b/src/core/server/rendering/views/template.tsx index 73e119a5a97e7..76af229ac02ba 100644 --- a/src/core/server/rendering/views/template.tsx +++ b/src/core/server/rendering/views/template.tsx @@ -74,7 +74,7 @@ export const Template: FunctionComponent<Props> = ({ <meta charSet="utf-8" /> <meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width" /> - <title>Elastic Kibana</title> + <title>Elastic</title> <Fonts url={uiPublicUrl} /> {/* Favicons (generated from http://realfavicongenerator.net/) */} <link @@ -126,10 +126,10 @@ export const Template: FunctionComponent<Props> = ({ className="kbnWelcomeText" data-error-message={i18n('core.ui.welcomeErrorMessage', { defaultMessage: - 'Elastic Kibana did not load properly. Check the server output for more information.', + 'Elastic did not load properly. Check the server output for more information.', })} > - {i18n('core.ui.welcomeMessage', { defaultMessage: 'Loading Elastic Kibana' })} + {i18n('core.ui.welcomeMessage', { defaultMessage: 'Loading Elastic' })} </div> <div className="kbnProgress" /> </div> @@ -146,7 +146,7 @@ export const Template: FunctionComponent<Props> = ({ <div className="kbnWelcomeText"> {i18n('core.ui.legacyBrowserMessage', { defaultMessage: - 'This Kibana installation has strict security requirements enabled that your current browser does not meet.', + 'This Elastic installation has strict security requirements enabled that your current browser does not meet.', })} </div> </div> diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index e8b77a8570291..62d11ee7cf9a7 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -103,6 +103,7 @@ import { NodesInfoParams } from 'elasticsearch'; import { NodesStatsParams } from 'elasticsearch'; import { ObjectType } from '@kbn/config-schema'; import { Observable } from 'rxjs'; +import { ParsedQuery } from 'query-string'; import { PeerCertificate } from 'tls'; import { PingParams } from 'elasticsearch'; import { PutScriptParams } from 'elasticsearch'; @@ -388,6 +389,9 @@ export interface APICaller { <T = any>(endpoint: string, clientParams?: Record<string, any>, options?: CallAPIOptions): Promise<T>; } +// @public +export function assertNever(x: never): never; + // @public (undocumented) export interface AssistanceAPIResponse { // (undocumented) @@ -691,6 +695,36 @@ export interface CustomHttpResponseOptions<T extends HttpResponsePayload | Respo statusCode: number; } +// @public +export function deepFreeze<T extends Freezable>(object: T): RecursiveReadonly<T>; + +// @internal (undocumented) +export const DEFAULT_APP_CATEGORIES: Readonly<{ + kibana: { + id: string; + label: string; + euiIconType: string; + order: number; + }; + observability: { + id: string; + label: string; + euiIconType: string; + order: number; + }; + security: { + id: string; + label: string; + order: number; + euiIconType: string; + }; + management: { + id: string; + label: string; + order: number; + }; +}>; + // @public (undocumented) export interface DeprecationAPIClientParams extends GenericParams { // (undocumented) @@ -838,6 +872,11 @@ export interface FakeRequest { headers: Headers; } +// @public (undocumented) +export type Freezable = { + [k: string]: any; +} | any[]; + // @public export type GetAuthHeaders = (request: KibanaRequest | LegacyRequest) => AuthHeaders | undefined; @@ -847,6 +886,11 @@ export type GetAuthState = <T = unknown>(request: KibanaRequest | LegacyRequest) state: T; }; +// @public +export function getFlattenedObject(rootValue: Record<string, any>): { + [key: string]: any; +}; + // @public export type HandlerContextType<T extends HandlerFunction<any>> = T extends HandlerFunction<infer U> ? U : never; @@ -1034,6 +1078,9 @@ export type ISavedObjectTypeRegistry = Omit<SavedObjectTypeRegistry, 'registerTy // @public export type IScopedClusterClient = Pick<ScopedClusterClient, 'callAsCurrentUser' | 'callAsInternalUser'>; +// @public +export function isRelativeUrl(candidatePath: string): boolean; + // @public export interface IUiSettingsClient { get: <T = any>(key: string) => Promise<T>; @@ -1289,6 +1336,9 @@ export type MIGRATION_ASSISTANCE_INDEX_ACTION = 'upgrade' | 'reindex'; // @public (undocumented) export type MIGRATION_DEPRECATION_LEVEL = 'none' | 'info' | 'warning' | 'critical'; +// @public +export function modifyUrl(url: string, urlModifier: (urlParts: URLMeaningfulParts) => Partial<URLMeaningfulParts> | void): string; + // @public export type MutatingOperationRefreshSetting = boolean | 'wait_for'; @@ -2447,6 +2497,26 @@ export interface UiSettingsServiceStart { // @public export type UiSettingsType = 'undefined' | 'json' | 'markdown' | 'number' | 'select' | 'boolean' | 'string' | 'array' | 'image'; +// @public +export interface URLMeaningfulParts { + // (undocumented) + auth?: string | null; + // (undocumented) + hash?: string | null; + // (undocumented) + hostname?: string | null; + // (undocumented) + pathname?: string | null; + // (undocumented) + port?: string | null; + // (undocumented) + protocol?: string | null; + // (undocumented) + query: ParsedQuery; + // (undocumented) + slashes?: boolean | null; +} + // @public export interface UserProvidedValues<T = any> { // (undocumented) diff --git a/src/core/types/app_category.ts b/src/core/types/app_category.ts index 83a3693f009b6..8b39889b43a82 100644 --- a/src/core/types/app_category.ts +++ b/src/core/types/app_category.ts @@ -24,6 +24,11 @@ * @public */ export interface AppCategory { + /** + * Unique identifier for the categories + */ + id: string; + /** * Label used for cateogry name. * Also used as aria-label if one isn't set. diff --git a/src/core/utils/assert_never.ts b/src/core/utils/assert_never.ts index 8e47f07a02a87..c713b373493c5 100644 --- a/src/core/utils/assert_never.ts +++ b/src/core/utils/assert_never.ts @@ -17,8 +17,12 @@ * under the License. */ -// Can be used in switch statements to ensure we perform exhaustive checks, see -// https://www.typescriptlang.org/docs/handbook/advanced-types.html#exhaustiveness-checking +/** + * Can be used in switch statements to ensure we perform exhaustive checks, see + * https://www.typescriptlang.org/docs/handbook/advanced-types.html#exhaustiveness-checking + * + * @public + */ export function assertNever(x: never): never { throw new Error(`Unexpected object: ${x}`); } diff --git a/src/core/utils/deep_freeze.ts b/src/core/utils/deep_freeze.ts index 8c3f8f2258b61..b0f283c60d0fc 100644 --- a/src/core/utils/deep_freeze.ts +++ b/src/core/utils/deep_freeze.ts @@ -17,8 +17,6 @@ * under the License. */ -type Freezable = { [k: string]: any } | any[]; - // if we define this inside RecursiveReadonly TypeScript complains // eslint-disable-next-line @typescript-eslint/no-empty-interface interface RecursiveReadonlyArray<T> extends Array<RecursiveReadonly<T>> {} @@ -32,6 +30,15 @@ export type RecursiveReadonly<T> = T extends (...args: any[]) => any ? Readonly<{ [K in keyof T]: RecursiveReadonly<T[K]> }> : T; +/** @public */ +export type Freezable = { [k: string]: any } | any[]; + +/** + * Apply Object.freeze to a value recursively and convert the return type to + * Readonly variant recursively + * + * @public + */ export function deepFreeze<T extends Freezable>(object: T) { // for any properties that reference an object, makes sure that object is // recursively frozen as well diff --git a/src/core/utils/default_app_categories.ts b/src/core/utils/default_app_categories.ts index 2285bd6afd365..5708bcfeac31a 100644 --- a/src/core/utils/default_app_categories.ts +++ b/src/core/utils/default_app_categories.ts @@ -21,13 +21,16 @@ import { i18n } from '@kbn/i18n'; /** @internal */ export const DEFAULT_APP_CATEGORIES = Object.freeze({ - analyze: { - label: i18n.translate('core.ui.analyzeNavList.label', { - defaultMessage: 'Analyze', + kibana: { + id: 'kibana', + label: i18n.translate('core.ui.kibanaNavList.label', { + defaultMessage: 'Kibana', }), + euiIconType: 'logoKibana', order: 1000, }, observability: { + id: 'observability', label: i18n.translate('core.ui.observabilityNavList.label', { defaultMessage: 'Observability', }), @@ -35,6 +38,7 @@ export const DEFAULT_APP_CATEGORIES = Object.freeze({ order: 2000, }, security: { + id: 'security', label: i18n.translate('core.ui.securityNavList.label', { defaultMessage: 'Security', }), @@ -42,9 +46,10 @@ export const DEFAULT_APP_CATEGORIES = Object.freeze({ euiIconType: 'logoSecurity', }, management: { + id: 'management', label: i18n.translate('core.ui.managementNavList.label', { defaultMessage: 'Management', }), - euiIconType: 'managementApp', + order: 5000, }, }); diff --git a/src/core/utils/get_flattened_object.ts b/src/core/utils/get_flattened_object.ts index ce03793284236..25ca0c7c83e26 100644 --- a/src/core/utils/get_flattened_object.ts +++ b/src/core/utils/get_flattened_object.ts @@ -30,8 +30,7 @@ function shouldReadKeys(value: unknown): value is Record<string, any> { * getFlattenedObject({ a: { b: 1, c: [2,3] } }) * // => { 'a.b': 1, 'a.c': [2,3] } * - * @param {Object} rootValue - * @returns {Object} + * @public */ export function getFlattenedObject(rootValue: Record<string, any>) { if (!shouldReadKeys(rootValue)) { diff --git a/src/core/utils/url.ts b/src/core/utils/url.ts index c2bf80ce3f86f..910fc8eaa4381 100644 --- a/src/core/utils/url.ts +++ b/src/core/utils/url.ts @@ -23,6 +23,8 @@ import { format as formatUrl, parse as parseUrl, UrlObject } from 'url'; * We define our own typings because the current version of @types/node * declares properties to be optional "hostname?: string". * Although, parse call returns "hostname: null | string". + * + * @public */ export interface URLMeaningfulParts { auth?: string | null; @@ -63,6 +65,7 @@ export interface URLMeaningfulParts { * @param url The string url to parse. * @param urlModifier A function that will modify the parsed url, or return a new one. * @returns The modified and reformatted url + * @public */ export function modifyUrl( url: string, @@ -100,6 +103,12 @@ export function modifyUrl( } as UrlObject); } +/** + * Determine if a url is relative. Any url including a protocol, hostname, or + * port is not considered relative. This means that absolute *paths* are considered + * to be relative *urls* + * @public + */ export function isRelativeUrl(candidatePath: string) { // validate that `candidatePath` is not attempting a redirect to somewhere // outside of this Kibana install diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 8630221b3e94f..601dcc86352a7 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -35,8 +35,8 @@ export const IGNORE_FILE_GLOBS = [ '**/Gruntfile.js', 'tasks/config/**/*', '**/{Dockerfile,docker-compose.yml}', - 'x-pack/legacy/plugins/canvas/tasks/**/*', - 'x-pack/legacy/plugins/canvas/canvas_plugin_src/**/*', + 'x-pack/plugins/canvas/tasks/**/*', + 'x-pack/plugins/canvas/canvas_plugin_src/**/*', 'x-pack/plugins/monitoring/public/lib/jquery_flot/**/*', '**/.*', '**/{webpackShims,__mocks__}/**/*', @@ -48,7 +48,7 @@ export const IGNORE_FILE_GLOBS = [ 'vars/*', // Files in this directory must match a pre-determined name in some cases. - 'x-pack/legacy/plugins/canvas/.storybook/*', + 'x-pack/plugins/canvas/.storybook/*', // filename must match language code which requires capital letters '**/translations/*.json', diff --git a/src/dev/register_git_hook/register_git_hook.js b/src/dev/register_git_hook/register_git_hook.js deleted file mode 100644 index 8820327d3adc0..0000000000000 --- a/src/dev/register_git_hook/register_git_hook.js +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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 chalk from 'chalk'; -import { chmod, unlink, writeFile } from 'fs'; -import dedent from 'dedent'; -import normalizePath from 'normalize-path'; -import os from 'os'; -import { resolve } from 'path'; -import { promisify } from 'util'; -import SimpleGit from 'simple-git'; -import { REPO_ROOT } from '../constants'; - -const simpleGit = new SimpleGit(REPO_ROOT); - -const chmodAsync = promisify(chmod); -const gitRevParseAsync = promisify(simpleGit.revparse.bind(simpleGit)); -const unlinkAsync = promisify(unlink); -const writeFileAsync = promisify(writeFile); - -async function getPrecommitGitHookScriptPath(rootPath) { - // Retrieves the correct location for the .git dir for - // every git setup (including git worktree) - const gitDirPath = (await gitRevParseAsync(['--git-common-dir'])).trim(); - - return resolve(rootPath, gitDirPath, 'hooks/pre-commit'); -} - -function getKbnPrecommitGitHookScript(rootPath, nodeHome, platform) { - return dedent(` - #!/usr/bin/env bash - # - # ** THIS IS AN AUTO-GENERATED FILE ** - # ** PLEASE DO NOT CHANGE IT MANUALLY ** - # - # GENERATED BY ${__dirname} - # IF YOU WANNA CHANGE SOMETHING INTO THIS SCRIPT - # PLEASE RE-RUN 'yarn kbn bootstrap' or 'node scripts/register_git_hook' IN THE ROOT - # OF THE CURRENT PROJECT ${rootPath} - - # pre-commit script takes zero arguments: https://git-scm.com/docs/githooks#_pre_commit - - set -euo pipefail - - # Make it possible to terminate pre commit hook - # using ctrl-c so nothing else would happen or be - # sent to the output. - # - # The correct exit code on that situation - # according the linux documentation project is 130 - # https://www.tldp.org/LDP/abs/html/exitcodes.html - trap "exit 130" INT - - has_node() { - command -v node >/dev/null 2>&1 - } - - has_nvm() { - command -v nvm >/dev/null 2>&1 - } - - try_load_node_from_nvm_paths () { - # If nvm is not loaded, load it - has_node || { - NVM_SH="${nodeHome}/.nvm/nvm.sh" - - if [ "${platform}" == "darwin" ] && [ -s "$(brew --prefix nvm)/nvm.sh" ]; then - NVM_SH="$(brew --prefix nvm)/nvm.sh" - fi - - export NVM_DIR=${nodeHome}/.nvm - - [ -s "$NVM_SH" ] && \. "$NVM_SH" - - # If nvm has been loaded correctly, use project .nvmrc - has_nvm && nvm use - } - } - - extend_user_path() { - if [ "${platform}" == "win32" ]; then - export PATH="$PATH:/c/Program Files/nodejs" - else - export PATH="$PATH:/usr/local/bin:/usr/local" - try_load_node_from_nvm_paths - fi - } - - # Extend path with common path locations for node - # in order to make the hook working on git GUI apps - extend_user_path - - # Check if we have node js bin in path - has_node || { - echo "Can't found node bin in the PATH. Please update the PATH to proceed." - echo "If your PATH already has the node bin, maybe you are using some git GUI app." - echo "Can't found node bin in the PATH. Please update the PATH to proceed." - echo "If your PATH already has the node bin, maybe you are using some git GUI app not launched from the shell." - echo "In order to proceed, you need to config the PATH used by the application that are launching your git GUI app." - echo "If you are running macOS, you can do that using:" - echo "'sudo launchctl config user path /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'" - - exit 1 - } - - execute_precommit_hook() { - node scripts/precommit_hook || return 1 - - PRECOMMIT_FILE="./.git/hooks/pre-commit.local" - if [ -x "\${PRECOMMIT_FILE}" ]; then - echo "Executing local precommit hook found in \${PRECOMMIT_FILE}" - "$PRECOMMIT_FILE" || return 1 - fi - } - - execute_precommit_hook || { - echo "Pre-commit hook failed (add --no-verify to bypass)"; - echo ' For eslint failures you can try running \`node scripts/precommit_hook --fix\`'; - exit 1; - } - - exit 0 - `); -} - -export async function registerPrecommitGitHook(log) { - log.write(chalk.bold(`Registering Kibana pre-commit git hook...\n`)); - - try { - await writeGitHook( - await getPrecommitGitHookScriptPath(REPO_ROOT), - getKbnPrecommitGitHookScript(REPO_ROOT, normalizePath(os.homedir()), process.platform) - ); - } catch (e) { - log.write( - `${chalk.red('fail')} Kibana pre-commit git hook was not installed as an error occur.\n` - ); - throw e; - } - - log.write(`${chalk.green('success')} Kibana pre-commit git hook was installed successfully.\n`); -} - -async function writeGitHook(gitHookScriptPath, kbnHookScriptSource) { - try { - await unlinkAsync(gitHookScriptPath); - } catch (e) { - /* no-op */ - } - - await writeFileAsync(gitHookScriptPath, kbnHookScriptSource); - await chmodAsync(gitHookScriptPath, 0o755); -} diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 0e91f0a214a45..416702c56d852 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -20,7 +20,7 @@ export const storybookAliases = { advanced_ui_actions: 'x-pack/plugins/advanced_ui_actions/scripts/storybook.js', apm: 'x-pack/plugins/apm/scripts/storybook.js', - canvas: 'x-pack/legacy/plugins/canvas/scripts/storybook_new.js', + canvas: 'x-pack/plugins/canvas/scripts/storybook_new.js', codeeditor: 'src/plugins/kibana_react/public/code_editor/scripts/storybook.ts', dashboard_enhanced: 'x-pack/plugins/dashboard_enhanced/scripts/storybook.js', drilldowns: 'x-pack/plugins/drilldowns/scripts/storybook.js', diff --git a/src/legacy/core_plugins/kibana/index.js b/src/legacy/core_plugins/kibana/index.js index 51577456135d1..6664cf0d7366d 100644 --- a/src/legacy/core_plugins/kibana/index.js +++ b/src/legacy/core_plugins/kibana/index.js @@ -24,11 +24,11 @@ import { promisify } from 'util'; import { importApi } from './server/routes/api/import'; import { exportApi } from './server/routes/api/export'; import mappings from './mappings.json'; -import { getUiSettingDefaults } from './ui_setting_defaults'; +import { getUiSettingDefaults } from './server/ui_setting_defaults'; import { registerCspCollector } from './server/lib/csp_usage_collector'; import { injectVars } from './inject_vars'; import { i18n } from '@kbn/i18n'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server'; import { kbnBaseUrl } from '../../../plugins/kibana_legacy/server'; const mkdirAsync = promisify(Fs.mkdir); @@ -67,33 +67,33 @@ export default function(kibana) { title: i18n.translate('kbn.discoverTitle', { defaultMessage: 'Discover', }), - order: -1003, + order: 2000, url: `${kbnBaseUrl}#/discover`, euiIconType: 'discoverApp', disableSubUrlTracking: true, - category: DEFAULT_APP_CATEGORIES.analyze, + category: DEFAULT_APP_CATEGORIES.kibana, }, { id: 'kibana:visualize', title: i18n.translate('kbn.visualizeTitle', { defaultMessage: 'Visualize', }), - order: -1002, + order: 7000, url: `${kbnBaseUrl}#/visualize`, euiIconType: 'visualizeApp', disableSubUrlTracking: true, - category: DEFAULT_APP_CATEGORIES.analyze, + category: DEFAULT_APP_CATEGORIES.kibana, }, { id: 'kibana:dashboard', title: i18n.translate('kbn.dashboardTitle', { defaultMessage: 'Dashboard', }), - order: -1001, + order: 1000, url: `${kbnBaseUrl}#/dashboards`, euiIconType: 'dashboardApp', disableSubUrlTracking: true, - category: DEFAULT_APP_CATEGORIES.analyze, + category: DEFAULT_APP_CATEGORIES.kibana, }, { id: 'kibana:dev_tools', @@ -108,7 +108,7 @@ export default function(kibana) { { id: 'kibana:stack_management', title: i18n.translate('kbn.managementTitle', { - defaultMessage: 'Management', + defaultMessage: 'Stack Management', }), order: 9003, url: `${kbnBaseUrl}#/management`, diff --git a/src/legacy/core_plugins/kibana/public/__tests__/vis_type_table/agg_table.js b/src/legacy/core_plugins/kibana/public/__tests__/vis_type_table/agg_table.js index b212ecf578dd1..de85bec011eeb 100644 --- a/src/legacy/core_plugins/kibana/public/__tests__/vis_type_table/agg_table.js +++ b/src/legacy/core_plugins/kibana/public/__tests__/vis_type_table/agg_table.js @@ -415,7 +415,7 @@ describe('Table Vis - AggTable Directive', function() { ); $percentageColValues.each((i, value) => { - const percentage = `${round((counts[i] / total) * 100, 1)}%`; + const percentage = `${round((counts[i] / total) * 100, 3)}%`; expect(value).to.be(percentage); }); }); diff --git a/src/legacy/core_plugins/kibana/public/management/index.js b/src/legacy/core_plugins/kibana/public/management/index.js index 6a36391c56b5c..2cba9fab7be22 100644 --- a/src/legacy/core_plugins/kibana/public/management/index.js +++ b/src/legacy/core_plugins/kibana/public/management/index.js @@ -69,7 +69,7 @@ export function updateLandingPage(version) { <h1> <FormattedMessage id="kbn.management.landing.header" - defaultMessage="Kibana {version} management" + defaultMessage="Welcome to Stack Management {version}" values={{ version }} /> </h1> diff --git a/src/legacy/core_plugins/kibana/ui_setting_defaults.js b/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js similarity index 98% rename from src/legacy/core_plugins/kibana/ui_setting_defaults.js rename to src/legacy/core_plugins/kibana/server/ui_setting_defaults.js index 85b1956f45333..91c61886d216c 100644 --- a/src/legacy/core_plugins/kibana/ui_setting_defaults.js +++ b/src/legacy/core_plugins/kibana/server/ui_setting_defaults.js @@ -16,13 +16,14 @@ * specific language governing permissions and limitations * under the License. */ + import moment from 'moment-timezone'; import numeralLanguages from '@elastic/numeral/languages'; import { i18n } from '@kbn/i18n'; import { schema } from '@kbn/config-schema'; -import { DEFAULT_QUERY_LANGUAGE } from '../../../plugins/data/common'; -import { isRelativeUrl } from '../../../core/utils'; +import { isRelativeUrl } from '../../../../core/server'; +import { DEFAULT_QUERY_LANGUAGE } from '../../../../plugins/data/common'; export function getUiSettingDefaults() { const weekdays = moment.weekdays().slice(); @@ -1171,5 +1172,25 @@ export function getUiSettingDefaults() { category: ['accessibility'], requiresPageReload: true, }, + pageNavigation: { + name: i18n.translate('kbn.advancedSettings.pageNavigationName', { + defaultMessage: 'Side nav style', + }), + value: 'modern', + description: i18n.translate('kbn.advancedSettings.pageNavigationDesc', { + defaultMessage: 'Change the style of navigation', + }), + type: 'select', + options: ['modern', 'legacy'], + optionLabels: { + modern: i18n.translate('kbn.advancedSettings.pageNavigationModern', { + defaultMessage: 'Modern', + }), + legacy: i18n.translate('kbn.advancedSettings.pageNavigationLegacy', { + defaultMessage: 'Legacy', + }), + }, + schema: schema.oneOf([schema.literal('modern'), schema.literal('legacy')]), + }, }; } diff --git a/src/legacy/core_plugins/timelion/index.ts b/src/legacy/core_plugins/timelion/index.ts index 41a15dc4e0186..31926f658ec13 100644 --- a/src/legacy/core_plugins/timelion/index.ts +++ b/src/legacy/core_plugins/timelion/index.ts @@ -21,7 +21,7 @@ import { resolve } from 'path'; import { i18n } from '@kbn/i18n'; import { Legacy } from 'kibana'; import { LegacyPluginApi, LegacyPluginInitializer } from 'src/legacy/plugin_discovery/types'; -import { DEFAULT_APP_CATEGORIES } from '../../../core/utils'; +import { DEFAULT_APP_CATEGORIES } from '../../../core/server'; const experimentalLabel = i18n.translate('timelion.uiSettings.experimentalLabel', { defaultMessage: 'experimental', @@ -54,11 +54,11 @@ const timelionPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPl uiExports: { app: { title: 'Timelion', - order: -1000, + order: 8000, icon: 'plugins/timelion/icon.svg', euiIconType: 'timelionApp', main: 'plugins/timelion/app', - category: DEFAULT_APP_CATEGORIES.analyze, + category: DEFAULT_APP_CATEGORIES.kibana, }, styleSheetPaths: resolve(__dirname, 'public/index.scss'), hacks: [resolve(__dirname, 'public/legacy')], diff --git a/src/legacy/ui/public/exit_full_screen/__snapshots__/exit_full_screen_button.test.js.snap b/src/legacy/ui/public/exit_full_screen/__snapshots__/exit_full_screen_button.test.js.snap index 365f3afdab395..ad13256c8245a 100644 --- a/src/legacy/ui/public/exit_full_screen/__snapshots__/exit_full_screen_button.test.js.snap +++ b/src/legacy/ui/public/exit_full_screen/__snapshots__/exit_full_screen_button.test.js.snap @@ -29,13 +29,8 @@ exports[`is rendered 1`] = ` data-test-subj="exitFullScreenModeText" > <div> - <p - class="euiTitle euiTitle--xxxsmall dshExitFullScreenButton__title" - > - Elastic Kibana - </p> <div - class="euiText euiText--extraSmall dshExitFullScreenButton__text" + class="euiText euiText--small dshExitFullScreenButton__text" > <p> Exit full screen diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/label_template_flyout.test.tsx.snap b/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/label_template_flyout.test.tsx.snap index cba8e85a65249..f0766df176c0d 100644 --- a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/label_template_flyout.test.tsx.snap +++ b/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/label_template_flyout.test.tsx.snap @@ -4,12 +4,7 @@ exports[`LabelTemplateFlyout should not render if not visible 1`] = `""`; exports[`LabelTemplateFlyout should render normally 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutBody> <EuiText> diff --git a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/url_template_flyout.test.tsx.snap b/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/url_template_flyout.test.tsx.snap index 849e307f7b527..fd697a2a4c70a 100644 --- a/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/url_template_flyout.test.tsx.snap +++ b/src/legacy/ui/public/field_editor/components/field_format_editor/editors/url/__snapshots__/url_template_flyout.test.tsx.snap @@ -4,12 +4,7 @@ exports[`UrlTemplateFlyout should not render if not visible 1`] = `""`; exports[`UrlTemplateFlyout should render normally 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutBody> <EuiText> diff --git a/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.tsx.snap b/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.tsx.snap index 282e8e311d984..6991281dc86a9 100644 --- a/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.tsx.snap +++ b/src/legacy/ui/public/field_editor/components/scripting_help/__snapshots__/help_flyout.test.tsx.snap @@ -2,13 +2,8 @@ exports[`ScriptingHelpFlyout should render normally 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" data-test-subj="scriptedFieldsHelpFlyout" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutBody> <EuiTabbedContent @@ -53,13 +48,8 @@ exports[`ScriptingHelpFlyout should render normally 1`] = ` exports[`ScriptingHelpFlyout should render nothing if not visible 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" data-test-subj="scriptedFieldsHelpFlyout" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutBody> <EuiTabbedContent diff --git a/src/legacy/ui/public/management/breadcrumbs.ts b/src/legacy/ui/public/management/breadcrumbs.ts index e6156b6639ac4..936e99caff565 100644 --- a/src/legacy/ui/public/management/breadcrumbs.ts +++ b/src/legacy/ui/public/management/breadcrumbs.ts @@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n'; export const MANAGEMENT_BREADCRUMB = Object.freeze({ text: i18n.translate('common.ui.stackManagement.breadcrumb', { - defaultMessage: 'Management', + defaultMessage: 'Stack Management', }), href: '#/management', }); diff --git a/src/legacy/ui/public/styles/_legacy/_base.scss b/src/legacy/ui/public/styles/_legacy/_base.scss index 0fcfb515c7c90..fd0a1335f9685 100644 --- a/src/legacy/ui/public/styles/_legacy/_base.scss +++ b/src/legacy/ui/public/styles/_legacy/_base.scss @@ -1,3 +1,5 @@ +@import '@elastic/eui/src/components/collapsible_nav/variables'; + // Forms // Angular form states @@ -38,7 +40,9 @@ input[type='checkbox'], // Application Layout // chrome-context -.content { +// TODO #64541 +// Delete this block +.chrHeaderWrapper:not(.headerWrapper) .content { display: flex; flex-flow: row nowrap; width: 100%; @@ -119,7 +123,7 @@ input[type='checkbox'], } } -// A neccessary hack so that the above focus policy doesn't polute some EUI +// A necessary hack so that the above focus policy doesn't pollute some EUI // entrenched inputs. .euiComboBox { // :not() specificity needed to override the above @@ -128,6 +132,10 @@ input[type='checkbox'], } } +.euiBody--collapsibleNavIsDocked .euiBottomBar { + margin-left: $euiCollapsibleNavWidth; +} + // Utility classes .fullWidth { diff --git a/src/legacy/ui/public/url/kibana_parsed_url.ts b/src/legacy/ui/public/url/kibana_parsed_url.ts index 93d2e17d6038f..22288160acc6d 100644 --- a/src/legacy/ui/public/url/kibana_parsed_url.ts +++ b/src/legacy/ui/public/url/kibana_parsed_url.ts @@ -19,7 +19,7 @@ import { parse } from 'url'; -import { modifyUrl } from '../../../../core/utils'; +import { modifyUrl } from '../../../../core/public'; import { prependPath } from './prepend_path'; interface Options { diff --git a/src/plugins/advanced_settings/public/management_app/components/form/_form.scss b/src/plugins/advanced_settings/public/management_app/components/form/_form.scss index 02ebb90221d90..5fddaa178f580 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/_form.scss +++ b/src/plugins/advanced_settings/public/management_app/components/form/_form.scss @@ -1,6 +1,8 @@ @import '@elastic/eui/src/components/header/variables'; @import '@elastic/eui/src/components/nav_drawer/variables'; +// TODO #64541 +// Delete this whole file .mgtAdvancedSettingsForm__bottomBar { margin-left: $euiNavDrawerWidthCollapsed; z-index: 9; // Puts it inuder the nav drawer when expanded diff --git a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx index c859e8fdd7136..2cd4d3c0b43ec 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx @@ -19,6 +19,7 @@ import React, { PureComponent, Fragment } from 'react'; import classNames from 'classnames'; + import { EuiFlexGroup, EuiFlexItem, @@ -325,10 +326,18 @@ export class Form extends PureComponent<FormProps> { renderBottomBar = () => { const areChangesInvalid = this.areChangesInvalid(); - const bottomBarClasses = classNames('mgtAdvancedSettingsForm__bottomBar', { - 'mgtAdvancedSettingsForm__bottomBar--pushForNav': - localStorage.getItem(NAV_IS_LOCKED_KEY) === 'true', - }); + + // TODO #64541 + // Delete these classes + let bottomBarClasses = ''; + const pageNav = this.props.settings.general.find(setting => setting.name === 'pageNavigation'); + + if (pageNav?.value === 'legacy') { + bottomBarClasses = classNames('mgtAdvancedSettingsForm__bottomBar', { + 'mgtAdvancedSettingsForm__bottomBar--pushForNav': + localStorage.getItem(NAV_IS_LOCKED_KEY) === 'true', + }); + } return ( <EuiBottomBar className={bottomBarClasses} data-test-subj="advancedSetting-bottomBar"> <EuiFlexGroup diff --git a/src/plugins/dashboard/public/application/_dashboard_app.scss b/src/plugins/dashboard/public/application/_dashboard_app.scss index 8f389bb031df1..719d0a3268b5d 100644 --- a/src/plugins/dashboard/public/application/_dashboard_app.scss +++ b/src/plugins/dashboard/public/application/_dashboard_app.scss @@ -1,7 +1,8 @@ .dshAppContainer { display: flex; flex-direction: column; - height: 100%; + height: 100%; // TODO #64541 - can delete this + flex: 1; } .dshStartScreen { diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx index 4f9aa75f52105..b3fc462fd1c50 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx @@ -34,6 +34,7 @@ import { import { KibanaContextProvider } from '../../../../../kibana_react/public'; // eslint-disable-next-line import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; +import { applicationServiceMock } from '../../../../../../core/public/mocks'; let dashboardContainer: DashboardContainer | undefined; @@ -50,7 +51,7 @@ function getProps( const start = doStart(); const options: DashboardContainerOptions = { - application: {} as any, + application: applicationServiceMock.createStartContract(), embeddable: { getTriggerCompatibleActions: (() => []) as any, getEmbeddableFactories: start.getEmbeddableFactories, diff --git a/src/plugins/dashboard/public/application/tests/dashboard_container.test.tsx b/src/plugins/dashboard/public/application/tests/dashboard_container.test.tsx index 40231de7597f1..6eb85faeea014 100644 --- a/src/plugins/dashboard/public/application/tests/dashboard_container.test.tsx +++ b/src/plugins/dashboard/public/application/tests/dashboard_container.test.tsx @@ -38,6 +38,7 @@ import { embeddablePluginMock } from '../../../../embeddable/public/mocks'; import { inspectorPluginMock } from '../../../../inspector/public/mocks'; import { KibanaContextProvider } from '../../../../kibana_react/public'; import { uiActionsPluginMock } from '../../../../ui_actions/public/mocks'; +import { applicationServiceMock } from '../../../../../core/public/mocks'; test('DashboardContainer in edit mode shows edit mode actions', async () => { const inspector = inspectorPluginMock.createStartContract(); @@ -56,7 +57,7 @@ test('DashboardContainer in edit mode shows edit mode actions', async () => { const initialInput = getSampleDashboardInput({ viewMode: ViewMode.VIEW }); const options: DashboardContainerOptions = { - application: {} as any, + application: applicationServiceMock.createStartContract(), embeddable: start, notifications: {} as any, overlays: {} as any, @@ -84,7 +85,7 @@ test('DashboardContainer in edit mode shows edit mode actions', async () => { getAllEmbeddableFactories={(() => []) as any} getEmbeddableFactory={(() => null) as any} notifications={{} as any} - application={{} as any} + application={options.application} overlays={{} as any} inspector={inspector} SavedObjectFinder={() => null} diff --git a/src/plugins/dashboard/public/dashboard_constants.ts b/src/plugins/dashboard/public/dashboard_constants.ts index 0820ebd371004..490ddbed933d9 100644 --- a/src/plugins/dashboard/public/dashboard_constants.ts +++ b/src/plugins/dashboard/public/dashboard_constants.ts @@ -18,7 +18,6 @@ */ export const DashboardConstants = { - ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM: 'addToDashboard', LANDING_PAGE_PATH: '/dashboards', CREATE_NEW_DASHBOARD_URL: '/dashboard', ADD_EMBEDDABLE_ID: 'addEmbeddableId', diff --git a/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_suggestor.tsx b/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_suggestor.tsx index 2b2d83c9f5a8b..546365b89d9be 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_suggestor.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_suggestor.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { Component } from 'react'; +import React from 'react'; import { debounce } from 'lodash'; import { withKibana, KibanaReactContextValue } from '../../../../../kibana_react/public'; @@ -39,7 +39,7 @@ export interface PhraseSuggestorState { * aggregatable), we pull out the common logic for requesting suggestions into this component * which both of them extend. */ -export class PhraseSuggestorUI<T extends PhraseSuggestorProps> extends Component< +export class PhraseSuggestorUI<T extends PhraseSuggestorProps> extends React.Component< T, PhraseSuggestorState > { diff --git a/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx b/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx index 6ca1b7582001f..8ad1b5d392f3b 100644 --- a/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx +++ b/src/plugins/data/public/ui/saved_query_management/saved_query_management_component.tsx @@ -180,6 +180,7 @@ export function SavedQueryManagementComponent({ }} anchorPosition="downLeft" panelPaddingSize="none" + buffer={-8} ownFocus > <div diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.tsx b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.tsx index d440f09ca09dd..3606bfbaeb1f9 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.tsx +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_description.tsx @@ -19,7 +19,7 @@ import React from 'react'; import { EuiCodeBlock, EuiDescriptionList, EuiSpacer } from '@elastic/eui'; import { ShardFailure } from './shard_failure_types'; -import { getFlattenedObject } from '../../../../../core/utils'; +import { getFlattenedObject } from '../../../../../core/public'; import { ShardFailureDescriptionHeader } from './shard_failure_description_header'; /** diff --git a/src/plugins/discover/public/application/angular/_index.scss b/src/plugins/discover/public/application/angular/_index.scss index 9e00ade3d41f6..b0e5b6e3edf7b 100644 --- a/src/plugins/discover/public/application/angular/_index.scss +++ b/src/plugins/discover/public/application/angular/_index.scss @@ -1,3 +1,2 @@ @import 'directives/index'; -@import 'doc_table/index'; @import 'context/index'; diff --git a/src/plugins/discover/public/application/angular/doc_table/_doc_table.scss b/src/plugins/discover/public/application/angular/doc_table/_doc_table.scss index 8b754d23f9604..3e30214acd2a9 100644 --- a/src/plugins/discover/public/application/angular/doc_table/_doc_table.scss +++ b/src/plugins/discover/public/application/angular/doc_table/_doc_table.scss @@ -2,6 +2,7 @@ * 1. Stack content vertically so the table can scroll when its constrained by a fixed container height. */ doc-table { + @include euiScrollBar; overflow: auto; flex: 1 1 100%; flex-direction: column; /* 1 */ diff --git a/src/plugins/discover/public/application/angular/doc_table/doc_table.ts b/src/plugins/discover/public/application/angular/doc_table/doc_table.ts index 66b162a4584a7..8af7380afcdc9 100644 --- a/src/plugins/discover/public/application/angular/doc_table/doc_table.ts +++ b/src/plugins/discover/public/application/angular/doc_table/doc_table.ts @@ -22,6 +22,7 @@ import { dispatchRenderComplete } from '../../../../../kibana_utils/public'; // @ts-ignore import { getLimitedSearchResultsMessage } from './doc_table_strings'; import { getServices } from '../../../kibana_services'; +import './index.scss'; export interface LazyScope extends ng.IScope { [key: string]: any; diff --git a/src/plugins/discover/public/application/angular/doc_table/_index.scss b/src/plugins/discover/public/application/angular/doc_table/index.scss similarity index 66% rename from src/plugins/discover/public/application/angular/doc_table/_index.scss rename to src/plugins/discover/public/application/angular/doc_table/index.scss index 3663d807851c4..4e6cb83c5fe5a 100644 --- a/src/plugins/discover/public/application/angular/doc_table/_index.scss +++ b/src/plugins/discover/public/application/angular/doc_table/index.scss @@ -1,2 +1,4 @@ +@import '../../mixins'; + @import 'doc_table'; @import 'components/index'; diff --git a/src/plugins/discover/public/application/components/_index.scss b/src/plugins/discover/public/application/components/_index.scss deleted file mode 100644 index 91fb3df79b177..0000000000000 --- a/src/plugins/discover/public/application/components/_index.scss +++ /dev/null @@ -1,3 +0,0 @@ -@import 'doc_viewer/index'; -@import 'fetch_error/index'; -@import 'sidebar/index'; diff --git a/src/plugins/discover/public/application/components/doc_viewer/_index.scss b/src/plugins/discover/public/application/components/doc_viewer/_index.scss deleted file mode 100644 index aaf925f435d81..0000000000000 --- a/src/plugins/discover/public/application/components/doc_viewer/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import 'doc_viewer'; diff --git a/src/plugins/discover/public/application/components/doc_viewer/_doc_viewer.scss b/src/plugins/discover/public/application/components/doc_viewer/doc_viewer.scss similarity index 100% rename from src/plugins/discover/public/application/components/doc_viewer/_doc_viewer.scss rename to src/plugins/discover/public/application/components/doc_viewer/doc_viewer.scss diff --git a/src/plugins/discover/public/application/components/doc_viewer/doc_viewer.tsx b/src/plugins/discover/public/application/components/doc_viewer/doc_viewer.tsx index dce6de150155c..80c43db016698 100644 --- a/src/plugins/discover/public/application/components/doc_viewer/doc_viewer.tsx +++ b/src/plugins/discover/public/application/components/doc_viewer/doc_viewer.tsx @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +import './doc_viewer.scss'; import React from 'react'; import { EuiTabbedContent } from '@elastic/eui'; import { getDocViewsRegistry } from '../../../kibana_services'; diff --git a/src/plugins/discover/public/application/components/fetch_error/_index.scss b/src/plugins/discover/public/application/components/fetch_error/_index.scss deleted file mode 100644 index 596f7b66866e3..0000000000000 --- a/src/plugins/discover/public/application/components/fetch_error/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import 'fetch_error'; diff --git a/src/plugins/discover/public/application/components/fetch_error/_fetch_error.scss b/src/plugins/discover/public/application/components/fetch_error/fetch_error.scss similarity index 100% rename from src/plugins/discover/public/application/components/fetch_error/_fetch_error.scss rename to src/plugins/discover/public/application/components/fetch_error/fetch_error.scss diff --git a/src/plugins/discover/public/application/components/fetch_error/fetch_error.tsx b/src/plugins/discover/public/application/components/fetch_error/fetch_error.tsx index e16089500d3e5..0bae2456f743c 100644 --- a/src/plugins/discover/public/application/components/fetch_error/fetch_error.tsx +++ b/src/plugins/discover/public/application/components/fetch_error/fetch_error.tsx @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +import './fetch_error.scss'; import React, { Fragment } from 'react'; import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; import { EuiFlexGroup, EuiFlexItem, EuiCallOut, EuiCodeBlock, EuiSpacer } from '@elastic/eui'; diff --git a/src/plugins/discover/public/application/components/sidebar/_index.scss b/src/plugins/discover/public/application/components/sidebar/_index.scss deleted file mode 100644 index 17b0a6c9cfe4e..0000000000000 --- a/src/plugins/discover/public/application/components/sidebar/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './_sidebar'; diff --git a/src/plugins/discover/public/application/components/sidebar/_sidebar.scss b/src/plugins/discover/public/application/components/sidebar/discover_sidebar.scss similarity index 100% rename from src/plugins/discover/public/application/components/sidebar/_sidebar.scss rename to src/plugins/discover/public/application/components/sidebar/discover_sidebar.scss diff --git a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx b/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx index 74d1347b1694c..56597dd31e572 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx +++ b/src/plugins/discover/public/application/components/sidebar/discover_sidebar.tsx @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +import './discover_sidebar.scss'; import React, { useCallback, useEffect, useState, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiButtonIcon, EuiTitle } from '@elastic/eui'; diff --git a/src/plugins/discover/public/application/components/top_nav/__snapshots__/open_search_panel.test.js.snap b/src/plugins/discover/public/application/components/top_nav/__snapshots__/open_search_panel.test.js.snap index be4cd712f7e31..3204252c808ac 100644 --- a/src/plugins/discover/public/application/components/top_nav/__snapshots__/open_search_panel.test.js.snap +++ b/src/plugins/discover/public/application/components/top_nav/__snapshots__/open_search_panel.test.js.snap @@ -2,13 +2,9 @@ exports[`render 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" data-test-subj="loadSearchForm" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} ownFocus={true} - size="m" > <EuiFlyoutHeader hasBorder={true} diff --git a/src/plugins/discover/public/application/embeddable/_index.scss b/src/plugins/discover/public/application/embeddable/_index.scss deleted file mode 100644 index 6d64040e9e7a3..0000000000000 --- a/src/plugins/discover/public/application/embeddable/_index.scss +++ /dev/null @@ -1,2 +0,0 @@ - -@import 'embeddables'; diff --git a/src/plugins/discover/public/application/embeddable/_embeddables.scss b/src/plugins/discover/public/application/embeddable/search_embeddable.scss similarity index 100% rename from src/plugins/discover/public/application/embeddable/_embeddables.scss rename to src/plugins/discover/public/application/embeddable/search_embeddable.scss diff --git a/src/plugins/discover/public/application/embeddable/search_embeddable.ts b/src/plugins/discover/public/application/embeddable/search_embeddable.ts index b650672ccaea7..2f8ac40bdf52c 100644 --- a/src/plugins/discover/public/application/embeddable/search_embeddable.ts +++ b/src/plugins/discover/public/application/embeddable/search_embeddable.ts @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +import './search_embeddable.scss'; import angular from 'angular'; import _ from 'lodash'; import * as Rx from 'rxjs'; diff --git a/src/plugins/discover/public/application/index.scss b/src/plugins/discover/public/application/index.scss index 0de036b1e1707..aaec7ab387e96 100644 --- a/src/plugins/discover/public/application/index.scss +++ b/src/plugins/discover/public/application/index.scss @@ -10,6 +10,4 @@ // monChart__legend--small // monChart__legend-isLoading -@import 'components/index'; @import 'angular/index'; -@import 'embeddable/index'; diff --git a/src/plugins/embeddable/public/components/panel_options_menu/index.tsx b/src/plugins/embeddable/public/components/panel_options_menu/index.tsx index 4a95027269587..e0796990e0c4e 100644 --- a/src/plugins/embeddable/public/components/panel_options_menu/index.tsx +++ b/src/plugins/embeddable/public/components/panel_options_menu/index.tsx @@ -61,9 +61,7 @@ export const PanelOptionsMenu: React.FC<PanelOptionsMenuProps> = ({ ); const ariaLabelWithoutTitle = i18n.translate( 'embeddableApi.panel.optionsMenu.panelOptionsButtonAriaLabel', - { - defaultMessage: 'Panel options', - } + { defaultMessage: 'Panel options' } ); const button = ( diff --git a/src/plugins/embeddable/public/index.ts b/src/plugins/embeddable/public/index.ts index e61ad2a6eefed..84c6eea7c4ff1 100644 --- a/src/plugins/embeddable/public/index.ts +++ b/src/plugins/embeddable/public/index.ts @@ -22,6 +22,7 @@ import './index.scss'; import { PluginInitializerContext } from 'src/core/public'; import { EmbeddablePublicPlugin } from './plugin'; +export { EMBEDDABLE_ORIGINATING_APP_PARAM } from './types'; export { ACTION_ADD_PANEL, ACTION_APPLY_FILTER, diff --git a/src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx b/src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx index fc5438b8c8dcb..196bd593eb8d5 100644 --- a/src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx +++ b/src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx @@ -22,10 +22,12 @@ import { Embeddable, EmbeddableInput } from '../embeddables'; import { ViewMode } from '../types'; import { ContactCardEmbeddable } from '../test_samples'; import { embeddablePluginMock } from '../../mocks'; +import { applicationServiceMock } from '../../../../../core/public/mocks'; const { doStart } = embeddablePluginMock.createInstance(); const start = doStart(); const getFactory = start.getEmbeddableFactory; +const applicationMock = applicationServiceMock.createStartContract(); class EditableEmbeddable extends Embeddable { public readonly type = 'EDITABLE_EMBEDDABLE'; @@ -41,7 +43,7 @@ class EditableEmbeddable extends Embeddable { } test('is compatible when edit url is available, in edit mode and editable', async () => { - const action = new EditPanelAction(getFactory, {} as any); + const action = new EditPanelAction(getFactory, applicationMock); expect( await action.isCompatible({ embeddable: new EditableEmbeddable({ id: '123', viewMode: ViewMode.EDIT }, true), @@ -50,7 +52,7 @@ test('is compatible when edit url is available, in edit mode and editable', asyn }); test('getHref returns the edit urls', async () => { - const action = new EditPanelAction(getFactory, {} as any); + const action = new EditPanelAction(getFactory, applicationMock); expect(action.getHref).toBeDefined(); if (action.getHref) { @@ -64,7 +66,7 @@ test('getHref returns the edit urls', async () => { }); test('is not compatible when edit url is not available', async () => { - const action = new EditPanelAction(getFactory, {} as any); + const action = new EditPanelAction(getFactory, applicationMock); const embeddable = new ContactCardEmbeddable( { id: '123', @@ -83,7 +85,7 @@ test('is not compatible when edit url is not available', async () => { }); test('is not visible when edit url is available but in view mode', async () => { - const action = new EditPanelAction(getFactory, {} as any); + const action = new EditPanelAction(getFactory, applicationMock); expect( await action.isCompatible({ embeddable: new EditableEmbeddable( @@ -98,7 +100,7 @@ test('is not visible when edit url is available but in view mode', async () => { }); test('is not compatible when edit url is available, in edit mode, but not editable', async () => { - const action = new EditPanelAction(getFactory, {} as any); + const action = new EditPanelAction(getFactory, applicationMock); expect( await action.isCompatible({ embeddable: new EditableEmbeddable( diff --git a/src/plugins/embeddable/public/lib/actions/edit_panel_action.ts b/src/plugins/embeddable/public/lib/actions/edit_panel_action.ts index d57867900c24b..d1edddb2aa86b 100644 --- a/src/plugins/embeddable/public/lib/actions/edit_panel_action.ts +++ b/src/plugins/embeddable/public/lib/actions/edit_panel_action.ts @@ -20,10 +20,11 @@ import { i18n } from '@kbn/i18n'; import { ApplicationStart } from 'kibana/public'; import { Action } from 'src/plugins/ui_actions/public'; +import { take } from 'rxjs/operators'; import { ViewMode } from '../types'; import { EmbeddableFactoryNotFoundError } from '../errors'; -import { IEmbeddable } from '../embeddables'; import { EmbeddableStart } from '../../plugin'; +import { EMBEDDABLE_ORIGINATING_APP_PARAM, IEmbeddable } from '../..'; export const ACTION_EDIT_PANEL = 'editPanel'; @@ -35,11 +36,18 @@ export class EditPanelAction implements Action<ActionContext> { public readonly type = ACTION_EDIT_PANEL; public readonly id = ACTION_EDIT_PANEL; public order = 50; + public currentAppId: string | undefined; constructor( private readonly getEmbeddableFactory: EmbeddableStart['getEmbeddableFactory'], private readonly application: ApplicationStart - ) {} + ) { + if (this.application?.currentAppId$) { + this.application.currentAppId$ + .pipe(take(1)) + .subscribe((appId: string | undefined) => (this.currentAppId = appId)); + } + } public getDisplayName({ embeddable }: ActionContext) { const factory = this.getEmbeddableFactory(embeddable.type); @@ -93,7 +101,15 @@ export class EditPanelAction implements Action<ActionContext> { } public async getHref({ embeddable }: ActionContext): Promise<string> { - const editUrl = embeddable ? embeddable.getOutput().editUrl : undefined; + let editUrl = embeddable ? embeddable.getOutput().editUrl : undefined; + if (editUrl && this.currentAppId) { + editUrl += `?${EMBEDDABLE_ORIGINATING_APP_PARAM}=${this.currentAppId}`; + + // TODO: Remove this after https://github.com/elastic/kibana/pull/63443 + if (this.currentAppId === 'kibana') { + editUrl += `:${window.location.hash.split(/[\/\?]/)[1]}`; + } + } return editUrl ? editUrl : ''; } } diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx index 9dd4c74c624d9..384297d8dee7d 100644 --- a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx @@ -44,6 +44,7 @@ import { import { inspectorPluginMock } from '../../../../inspector/public/mocks'; import { EuiBadge } from '@elastic/eui'; import { embeddablePluginMock } from '../../mocks'; +import { applicationServiceMock } from '../../../../../core/public/mocks'; const actionRegistry = new Map<string, Action>(); const triggerRegistry = new Map<string, Trigger>(); @@ -55,6 +56,7 @@ const trigger: Trigger = { id: CONTEXT_MENU_TRIGGER, }; const embeddableFactory = new ContactCardEmbeddableFactory((() => null) as any, {} as any); +const applicationMock = applicationServiceMock.createStartContract(); actionRegistry.set(editModeAction.id, editModeAction); triggerRegistry.set(trigger.id, trigger); @@ -159,7 +161,7 @@ test('HelloWorldContainer in view mode hides edit mode actions', async () => { getAllEmbeddableFactories={start.getEmbeddableFactories} getEmbeddableFactory={start.getEmbeddableFactory} notifications={{} as any} - application={{} as any} + application={applicationMock} overlays={{} as any} inspector={inspector} SavedObjectFinder={() => null} @@ -199,7 +201,7 @@ const renderInEditModeAndOpenContextMenu = async ( getEmbeddableFactory={start.getEmbeddableFactory} notifications={{} as any} overlays={{} as any} - application={{} as any} + application={applicationMock} inspector={inspector} SavedObjectFinder={() => null} /> @@ -306,7 +308,7 @@ test('HelloWorldContainer in edit mode shows edit mode actions', async () => { getEmbeddableFactory={start.getEmbeddableFactory} notifications={{} as any} overlays={{} as any} - application={{} as any} + application={applicationMock} inspector={inspector} SavedObjectFinder={() => null} /> @@ -369,7 +371,7 @@ test('Updates when hidePanelTitles is toggled', async () => { getEmbeddableFactory={start.getEmbeddableFactory} notifications={{} as any} overlays={{} as any} - application={{} as any} + application={applicationMock} inspector={inspector} SavedObjectFinder={() => null} /> @@ -422,7 +424,7 @@ test('Check when hide header option is false', async () => { getEmbeddableFactory={start.getEmbeddableFactory} notifications={{} as any} overlays={{} as any} - application={{} as any} + application={applicationMock} inspector={inspector} SavedObjectFinder={() => null} hideHeader={false} diff --git a/src/plugins/embeddable/public/types.ts b/src/plugins/embeddable/public/types.ts index 2d112b2359818..a57af862f2a34 100644 --- a/src/plugins/embeddable/public/types.ts +++ b/src/plugins/embeddable/public/types.ts @@ -26,6 +26,8 @@ import { EmbeddableFactoryDefinition, } from './lib/embeddables'; +export const EMBEDDABLE_ORIGINATING_APP_PARAM = 'embeddableOriginatingApp'; + export type EmbeddableFactoryRegistry = Map<string, EmbeddableFactory>; export type EmbeddableFactoryProvider = < diff --git a/src/plugins/home/public/application/components/__snapshots__/welcome.test.tsx.snap b/src/plugins/home/public/application/components/__snapshots__/welcome.test.tsx.snap index 7176eef9bf413..64e2e7e4844cf 100644 --- a/src/plugins/home/public/application/components/__snapshots__/welcome.test.tsx.snap +++ b/src/plugins/home/public/application/components/__snapshots__/welcome.test.tsx.snap @@ -28,25 +28,12 @@ exports[`should render a Welcome screen with no telemetry disclaimer 1`] = ` > <h1> <FormattedMessage - defaultMessage="Welcome to Elastic Kibana" + defaultMessage="Welcome to Elastic" id="home.welcomeTitle" values={Object {}} /> </h1> </EuiTitle> - <EuiText - className="homWelcome__subtitle" - color="subdued" - size="s" - > - <p> - <FormattedMessage - defaultMessage="Your window into the Elastic Stack" - id="home.welcomeDescription" - values={Object {}} - /> - </p> - </EuiText> <EuiSpacer size="m" /> @@ -102,25 +89,12 @@ exports[`should render a Welcome screen with the telemetry disclaimer 1`] = ` > <h1> <FormattedMessage - defaultMessage="Welcome to Elastic Kibana" + defaultMessage="Welcome to Elastic" id="home.welcomeTitle" values={Object {}} /> </h1> </EuiTitle> - <EuiText - className="homWelcome__subtitle" - color="subdued" - size="s" - > - <p> - <FormattedMessage - defaultMessage="Your window into the Elastic Stack" - id="home.welcomeDescription" - values={Object {}} - /> - </p> - </EuiText> <EuiSpacer size="m" /> @@ -214,25 +188,12 @@ exports[`should render a Welcome screen with the telemetry disclaimer when optIn > <h1> <FormattedMessage - defaultMessage="Welcome to Elastic Kibana" + defaultMessage="Welcome to Elastic" id="home.welcomeTitle" values={Object {}} /> </h1> </EuiTitle> - <EuiText - className="homWelcome__subtitle" - color="subdued" - size="s" - > - <p> - <FormattedMessage - defaultMessage="Your window into the Elastic Stack" - id="home.welcomeDescription" - values={Object {}} - /> - </p> - </EuiText> <EuiSpacer size="m" /> @@ -326,25 +287,12 @@ exports[`should render a Welcome screen with the telemetry disclaimer when optIn > <h1> <FormattedMessage - defaultMessage="Welcome to Elastic Kibana" + defaultMessage="Welcome to Elastic" id="home.welcomeTitle" values={Object {}} /> </h1> </EuiTitle> - <EuiText - className="homWelcome__subtitle" - color="subdued" - size="s" - > - <p> - <FormattedMessage - defaultMessage="Your window into the Elastic Stack" - id="home.welcomeDescription" - values={Object {}} - /> - </p> - </EuiText> <EuiSpacer size="m" /> diff --git a/src/plugins/home/public/application/components/welcome.tsx b/src/plugins/home/public/application/components/welcome.tsx index 8461b10aaa520..9ad5862896e8a 100644 --- a/src/plugins/home/public/application/components/welcome.tsx +++ b/src/plugins/home/public/application/components/welcome.tsx @@ -31,7 +31,6 @@ import { EuiSpacer, EuiFlexGroup, EuiFlexItem, - EuiText, EuiIcon, EuiPortal, } from '@elastic/eui'; @@ -141,20 +140,9 @@ export class Welcome extends React.Component<Props> { </span> <EuiTitle size="l" className="homWelcome__title"> <h1> - <FormattedMessage - id="home.welcomeTitle" - defaultMessage="Welcome to Elastic Kibana" - /> + <FormattedMessage id="home.welcomeTitle" defaultMessage="Welcome to Elastic" /> </h1> </EuiTitle> - <EuiText size="s" color="subdued" className="homWelcome__subtitle"> - <p> - <FormattedMessage - id="home.welcomeDescription" - defaultMessage="Your window into the Elastic Stack" - /> - </p> - </EuiText> <EuiSpacer size="m" /> </div> </header> diff --git a/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap b/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap index 43e2af6d099e8..eab52795fefaa 100644 --- a/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap +++ b/src/plugins/input_control_vis/public/components/vis/__snapshots__/list_control.test.tsx.snap @@ -8,6 +8,7 @@ exports[`disableMsg 1`] = ` label="list control" > <EuiFieldText + aria-label="Select..." disabled={true} placeholder="Select..." /> diff --git a/src/plugins/input_control_vis/public/components/vis/list_control.tsx b/src/plugins/input_control_vis/public/components/vis/list_control.tsx index 6ded66917a3fd..cf95eed470beb 100644 --- a/src/plugins/input_control_vis/public/components/vis/list_control.tsx +++ b/src/plugins/input_control_vis/public/components/vis/list_control.tsx @@ -114,6 +114,10 @@ class ListControlUi extends PureComponent<ListControlUiProps, ListControlUiState if (this.props.disableMsg) { return ( <EuiFieldText + aria-label={intl.formatMessage({ + id: 'inputControl.vis.listControl.selectTextPlaceholder', + defaultMessage: 'Select...', + })} placeholder={intl.formatMessage({ id: 'inputControl.vis.listControl.selectTextPlaceholder', defaultMessage: 'Select...', diff --git a/src/plugins/kibana_legacy/public/angular/angular_config.tsx b/src/plugins/kibana_legacy/public/angular/angular_config.tsx index 295cf27688c80..a52546d68c4d8 100644 --- a/src/plugins/kibana_legacy/public/angular/angular_config.tsx +++ b/src/plugins/kibana_legacy/public/angular/angular_config.tsx @@ -36,7 +36,7 @@ import { ChromeBreadcrumb, EnvironmentMode, PackageInfo } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { CoreStart, LegacyCoreStart } from 'kibana/public'; -import { modifyUrl } from '../../../../core/utils'; +import { modifyUrl } from '../../../../core/public'; import { toMountPoint } from '../../../kibana_react/public'; import { isSystemApiRequest, UrlOverflowService } from '../utils'; import { formatAngularHttpError, isAngularHttpError } from '../notify/lib'; diff --git a/src/plugins/kibana_legacy/public/notify/app_redirect/app_redirect.ts b/src/plugins/kibana_legacy/public/notify/app_redirect/app_redirect.ts index e79ab4b2fbc6d..01321c60f5c87 100644 --- a/src/plugins/kibana_legacy/public/notify/app_redirect/app_redirect.ts +++ b/src/plugins/kibana_legacy/public/notify/app_redirect/app_redirect.ts @@ -18,7 +18,7 @@ */ import { ILocationService } from 'angular'; -import { modifyUrl } from '../../../../../core/utils'; +import { modifyUrl } from '../../../../../core/public'; import { ToastsStart } from '../../../../../core/public'; const APP_REDIRECT_MESSAGE_PARAM = 'app_redirect_message'; diff --git a/src/plugins/kibana_react/public/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap b/src/plugins/kibana_react/public/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap index ee97a5acfd3d2..d11a346b874c0 100644 --- a/src/plugins/kibana_react/public/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap +++ b/src/plugins/kibana_react/public/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap @@ -55,22 +55,12 @@ exports[`is rendered 1`] = ` data-test-subj="exitFullScreenModeText" > <div> - <EuiTitle - className="dshExitFullScreenButton__title" - size="xxxs" - > - <p - className="euiTitle euiTitle--xxxsmall dshExitFullScreenButton__title" - > - Elastic Kibana - </p> - </EuiTitle> <EuiText className="dshExitFullScreenButton__text" - size="xs" + size="s" > <div - className="euiText euiText--extraSmall dshExitFullScreenButton__text" + className="euiText euiText--small dshExitFullScreenButton__text" > <p> Exit full screen diff --git a/src/plugins/kibana_react/public/exit_full_screen_button/_exit_full_screen_button.scss b/src/plugins/kibana_react/public/exit_full_screen_button/_exit_full_screen_button.scss index a2e951cb5b775..7548bd0c0db5f 100644 --- a/src/plugins/kibana_react/public/exit_full_screen_button/_exit_full_screen_button.scss +++ b/src/plugins/kibana_react/public/exit_full_screen_button/_exit_full_screen_button.scss @@ -10,12 +10,11 @@ bottom: $euiSizeS; position: fixed; display: block; - padding: 0; + padding: $euiSizeXS $euiSizeS; border: none; background: none; z-index: 5; background: $euiColorFullShade; - padding: $euiSizeXS; border-radius: $euiBorderRadius; text-align: left; @@ -28,11 +27,6 @@ } } -.dshExitFullScreenButton__title { - line-height: 1.2; - color: $euiColorEmptyShade; -} - .dshExitFullScreenButton__text { line-height: 1.2; color: makeHighContrastColor($euiColorMediumShade, $euiColorFullShade); diff --git a/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx b/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx index 97fc02ac64e12..8e3113aa9ccfd 100644 --- a/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx +++ b/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx @@ -20,7 +20,7 @@ import { i18n } from '@kbn/i18n'; import React, { PureComponent } from 'react'; import { EuiScreenReaderOnly, keyCodes } from '@elastic/eui'; -import { EuiIcon, EuiTitle, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { EuiIcon, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; export interface ExitFullScreenButtonProps { onExitFullScreenMode: () => void; @@ -69,17 +69,7 @@ class ExitFullScreenButtonUi extends PureComponent<ExitFullScreenButtonProps> { </EuiFlexItem> <EuiFlexItem grow={false} data-test-subj="exitFullScreenModeText"> <div> - <EuiTitle size="xxxs" className="dshExitFullScreenButton__title"> - <p> - {i18n.translate( - 'kibana-react.exitFullScreenButton.exitFullScreenModeButtonTitle', - { - defaultMessage: 'Elastic Kibana', - } - )} - </p> - </EuiTitle> - <EuiText size="xs" className="dshExitFullScreenButton__text"> + <EuiText size="s" className="dshExitFullScreenButton__text"> <p> {i18n.translate( 'kibana-react.exitFullScreenButton.exitFullScreenModeButtonText', diff --git a/src/plugins/kibana_react/public/validated_range/validated_dual_range.tsx b/src/plugins/kibana_react/public/validated_range/validated_dual_range.tsx index ce583236e7c81..8187e70b1bbd1 100644 --- a/src/plugins/kibana_react/public/validated_range/validated_dual_range.tsx +++ b/src/plugins/kibana_react/public/validated_range/validated_dual_range.tsx @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ - -import React, { Component } from 'react'; +import { i18n } from '@kbn/i18n'; +import React, { Component, createRef } from 'react'; import { EuiFormRow, EuiDualRange } from '@elastic/eui'; import { EuiFormRowDisplayKeys } from '@elastic/eui/src/components/form/form_row/form_row'; import { EuiDualRangeProps } from '@elastic/eui/src/components/form/range/dual_range'; @@ -35,8 +35,8 @@ interface Props extends Omit<EuiDualRangeProps, 'value' | 'onChange' | 'min' | ' label?: string; formRowDisplay?: EuiFormRowDisplayKeys; onChange?: (val: [string, string]) => void; - min?: ValueMember; - max?: ValueMember; + min?: number; + max?: number; } interface State { @@ -72,6 +72,18 @@ export class ValidatedDualRange extends Component<Props> { return null; } + // Can remove after eui#3412 is resolved + componentDidMount() { + if (this.trackRef.current) { + const track = this.trackRef.current.querySelector('.euiRangeTrack'); + if (track) { + track.setAttribute('aria-hidden', 'true'); + } + } + } + + trackRef = createRef<HTMLDivElement>(); + // @ts-ignore state populated by getDerivedStateFromProps state: State = {}; @@ -103,29 +115,38 @@ export class ValidatedDualRange extends Component<Props> { value, // eslint-disable-line no-unused-vars onChange, // eslint-disable-line no-unused-vars allowEmptyRange, // eslint-disable-line no-unused-vars - // @ts-ignore ...rest // TODO: Consider alternatives for spread operator in component } = this.props; return ( - <EuiFormRow - compressed={compressed} - fullWidth={fullWidth} - isInvalid={!this.state.isValid} - error={this.state.errorMessage ? [this.state.errorMessage] : []} - label={label} - display={formRowDisplay} - > - <EuiDualRange + <div ref={this.trackRef}> + <EuiFormRow compressed={compressed} fullWidth={fullWidth} - value={this.state.value} - onChange={this._onChange} - // @ts-ignore - focusable={false} // remove when #59039 is fixed - {...rest} - /> - </EuiFormRow> + isInvalid={!this.state.isValid} + error={this.state.errorMessage ? [this.state.errorMessage] : []} + label={label} + display={formRowDisplay} + > + <EuiDualRange + compressed={compressed} + fullWidth={fullWidth} + value={this.state.value} + onChange={this._onChange} + minInputProps={{ + 'aria-label': i18n.translate('kibana-react.dualRangeControl.minInputAriaLabel', { + defaultMessage: 'Range minimum', + }), + }} + maxInputProps={{ + 'aria-label': i18n.translate('kibana-react.dualRangeControl.maxInputAriaLabel', { + defaultMessage: 'Range maximum', + }), + }} + {...rest} + /> + </EuiFormRow> + </div> ); } } diff --git a/src/plugins/management/public/legacy/sections_register.js b/src/plugins/management/public/legacy/sections_register.js index 63d919377f89e..aae58ba3e4651 100644 --- a/src/plugins/management/public/legacy/sections_register.js +++ b/src/plugins/management/public/legacy/sections_register.js @@ -27,7 +27,7 @@ export class LegacyManagementAdapter { 'management', { display: i18n.translate('management.displayName', { - defaultMessage: 'Management', + defaultMessage: 'Stack Management', }), }, capabilities diff --git a/src/plugins/management/public/management_app.tsx b/src/plugins/management/public/management_app.tsx index 38db1039042e5..843bbfde654ee 100644 --- a/src/plugins/management/public/management_app.tsx +++ b/src/plugins/management/public/management_app.tsx @@ -64,7 +64,7 @@ export class ManagementApp { coreStart.chrome.setBreadcrumbs([ { text: i18n.translate('management.breadcrumb', { - defaultMessage: 'Management', + defaultMessage: 'Stack Management', }), href: '#/management', }, diff --git a/src/plugins/management/public/plugin.ts b/src/plugins/management/public/plugin.ts index 1c9e1d5c89550..df2398412dac2 100644 --- a/src/plugins/management/public/plugin.ts +++ b/src/plugins/management/public/plugin.ts @@ -36,8 +36,8 @@ export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart ) { home.featureCatalogue.register({ id: 'stack-management', - title: i18n.translate('management.displayName', { - defaultMessage: 'Management', + title: i18n.translate('management.stackManagement.managementLabel', { + defaultMessage: 'Stack Management', }), description: i18n.translate('management.stackManagement.managementDescription', { defaultMessage: 'Your center console for managing the Elastic Stack.', diff --git a/src/plugins/newsfeed/public/components/__snapshots__/loading_news.test.tsx.snap b/src/plugins/newsfeed/public/components/__snapshots__/loading_news.test.tsx.snap index 2e88b0053535e..dfd1cf4dbcf5e 100644 --- a/src/plugins/newsfeed/public/components/__snapshots__/loading_news.test.tsx.snap +++ b/src/plugins/newsfeed/public/components/__snapshots__/loading_news.test.tsx.snap @@ -12,7 +12,7 @@ exports[`news_loading rendering renders the default News Loading 1`] = ` </p> } title={ - <EuiLoadingKibana + <EuiLoadingElastic size="xl" /> } diff --git a/src/plugins/newsfeed/public/components/loading_news.tsx b/src/plugins/newsfeed/public/components/loading_news.tsx index fcbc7970377d4..d95577878cd7a 100644 --- a/src/plugins/newsfeed/public/components/loading_news.tsx +++ b/src/plugins/newsfeed/public/components/loading_news.tsx @@ -20,12 +20,12 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiEmptyPrompt } from '@elastic/eui'; -import { EuiLoadingKibana } from '@elastic/eui'; +import { EuiLoadingElastic } from '@elastic/eui'; export const NewsLoadingPrompt = () => { return ( <EuiEmptyPrompt - title={<EuiLoadingKibana size="xl" />} + title={<EuiLoadingElastic size="xl" />} body={ <p> <FormattedMessage diff --git a/src/plugins/saved_objects/public/index.ts b/src/plugins/saved_objects/public/index.ts index 9e0a7c40c043f..e38a0ef9830ea 100644 --- a/src/plugins/saved_objects/public/index.ts +++ b/src/plugins/saved_objects/public/index.ts @@ -19,7 +19,14 @@ import { SavedObjectsPublicPlugin } from './plugin'; -export { OnSaveProps, SavedObjectSaveModal, SaveResult, showSaveModal } from './save_modal'; +export { + OnSaveProps, + SavedObjectSaveModal, + SavedObjectSaveModalOrigin, + SaveModalState, + SaveResult, + showSaveModal, +} from './save_modal'; export { getSavedObjectFinder, SavedObjectFinderUi, SavedObjectMetaData } from './finder'; export { SavedObjectLoader, diff --git a/src/plugins/saved_objects/public/save_modal/index.ts b/src/plugins/saved_objects/public/save_modal/index.ts index f26aa732f30a1..7c32337bb314a 100644 --- a/src/plugins/saved_objects/public/save_modal/index.ts +++ b/src/plugins/saved_objects/public/save_modal/index.ts @@ -17,5 +17,6 @@ * under the License. */ -export { SavedObjectSaveModal, OnSaveProps } from './saved_object_save_modal'; +export { SavedObjectSaveModal, OnSaveProps, SaveModalState } from './saved_object_save_modal'; +export { SavedObjectSaveModalOrigin } from './saved_object_save_modal_origin'; export { showSaveModal, SaveResult } from './show_saved_object_save_modal'; diff --git a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx index 95eb56c0e874b..962f993633e6f 100644 --- a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx +++ b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx @@ -53,14 +53,15 @@ interface Props { onClose: () => void; title: string; showCopyOnSave: boolean; + initialCopyOnSave?: boolean; objectType: string; confirmButtonLabel?: React.ReactNode; - options?: React.ReactNode; + options?: React.ReactNode | ((state: SaveModalState) => React.ReactNode); description?: string; showDescription: boolean; } -interface State { +export interface SaveModalState { title: string; copyOnSave: boolean; isTitleDuplicateConfirmed: boolean; @@ -71,11 +72,11 @@ interface State { const generateId = htmlIdGenerator(); -export class SavedObjectSaveModal extends React.Component<Props, State> { +export class SavedObjectSaveModal extends React.Component<Props, SaveModalState> { private warning = React.createRef<HTMLDivElement>(); public readonly state = { title: this.props.title, - copyOnSave: false, + copyOnSave: Boolean(this.props.initialCopyOnSave), isTitleDuplicateConfirmed: false, hasTitleDuplicate: false, isLoading: false, @@ -139,7 +140,9 @@ export class SavedObjectSaveModal extends React.Component<Props, State> { {this.renderViewDescription()} - {this.props.options} + {typeof this.props.options === 'function' + ? this.props.options(this.state) + : this.props.options} </EuiForm> </EuiModalBody> diff --git a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal_origin.tsx b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal_origin.tsx new file mode 100644 index 0000000000000..34f4bc593fdc4 --- /dev/null +++ b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal_origin.tsx @@ -0,0 +1,117 @@ +/* + * 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 React, { Fragment, useState } from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiFormRow, EuiSwitch } from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; +import { OnSaveProps, SaveModalState, SavedObjectSaveModal } from '.'; + +interface SaveModalDocumentInfo { + id?: string; + title: string; + description?: string; +} + +interface OriginSaveModalProps { + originatingApp?: string; + documentInfo: SaveModalDocumentInfo; + objectType: string; + onClose: () => void; + onSave: (props: OnSaveProps & { returnToOrigin: boolean }) => void; +} + +export function SavedObjectSaveModalOrigin(props: OriginSaveModalProps) { + const [returnToOriginMode, setReturnToOriginMode] = useState(Boolean(props.originatingApp)); + const { documentInfo } = props; + + const returnLabel = i18n.translate('savedObjects.saveModalOrigin.returnToOriginLabel', { + defaultMessage: 'Return', + }); + const addLabel = i18n.translate('savedObjects.saveModalOrigin.addToOriginLabel', { + defaultMessage: 'Add', + }); + + const getReturnToOriginSwitch = (state: SaveModalState) => { + if (!props.originatingApp) { + return; + } + let origin = props.originatingApp!; + + // TODO: Remove this after https://github.com/elastic/kibana/pull/63443 + if (origin.startsWith('kibana:')) { + origin = origin.split(':')[1]; + } + + if ( + !state.copyOnSave || + origin === 'dashboard' // dashboard supports adding a copied panel on save... + ) { + const originVerb = !documentInfo.id || state.copyOnSave ? addLabel : returnLabel; + return ( + <Fragment> + <EuiFormRow> + <EuiSwitch + data-test-subj="returnToOriginModeSwitch" + checked={returnToOriginMode} + onChange={event => { + setReturnToOriginMode(event.target.checked); + }} + label={ + <FormattedMessage + id="savedObjects.saveModalOrigin.originAfterSavingSwitchLabel" + defaultMessage="{originVerb} to {origin} after saving" + values={{ originVerb, origin }} + /> + } + /> + </EuiFormRow> + </Fragment> + ); + } else { + setReturnToOriginMode(false); + } + }; + + const onModalSave = (onSaveProps: OnSaveProps) => { + props.onSave({ ...onSaveProps, returnToOrigin: returnToOriginMode }); + }; + + const confirmButtonLabel = returnToOriginMode + ? i18n.translate('savedObjects.saveModalOrigin.saveAndReturnLabel', { + defaultMessage: 'Save and return', + }) + : null; + + return ( + <SavedObjectSaveModal + onSave={onModalSave} + onClose={props.onClose} + title={documentInfo.title} + showCopyOnSave={documentInfo.id ? true : false} + initialCopyOnSave={Boolean(documentInfo.id) && returnToOriginMode} + confirmButtonLabel={confirmButtonLabel} + objectType={props.objectType} + options={getReturnToOriginSwitch} + description={documentInfo.description} + showDescription={true} + /> + ); +} diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap index 4721d166c65e5..b7bd9368e8b1c 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/flyout.test.tsx.snap @@ -2,11 +2,7 @@ exports[`Flyout conflicts should allow conflict resolution 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} size="s" > <EuiFlyoutHeader @@ -321,11 +317,7 @@ exports[`Flyout errors should display unsupported type errors properly 1`] = ` exports[`Flyout legacy conflicts should allow conflict resolution 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} size="s" > <EuiFlyoutHeader @@ -586,11 +578,7 @@ Array [ exports[`Flyout should render import step 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} size="s" > <EuiFlyoutHeader diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap index a8bb691cd54e9..a4fc36db39cb8 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap @@ -2,12 +2,7 @@ exports[`Relationships should render dashboards normally 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -166,12 +161,7 @@ exports[`Relationships should render dashboards normally 1`] = ` exports[`Relationships should render errors 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -215,12 +205,7 @@ exports[`Relationships should render errors 1`] = ` exports[`Relationships should render index patterns normally 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -384,12 +369,7 @@ exports[`Relationships should render index patterns normally 1`] = ` exports[`Relationships should render searches normally 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -553,12 +533,7 @@ exports[`Relationships should render searches normally 1`] = ` exports[`Relationships should render visualizations normally 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} diff --git a/src/plugins/share/server/routes/goto.ts b/src/plugins/share/server/routes/goto.ts index 747af3b9e57df..0dbddd6552c36 100644 --- a/src/plugins/share/server/routes/goto.ts +++ b/src/plugins/share/server/routes/goto.ts @@ -23,7 +23,7 @@ import { schema } from '@kbn/config-schema'; import { shortUrlAssertValid } from './lib/short_url_assert_valid'; import { ShortUrlLookupService } from './lib/short_url_lookup'; import { getGotoPath } from '../../common/short_url_routes'; -import { modifyUrl } from '../../../../core/utils'; +import { modifyUrl } from '../../../../core/server'; export const createGotoRoute = ({ router, diff --git a/src/plugins/telemetry_management_section/public/components/__snapshots__/opt_in_example_flyout.test.tsx.snap b/src/plugins/telemetry_management_section/public/components/__snapshots__/opt_in_example_flyout.test.tsx.snap index 2601f691cd184..7c60ec85ab0da 100644 --- a/src/plugins/telemetry_management_section/public/components/__snapshots__/opt_in_example_flyout.test.tsx.snap +++ b/src/plugins/telemetry_management_section/public/components/__snapshots__/opt_in_example_flyout.test.tsx.snap @@ -3,12 +3,9 @@ exports[`OptInDetailsComponent renders as expected 1`] = ` <EuiPortal> <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} maxWidth={true} onClose={[MockFunction]} ownFocus={true} - size="m" > <EuiFlyoutHeader> <EuiTitle> diff --git a/src/plugins/ui_actions/public/actions/action_internal.ts b/src/plugins/ui_actions/public/actions/action_internal.ts index 4cbc4dd2a053c..e3504c7c5d301 100644 --- a/src/plugins/ui_actions/public/actions/action_internal.ts +++ b/src/plugins/ui_actions/public/actions/action_internal.ts @@ -17,6 +17,8 @@ * under the License. */ +// @ts-ignore +import React from 'react'; import { Action, ActionContext as Context, ActionDefinition } from './action'; import { Presentable } from '../util/presentable'; import { uiToReactComponent } from '../../../kibana_react/public'; diff --git a/src/plugins/vis_type_table/public/agg_table/agg_table.js b/src/plugins/vis_type_table/public/agg_table/agg_table.js index 0cd501e2d0344..6b5796d6eb5bc 100644 --- a/src/plugins/vis_type_table/public/agg_table/agg_table.js +++ b/src/plugins/vis_type_table/public/agg_table/agg_table.js @@ -258,7 +258,7 @@ function addPercentageCol(columns, title, rows, insertAtIndex) { formatter, }); const newRows = rows.map(row => ({ - [newId]: formatter.convert(row[id] / sumTotal / 100), + [newId]: row[id] / sumTotal, ...row, })); diff --git a/src/plugins/vis_type_timelion/server/plugin.ts b/src/plugins/vis_type_timelion/server/plugin.ts index 40e89008e7562..435ec9027eef2 100644 --- a/src/plugins/vis_type_timelion/server/plugin.ts +++ b/src/plugins/vis_type_timelion/server/plugin.ts @@ -25,7 +25,7 @@ import { PluginInitializerContext, RecursiveReadonly, } from '../../../../src/core/server'; -import { deepFreeze } from '../../../../src/core/utils'; +import { deepFreeze } from '../../../../src/core/server'; import { configSchema } from '../config'; import loadFunctions from './lib/load_functions'; import { functionsRoute } from './routes/functions'; diff --git a/src/plugins/visualizations/public/components/__snapshots__/visualization_noresults.test.js.snap b/src/plugins/visualizations/public/components/__snapshots__/visualization_noresults.test.js.snap index afaea0d9b8462..43fc2671ba42a 100644 --- a/src/plugins/visualizations/public/components/__snapshots__/visualization_noresults.test.js.snap +++ b/src/plugins/visualizations/public/components/__snapshots__/visualization_noresults.test.js.snap @@ -17,7 +17,6 @@ exports[`VisualizationNoResults should render according to snapshot 1`] = ` class="euiTextColor euiTextColor--subdued" > <div - aria-hidden="true" color="subdued" data-euiicon-type="visualizeApp" /> diff --git a/src/plugins/visualizations/public/components/__snapshots__/visualization_requesterror.test.js.snap b/src/plugins/visualizations/public/components/__snapshots__/visualization_requesterror.test.js.snap index f42e596b9d34a..95b0e884e79dc 100644 --- a/src/plugins/visualizations/public/components/__snapshots__/visualization_requesterror.test.js.snap +++ b/src/plugins/visualizations/public/components/__snapshots__/visualization_requesterror.test.js.snap @@ -11,7 +11,6 @@ exports[`VisualizationRequestError should render according to snapshot 1`] = ` class="euiTextColor euiTextColor--subdued" > <div - aria-hidden="true" color="danger" data-euiicon-type="alert" /> diff --git a/src/plugins/visualizations/public/components/visualization_chart.test.js b/src/plugins/visualizations/public/components/visualization_chart.test.js index 6a583ac37f823..04d8bb253621a 100644 --- a/src/plugins/visualizations/public/components/visualization_chart.test.js +++ b/src/plugins/visualizations/public/components/visualization_chart.test.js @@ -55,7 +55,7 @@ describe('<VisualizationChart/>', () => { it('should render initial html', () => { const wrapper = render(<VisualizationChart vis={vis} listenOnChange={true} />); - expect(wrapper.text()).toBe('Test Visualization visualization, not yet accessible'); + expect(wrapper.text()).toBe(''); }); it('should render visualization', async () => { diff --git a/src/plugins/visualizations/public/components/visualization_chart.tsx b/src/plugins/visualizations/public/components/visualization_chart.tsx index 7d163d2067ee5..fba0afa89ca53 100644 --- a/src/plugins/visualizations/public/components/visualization_chart.tsx +++ b/src/plugins/visualizations/public/components/visualization_chart.tsx @@ -77,14 +77,7 @@ class VisualizationChart extends React.Component<VisualizationChartProps> { public render() { return ( <div className="visChart__container kbn-resetFocusState" tabIndex={0} ref={this.containerDiv}> - <p className="euiScreenReaderOnly"> - {this.props.vis.type.title} visualization, not yet accessible - </p> - <div - aria-hidden={!this.props.vis.type.isAccessible} - className="visChart" - ref={this.chartDiv} - /> + <div className="visChart" ref={this.chartDiv} /> </div> ); } diff --git a/src/plugins/visualizations/public/components/visualization_noresults.tsx b/src/plugins/visualizations/public/components/visualization_noresults.tsx index 5a964caa46b4b..1b45463f1d2ef 100644 --- a/src/plugins/visualizations/public/components/visualization_noresults.tsx +++ b/src/plugins/visualizations/public/components/visualization_noresults.tsx @@ -33,7 +33,7 @@ export class VisualizationNoResults extends React.Component<VisualizationNoResul <div className="item top" /> <div className="item"> <EuiText size="xs" color="subdued"> - <EuiIcon type="visualizeApp" size="m" color="subdued" aria-hidden="true" /> + <EuiIcon type="visualizeApp" size="m" color="subdued" /> <EuiSpacer size="s" /> diff --git a/src/plugins/visualizations/public/components/visualization_requesterror.tsx b/src/plugins/visualizations/public/components/visualization_requesterror.tsx index 3e677e609ad9a..d40aa641ef6c7 100644 --- a/src/plugins/visualizations/public/components/visualization_requesterror.tsx +++ b/src/plugins/visualizations/public/components/visualization_requesterror.tsx @@ -36,7 +36,7 @@ export class VisualizationRequestError extends React.Component<VisualizationRequ return ( <div className="visError" ref={this.containerDiv}> <EuiText size="xs" color="subdued"> - <EuiIcon type="alert" size="m" color="danger" aria-hidden="true" /> + <EuiIcon type="alert" size="m" color="danger" /> <EuiSpacer size="s" /> diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts b/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts index 89697ecd7ed71..10704514ab8d5 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable.ts @@ -340,13 +340,14 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut this.abortController.abort(); } this.abortController = new AbortController(); + const abortController = this.abortController; this.expression = await buildPipeline(this.vis, { timefilter: this.timefilter, timeRange: this.timeRange, abortSignal: this.abortController!.signal, }); - if (this.handler) { + if (this.handler && !abortController.signal.aborted) { this.handler.update(this.expression, expressionParams); } } diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx index 6ab1c98645988..c6d43a4ef2f80 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable_factory.tsx @@ -19,12 +19,14 @@ import { i18n } from '@kbn/i18n'; import { SavedObjectMetaData } from 'src/plugins/saved_objects/public'; +import { first } from 'rxjs/operators'; import { SavedObjectAttributes } from '../../../../core/public'; import { EmbeddableFactoryDefinition, EmbeddableOutput, ErrorEmbeddable, IContainer, + EMBEDDABLE_ORIGINATING_APP_PARAM, } from '../../../embeddable/public'; import { DisabledLabEmbeddable } from './disabled_lab_embeddable'; import { VisualizeEmbeddable, VisualizeInput, VisualizeOutput } from './visualize_embeddable'; @@ -59,6 +61,7 @@ export class VisualizeEmbeddableFactory VisualizationAttributes > { public readonly type = VISUALIZE_EMBEDDABLE_TYPE; + public readonly savedObjectMetaData: SavedObjectMetaData<VisualizationAttributes> = { name: i18n.translate('visualizations.savedObjectName', { defaultMessage: 'Visualization' }), includeFields: ['visState'], @@ -98,6 +101,18 @@ export class VisualizeEmbeddableFactory }); } + public async getCurrentAppId() { + let currentAppId = await this.deps + .start() + .core.application.currentAppId$.pipe(first()) + .toPromise(); + // TODO: Remove this after https://github.com/elastic/kibana/pull/63443 + if (currentAppId === 'kibana') { + currentAppId += `:${window.location.hash.split(/[\/\?]/)[1]}`; + } + return currentAppId; + } + public async createFromSavedObject( savedObjectId: string, input: Partial<VisualizeInput> & { id: string }, @@ -118,8 +133,9 @@ export class VisualizeEmbeddableFactory public async create() { // TODO: This is a bit of a hack to preserve the original functionality. Ideally we will clean this up // to allow for in place creation of visualizations without having to navigate away to a new URL. + const originatingAppParam = await this.getCurrentAppId(); showNewVisModal({ - editorParams: ['addToDashboard'], + editorParams: [`${EMBEDDABLE_ORIGINATING_APP_PARAM}=${originatingAppParam}`], }); return undefined; } diff --git a/src/plugins/visualizations/public/mocks.ts b/src/plugins/visualizations/public/mocks.ts index d6eeffdb01459..70c3bc2c1ed05 100644 --- a/src/plugins/visualizations/public/mocks.ts +++ b/src/plugins/visualizations/public/mocks.ts @@ -20,7 +20,7 @@ import { PluginInitializerContext } from '../../../core/public'; import { VisualizationsSetup, VisualizationsStart } from './'; import { VisualizationsPlugin } from './plugin'; -import { coreMock } from '../../../core/public/mocks'; +import { coreMock, applicationServiceMock } from '../../../core/public/mocks'; import { embeddablePluginMock } from '../../../plugins/embeddable/public/mocks'; import { expressionsPluginMock } from '../../../plugins/expressions/public/mocks'; import { dataPluginMock } from '../../../plugins/data/public/mocks'; @@ -65,6 +65,7 @@ const createInstance = async () => { expressions: expressionsPluginMock.createStartContract(), inspector: inspectorPluginMock.createStartContract(), uiActions: uiActionsPluginMock.createStartContract(), + application: applicationServiceMock.createStartContract(), }); return { diff --git a/src/plugins/visualizations/public/plugin.ts b/src/plugins/visualizations/public/plugin.ts index b3e8c9b5b61b3..29d66ea963a66 100644 --- a/src/plugins/visualizations/public/plugin.ts +++ b/src/plugins/visualizations/public/plugin.ts @@ -17,7 +17,13 @@ * under the License. */ -import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '../../../core/public'; +import { + PluginInitializerContext, + CoreSetup, + CoreStart, + Plugin, + ApplicationStart, +} from '../../../core/public'; import { TypesService, TypesSetup, TypesStart } from './vis_types'; import { setUISettings, @@ -95,6 +101,7 @@ export interface VisualizationsStartDeps { expressions: ExpressionsStart; inspector: InspectorStart; uiActions: UiActionsStart; + application: ApplicationStart; } /** @@ -131,7 +138,6 @@ export class VisualizationsPlugin expressions.registerRenderer(visualizationRenderer); expressions.registerFunction(rangeExpressionFunction); expressions.registerFunction(visDimensionExpressionFunction); - const embeddableFactory = new VisualizeEmbeddableFactory({ start }); embeddable.registerEmbeddableFactory(VISUALIZE_EMBEDDABLE_TYPE, embeddableFactory); diff --git a/src/plugins/visualizations/public/wizard/__snapshots__/new_vis_modal.test.tsx.snap b/src/plugins/visualizations/public/wizard/__snapshots__/new_vis_modal.test.tsx.snap index 6aef2c2b2ceb7..670d0ce3c650a 100644 --- a/src/plugins/visualizations/public/wizard/__snapshots__/new_vis_modal.test.tsx.snap +++ b/src/plugins/visualizations/public/wizard/__snapshots__/new_vis_modal.test.tsx.snap @@ -288,7 +288,6 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -319,7 +318,6 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -351,7 +349,6 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -602,7 +599,6 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -633,7 +629,6 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -665,7 +660,6 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -856,7 +850,6 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -887,7 +880,6 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -919,7 +911,6 @@ exports[`NewVisModal filter for visualization types should render as expected 1` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -1304,13 +1295,11 @@ exports[`NewVisModal filter for visualization types should render as expected 1` > <VisTypeIcon> <EuiIcon - aria-hidden="true" color="secondary" size="l" type="empty" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" size="l" @@ -1373,13 +1362,11 @@ exports[`NewVisModal filter for visualization types should render as expected 1` > <VisTypeIcon> <EuiIcon - aria-hidden="true" color="secondary" size="l" type="empty" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" size="l" @@ -1442,13 +1429,11 @@ exports[`NewVisModal filter for visualization types should render as expected 1` > <VisTypeIcon> <EuiIcon - aria-hidden="true" color="secondary" size="l" type="empty" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" size="l" @@ -1811,7 +1796,6 @@ exports[`NewVisModal should render as expected 1`] = ` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -1860,7 +1844,6 @@ exports[`NewVisModal should render as expected 1`] = ` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -1891,7 +1874,6 @@ exports[`NewVisModal should render as expected 1`] = ` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -2108,7 +2090,6 @@ exports[`NewVisModal should render as expected 1`] = ` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -2157,7 +2138,6 @@ exports[`NewVisModal should render as expected 1`] = ` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -2188,7 +2168,6 @@ exports[`NewVisModal should render as expected 1`] = ` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -2345,7 +2324,6 @@ exports[`NewVisModal should render as expected 1`] = ` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -2394,7 +2372,6 @@ exports[`NewVisModal should render as expected 1`] = ` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -2425,7 +2402,6 @@ exports[`NewVisModal should render as expected 1`] = ` class="euiKeyPadMenuItem__icon" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" /> @@ -2712,13 +2688,11 @@ exports[`NewVisModal should render as expected 1`] = ` > <VisTypeIcon> <EuiIcon - aria-hidden="true" color="secondary" size="l" type="empty" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" size="l" @@ -2828,13 +2802,11 @@ exports[`NewVisModal should render as expected 1`] = ` > <VisTypeIcon> <EuiIcon - aria-hidden="true" color="secondary" size="l" type="empty" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" size="l" @@ -2897,13 +2869,11 @@ exports[`NewVisModal should render as expected 1`] = ` > <VisTypeIcon> <EuiIcon - aria-hidden="true" color="secondary" size="l" type="empty" > <div - aria-hidden="true" color="secondary" data-euiicon-type="empty" size="l" diff --git a/src/plugins/visualizations/public/wizard/new_vis_modal.test.tsx b/src/plugins/visualizations/public/wizard/new_vis_modal.test.tsx index 5637aeafc6f14..2fdbdedd5b590 100644 --- a/src/plugins/visualizations/public/wizard/new_vis_modal.test.tsx +++ b/src/plugins/visualizations/public/wizard/new_vis_modal.test.tsx @@ -144,7 +144,7 @@ describe('NewVisModal', () => { isOpen={true} onClose={onClose} visTypesRegistry={visTypes} - editorParams={['foo=true', 'bar=42', 'addToDashboard']} + editorParams={['foo=true', 'bar=42', 'embeddableOriginatingApp=notAnApp']} addBasePath={addBasePath} uiSettings={uiSettings} savedObjects={{} as SavedObjectsStart} @@ -152,7 +152,9 @@ describe('NewVisModal', () => { ); const visButton = wrapper.find('button[data-test-subj="visType-visWithAliasUrl"]'); visButton.simulate('click'); - expect(window.location.assign).toBeCalledWith('testbasepath/aliasUrl?addToDashboard'); + expect(window.location.assign).toBeCalledWith( + 'testbasepath/aliasUrl?embeddableOriginatingApp=notAnApp' + ); expect(onClose).toHaveBeenCalled(); }); diff --git a/src/plugins/visualizations/public/wizard/new_vis_modal.tsx b/src/plugins/visualizations/public/wizard/new_vis_modal.tsx index 448077819bb8d..6fd65da7e88d2 100644 --- a/src/plugins/visualizations/public/wizard/new_vis_modal.tsx +++ b/src/plugins/visualizations/public/wizard/new_vis_modal.tsx @@ -28,6 +28,7 @@ import { SearchSelection } from './search_selection'; import { TypeSelection } from './type_selection'; import { TypesStart, VisType, VisTypeAlias } from '../vis_types'; import { UsageCollectionSetup } from '../../../../plugins/usage_collection/public'; +import { EMBEDDABLE_ORIGINATING_APP_PARAM } from '../../../embeddable/public'; interface TypeSelectionProps { isOpen: boolean; @@ -143,8 +144,11 @@ class NewVisModal extends React.Component<TypeSelectionProps, TypeSelectionState let params; if ('aliasUrl' in visType) { params = this.props.addBasePath(visType.aliasUrl); - if (this.props.editorParams && this.props.editorParams.includes('addToDashboard')) { - params = `${params}?addToDashboard`; + if (this.props.editorParams) { + const originatingAppParam = this.props.editorParams?.find((param: string) => + param.startsWith(EMBEDDABLE_ORIGINATING_APP_PARAM) + ); + params = originatingAppParam ? `${params}?${originatingAppParam}` : params; } this.props.onClose(); window.location.assign(params); diff --git a/src/plugins/visualizations/public/wizard/type_selection/vis_type_icon.tsx b/src/plugins/visualizations/public/wizard/type_selection/vis_type_icon.tsx index e91655cec980c..a9837313f2917 100644 --- a/src/plugins/visualizations/public/wizard/type_selection/vis_type_icon.tsx +++ b/src/plugins/visualizations/public/wizard/type_selection/vis_type_icon.tsx @@ -34,16 +34,8 @@ interface VisTypeIconProps { export const VisTypeIcon = ({ icon, image }: VisTypeIconProps) => { return ( <React.Fragment> - {image && ( - <img - src={image} - aria-hidden="true" - role="presentation" - alt="" - className="visNewVisDialog__typeImage" - /> - )} - {!image && <EuiIcon type={icon || 'empty'} size="l" color="secondary" aria-hidden="true" />} + {image && <img src={image} alt="" className="visNewVisDialog__typeImage" />} + {!image && <EuiIcon type={icon || 'empty'} size="l" color="secondary" />} </React.Fragment> ); }; diff --git a/src/plugins/visualize/public/application/editor/editor.js b/src/plugins/visualize/public/application/editor/editor.js index 9ec411a7744bf..bd699c762371c 100644 --- a/src/plugins/visualize/public/application/editor/editor.js +++ b/src/plugins/visualize/public/application/editor/editor.js @@ -25,11 +25,12 @@ import { i18n } from '@kbn/i18n'; import { EventEmitter } from 'events'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; import { makeStateful, useVisualizeAppState, addEmbeddableToDashboardUrl } from './lib'; import { VisualizeConstants } from '../visualize_constants'; import { getEditBreadcrumbs } from '../breadcrumbs'; +import { EMBEDDABLE_ORIGINATING_APP_PARAM } from '../../../../embeddable/public'; + import { addHelpMenuToAppChrome } from '../help_menu/help_menu_util'; import { unhashUrl, removeQueryParam } from '../../../../kibana_utils/public'; import { MarkdownSimple, toMountPoint } from '../../../../kibana_react/public'; @@ -38,9 +39,8 @@ import { subscribeWithScope, migrateLegacyQuery, } from '../../../../kibana_legacy/public'; -import { SavedObjectSaveModal, showSaveModal } from '../../../../saved_objects/public'; +import { showSaveModal, SavedObjectSaveModalOrigin } from '../../../../saved_objects/public'; import { esFilters, connectToQueryState, syncQueryStateWithUrl } from '../../../../data/public'; -import { DashboardConstants } from '../../../../dashboard/public'; import { initVisEditorDirective } from './visualization_editor'; import { initVisualizationDirective } from './visualization'; @@ -110,6 +110,11 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState localStorage.get('kibana.userQueryLanguage') || uiSettings.get('search:queryLanguage'), }; + const originatingApp = $route.current.params[EMBEDDABLE_ORIGINATING_APP_PARAM]; + removeQueryParam(history, EMBEDDABLE_ORIGINATING_APP_PARAM); + + $scope.getOriginatingApp = () => originatingApp; + const visStateToEditorState = () => { const savedVisState = visualizations.convertFromSerializedVis(vis.serialize()); return { @@ -144,13 +149,58 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState $scope.embeddableHandler = embeddableHandler; $scope.topNavMenu = [ + ...($scope.getOriginatingApp() && savedVis.id + ? [ + { + id: 'saveAndReturn', + label: i18n.translate('visualize.topNavMenu.saveAndReturnVisualizationButtonLabel', { + defaultMessage: 'Save and return', + }), + emphasize: true, + iconType: 'check', + description: i18n.translate( + 'visualize.topNavMenu.saveAndReturnVisualizationButtonAriaLabel', + { + defaultMessage: 'Finish editing visualization and return to the last app', + } + ), + testId: 'visualizesaveAndReturnButton', + disableButton() { + return Boolean($scope.dirty); + }, + tooltip() { + if ($scope.dirty) { + return i18n.translate( + 'visualize.topNavMenu.saveAndReturnVisualizationDisabledButtonTooltip', + { + defaultMessage: 'Apply or Discard your changes before finishing', + } + ); + } + }, + run: async () => { + const saveOptions = { + confirmOverwrite: false, + returnToOrigin: true, + }; + return doSave(saveOptions); + }, + }, + ] + : []), ...(visualizeCapabilities.save ? [ { id: 'save', - label: i18n.translate('visualize.topNavMenu.saveVisualizationButtonLabel', { - defaultMessage: 'save', - }), + label: + savedVis.id && $scope.getOriginatingApp() + ? i18n.translate('visualize.topNavMenu.saveVisualizationAsButtonLabel', { + defaultMessage: 'save as', + }) + : i18n.translate('visualize.topNavMenu.saveVisualizationButtonLabel', { + defaultMessage: 'save', + }), + emphasize: !savedVis.id || !$scope.getOriginatingApp(), description: i18n.translate('visualize.topNavMenu.saveVisualizationButtonAriaLabel', { defaultMessage: 'Save Visualization', }), @@ -175,6 +225,7 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState isTitleDuplicateConfirmed, onTitleDuplicate, newDescription, + returnToOrigin, }) => { const currentTitle = savedVis.title; savedVis.title = newTitle; @@ -184,6 +235,7 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState confirmOverwrite: false, isTitleDuplicateConfirmed, onTitleDuplicate, + returnToOrigin, }; return doSave(saveOptions).then(response => { // If the save wasn't successful, put the original values back. @@ -194,23 +246,13 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState }); }; - const confirmButtonLabel = $scope.isAddToDashMode() ? ( - <FormattedMessage - id="visualize.saveDialog.saveAndAddToDashboardButtonLabel" - defaultMessage="Save and add to dashboard" - /> - ) : null; - const saveModal = ( - <SavedObjectSaveModal + <SavedObjectSaveModalOrigin + documentInfo={savedVis} onSave={onSave} + objectType={'visualization'} onClose={() => {}} - title={savedVis.title} - showCopyOnSave={savedVis.id ? true : false} - objectType="visualization" - confirmButtonLabel={confirmButtonLabel} - description={savedVis.description} - showDescription={true} + originatingApp={$scope.getOriginatingApp()} /> ); showSaveModal(saveModal, I18nContext); @@ -398,12 +440,6 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState $scope.refreshInterval = timefilter.getRefreshInterval(); handleLinkedSearch(initialState.linked); - const addToDashMode = - $route.current.params[DashboardConstants.ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM]; - removeQueryParam(history, DashboardConstants.ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM); - - $scope.isAddToDashMode = () => addToDashMode; - $scope.showFilterBar = () => { return vis.type.options.showFilterBar; }; @@ -604,6 +640,7 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState */ function doSave(saveOptions) { // vis.title was not bound and it's needed to reflect title into visState + const firstSave = !Boolean(savedVis.id); stateContainer.transitions.setVis({ title: savedVis.title, type: savedVis.type || stateContainer.getState().vis.type, @@ -631,15 +668,23 @@ function VisualizeAppController($scope, $route, $injector, $timeout, kbnUrlState 'data-test-subj': 'saveVisualizationSuccess', }); - if ($scope.isAddToDashMode()) { + if ($scope.getOriginatingApp() && saveOptions.returnToOrigin) { const appPath = `${VisualizeConstants.EDIT_PATH}/${encodeURIComponent(savedVis.id)}`; + // Manually insert a new url so the back button will open the saved visualization. history.replace(appPath); setActiveUrl(appPath); - - const lastDashboardUrl = chrome.navLinks.get('kibana:dashboard').url; - const dashboardUrl = addEmbeddableToDashboardUrl(lastDashboardUrl, savedVis.id); - history.push(dashboardUrl); + const lastAppType = $scope.getOriginatingApp(); + let href = chrome.navLinks.get(lastAppType).url; + + // TODO: Remove this and use application.redirectTo after https://github.com/elastic/kibana/pull/63443 + if (lastAppType === 'kibana:dashboard') { + const savedVisId = firstSave || savedVis.copyOnSave ? savedVis.id : ''; + href = addEmbeddableToDashboardUrl(href, savedVisId); + history.push(href); + } else { + window.location.href = href; + } } else if (savedVis.id === $route.current.params.id) { chrome.docTitle.change(savedVis.lastSavedTitle); chrome.setBreadcrumbs($injector.invoke(getEditBreadcrumbs)); diff --git a/src/plugins/visualize/public/application/editor/lib/url_helper.ts b/src/plugins/visualize/public/application/editor/lib/url_helper.ts index 84e1ef9687cd0..9f8a0075118ae 100644 --- a/src/plugins/visualize/public/application/editor/lib/url_helper.ts +++ b/src/plugins/visualize/public/application/editor/lib/url_helper.ts @@ -33,8 +33,10 @@ export function addEmbeddableToDashboardUrl(dashboardUrl: string, embeddableId: const { url, query } = parseUrl(dashboardUrl); const [, dashboardId] = url.split(DashboardConstants.CREATE_NEW_DASHBOARD_URL); - query[DashboardConstants.ADD_EMBEDDABLE_TYPE] = VISUALIZE_EMBEDDABLE_TYPE; - query[DashboardConstants.ADD_EMBEDDABLE_ID] = embeddableId; + if (embeddableId) { + query[DashboardConstants.ADD_EMBEDDABLE_TYPE] = VISUALIZE_EMBEDDABLE_TYPE; + query[DashboardConstants.ADD_EMBEDDABLE_ID] = embeddableId; + } return `${DashboardConstants.CREATE_NEW_DASHBOARD_URL}${dashboardId}?${stringify(query)}`; } diff --git a/src/setup_node_env/index.js b/src/setup_node_env/index.js index 97de5ba76b926..d84249df7fd8f 100644 --- a/src/setup_node_env/index.js +++ b/src/setup_node_env/index.js @@ -17,12 +17,5 @@ * under the License. */ -// The following require statements MUST be executed before any others - BEGIN -require('./exit_on_warning'); -require('./harden'); -// The following require statements MUST be executed before any others - END - -require('symbol-observable'); -require('./root'); -require('./node_version_validator'); +require('./prebuilt_dev_only_entry'); require('./babel_register'); diff --git a/src/dev/run_register_git_hook.js b/src/setup_node_env/prebuilt_dev_only_entry.js similarity index 73% rename from src/dev/run_register_git_hook.js rename to src/setup_node_env/prebuilt_dev_only_entry.js index 8d5bb9e59359b..9453b3bd67eb7 100644 --- a/src/dev/run_register_git_hook.js +++ b/src/setup_node_env/prebuilt_dev_only_entry.js @@ -17,13 +17,11 @@ * under the License. */ -import { run, createFailError } from '@kbn/dev-utils'; -import { registerPrecommitGitHook } from './register_git_hook'; +// The following require statements MUST be executed before any others - BEGIN +require('./exit_on_warning'); +require('./harden'); +// The following require statements MUST be executed before any others - END -run(async ({ log }) => { - try { - await registerPrecommitGitHook(log); - } catch (error) { - throw createFailError(error); - } -}); +require('symbol-observable'); +require('./root'); +require('./node_version_validator'); diff --git a/test/accessibility/apps/dashboard.ts b/test/accessibility/apps/dashboard.ts index 8033dbb7ad210..83bde9aa99a73 100644 --- a/test/accessibility/apps/dashboard.ts +++ b/test/accessibility/apps/dashboard.ts @@ -162,11 +162,5 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.common.clickConfirmOnModal(); await listingTable.searchForItemWithName(''); }); - - // Blocked by https://github.com/elastic/kibana/issues/38980 - it.skip('Open flight dashboard', async () => { - await testSubjects.click('dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard'); - await a11y.testAppSnapshot(); - }); }); } diff --git a/test/functional/apps/dashboard/create_and_add_embeddables.js b/test/functional/apps/dashboard/create_and_add_embeddables.js index 410acdcb5680d..8180051f56e44 100644 --- a/test/functional/apps/dashboard/create_and_add_embeddables.js +++ b/test/functional/apps/dashboard/create_and_add_embeddables.js @@ -48,7 +48,8 @@ export default function({ getService, getPageObjects }) { await PageObjects.visualize.clickAreaChart(); await PageObjects.visualize.clickNewSearch(); await PageObjects.visualize.saveVisualizationExpectSuccess( - 'visualization from top nav add new panel' + 'visualization from top nav add new panel', + { redirectToOrigin: true } ); await retry.try(async () => { const panelCount = await PageObjects.dashboard.getPanelCount(); @@ -64,7 +65,8 @@ export default function({ getService, getPageObjects }) { await PageObjects.visualize.clickAreaChart(); await PageObjects.visualize.clickNewSearch(); await PageObjects.visualize.saveVisualizationExpectSuccess( - 'visualization from add new link' + 'visualization from add new link', + { redirectToOrigin: true } ); await retry.try(async () => { diff --git a/test/functional/apps/dashboard/dashboard_time.js b/test/functional/apps/dashboard/dashboard_time.js index 5a2628f42ded5..c64c4c50cd725 100644 --- a/test/functional/apps/dashboard/dashboard_time.js +++ b/test/functional/apps/dashboard/dashboard_time.js @@ -22,7 +22,7 @@ import expect from '@kbn/expect'; const dashboardName = 'Dashboard Test Time'; export default function({ getPageObjects, getService }) { - const PageObjects = getPageObjects(['dashboard', 'header', 'timePicker']); + const PageObjects = getPageObjects(['common', 'dashboard', 'header', 'timePicker']); const browser = getService('browser'); describe('dashboard time', () => { @@ -32,7 +32,7 @@ export default function({ getPageObjects, getService }) { }); after(async function() { - await PageObjects.dashboard.gotoDashboardLandingPage(); + await PageObjects.common.navigateToApp('dashboard'); }); describe('dashboard without stored timed', () => { diff --git a/test/functional/apps/dashboard/edit_embeddable_redirects.js b/test/functional/apps/dashboard/edit_embeddable_redirects.js new file mode 100644 index 0000000000000..b45dcc2cedf9b --- /dev/null +++ b/test/functional/apps/dashboard/edit_embeddable_redirects.js @@ -0,0 +1,79 @@ +/* + * 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 expect from '@kbn/expect'; + +export default function({ getService, getPageObjects }) { + const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']); + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const dashboardPanelActions = getService('dashboardPanelActions'); + + describe('edit embeddable redirects', () => { + before(async () => { + await esArchiver.load('dashboard/current/kibana'); + await kibanaServer.uiSettings.replace({ + defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', + }); + await PageObjects.common.navigateToApp('dashboard'); + await PageObjects.dashboard.preserveCrossAppState(); + await PageObjects.dashboard.loadSavedDashboard('few panels'); + await PageObjects.dashboard.switchToEditMode(); + }); + + it('redirects via save and return button after edit', async () => { + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.clickEdit(); + await PageObjects.visualize.saveVisualizationAndReturn(); + }); + + it('redirects via save as button after edit, renaming itself', async () => { + const newTitle = 'wowee, looks like I have a new title'; + const originalPanelCount = await PageObjects.dashboard.getPanelCount(); + await PageObjects.header.waitUntilLoadingHasFinished(); + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.clickEdit(); + await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, { + saveAsNew: false, + redirectToOrigin: true, + }); + await PageObjects.header.waitUntilLoadingHasFinished(); + const newPanelCount = await PageObjects.dashboard.getPanelCount(); + expect(newPanelCount).to.eql(originalPanelCount); + const titles = await PageObjects.dashboard.getPanelTitles(); + expect(titles.indexOf(newTitle)).to.not.be(-1); + }); + + it('redirects via save as button after edit, adding a new panel', async () => { + const newTitle = 'wowee, my title just got cooler'; + const originalPanelCount = await PageObjects.dashboard.getPanelCount(); + await PageObjects.header.waitUntilLoadingHasFinished(); + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.clickEdit(); + await PageObjects.visualize.saveVisualizationExpectSuccess(newTitle, { + saveAsNew: true, + redirectToOrigin: true, + }); + await PageObjects.header.waitUntilLoadingHasFinished(); + const newPanelCount = await PageObjects.dashboard.getPanelCount(); + expect(newPanelCount).to.eql(originalPanelCount + 1); + const titles = await PageObjects.dashboard.getPanelTitles(); + expect(titles.indexOf(newTitle)).to.not.be(-1); + }); + }); +} diff --git a/test/functional/apps/dashboard/index.js b/test/functional/apps/dashboard/index.js index bd8e6812147e1..3b81a4d974bec 100644 --- a/test/functional/apps/dashboard/index.js +++ b/test/functional/apps/dashboard/index.js @@ -51,6 +51,7 @@ export default function({ getService, loadTestFile }) { loadTestFile(require.resolve('./empty_dashboard')); loadTestFile(require.resolve('./embeddable_rendering')); loadTestFile(require.resolve('./create_and_add_embeddables')); + loadTestFile(require.resolve('./edit_embeddable_redirects')); loadTestFile(require.resolve('./time_zones')); loadTestFile(require.resolve('./dashboard_options')); loadTestFile(require.resolve('./data_shared_attributes')); diff --git a/test/functional/apps/dashboard/view_edit.js b/test/functional/apps/dashboard/view_edit.js index a0b972f3ab63c..c8eb10d43ea83 100644 --- a/test/functional/apps/dashboard/view_edit.js +++ b/test/functional/apps/dashboard/view_edit.js @@ -136,7 +136,10 @@ export default function({ getService, getPageObjects }) { await dashboardAddPanel.clickAddNewEmbeddableLink('visualization'); await PageObjects.visualize.clickAreaChart(); await PageObjects.visualize.clickNewSearch(); - await PageObjects.visualize.saveVisualizationExpectSuccess('new viz panel'); + await PageObjects.visualize.saveVisualizationExpectSuccess('new viz panel', { + saveAsNew: false, + redirectToOrigin: true, + }); await PageObjects.dashboard.clickCancelOutOfEditMode(); // for this sleep see https://github.com/elastic/kibana/issues/22299 diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index 4f357e2993b30..1f9a896ea8c7f 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -97,12 +97,12 @@ export default function({ getService, getPageObjects }) { await PageObjects.discover.brushHistogram(); const newDurationHours = await PageObjects.timePicker.getTimeDurationInHours(); - expect(Math.round(newDurationHours)).to.be(25); + expect(Math.round(newDurationHours)).to.be(24); const rowData = await PageObjects.discover.getDocTableField(1); log.debug(`The first timestamp value in doc table: ${rowData}`); expect(Date.parse(rowData)).to.be.within( - Date.parse('Sep 20, 2015 @ 21:30:00.000'), - Date.parse('Sep 20, 2015 @ 23:00:00.000') + Date.parse('Sep 20, 2015 @ 17:30:00.000'), + Date.parse('Sep 20, 2015 @ 23:30:00.000') ); }); diff --git a/test/functional/apps/visualize/_data_table.js b/test/functional/apps/visualize/_data_table.js index a6305e158007d..d0136677bb4de 100644 --- a/test/functional/apps/visualize/_data_table.js +++ b/test/functional/apps/visualize/_data_table.js @@ -100,9 +100,9 @@ export default function({ getService, getPageObjects }) { const data = await PageObjects.visChart.getTableVisData(); expect(data.trim().split('\n')).to.be.eql([ '≥ 0B and < 1,000B', - '1,351 64.7%', + '1,351 64.703%', '≥ 1,000B and < 1.953KB', - '737 35.3%', + '737 35.297%', ]); } diff --git a/test/functional/apps/visualize/_tile_map.js b/test/functional/apps/visualize/_tile_map.js index 0a7be3d682311..eefd5c6c8a8af 100644 --- a/test/functional/apps/visualize/_tile_map.js +++ b/test/functional/apps/visualize/_tile_map.js @@ -129,29 +129,28 @@ export default function({ getService, getPageObjects }) { expect(enabled).to.be(false); }); - // See https://github.com/elastic/kibana/issues/13137 if this test starts failing intermittently it('Fit data bounds should zoom to level 3', async function() { const expectedPrecision2DataTable = [ - ['-', 'dn', '1,429', { lat: 36, lon: -85 }], - ['-', 'dp', '1,418', { lat: 41, lon: -85 }], - ['-', '9y', '1,215', { lat: 36, lon: -96 }], - ['-', '9z', '1,099', { lat: 42, lon: -96 }], - ['-', 'dr', '1,076', { lat: 42, lon: -74 }], - ['-', 'dj', '982', { lat: 31, lon: -85 }], - ['-', '9v', '938', { lat: 31, lon: -96 }], - ['-', '9q', '722', { lat: 36, lon: -120 }], - ['-', '9w', '475', { lat: 36, lon: -107 }], - ['-', 'cb', '457', { lat: 46, lon: -96 }], - ['-', 'c2', '453', { lat: 47, lon: -120 }], - ['-', '9x', '420', { lat: 41, lon: -107 }], - ['-', 'dq', '399', { lat: 37, lon: -78 }], - ['-', '9r', '396', { lat: 41, lon: -120 }], - ['-', '9t', '274', { lat: 32, lon: -107 }], - ['-', 'c8', '271', { lat: 47, lon: -107 }], - ['-', 'dh', '214', { lat: 26, lon: -82 }], - ['-', 'b6', '207', { lat: 60, lon: -162 }], - ['-', 'bd', '206', { lat: 59, lon: -153 }], - ['-', 'b7', '167', { lat: 64, lon: -163 }], + ['-', 'dr4', '127', { lat: 40, lon: -76 }], + ['-', 'dr7', '92', { lat: 41, lon: -74 }], + ['-', '9q5', '91', { lat: 34, lon: -119 }], + ['-', '9qc', '89', { lat: 38, lon: -122 }], + ['-', 'drk', '87', { lat: 41, lon: -73 }], + ['-', 'dps', '82', { lat: 42, lon: -84 }], + ['-', 'dph', '82', { lat: 40, lon: -84 }], + ['-', 'dp3', '79', { lat: 41, lon: -88 }], + ['-', 'dpe', '78', { lat: 42, lon: -86 }], + ['-', 'dp8', '77', { lat: 43, lon: -90 }], + ['-', 'dp6', '74', { lat: 41, lon: -87 }], + ['-', 'djv', '74', { lat: 33, lon: -83 }], + ['-', '9qh', '74', { lat: 34, lon: -118 }], + ['-', 'dpq', '73', { lat: 41, lon: -81 }], + ['-', 'dpp', '73', { lat: 40, lon: -80 }], + ['-', '9y7', '73', { lat: 35, lon: -97 }], + ['-', '9vg', '73', { lat: 32, lon: -97 }], + ['-', 'drs', '71', { lat: 42, lon: -73 }], + ['-', '9ys', '71', { lat: 37, lon: -95 }], + ['-', '9yn', '71', { lat: 34, lon: -93 }], ]; await PageObjects.tileMap.clickMapFitDataBounds(); diff --git a/test/functional/apps/visualize/_tsvb_chart.ts b/test/functional/apps/visualize/_tsvb_chart.ts index 27a06cc05b45c..333aa93b7776d 100644 --- a/test/functional/apps/visualize/_tsvb_chart.ts +++ b/test/functional/apps/visualize/_tsvb_chart.ts @@ -29,6 +29,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['visualize', 'visualBuilder', 'timePicker', 'visChart']); describe('visual builder', function describeIndexTests() { + this.tags('includeFirefox'); beforeEach(async () => { await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']); await PageObjects.visualize.navigateToNewVisualization(); diff --git a/test/functional/page_objects/header_page.ts b/test/functional/page_objects/header_page.ts index 5f18034733822..d69a01ab6bb26 100644 --- a/test/functional/page_objects/header_page.ts +++ b/test/functional/page_objects/header_page.ts @@ -32,13 +32,13 @@ export function HeaderPageProvider({ getService, getPageObjects }: FtrProviderCo class HeaderPage { public async clickDiscover() { - await appsMenu.clickLink('Discover'); + await appsMenu.clickLink('Discover', { category: 'kibana' }); await PageObjects.common.waitForTopNavToBeVisible(); await this.awaitGlobalLoadingIndicatorHidden(); } public async clickVisualize() { - await appsMenu.clickLink('Visualize'); + await appsMenu.clickLink('Visualize', { category: 'kibana' }); await this.awaitGlobalLoadingIndicatorHidden(); await retry.waitFor('first breadcrumb to be "Visualize"', async () => { const firstBreadcrumb = await globalNav.getFirstBreadcrumb(); @@ -52,7 +52,7 @@ export function HeaderPageProvider({ getService, getPageObjects }: FtrProviderCo } public async clickDashboard() { - await appsMenu.clickLink('Dashboard'); + await appsMenu.clickLink('Dashboard', { category: 'kibana' }); await retry.waitFor('dashboard app to be loaded', async () => { const isNavVisible = await testSubjects.exists('top-nav'); const isLandingPageVisible = await testSubjects.exists('dashboardLandingPage'); @@ -62,7 +62,7 @@ export function HeaderPageProvider({ getService, getPageObjects }: FtrProviderCo } public async clickStackManagement() { - await appsMenu.clickLink('Management'); + await appsMenu.clickLink('Stack Management', { category: 'management' }); await this.awaitGlobalLoadingIndicatorHidden(); } diff --git a/test/functional/page_objects/visualize_page.ts b/test/functional/page_objects/visualize_page.ts index 220c2d8f6b363..8fa15fc8268ed 100644 --- a/test/functional/page_objects/visualize_page.ts +++ b/test/functional/page_objects/visualize_page.ts @@ -300,12 +300,25 @@ export function VisualizePageProvider({ getService, getPageObjects }: FtrProvide } } - public async saveVisualization(vizName: string, { saveAsNew = false } = {}) { + public async saveVisualization( + vizName: string, + { saveAsNew = false, redirectToOrigin = false } = {} + ) { await this.ensureSavePanelOpen(); await testSubjects.setValue('savedObjectTitle', vizName); - if (saveAsNew) { - log.debug('Check save as new visualization'); - await testSubjects.click('saveAsNewCheckbox'); + + const saveAsNewCheckboxExists = await testSubjects.exists('saveAsNewCheckbox'); + if (saveAsNewCheckboxExists) { + const state = saveAsNew ? 'check' : 'uncheck'; + log.debug('save as new checkbox exists. Setting its state to', state); + await testSubjects.setEuiSwitch('saveAsNewCheckbox', state); + } + + const redirectToOriginCheckboxExists = await testSubjects.exists('returnToOriginModeSwitch'); + if (redirectToOriginCheckboxExists) { + const state = redirectToOrigin ? 'check' : 'uncheck'; + log.debug('redirect to origin checkbox exists. Setting its state to', state); + await testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); } log.debug('Click Save Visualization button'); @@ -320,8 +333,11 @@ export function VisualizePageProvider({ getService, getPageObjects }: FtrProvide return message; } - public async saveVisualizationExpectSuccess(vizName: string, { saveAsNew = false } = {}) { - const saveMessage = await this.saveVisualization(vizName, { saveAsNew }); + public async saveVisualizationExpectSuccess( + vizName: string, + { saveAsNew = false, redirectToOrigin = false } = {} + ) { + const saveMessage = await this.saveVisualization(vizName, { saveAsNew, redirectToOrigin }); if (!saveMessage) { throw new Error( `Expected saveVisualization to respond with the saveMessage from the toast, got ${saveMessage}` @@ -331,14 +347,20 @@ export function VisualizePageProvider({ getService, getPageObjects }: FtrProvide public async saveVisualizationExpectSuccessAndBreadcrumb( vizName: string, - { saveAsNew = false } = {} + { saveAsNew = false, redirectToOrigin = false } = {} ) { - await this.saveVisualizationExpectSuccess(vizName, { saveAsNew }); + await this.saveVisualizationExpectSuccess(vizName, { saveAsNew, redirectToOrigin }); await retry.waitFor( 'last breadcrumb to have new vis name', async () => (await globalNav.getLastBreadcrumb()) === vizName ); } + + public async saveVisualizationAndReturn() { + await header.waitUntilLoadingHasFinished(); + await testSubjects.existOrFail('visualizesaveAndReturnButton'); + await testSubjects.click('visualizesaveAndReturnButton'); + } } return new VisualizePage(); diff --git a/test/functional/screenshots/baseline/area_chart.png b/test/functional/screenshots/baseline/area_chart.png index 1a381d61dd9f1..8ff0df0563eda 100644 Binary files a/test/functional/screenshots/baseline/area_chart.png and b/test/functional/screenshots/baseline/area_chart.png differ diff --git a/test/functional/screenshots/baseline/tsvb_dashboard.png b/test/functional/screenshots/baseline/tsvb_dashboard.png index f5ebccbcb96c6..fe63e352aef78 100644 Binary files a/test/functional/screenshots/baseline/tsvb_dashboard.png and b/test/functional/screenshots/baseline/tsvb_dashboard.png differ diff --git a/test/functional/services/apps_menu.ts b/test/functional/services/apps_menu.ts index fe17532f6a41a..236fb8f7535b6 100644 --- a/test/functional/services/apps_menu.ts +++ b/test/functional/services/apps_menu.ts @@ -22,16 +22,34 @@ import { FtrProviderContext } from '../ftr_provider_context'; export function AppsMenuProvider({ getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); const log = getService('log'); + const find = getService('find'); return new (class AppsMenu { + /** + * Close the collapsible nav + * TODO #64541 can replace with a data-test-subj + */ + public async closeCollapsibleNav() { + const CLOSE_BUTTON = '[data-test-subj=collapsibleNav] > button'; + if (await find.existsByCssSelector(CLOSE_BUTTON)) { + (await find.byCssSelector(CLOSE_BUTTON)).click(); + } + } + + public async openCollapsibleNav() { + if (!(await testSubjects.exists('collapsibleNav'))) { + await testSubjects.click('toggleNavButton'); + } + } + /** * Get the attributes from each of the links in the apps menu */ public async readLinks() { - const appMenu = await testSubjects.find('navDrawer'); + await this.openCollapsibleNav(); + const appMenu = await testSubjects.find('collapsibleNav'); const $ = await appMenu.parseDomContent(); - - const links = $.findTestSubjects('navDrawerAppsMenuLink') + const links = $.findTestSubjects('collapsibleNavAppLink') .toArray() .map(link => { return { @@ -41,6 +59,8 @@ export function AppsMenuProvider({ getService }: FtrProviderContext) { }; }); + await this.closeCollapsibleNav(); + return links; } @@ -63,14 +83,32 @@ export function AppsMenuProvider({ getService }: FtrProviderContext) { /** * Click the app link within the app menu that has the given name * @param name + * @param options.closeCollapsibleNav + * @param options.category - optional field to ensure that a link is clicked in a particular category + * helpful when there may be a recent link with the same name as an app */ - public async clickLink(name: string) { + public async clickLink( + name: string, + { + closeCollapsibleNav = true, + category, + }: { closeCollapsibleNav?: boolean; category?: string } = {} + ) { try { log.debug(`click "${name}" app link`); - const container = await testSubjects.find('navDrawer'); - // Text content is not visible or selectable (0px width) so we use an attr with th same value - const link = await container.findByCssSelector(`[aria-label='${name}']`); + await this.openCollapsibleNav(); + let nav; + if (typeof category === 'string') { + nav = await testSubjects.find(`collapsibleNavGroup-${category}`); + } else { + nav = await testSubjects.find('collapsibleNav'); + } + const link = await nav.findByPartialLinkText(name); await link.click(); + + if (closeCollapsibleNav) { + await this.closeCollapsibleNav(); + } } finally { // Intentionally empty } diff --git a/test/functional/services/dashboard/visualizations.js b/test/functional/services/dashboard/visualizations.js index f7a6fb7d2f694..676e4c384fe36 100644 --- a/test/functional/services/dashboard/visualizations.js +++ b/test/functional/services/dashboard/visualizations.js @@ -116,7 +116,10 @@ export function DashboardVisualizationProvider({ getService, getPageObjects }) { await PageObjects.visualize.clickMarkdownWidget(); await PageObjects.visEditor.setMarkdownTxt(markdown); await PageObjects.visEditor.clickGo(); - await PageObjects.visualize.saveVisualizationExpectSuccess(name); + await PageObjects.visualize.saveVisualizationExpectSuccess(name, { + saveAsNew: false, + redirectToOrigin: true, + }); } })(); } diff --git a/test/functional/services/test_subjects.ts b/test/functional/services/test_subjects.ts index e5c2e61c48a0b..090dc995ddc11 100644 --- a/test/functional/services/test_subjects.ts +++ b/test/functional/services/test_subjects.ts @@ -307,6 +307,7 @@ export function TestSubjectsProvider({ getService }: FtrProviderContext) { await element.scrollIntoViewIfNecessary(); } + // isChecked always returns false when run on an euiSwitch, because they use the aria-checked attribute public async isChecked(selector: string) { const checkbox = await this.find(selector); return await checkbox.isSelected(); @@ -316,7 +317,22 @@ export function TestSubjectsProvider({ getService }: FtrProviderContext) { const isChecked = await this.isChecked(selector); const states = { check: true, uncheck: false }; if (isChecked !== states[state]) { - log.debug(`updating checkbox ${selector}`); + log.debug(`updating checkbox ${selector} from ${isChecked} to ${states[state]}`); + await this.click(selector); + } + } + + public async isEuiSwitchChecked(selector: string) { + const euiSwitch = await this.find(selector); + const isChecked = await euiSwitch.getAttribute('aria-checked'); + return isChecked === 'true'; + } + + public async setEuiSwitch(selector: string, state: 'check' | 'uncheck') { + const isChecked = await this.isEuiSwitchChecked(selector); + const states = { check: true, uncheck: false }; + if (isChecked !== states[state]) { + log.debug(`updating checkbox ${selector} from ${isChecked} to ${states[state]}`); await this.click(selector); } } diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json index 001293be44829..338e85038922d 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json @@ -7,7 +7,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "22.3.0", + "@elastic/eui": "22.3.1", "react": "^16.12.0", "react-dom": "^16.12.0" } diff --git a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json index 4ca705137a12c..ef94ad7444eba 100644 --- a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "22.3.0", + "@elastic/eui": "22.3.1", "react": "^16.12.0" }, "scripts": { diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json index 818621ffe5ae5..56addbca0c2b8 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "22.3.0", + "@elastic/eui": "22.3.1", "react": "^16.12.0" }, "scripts": { diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json index 59b7337f5ff07..07bf435eeb9d8 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/package.json @@ -8,7 +8,7 @@ }, "license": "Apache-2.0", "dependencies": { - "@elastic/eui": "22.3.0", + "@elastic/eui": "22.3.1", "react": "^16.12.0" }, "scripts": { diff --git a/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts b/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts index f892e52754c57..7f5580dc6fa54 100644 --- a/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts +++ b/test/plugin_functional/test_suites/core_plugins/application_leave_confirm.ts @@ -59,19 +59,19 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider describe('when navigating to a legacy app', () => { it('prevents navigation if user click cancel on the alert dialog', async () => { await PageObjects.common.navigateToApp('appleave1'); - await appsMenu.clickLink('Core Legacy Compat'); + await appsMenu.clickLink('Core Legacy Compat', { closeCollapsibleNav: false }); const alert = await browser.getAlert(); - expect(alert).not.to.eql(undefined); + expect(alert).not.to.eql(null); alert!.dismiss(); expect(await browser.getCurrentUrl()).to.eql(getKibanaUrl('/app/appleave1')); }); it('allows navigation if user click leave on the alert dialog', async () => { await PageObjects.common.navigateToApp('appleave1'); - await appsMenu.clickLink('Core Legacy Compat'); + await appsMenu.clickLink('Core Legacy Compat', { closeCollapsibleNav: false }); const alert = await browser.getAlert(); - expect(alert).not.to.eql(undefined); + expect(alert).not.to.eql(null); alert!.accept(); expect(await browser.getCurrentUrl()).to.eql(getKibanaUrl('/app/core_legacy_compat')); }); diff --git a/test/plugin_functional/test_suites/core_plugins/application_status.ts b/test/plugin_functional/test_suites/core_plugins/application_status.ts index c384e41851e15..0781cf8a4f5bd 100644 --- a/test/plugin_functional/test_suites/core_plugins/application_status.ts +++ b/test/plugin_functional/test_suites/core_plugins/application_status.ts @@ -75,14 +75,6 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider }); link = await appsMenu.getLink('App Status'); expect(link).to.eql(undefined); - - await setAppStatus({ - navLinkStatus: AppNavLinkStatus.visible, - tooltip: 'Some tooltip', - }); - link = await appsMenu.getLink('Some tooltip'); // the tooltip replaces the name in the selector we use. - expect(link).not.to.eql(undefined); - expect(link!.disabled).to.eql(false); }); it('shows an error when navigating to an inaccessible app', async () => { diff --git a/test/plugin_functional/test_suites/core_plugins/applications.ts b/test/plugin_functional/test_suites/core_plugins/applications.ts index 27480ec964b32..7cf78f280a4a4 100644 --- a/test/plugin_functional/test_suites/core_plugins/applications.ts +++ b/test/plugin_functional/test_suites/core_plugins/applications.ts @@ -33,11 +33,9 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider const loadingScreenNotShown = async () => expect(await testSubjects.exists('kbnLoadingMessage')).to.be(false); - const loadingScreenShown = () => testSubjects.existOrFail('kbnLoadingMessage'); - - const getAppWrapperWidth = async () => { + const getAppWrapperHeight = async () => { const wrapper = await find.byClassName('app-wrapper'); - return (await wrapper.getSize()).width; + return (await wrapper.getSize()).height; }; const getKibanaUrl = (pathname?: string, search?: string) => @@ -90,7 +88,7 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider it('navigates to app root when navlink is clicked', async () => { await appsMenu.clickLink('Foo'); await waitForUrlToBe('/app/foo'); - await loadingScreenNotShown(); + // await loadingScreenNotShown(); await testSubjects.existOrFail('fooAppHome'); }); @@ -122,9 +120,9 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider await loadingScreenNotShown(); expect(await testSubjects.exists('headerGlobalNav')).to.be(false); - const wrapperWidth = await getAppWrapperWidth(); - const windowWidth = (await browser.getWindowSize()).width; - expect(wrapperWidth).to.eql(windowWidth); + const wrapperHeight = await getAppWrapperHeight(); + const windowHeight = (await browser.getWindowSize()).height; + expect(wrapperHeight).to.eql(windowHeight); }); it('navigating away from chromeless application shows chrome', async () => { @@ -132,20 +130,18 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider await loadingScreenNotShown(); expect(await testSubjects.exists('headerGlobalNav')).to.be(true); - const wrapperWidth = await getAppWrapperWidth(); - const windowWidth = (await browser.getWindowSize()).width; - expect(wrapperWidth).to.be.below(windowWidth); + const wrapperHeight = await getAppWrapperHeight(); + const windowHeight = (await browser.getWindowSize()).height; + expect(wrapperHeight).to.be.below(windowHeight); }); it('can navigate from NP apps to legacy apps', async () => { - await appsMenu.clickLink('Management'); - await loadingScreenShown(); + await appsMenu.clickLink('Stack Management'); await testSubjects.existOrFail('managementNav'); }); it('can navigate from legacy apps to NP apps', async () => { await appsMenu.clickLink('Foo'); - await loadingScreenShown(); await testSubjects.existOrFail('fooAppHome'); }); }); diff --git a/test/scripts/jenkins_xpack.sh b/test/scripts/jenkins_xpack.sh index 951ba8e22d885..c1243527de2c3 100755 --- a/test/scripts/jenkins_xpack.sh +++ b/test/scripts/jenkins_xpack.sh @@ -38,7 +38,7 @@ else cd "$XPACK_DIR" # build runtime for canvas echo "NODE_ENV=$NODE_ENV" - node ./legacy/plugins/canvas/scripts/shareable_runtime + node ./plugins/canvas/scripts/shareable_runtime node --max-old-space-size=6144 scripts/jest --ci --verbose --detectOpenHandles --coverage # rename file in order to be unique one test -f ../target/kibana-coverage/jest/coverage-final.json \ diff --git a/test/scripts/jenkins_xpack_build_kibana.sh b/test/scripts/jenkins_xpack_build_kibana.sh index 962d2794f712f..8dc41639fa946 100755 --- a/test/scripts/jenkins_xpack_build_kibana.sh +++ b/test/scripts/jenkins_xpack_build_kibana.sh @@ -7,7 +7,9 @@ echo " -> building kibana platform plugins" node scripts/build_kibana_platform_plugins \ --scan-dir "$XPACK_DIR/test/plugin_functional/plugins" \ --scan-dir "$XPACK_DIR/test/functional_with_es_ssl/fixtures/plugins" \ + --scan-dir "$XPACK_DIR/test/alerting_api_integration/plugins" \ --scan-dir "$XPACK_DIR/test/plugin_api_integration/plugins" \ + --scan-dir "$XPACK_DIR/test/plugin_api_perf/plugins" \ --verbose; # doesn't persist, also set in kibanaPipeline.groovy diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index ccf8739dd9730..a033515fef8b0 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -8,7 +8,7 @@ "xpack.alertingBuiltins": "plugins/alerting_builtins", "xpack.apm": ["legacy/plugins/apm", "plugins/apm"], "xpack.beatsManagement": "legacy/plugins/beats_management", - "xpack.canvas": "legacy/plugins/canvas", + "xpack.canvas": "plugins/canvas", "xpack.dashboard": "plugins/dashboard_enhanced", "xpack.crossClusterReplication": "plugins/cross_cluster_replication", "xpack.dashboardMode": "legacy/plugins/dashboard_mode", diff --git a/x-pack/.kibana-plugin-helpers.json b/x-pack/.kibana-plugin-helpers.json index 032783d9309f1..ed0b38841c1a8 100644 --- a/x-pack/.kibana-plugin-helpers.json +++ b/x-pack/.kibana-plugin-helpers.json @@ -29,8 +29,8 @@ "!legacy/plugins/**/__snapshots__", "!legacy/plugins/**/__snapshots__/*", "!legacy/plugins/**/__mocks__/*", - "!legacy/plugins/canvas/shareable_runtime/test", - "!legacy/plugins/canvas/shareable_runtime/test/**/*" + "!plugins/canvas/shareable_runtime/test", + "!plugins/canvas/shareable_runtime/test/**/*" ], "skipInstallDependencies": true } diff --git a/x-pack/index.js b/x-pack/index.js index 99b63a49f5793..bac871fcb5414 100644 --- a/x-pack/index.js +++ b/x-pack/index.js @@ -12,7 +12,6 @@ import { dashboardMode } from './legacy/plugins/dashboard_mode'; import { beats } from './legacy/plugins/beats_management'; import { maps } from './legacy/plugins/maps'; import { spaces } from './legacy/plugins/spaces'; -import { taskManager } from './legacy/plugins/task_manager'; import { encryptedSavedObjects } from './legacy/plugins/encrypted_saved_objects'; import { ingestManager } from './legacy/plugins/ingest_manager'; @@ -26,7 +25,6 @@ module.exports = function(kibana) { dashboardMode(kibana), beats(kibana), maps(kibana), - taskManager(kibana), encryptedSavedObjects(kibana), ingestManager(kibana), ]; diff --git a/x-pack/legacy/plugins/canvas/i18n/index.ts b/x-pack/legacy/plugins/canvas/i18n/index.ts deleted file mode 100644 index 864311d34aca0..0000000000000 --- a/x-pack/legacy/plugins/canvas/i18n/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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. - */ - -export * from './capabilities'; -export * from './components'; -export * from './constants'; -export * from './errors'; -export * from './expression_types'; -export * from './elements'; -export * from './functions'; -export * from './renderers'; -export * from './shortcuts'; -export * from './tags'; -export * from './transitions'; -export * from './ui'; -export * from './units'; diff --git a/x-pack/legacy/plugins/canvas/index.js b/x-pack/legacy/plugins/canvas/index.js deleted file mode 100644 index 4c7825e5b58aa..0000000000000 --- a/x-pack/legacy/plugins/canvas/index.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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. - */ - -import { resolve } from 'path'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; -import { CANVAS_APP, CANVAS_TYPE, CUSTOM_ELEMENT_TYPE } from './common/lib'; - -export function canvas(kibana) { - return new kibana.Plugin({ - id: CANVAS_APP, - configPrefix: 'xpack.canvas', - require: ['kibana', 'elasticsearch', 'xpack_main'], - publicDir: resolve(__dirname, 'public'), - uiExports: { - app: { - title: 'Canvas', - description: 'Data driven workpads', - icon: 'plugins/canvas/icon.svg', - euiIconType: 'canvasApp', - main: 'plugins/canvas/legacy_start', - category: DEFAULT_APP_CATEGORIES.analyze, - }, - interpreter: ['plugins/canvas/legacy_register_interpreter'], - styleSheetPaths: resolve(__dirname, 'public/style/index.scss'), - hacks: [ - // window.onerror override - 'plugins/canvas/lib/window_error_handler.js', - ], - home: ['plugins/canvas/legacy_register_feature'], - savedObjectsManagement: { - [CANVAS_TYPE]: { - icon: 'canvasApp', - defaultSearchField: 'name', - isImportableAndExportable: true, - getTitle(obj) { - return obj.attributes.name; - }, - getInAppUrl(obj) { - return { - path: `/app/canvas#/workpad/${encodeURIComponent(obj.id)}`, - uiCapabilitiesPath: 'canvas.show', - }; - }, - }, - [CUSTOM_ELEMENT_TYPE]: { - icon: 'canvasApp', - defaultSearchField: 'name', - isImportableAndExportable: true, - getTitle(obj) { - return obj.attributes.displayName; - }, - }, - }, - }, - - config: Joi => { - return Joi.object({ - enabled: Joi.boolean().default(true), - indexPrefix: Joi.string().default('.canvas'), - }).default(); - }, - - init: () => undefined, - }); -} diff --git a/x-pack/legacy/plugins/canvas/public/index.ts b/x-pack/legacy/plugins/canvas/public/index.ts deleted file mode 100644 index b053920fec6e4..0000000000000 --- a/x-pack/legacy/plugins/canvas/public/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -import { - PluginInitializer, - PluginInitializerContext, - CoreStart, -} from '../../../../../src/core/public'; -import { CanvasSetup, CanvasStart, CanvasSetupDeps, CanvasStartDeps, CanvasPlugin } from './plugin'; -import { CanvasServices } from './services'; - -export const plugin: PluginInitializer< - CanvasSetup, - CanvasStart, - CanvasSetupDeps, - CanvasStartDeps -> = (initializerContext: PluginInitializerContext) => { - return new CanvasPlugin(); -}; - -export interface WithKibanaProps { - kibana: { - services: CoreStart & CanvasStartDeps & { canvas: CanvasServices }; - }; -} - -// These are your public types & static code -export { CanvasSetup, CanvasStart }; diff --git a/x-pack/legacy/plugins/canvas/public/legacy.ts b/x-pack/legacy/plugins/canvas/public/legacy.ts deleted file mode 100644 index f4a2b309b3499..0000000000000 --- a/x-pack/legacy/plugins/canvas/public/legacy.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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. - */ - -import { npSetup, npStart } from 'ui/new_platform'; -import { CanvasStartDeps, CanvasSetupDeps } from './plugin'; // eslint-disable-line import/order - -// @ts-ignore Untyped Kibana Lib -import chrome, { loadingCount } from 'ui/chrome'; // eslint-disable-line import/order -// @ts-ignore Untyped Kibana Lib -import { formatMsg } from '../../../../../src/plugins/kibana_legacy/public'; // eslint-disable-line import/order - -const shimCoreSetup = { - ...npSetup.core, -}; -const shimCoreStart = { - ...npStart.core, -}; - -const shimSetupPlugins: CanvasSetupDeps = { - data: npSetup.plugins.data, - expressions: npSetup.plugins.expressions, - home: npSetup.plugins.home, - usageCollection: npSetup.plugins.usageCollection, -}; -const shimStartPlugins: CanvasStartDeps = { - ...npStart.plugins, - embeddable: npStart.plugins.embeddable, - expressions: npStart.plugins.expressions, - inspector: npStart.plugins.inspector, - uiActions: npStart.plugins.uiActions, -}; - -// These methods are intended to be a replacement for import from 'ui/whatever' -// These will go away once all of this one plugin start/setup properly -// injects wherever these need to go. -export function getCoreSetup() { - return shimCoreSetup; -} - -export function getCoreStart() { - return shimCoreStart; -} - -export function getSetupPlugins() { - return shimSetupPlugins; -} - -export function getStartPlugins() { - return shimStartPlugins; -} diff --git a/x-pack/legacy/plugins/canvas/public/legacy_plugin_support.ts b/x-pack/legacy/plugins/canvas/public/legacy_plugin_support.ts deleted file mode 100644 index cfc3de8f6d54c..0000000000000 --- a/x-pack/legacy/plugins/canvas/public/legacy_plugin_support.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -// @ts-ignore -import { Registry, registryFactory } from '@kbn/interpreter/common'; - -type specFn = (...args: any[]) => { name: string }; - -const fnWrapper = (fn: specFn) => { - const obj = fn(); - return () => ({ - name: obj.name, - fn, - }); -}; - -class LegacyRegistry extends Registry<any, any> { - register(fn: specFn) { - super.register(fnWrapper(fn)); - } - - getOriginalFns() { - return this.toArray().map(entry => entry.fn); - } -} - -export const legacyRegistries = { - browserFunctions: new LegacyRegistry(), - renderers: new LegacyRegistry(), - types: new LegacyRegistry(), - elements: new LegacyRegistry(), - transformUIs: new LegacyRegistry(), - datasourceUIs: new LegacyRegistry(), - modelUIs: new LegacyRegistry(), - viewUIs: new LegacyRegistry(), - argumentUIs: new LegacyRegistry(), - templates: new LegacyRegistry(), - tagUIs: new LegacyRegistry(), -}; - -(global as any).kbnInterpreter = Object.assign( - (global as any).kbnInterpreter || {}, - registryFactory(legacyRegistries) -); diff --git a/x-pack/legacy/plugins/canvas/public/legacy_register_interpreter.ts b/x-pack/legacy/plugins/canvas/public/legacy_register_interpreter.ts deleted file mode 100644 index 274a9875d123d..0000000000000 --- a/x-pack/legacy/plugins/canvas/public/legacy_register_interpreter.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * 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. - */ - -import { npSetup } from 'ui/new_platform'; -import { functions } from '../canvas_plugin_src/functions/browser'; -import { typeFunctions } from '../canvas_plugin_src/expression_types'; -// @ts-ignore untyped local -import { renderFunctions } from '../canvas_plugin_src/renderers'; - -functions.forEach(npSetup.plugins.expressions.registerFunction); -typeFunctions.forEach(npSetup.plugins.expressions.registerType); -renderFunctions.forEach(npSetup.plugins.expressions.registerRenderer); - -// eslint-disable-next-line import/no-default-export -export default functions; diff --git a/x-pack/legacy/plugins/canvas/public/legacy_start.ts b/x-pack/legacy/plugins/canvas/public/legacy_start.ts deleted file mode 100644 index ac647fe8a5a93..0000000000000 --- a/x-pack/legacy/plugins/canvas/public/legacy_start.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -// TODO: These are legacy imports. We should work to have all of these come from New Platform -// Import the uiExports that the application uses -// These will go away as these plugins are converted to NP -import 'ui/autoload/all'; -import 'uiExports/savedObjectTypes'; -import 'uiExports/spyModes'; -import 'uiExports/embeddableFactories'; -import 'uiExports/interpreter'; - -import './legacy_plugin_support'; -// load application code -import 'uiExports/canvas'; - -import { PluginInitializerContext } from '../../../../../src/core/public'; -import { plugin } from './'; -import { getCoreStart, getStartPlugins, getSetupPlugins, getCoreSetup } from './legacy'; -const pluginInstance = plugin({} as PluginInitializerContext); - -// Setup and Startup the plugin -export const setup = pluginInstance.setup(getCoreSetup(), getSetupPlugins()); -export const start = pluginInstance.start(getCoreStart(), getStartPlugins()); diff --git a/x-pack/legacy/plugins/canvas/public/lib/function_definitions.js b/x-pack/legacy/plugins/canvas/public/lib/function_definitions.js deleted file mode 100644 index 36ad0ba0b0015..0000000000000 --- a/x-pack/legacy/plugins/canvas/public/lib/function_definitions.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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. - */ - -import uniqBy from 'lodash.uniqby'; -import { npStart } from 'ui/new_platform'; -import { getServerFunctions } from '../state/selectors/app'; - -export async function getFunctionDefinitions(state) { - const serverFunctions = getServerFunctions(state); - return uniqBy( - serverFunctions.concat(Object.values(npStart.plugins.expressions.getFunctions())), - 'name' - ); -} diff --git a/x-pack/legacy/plugins/canvas/types/index.ts b/x-pack/legacy/plugins/canvas/types/index.ts deleted file mode 100644 index 21b3d2643c44c..0000000000000 --- a/x-pack/legacy/plugins/canvas/types/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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. - */ - -export * from '../../../../../src/plugins/expressions/common'; -export * from './assets'; -export * from './canvas'; -export * from './elements'; -export * from './functions'; -export * from './renderers'; -export * from './shortcuts'; -export * from './state'; -export * from './style'; -export * from './telemetry'; diff --git a/x-pack/legacy/plugins/dashboard_mode/index.js b/x-pack/legacy/plugins/dashboard_mode/index.js index ab90c6511de01..bbe337005e9e2 100644 --- a/x-pack/legacy/plugins/dashboard_mode/index.js +++ b/x-pack/legacy/plugins/dashboard_mode/index.js @@ -6,7 +6,7 @@ import { resolve } from 'path'; import { i18n } from '@kbn/i18n'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server'; import { CONFIG_DASHBOARD_ONLY_MODE_ROLES } from './common'; import { createDashboardModeRequestInterceptor } from './server'; @@ -61,7 +61,7 @@ export function dashboardMode(kibana) { title: i18n.translate('xpack.dashboardMode.dashboardViewer.dashboardTitle', { defaultMessage: 'Dashboard', }), - order: -1001, + order: 1000, url: `${kbnBaseUrl}#/dashboards`, subUrlBase: `${kbnBaseUrl}#/dashboard`, description: i18n.translate( @@ -71,7 +71,7 @@ export function dashboardMode(kibana) { } ), icon: 'plugins/kibana/dashboard/assets/dashboard.svg', - category: DEFAULT_APP_CATEGORIES.analyze, + category: DEFAULT_APP_CATEGORIES.kibana, }, ], }, diff --git a/x-pack/legacy/plugins/maps/index.js b/x-pack/legacy/plugins/maps/index.js index a1186e04ee27a..40123040764b7 100644 --- a/x-pack/legacy/plugins/maps/index.js +++ b/x-pack/legacy/plugins/maps/index.js @@ -17,7 +17,7 @@ import { createMapPath, MAP_SAVED_OBJECT_TYPE, } from '../../../plugins/maps/common/constants'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server'; export function maps(kibana) { return new kibana.Plugin({ @@ -34,7 +34,8 @@ export function maps(kibana) { main: 'plugins/maps/legacy', icon: 'plugins/maps/icon.svg', euiIconType: APP_ICON, - category: DEFAULT_APP_CATEGORIES.analyze, + category: DEFAULT_APP_CATEGORIES.kibana, + order: 4000, }, injectDefaultVars(server) { const serverConfig = server.config(); diff --git a/x-pack/legacy/plugins/task_manager/server/index.ts b/x-pack/legacy/plugins/task_manager/server/index.ts deleted file mode 100644 index a3167920efa06..0000000000000 --- a/x-pack/legacy/plugins/task_manager/server/index.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -import { Root } from 'joi'; -import { Legacy } from 'kibana'; - -import { createLegacyApi, getTaskManagerSetup } from './legacy'; -export { LegacyTaskManagerApi, getTaskManagerSetup, getTaskManagerStart } from './legacy'; - -// Once all plugins are migrated to NP, this can be removed -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { TaskManager } from '../../../../plugins/task_manager/server/task_manager'; -import { - LegacyPluginApi, - LegacyPluginSpec, - ArrayOrItem, -} from '../../../../../src/legacy/plugin_discovery/types'; - -export function taskManager(kibana: LegacyPluginApi): ArrayOrItem<LegacyPluginSpec> { - return new kibana.Plugin({ - id: 'task_manager', - require: ['kibana', 'elasticsearch', 'xpack_main'], - configPrefix: 'xpack.task_manager', - config(Joi: Root) { - return Joi.object({ - enabled: Joi.boolean().default(true), - index: Joi.string() - .description('The name of the index used to store task information.') - .default('.kibana_task_manager') - .invalid(['.tasks']), - }) - .unknown(true) - .default(); - }, - init(server: Legacy.Server) { - /* - * We must expose the New Platform Task Manager Plugin via the legacy Api - * as removing it now would be a breaking change - we'll remove this in v8.0.0 - */ - server.expose( - createLegacyApi( - getTaskManagerSetup(server)! - .registerLegacyAPI() - .then((taskManagerPlugin: TaskManager) => { - // we can't tell the Kibana Platform Task Manager plugin to - // to wait to `start` as that happens before legacy plugins - // instead we will start the internal Task Manager plugin when - // all legacy plugins have finished initializing - // Once all plugins are migrated to NP, this can be removed - - // the typing for the lagcy server isn't quite correct, so - // we'll bypase it for now - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this as any).kbnServer.afterPluginsInit(() => { - taskManagerPlugin.start(); - }); - return taskManagerPlugin; - }) - ) - ); - }, - } as Legacy.PluginSpecOptions); -} diff --git a/x-pack/legacy/plugins/task_manager/server/legacy.ts b/x-pack/legacy/plugins/task_manager/server/legacy.ts deleted file mode 100644 index 0d50828004a94..0000000000000 --- a/x-pack/legacy/plugins/task_manager/server/legacy.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ - -import { Server } from 'src/legacy/server/kbn_server'; -import { - TaskManagerSetupContract, - TaskManagerStartContract, -} from '../../../../plugins/task_manager/server'; - -import { Middleware } from '../../../../plugins/task_manager/server/lib/middleware.js'; -import { - TaskDictionary, - TaskInstanceWithDeprecatedFields, - TaskInstanceWithId, - TaskDefinition, -} from '../../../../plugins/task_manager/server/task.js'; -import { SearchOpts } from '../../../../plugins/task_manager/server/task_store.js'; - -// Once all plugins are migrated to NP and we can remove Legacy TaskManager in version 8.0.0, -// this can be removed -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { TaskManager } from '../../../../plugins/task_manager/server/task_manager'; - -export type LegacyTaskManagerApi = Pick< - TaskManagerSetupContract, - 'addMiddleware' | 'registerTaskDefinitions' -> & - TaskManagerStartContract; - -export function getTaskManagerSetup(server: Server): TaskManagerSetupContract | undefined { - return server?.newPlatform?.setup?.plugins?.taskManager as TaskManagerSetupContract; -} - -export function getTaskManagerStart(server: Server): TaskManagerStartContract | undefined { - return server?.newPlatform?.start?.plugins?.taskManager as TaskManagerStartContract; -} - -export function createLegacyApi(legacyTaskManager: Promise<TaskManager>): LegacyTaskManagerApi { - return { - addMiddleware: (middleware: Middleware) => { - legacyTaskManager.then((tm: TaskManager) => tm.addMiddleware(middleware)); - }, - registerTaskDefinitions: (taskDefinitions: TaskDictionary<TaskDefinition>) => { - legacyTaskManager.then((tm: TaskManager) => tm.registerTaskDefinitions(taskDefinitions)); - }, - fetch: (opts: SearchOpts) => legacyTaskManager.then((tm: TaskManager) => tm.fetch(opts)), - get: (id: string) => legacyTaskManager.then((tm: TaskManager) => tm.get(id)), - remove: (id: string) => legacyTaskManager.then((tm: TaskManager) => tm.remove(id)), - schedule: (taskInstance: TaskInstanceWithDeprecatedFields, options?: object) => - legacyTaskManager.then((tm: TaskManager) => tm.schedule(taskInstance, options)), - runNow: (taskId: string) => legacyTaskManager.then((tm: TaskManager) => tm.runNow(taskId)), - ensureScheduled: (taskInstance: TaskInstanceWithId, options?: object) => - legacyTaskManager.then((tm: TaskManager) => tm.ensureScheduled(taskInstance, options)), - }; -} diff --git a/x-pack/package.json b/x-pack/package.json index 5461b21b571f8..3a3a0a94fa9ea 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -6,7 +6,7 @@ "license": "Elastic-License", "scripts": { "kbn": "node ../scripts/kbn", - "kbn:bootstrap": "node legacy/plugins/canvas/scripts/storybook --clean", + "kbn:bootstrap": "node plugins/canvas/scripts/storybook --clean", "start": "gulp dev", "build": "gulp build", "testonly": "echo 'Deprecated, use `yarn test`' && gulp test", @@ -115,6 +115,8 @@ "@types/uuid": "^3.4.4", "@types/xml-crypto": "^1.4.0", "@types/xml2js": "^0.4.5", + "@types/stats-lite": "^2.2.0", + "@types/pretty-ms": "^5.0.0", "@welldone-software/why-did-you-render": "^4.0.0", "abab": "^1.0.4", "axios": "^0.19.0", @@ -189,7 +191,7 @@ "@elastic/apm-rum-react": "^1.1.1", "@elastic/datemath": "5.0.3", "@elastic/ems-client": "7.8.0", - "@elastic/eui": "22.3.0", + "@elastic/eui": "22.3.1", "@elastic/filesaver": "1.1.2", "@elastic/maki": "6.3.0", "@elastic/node-crypto": "1.1.1", diff --git a/x-pack/plugins/actions/server/lib/license_state.ts b/x-pack/plugins/actions/server/lib/license_state.ts index ae7180c4658bc..914aada08bb2c 100644 --- a/x-pack/plugins/actions/server/lib/license_state.ts +++ b/x-pack/plugins/actions/server/lib/license_state.ts @@ -6,7 +6,7 @@ import { i18n } from '@kbn/i18n'; import { Observable, Subscription } from 'rxjs'; -import { assertNever } from '../../../../../src/core/utils'; +import { assertNever } from '../../../../../src/core/server'; import { ILicense } from '../../../licensing/common/types'; import { PLUGIN } from '../constants/plugin'; import { ActionType } from '../types'; diff --git a/x-pack/plugins/actions/server/plugin.ts b/x-pack/plugins/actions/server/plugin.ts index a6cc1fb5463bb..f14df794bbf47 100644 --- a/x-pack/plugins/actions/server/plugin.ts +++ b/x-pack/plugins/actions/server/plugin.ts @@ -177,15 +177,15 @@ export class ActionsPlugin implements Plugin<Promise<PluginSetupContract>, Plugi const usageCollection = plugins.usageCollection; if (usageCollection) { + initializeActionsTelemetry( + this.telemetryLogger, + plugins.taskManager, + core, + await this.kibanaIndex + ); + core.getStartServices().then(async ([, startPlugins]) => { registerActionsUsageCollector(usageCollection, startPlugins.taskManager); - - initializeActionsTelemetry( - this.telemetryLogger, - plugins.taskManager, - core, - await this.kibanaIndex - ); }); } diff --git a/x-pack/plugins/alerting/README.md b/x-pack/plugins/alerting/README.md index 62c2caed669af..d15b5f4ce45cf 100644 --- a/x-pack/plugins/alerting/README.md +++ b/x-pack/plugins/alerting/README.md @@ -87,6 +87,7 @@ The following table describes the properties of the `options` object. |id|Unique identifier for the alert type. For convention purposes, ids starting with `.` are reserved for built in alert types. We recommend using a convention like `<plugin_id>.mySpecialAlert` for your alert types to avoid conflicting with another plugin.|string| |name|A user-friendly name for the alert type. These will be displayed in dropdowns when choosing alert types.|string| |actionGroups|An explicit list of groups the alert type may schedule actions for, each specifying the ActionGroup's unique ID and human readable name. Alert `actions` validation will use this configuartion to ensure groups are valid. We highly encourage using `kbn-i18n` to translate the names of actionGroup when registering the AlertType. |Array<{id:string, name:string}>| +|defaultActionGroupId|Default ID value for the group of the alert type.|string| |actionVariables|An explicit list of action variables the alert type makes available via context and state in action parameter templates, and a short human readable description. Alert UI will use this to display prompts for the users for these variables, in action parameter editors. We highly encourage using `kbn-i18n` to translate the descriptions. |{ context: Array<{name:string, description:string}, state: Array<{name:string, description:string}>| |validate.params|When developing an alert type, you can choose to accept a series of parameters. You may also have the parameters validated before they are passed to the `executor` function or created as an alert saved object. In order to do this, provide a `@kbn/config-schema` schema that we will use to validate the `params` attribute.|@kbn/config-schema| |executor|This is where the code of the alert type lives. This is a function to be called when executing an alert on an interval basis. For full details, see executor section below.|Function| @@ -102,6 +103,7 @@ This is the primary function for an alert type. Whenever the alert needs to exec |services.callCluster(path, opts)|Use this to do Elasticsearch queries on the cluster Kibana connects to. This function is the same as any other `callCluster` in Kibana but in the context of the user who created the alert when security is enabled.| |services.savedObjectsClient|This is an instance of the saved objects client. This provides the ability to do CRUD on any saved objects within the same space the alert lives in.<br><br>The scope of the saved objects client is tied to the user who created the alert (only when security isenabled).| |services.getScopedCallCluster|This function scopes an instance of CallCluster by returning a `callCluster(path, opts)` function that runs in the context of the user who created the alert when security is enabled. This must only be called with instances of CallCluster provided by core.| +|services.alertInstanceFactory(id)|This [alert instance factory](#alert-instance-factory) creates instances of alerts and must be used in order to execute actions. The id you give to the alert instance factory is a unique identifier to the alert instance.| |services.log(tags, [data], [timestamp])|Use this to create server logs. (This is the same function as server.log)| |startedAt|The date and time the alert type started execution.| |previousStartedAt|The previous date and time the alert type started a successful execution.| @@ -117,7 +119,7 @@ This is the primary function for an alert type. Whenever the alert needs to exec ### The `actionVariables` property -This property should contain the **flattened** names of the state and context variables available when an executor calls `alertInstance.scheduleActions(groupName, context)`. These names are meant to be used in prompters in the alerting user interface, are used as text values for display, and can be inserted into to an action parameter text entry field via UI gesture (eg, clicking a menu item from a menu built with these names). They should be flattened, so if a state or context variable is an object with properties, these should be listed with the "parent" property/properties in the name, separated by a `.` (period). +This property should contain the **flattened** names of the state and context variables available when an executor calls `alertInstance.scheduleActions(actionGroup, context)`. These names are meant to be used in prompters in the alerting user interface, are used as text values for display, and can be inserted into to an action parameter text entry field via UI gesture (eg, clicking a menu item from a menu built with these names). They should be flattened, so if a state or context variable is an object with properties, these should be listed with the "parent" property/properties in the name, separated by a `.` (period). For example, if the `context` has one variable `foo` which is an object that has one property `bar`, and there are no `state` variables, the `actionVariables` value would be in the following shape: @@ -145,6 +147,17 @@ server.newPlatform.setup.plugins.alerting.registerType({ threshold: schema.number({ min: 0, max: 1 }), }), }, + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + { + id: 'warning', + name: 'Warning', + }, + ], + defaultActionGroupId: 'default', actionVariables: { context: [ { name: 'server', description: 'the server' }, @@ -184,7 +197,7 @@ server.newPlatform.setup.plugins.alerting.registerType({ cpuUsage: currentCpuUsage, }); - // 'default' refers to a group of actions to be scheduled for execution, see 'actions' in create alert section + // 'default' refers to the id of a group of actions to be scheduled for execution, see 'actions' in create alert section alertInstance.scheduleActions('default', { server, hasCpuUsageIncreased: currentCpuUsage > previousCpuUsage, @@ -213,6 +226,13 @@ server.newPlatform.setup.plugins.alerting.registerType({ threshold: schema.number({ min: 0, max: 1 }), }), }, + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + ], + defaultActionGroupId: 'default', actionVariables: { context: [ { name: 'server', description: 'the server' }, @@ -253,7 +273,7 @@ server.newPlatform.setup.plugins.alerting.registerType({ cpuUsage: currentCpuUsage, }); - // 'default' refers to a group of actions to be scheduled for execution, see 'actions' in create alert section + // 'default' refers to the id of a group of actions to be scheduled for execution, see 'actions' in create alert section alertInstance.scheduleActions('default', { server, hasCpuUsageIncreased: currentCpuUsage > previousCpuUsage, @@ -472,7 +492,7 @@ This factory returns an instance of `AlertInstance`. The alert instance class ha |Method|Description| |---|---| |getState()|Get the current state of the alert instance.| -|scheduleActions(actionGroup, context)|Called to schedule the execution of actions. The actionGroup relates to the group of alert `actions` to execute and the context will be used for templating purposes. This should only be called once per alert instance.| +|scheduleActions(actionGroup, context)|Called to schedule the execution of actions. The actionGroup is a string `id` that relates to the group of alert `actions` to execute and the context will be used for templating purposes. This should only be called once per alert instance.| |replaceState(state)|Used to replace the current state of the alert instance. This doesn't work like react, the entire state must be provided. Use this feature as you see fit. The state that is set will persist between alert type executions whenever you re-create an alert instance with the same id. The instance state will be erased when `scheduleActions` isn't called during an execution.| ## Templating actions @@ -489,6 +509,8 @@ When an alert instance executes, the first argument is the `group` of actions to - `spaceId` - the id of the space the alert exists in - `tags` - the tags set in the alert +The templating engine is [mustache]. General definition for the [mustache variable] is a double-brace {{}}. All variables are HTML-escaped by default and if there is a requirement to render unescaped HTML, it should be applied the triple mustache: `{{{name}}}`. Also, can be used `&` to unescape a variable. + ## Examples The following code would be within an alert type. As you can see `cpuUsage ` will replace the state of the alert instance and `server` is the context for the alert instance to execute. The difference between the two is `cpuUsage ` will be accessible at the next execution. @@ -537,3 +559,6 @@ The templating system will take the alert and alert type as described above and ``` There are limitations that we are aware of using only templates, and we are gathering feedback and use cases for these. (for example passing an array of strings to an action). + +[mustache]: https://github.com/janl/mustache.js +[mustache variable]: https://github.com/janl/mustache.js#variables diff --git a/x-pack/plugins/alerting/server/lib/license_state.ts b/x-pack/plugins/alerting/server/lib/license_state.ts index db60d64db5df4..211d7a75dc4fa 100644 --- a/x-pack/plugins/alerting/server/lib/license_state.ts +++ b/x-pack/plugins/alerting/server/lib/license_state.ts @@ -8,7 +8,7 @@ import Boom from 'boom'; import { i18n } from '@kbn/i18n'; import { Observable, Subscription } from 'rxjs'; import { ILicense } from '../../../../plugins/licensing/common/types'; -import { assertNever } from '../../../../../src/core/utils'; +import { assertNever } from '../../../../../src/core/server'; import { PLUGIN } from '../constants/plugin'; export interface AlertingLicenseInformation { diff --git a/x-pack/plugins/alerting/server/plugin.ts b/x-pack/plugins/alerting/server/plugin.ts index 8cdde2eeb9877..7bd515616a3c1 100644 --- a/x-pack/plugins/alerting/server/plugin.ts +++ b/x-pack/plugins/alerting/server/plugin.ts @@ -152,15 +152,15 @@ export class AlertingPlugin { const usageCollection = plugins.usageCollection; if (usageCollection) { + initializeAlertingTelemetry( + this.telemetryLogger, + core, + plugins.taskManager, + await this.kibanaIndex + ); + core.getStartServices().then(async ([, startPlugins]) => { registerAlertsUsageCollector(usageCollection, startPlugins.taskManager); - - initializeAlertingTelemetry( - this.telemetryLogger, - core, - plugins.taskManager, - await this.kibanaIndex - ); }); } diff --git a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/TransactionActionMenu.tsx b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/TransactionActionMenu.tsx index c9376cdc01b5b..4092e0148286e 100644 --- a/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/TransactionActionMenu.tsx +++ b/x-pack/plugins/apm/public/components/shared/TransactionActionMenu/TransactionActionMenu.tsx @@ -27,7 +27,6 @@ import { CustomLink } from './CustomLink'; import { CustomLinkPopover } from './CustomLink/CustomLinkPopover'; import { getSections } from './sections'; import { useLicense } from '../../../hooks/useLicense'; -import { px } from '../../../style/variables'; import { convertFiltersToQuery } from '../../app/Settings/CustomizeUI/CustomLink/CustomLinkFlyout/helper'; interface Props { @@ -124,7 +123,7 @@ export const TransactionActionMenu: FunctionComponent<Props> = ({ <ActionMenuButton onClick={() => setIsActionPopoverOpen(true)} /> } > - <div style={{ maxHeight: px(600), width: px(335) }}> + <div> {isCustomLinksPopoverOpen ? ( <CustomLinkPopover customLinks={customLinks.slice(3, customLinks.length)} diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index f13c8853d0582..6ac2ecaae2b72 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -12,7 +12,7 @@ import { Plugin, PluginInitializerContext } from '../../../../src/core/public'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import { PluginSetupContract as AlertingPluginPublicSetup, diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts index 3eb61bb130725..c4b5dc868c37e 100644 --- a/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts +++ b/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts @@ -38,6 +38,21 @@ export async function createApmTelemetry({ taskManager: TaskManagerSetupContract; logger: Logger; }) { + taskManager.registerTaskDefinitions({ + [APM_TELEMETRY_TASK_NAME]: { + title: 'Collect APM telemetry', + type: APM_TELEMETRY_TASK_NAME, + createTaskRunner: () => { + return { + run: async () => { + await collectAndStore(); + }, + cancel: async () => {} + }; + } + } + }); + const savedObjectsClient = await getInternalSavedObjectsClient(core); const collectAndStore = async () => { @@ -79,21 +94,6 @@ export async function createApmTelemetry({ ); }; - taskManager.registerTaskDefinitions({ - [APM_TELEMETRY_TASK_NAME]: { - title: 'Collect APM telemetry', - type: APM_TELEMETRY_TASK_NAME, - createTaskRunner: () => { - return { - run: async () => { - await collectAndStore(); - }, - cancel: async () => {} - }; - } - } - }); - const collector = usageCollector.makeUsageCollector({ type: 'apm', fetch: async () => { diff --git a/x-pack/plugins/apm/server/tutorial/index_pattern.json b/x-pack/plugins/apm/server/tutorial/index_pattern.json index e0d9595585b88..1d061f9e11e61 100644 --- a/x-pack/plugins/apm/server/tutorial/index_pattern.json +++ b/x-pack/plugins/apm/server/tutorial/index_pattern.json @@ -1,7 +1,7 @@ { "attributes": { "fieldFormatMap": "{\"client.bytes\":{\"id\":\"bytes\"},\"client.nat.port\":{\"id\":\"string\"},\"client.port\":{\"id\":\"string\"},\"destination.bytes\":{\"id\":\"bytes\"},\"destination.nat.port\":{\"id\":\"string\"},\"destination.port\":{\"id\":\"string\"},\"event.duration\":{\"id\":\"duration\",\"params\":{\"inputFormat\":\"nanoseconds\",\"outputFormat\":\"asMilliseconds\",\"outputPrecision\":1}},\"event.sequence\":{\"id\":\"string\"},\"event.severity\":{\"id\":\"string\"},\"http.request.body.bytes\":{\"id\":\"bytes\"},\"http.request.bytes\":{\"id\":\"bytes\"},\"http.response.body.bytes\":{\"id\":\"bytes\"},\"http.response.bytes\":{\"id\":\"bytes\"},\"http.response.status_code\":{\"id\":\"string\"},\"log.syslog.facility.code\":{\"id\":\"string\"},\"log.syslog.priority\":{\"id\":\"string\"},\"network.bytes\":{\"id\":\"bytes\"},\"package.size\":{\"id\":\"string\"},\"process.parent.pgid\":{\"id\":\"string\"},\"process.parent.pid\":{\"id\":\"string\"},\"process.parent.ppid\":{\"id\":\"string\"},\"process.parent.thread.id\":{\"id\":\"string\"},\"process.pgid\":{\"id\":\"string\"},\"process.pid\":{\"id\":\"string\"},\"process.ppid\":{\"id\":\"string\"},\"process.thread.id\":{\"id\":\"string\"},\"server.bytes\":{\"id\":\"bytes\"},\"server.nat.port\":{\"id\":\"string\"},\"server.port\":{\"id\":\"string\"},\"source.bytes\":{\"id\":\"bytes\"},\"source.nat.port\":{\"id\":\"string\"},\"source.port\":{\"id\":\"string\"},\"system.cpu.total.norm.pct\":{\"id\":\"percent\"},\"system.memory.actual.free\":{\"id\":\"bytes\"},\"system.memory.total\":{\"id\":\"bytes\"},\"system.process.cpu.total.norm.pct\":{\"id\":\"percent\"},\"system.process.memory.rss.bytes\":{\"id\":\"bytes\"},\"system.process.memory.size\":{\"id\":\"bytes\"},\"url.port\":{\"id\":\"string\"},\"view spans\":{\"id\":\"url\",\"params\":{\"labelTemplate\":\"View Spans\"}}}", - "fields": "[{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"@timestamp\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tags\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.ephemeral_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.account.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.availability_zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.instance.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.instance.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.machine.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.provider\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.region\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.image.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.image.tag\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.runtime\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.class\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.data\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.ttl\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.header_flags\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.op_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.class\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.subdomain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.resolved_ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.response_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"ecs.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":4,\"doc_values\":true,\"indexed\":true,\"name\":\"error.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.stack_trace\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.stack_trace.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.action\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.created\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.dataset\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.duration\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.end\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.ingested\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.kind\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.module\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.outcome\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.provider\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.risk_score\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.risk_score_norm\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.sequence\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.severity\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.timezone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.url\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.accessed\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.attributes\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.created\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.ctime\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.device\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.drive_letter\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.extension\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.gid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.group\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.inode\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mime_type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mode\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mtime\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.owner\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.path.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.target_path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.target_path.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.uid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.architecture\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.content\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.content.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.method\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.referrer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.content\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.content.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.status_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.level\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.logger\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.file.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.file.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.facility.code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.facility.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.priority\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.severity.code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.severity.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.application\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.community_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.direction\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.forwarded_ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.iana_number\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.transport\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.serial_number\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.vendor\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.architecture\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.build_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.checksum\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.install_scope\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.installed\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.license\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.args\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.args_count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.command_line\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.command_line.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.entity_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.executable\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.executable.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.exit_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.args\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.args_count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.command_line\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.command_line.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.entity_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.executable\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.executable.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.exit_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.pgid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.pid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.ppid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.thread.id\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.thread.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.title\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.title.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.working_directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.working_directory.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pgid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.ppid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.thread.id\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.thread.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.title\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.title.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.working_directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.working_directory.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.strings\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.hive\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.key\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.value\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.user\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.author\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.license\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.ruleset\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.uuid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.ephemeral_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.node.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.state\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.framework\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.cipher\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.certificate\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.certificate_chain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.issuer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.ja3\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.not_after\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.not_before\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.server_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.subject\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.supported_ciphers\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.curve\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.established\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.next_protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.resumed\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.certificate\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.certificate_chain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.issuer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.ja3s\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.not_after\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.not_before\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.subject\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.version_protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tracing.trace.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tracing.transaction.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.extension\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.fragment\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.original.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.password\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.query\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.scheme\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.username\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.device.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.original.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.classification\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.description.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.enumeration\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.report_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.scanner.vendor\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.base\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.environmental\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.temporal\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.severity\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"fields\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"timeseries.instance\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.project.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.image.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"docker.container.labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.containerized\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.build\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.codename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.pod.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.pod.uid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.namespace\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.node.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.labels.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.annotations.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.replicaset.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.deployment.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.statefulset.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.container.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.container.image\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"processor.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"processor.event\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"timestamp.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"enabled\":false,\"indexed\":false,\"name\":\"http.request.headers\",\"scripted\":false,\"searchable\":false},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.finished\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"enabled\":false,\"indexed\":false,\"name\":\"http.response.headers\",\"scripted\":false,\"searchable\":false},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.environment\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.language.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.language.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.runtime.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.runtime.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.framework.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.framework.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.sampled\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.self_time.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.self_time.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.breakdown.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.subtype\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.self_time.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.self_time.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"trace.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"parent.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.listening\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.version_major\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"experimental\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.culprit\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.grouping_key\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.module\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":4,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.handled\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.level\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.logger_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.param_message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.cpu.total.norm.pct\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.memory.total\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.memory.actual.free\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.cpu.total.norm.pct\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.memory.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.memory.rss.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.cpu.ns\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.samples.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.alloc_objects.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.alloc_space.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.inuse_objects.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.inuse_space.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.duration\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.filename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.filename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.service.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.bundle_filepath\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"view spans\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"child.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.action\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.start.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.duration.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.sync\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.db.link\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.db.rows_affected\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.resource\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.message.queue.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.message.age.ms\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.result\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.marks\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.marks.*.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.span_count.dropped\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.message.queue.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.message.age.ms\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_id\",\"scripted\":false,\"searchable\":false,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_index\",\"scripted\":false,\"searchable\":false,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_score\",\"scripted\":false,\"searchable\":false,\"type\":\"number\"}]", + "fields": "[{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"@timestamp\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tags\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.ephemeral_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"client.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.account.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.availability_zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.instance.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.instance.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.machine.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.provider\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.region\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.image.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.image.tag\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"container.runtime\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"destination.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dll.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.class\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.data\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.ttl\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.answers.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.header_flags\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.op_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.class\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.subdomain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.question.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.resolved_ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.response_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"dns.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"ecs.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":4,\"doc_values\":true,\"indexed\":true,\"name\":\"error.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.stack_trace\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.stack_trace.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.action\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.created\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.dataset\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.duration\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.end\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.ingested\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.kind\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.module\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.outcome\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.provider\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.risk_score\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.risk_score_norm\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.sequence\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.severity\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.timezone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"event.url\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.accessed\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.attributes\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.created\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.ctime\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.device\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.drive_letter\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.extension\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.gid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.group\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.inode\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mime_type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mode\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.mtime\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.owner\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.path.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.target_path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.target_path.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"file.uid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.architecture\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.content\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.body.content.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.method\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.request.referrer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.content\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.body.content.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.status_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.level\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.logger\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.file.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.file.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.origin.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.facility.code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.facility.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.priority\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.severity.code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"log.syslog.severity.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.application\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.community_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.direction\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.forwarded_ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.iana_number\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.inner.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.transport\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"network.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.egress.zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.alias\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.interface.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ingress.zone\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.serial_number\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.vendor\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.architecture\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.build_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.checksum\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.install_scope\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.installed\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.license\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"package.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.args\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.args_count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.command_line\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.command_line.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.entity_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.executable\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.executable.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.exit_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.args\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.args_count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.exists\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.status\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.subject_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.trusted\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.code_signature.valid\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.command_line\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.command_line.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.entity_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.executable\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.executable.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.exit_code\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.hash.sha512\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.pgid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.pid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.ppid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.thread.id\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.thread.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.title\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.title.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.working_directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.parent.working_directory.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.company\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.file_version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.original_file_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pe.product\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pgid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.pid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.ppid\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.start\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.thread.id\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.thread.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.title\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.title.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.uptime\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.working_directory\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"process.working_directory.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.strings\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.data.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.hive\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.key\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"registry.value\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"related.user\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.author\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.license\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.ruleset\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.uuid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"rule.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"server.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.ephemeral_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.node.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.state\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.address\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.number\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.organization.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.as.organization.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.city_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.continent_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.country_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.country_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.location\",\"scripted\":false,\"searchable\":true,\"type\":\"geo_point\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.region_iso_code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.geo.region_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.mac\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.nat.ip\",\"scripted\":false,\"searchable\":true,\"type\":\"ip\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.nat.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.packets\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"source.user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.framework\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.tactic.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"threat.technique.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.cipher\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.certificate\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.certificate_chain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.issuer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.ja3\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.not_after\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.not_before\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.server_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.subject\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.client.supported_ciphers\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.curve\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.established\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.next_protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.resumed\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.certificate\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.certificate_chain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.md5\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.sha1\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.hash.sha256\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.issuer\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.ja3s\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.not_after\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.not_before\",\"scripted\":false,\"searchable\":true,\"type\":\"date\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.server.subject\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tls.version_protocol\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tracing.trace.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"tracing.transaction.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.extension\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.fragment\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.original.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.password\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.path\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.port\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.query\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.registered_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.scheme\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.top_level_domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"url.username\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.email\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.full_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.full_name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.domain\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.group.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.hash\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.device.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.original\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.original.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.family\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.full\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.full.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.kernel\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.platform\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.os.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"user_agent.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vlan.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vlan.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.category\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.classification\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.description\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.description.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.enumeration\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.reference\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.report_id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.scanner.vendor\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.base\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.environmental\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.temporal\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.score.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"vulnerability.severity\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"agent.hostname\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"fields\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"timeseries.instance\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.project.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.image.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"docker.container.labels\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.containerized\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.build\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"host.os.codename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.pod.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.pod.uid\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.namespace\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.node.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.labels.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.annotations.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.replicaset.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.deployment.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.statefulset.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.container.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"kubernetes.container.image\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"processor.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"processor.event\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"timestamp.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"enabled\":false,\"indexed\":false,\"name\":\"http.request.headers\",\"scripted\":false,\"searchable\":false},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"http.response.finished\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"enabled\":false,\"indexed\":false,\"name\":\"http.response.headers\",\"scripted\":false,\"searchable\":false},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.environment\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.language.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.language.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.runtime.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.runtime.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.framework.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"service.framework.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.sampled\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.name.text\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.self_time.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.self_time.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.breakdown.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.subtype\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.self_time.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.self_time.sum.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"trace.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"parent.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.listening\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"observer.version_major\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"experimental\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.account.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"cloud.project.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.culprit\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.grouping_key\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.code\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.module\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":4,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.exception.handled\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.level\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.logger_name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":2,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"error.log.param_message\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.cpu.total.norm.pct\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.memory.total\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.memory.actual.free\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.cpu.total.norm.pct\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.memory.size\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"system.process.memory.rss.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.root\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.cpu.ns\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.samples.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.alloc_objects.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.alloc_space.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.inuse_objects.count\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.inuse_space.bytes\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.duration\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.filename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.top.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.function\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.filename\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"profile.stack.line\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.service.version\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"sourcemap.bundle_filepath\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"view spans\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"child.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.id\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.action\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.start.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":1,\"doc_values\":true,\"indexed\":true,\"name\":\"span.duration.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.sync\",\"scripted\":false,\"searchable\":true,\"type\":\"boolean\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.db.link\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.db.rows_affected\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.destination.service.resource\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.message.queue.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"span.message.age.ms\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.us\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.result\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.marks\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.marks.*.*\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.span_count.dropped\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.message.queue.name\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.message.age.ms\",\"scripted\":false,\"searchable\":true,\"type\":\"number\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":true,\"indexed\":true,\"name\":\"transaction.duration.histogram\",\"scripted\":false,\"searchable\":true},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_id\",\"scripted\":false,\"searchable\":false,\"type\":\"string\"},{\"aggregatable\":true,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_type\",\"scripted\":false,\"searchable\":true,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_index\",\"scripted\":false,\"searchable\":false,\"type\":\"string\"},{\"aggregatable\":false,\"analyzed\":false,\"count\":0,\"doc_values\":false,\"indexed\":false,\"name\":\"_score\",\"scripted\":false,\"searchable\":false,\"type\":\"number\"}]", "sourceFilters": "[{\"value\":\"sourcemap.sourcemap\"}]", "timeFieldName": "@timestamp" }, diff --git a/x-pack/legacy/plugins/canvas/.gitignore b/x-pack/plugins/canvas/.gitignore similarity index 100% rename from x-pack/legacy/plugins/canvas/.gitignore rename to x-pack/plugins/canvas/.gitignore diff --git a/x-pack/legacy/plugins/canvas/.prettierrc b/x-pack/plugins/canvas/.prettierrc similarity index 100% rename from x-pack/legacy/plugins/canvas/.prettierrc rename to x-pack/plugins/canvas/.prettierrc diff --git a/x-pack/legacy/plugins/canvas/.storybook/.babelrc b/x-pack/plugins/canvas/.storybook/.babelrc similarity index 100% rename from x-pack/legacy/plugins/canvas/.storybook/.babelrc rename to x-pack/plugins/canvas/.storybook/.babelrc diff --git a/x-pack/legacy/plugins/canvas/.storybook/addons.js b/x-pack/plugins/canvas/.storybook/addons.js similarity index 100% rename from x-pack/legacy/plugins/canvas/.storybook/addons.js rename to x-pack/plugins/canvas/.storybook/addons.js diff --git a/x-pack/legacy/plugins/canvas/.storybook/config.js b/x-pack/plugins/canvas/.storybook/config.js similarity index 93% rename from x-pack/legacy/plugins/canvas/.storybook/config.js rename to x-pack/plugins/canvas/.storybook/config.js index 725a3b12666d1..c808a672711ab 100644 --- a/x-pack/legacy/plugins/canvas/.storybook/config.js +++ b/x-pack/plugins/canvas/.storybook/config.js @@ -10,7 +10,7 @@ import { withKnobs } from '@storybook/addon-knobs/react'; import { withInfo } from '@storybook/addon-info'; import { create } from '@storybook/theming'; -import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; +import { KibanaContextProvider } from '../../../../src/plugins/kibana_react/public'; // If we're running Storyshots, be sure to register the require context hook. // Otherwise, add the other decorators. @@ -50,7 +50,7 @@ function loadStories() { // Only gather and require CSS files related to Canvas. The other CSS files // are built into the DLL. const css = require.context( - '../../../../../built_assets/css', + '../../../../built_assets/css', true, /plugins\/(?=canvas).*light\.css/ ); @@ -67,7 +67,7 @@ addParameters({ theme: create({ base: 'light', brandTitle: 'Canvas Storybook', - brandUrl: 'https://github.com/elastic/kibana/tree/master/x-pack/legacy/plugins/canvas', + brandUrl: 'https://github.com/elastic/kibana/tree/master/x-pack/plugins/canvas', }), showPanel: true, isFullscreen: false, diff --git a/x-pack/legacy/plugins/canvas/.storybook/constants.js b/x-pack/plugins/canvas/.storybook/constants.js similarity index 89% rename from x-pack/legacy/plugins/canvas/.storybook/constants.js rename to x-pack/plugins/canvas/.storybook/constants.js index 9b59afbaf69f2..258bf208ed877 100644 --- a/x-pack/legacy/plugins/canvas/.storybook/constants.js +++ b/x-pack/plugins/canvas/.storybook/constants.js @@ -7,7 +7,7 @@ const path = require('path'); const DLL_NAME = 'canvas_storybook_dll'; -const KIBANA_ROOT = path.resolve(__dirname, '../../../../..'); +const KIBANA_ROOT = path.resolve(__dirname, '../../../..'); const BUILT_ASSETS = path.resolve(KIBANA_ROOT, 'built_assets'); const DLL_OUTPUT = path.resolve(BUILT_ASSETS, DLL_NAME); diff --git a/x-pack/legacy/plugins/canvas/.storybook/dll_contexts.js b/x-pack/plugins/canvas/.storybook/dll_contexts.js similarity index 84% rename from x-pack/legacy/plugins/canvas/.storybook/dll_contexts.js rename to x-pack/plugins/canvas/.storybook/dll_contexts.js index 273323d065ecf..529fd8aa5c791 100644 --- a/x-pack/legacy/plugins/canvas/.storybook/dll_contexts.js +++ b/x-pack/plugins/canvas/.storybook/dll_contexts.js @@ -11,7 +11,7 @@ // Pull in the built CSS produced by the Kibana server, but not // the Canvas CSS-- we want that in the HMR service. const css = require.context( - '../../../../../built_assets/css', + '../../../../built_assets/css', true, /\.\/plugins\/(?!canvas).*light\.css/ ); @@ -21,15 +21,11 @@ css.keys().forEach(filename => { // Include Legacy styles const uiStyles = require.context( - '../../../../../src/legacy/ui/public/styles', + '../../../../src/legacy/ui/public/styles', false, /[\/\\](?!mixins|variables|_|\.|bootstrap_(light|dark))[^\/\\]+\.less/ ); uiStyles.keys().forEach(key => uiStyles(key)); -const json = require.context( - '../shareable_runtime/test/workpads', - false, - /\.json$/ -); +const json = require.context('../shareable_runtime/test/workpads', false, /\.json$/); json.keys().forEach(key => json(key)); diff --git a/x-pack/legacy/plugins/canvas/.storybook/middleware.js b/x-pack/plugins/canvas/.storybook/middleware.js similarity index 100% rename from x-pack/legacy/plugins/canvas/.storybook/middleware.js rename to x-pack/plugins/canvas/.storybook/middleware.js diff --git a/x-pack/legacy/plugins/canvas/.storybook/preview-head.html b/x-pack/plugins/canvas/.storybook/preview-head.html similarity index 100% rename from x-pack/legacy/plugins/canvas/.storybook/preview-head.html rename to x-pack/plugins/canvas/.storybook/preview-head.html diff --git a/x-pack/legacy/plugins/canvas/.storybook/storyshots.test.js b/x-pack/plugins/canvas/.storybook/storyshots.test.js similarity index 96% rename from x-pack/legacy/plugins/canvas/.storybook/storyshots.test.js rename to x-pack/plugins/canvas/.storybook/storyshots.test.js index a679010c67092..59645cad26200 100644 --- a/x-pack/legacy/plugins/canvas/.storybook/storyshots.test.js +++ b/x-pack/plugins/canvas/.storybook/storyshots.test.js @@ -7,7 +7,7 @@ import path from 'path'; import moment from 'moment'; import 'moment-timezone'; -import ReactDOM from "react-dom"; +import ReactDOM from 'react-dom'; import initStoryshots, { multiSnapshotWithOptions } from '@storybook/addon-storyshots'; import styleSheetSerializer from 'jest-styled-components/src/styleSheetSerializer'; @@ -25,8 +25,8 @@ moment.tz.setDefault('UTC'); const testTime = new Date(Date.UTC(2019, 5, 1)); // June 1 2019 Date.now = jest.fn(() => testTime); -// Mock telemetry service -jest.mock('../public/lib/ui_metric', () => ({ trackCanvasUiMetric: () => { } })); +// Mock telemetry service +jest.mock('../public/lib/ui_metric', () => ({ trackCanvasUiMetric: () => {} })); // Mock EUI generated ids to be consistently predictable for snapshots. jest.mock(`@elastic/eui/lib/components/form/form_row/make_id`, () => () => `generated-id`); @@ -65,9 +65,8 @@ jest.mock('@elastic/eui/packages/react-datepicker', () => { }; }); - // Mock React Portal for components that use modals, tooltips, etc -ReactDOM.createPortal = jest.fn((element) => { +ReactDOM.createPortal = jest.fn(element => { return element; }); diff --git a/x-pack/legacy/plugins/canvas/.storybook/webpack.config.js b/x-pack/plugins/canvas/.storybook/webpack.config.js similarity index 100% rename from x-pack/legacy/plugins/canvas/.storybook/webpack.config.js rename to x-pack/plugins/canvas/.storybook/webpack.config.js diff --git a/x-pack/legacy/plugins/canvas/.storybook/webpack.dll.config.js b/x-pack/plugins/canvas/.storybook/webpack.dll.config.js similarity index 100% rename from x-pack/legacy/plugins/canvas/.storybook/webpack.dll.config.js rename to x-pack/plugins/canvas/.storybook/webpack.dll.config.js diff --git a/x-pack/legacy/plugins/canvas/README.md b/x-pack/plugins/canvas/README.md similarity index 100% rename from x-pack/legacy/plugins/canvas/README.md rename to x-pack/plugins/canvas/README.md diff --git a/x-pack/legacy/plugins/canvas/__tests__/fixtures/elasticsearch.js b/x-pack/plugins/canvas/__tests__/fixtures/elasticsearch.js similarity index 100% rename from x-pack/legacy/plugins/canvas/__tests__/fixtures/elasticsearch.js rename to x-pack/plugins/canvas/__tests__/fixtures/elasticsearch.js diff --git a/x-pack/legacy/plugins/canvas/__tests__/fixtures/elasticsearch_plugin.js b/x-pack/plugins/canvas/__tests__/fixtures/elasticsearch_plugin.js similarity index 100% rename from x-pack/legacy/plugins/canvas/__tests__/fixtures/elasticsearch_plugin.js rename to x-pack/plugins/canvas/__tests__/fixtures/elasticsearch_plugin.js diff --git a/x-pack/legacy/plugins/canvas/__tests__/fixtures/function_specs.ts b/x-pack/plugins/canvas/__tests__/fixtures/function_specs.ts similarity index 83% rename from x-pack/legacy/plugins/canvas/__tests__/fixtures/function_specs.ts rename to x-pack/plugins/canvas/__tests__/fixtures/function_specs.ts index 3ed08268222d0..edf11f5a25c08 100644 --- a/x-pack/legacy/plugins/canvas/__tests__/fixtures/function_specs.ts +++ b/x-pack/plugins/canvas/__tests__/fixtures/function_specs.ts @@ -5,6 +5,6 @@ */ import { functions as browserFns } from '../../canvas_plugin_src/functions/browser'; -import { ExpressionFunction } from '../../../../../../src/plugins/expressions'; +import { ExpressionFunction } from '../../../../../src/plugins/expressions'; export const functionSpecs = browserFns.map(fn => new ExpressionFunction(fn())); diff --git a/x-pack/legacy/plugins/canvas/__tests__/fixtures/kibana.js b/x-pack/plugins/canvas/__tests__/fixtures/kibana.js similarity index 95% rename from x-pack/legacy/plugins/canvas/__tests__/fixtures/kibana.js rename to x-pack/plugins/canvas/__tests__/fixtures/kibana.js index 8caab5c41563c..4503adcec0c2c 100644 --- a/x-pack/legacy/plugins/canvas/__tests__/fixtures/kibana.js +++ b/x-pack/plugins/canvas/__tests__/fixtures/kibana.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { get, has, noop } from 'lodash'; +import { get, has } from 'lodash'; import mockElasticsearch from './elasticsearch_plugin'; const config = { diff --git a/x-pack/legacy/plugins/canvas/__tests__/fixtures/workpads.ts b/x-pack/plugins/canvas/__tests__/fixtures/workpads.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/__tests__/fixtures/workpads.ts rename to x-pack/plugins/canvas/__tests__/fixtures/workpads.ts diff --git a/x-pack/legacy/plugins/canvas/__tests__/helpers/function_wrapper.js b/x-pack/plugins/canvas/__tests__/helpers/function_wrapper.js similarity index 100% rename from x-pack/legacy/plugins/canvas/__tests__/helpers/function_wrapper.js rename to x-pack/plugins/canvas/__tests__/helpers/function_wrapper.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/area_chart/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/area_chart/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/area_chart/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/area_chart/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/bubble_chart/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/bubble_chart/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/bubble_chart/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/bubble_chart/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/debug/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/debug/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/debug/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/debug/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/dropdown_filter/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/dropdown_filter/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/dropdown_filter/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/dropdown_filter/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/filter_debug/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/filter_debug/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/filter_debug/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/filter_debug/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/horizontal_bar_chart/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/horizontal_bar_chart/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/horizontal_bar_chart/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/horizontal_bar_chart/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/horizontal_progress_bar/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/horizontal_progress_bar/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/horizontal_progress_bar/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/horizontal_progress_bar/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/horizontal_progress_pill/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/horizontal_progress_pill/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/horizontal_progress_pill/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/horizontal_progress_pill/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/image/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/image/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/image/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/image/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/line_chart/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/line_chart/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/line_chart/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/line_chart/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/markdown/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/markdown/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/markdown/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/markdown/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/metric/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/metric/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/metric/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/metric/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/pie/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/pie/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/pie/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/pie/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/plot/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/plot/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/plot/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/plot/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/progress_gauge/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/progress_gauge/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/progress_gauge/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/progress_gauge/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/progress_semicircle/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/progress_semicircle/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/progress_semicircle/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/progress_semicircle/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/progress_wheel/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/progress_wheel/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/progress_wheel/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/progress_wheel/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/repeat_image/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/repeat_image/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/repeat_image/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/repeat_image/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/reveal_image/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/reveal_image/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/reveal_image/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/reveal_image/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/shape/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/shape/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/shape/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/shape/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/table/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/table/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/table/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/table/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/time_filter/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/time_filter/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/time_filter/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/time_filter/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/vert_bar_chart/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/vert_bar_chart/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/vert_bar_chart/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/vert_bar_chart/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/vertical_progress_bar/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/vertical_progress_bar/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/vertical_progress_bar/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/vertical_progress_bar/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/vertical_progress_pill/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/elements/vertical_progress_pill/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/elements/vertical_progress_pill/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/elements/vertical_progress_pill/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts similarity index 84% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts rename to x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts index fbe7825c3b2c8..74de223b9fcb7 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ExpressionTypeDefinition } from '../../../../../../src/plugins/expressions'; -import { EmbeddableInput } from '../../../../../../src/plugins/embeddable/public'; +import { ExpressionTypeDefinition } from '../../../../../src/plugins/expressions'; +import { EmbeddableInput } from '../../../../../src/plugins/embeddable/public'; import { EmbeddableTypes } from './embeddable_types'; export const EmbeddableExpressionType = 'embeddable'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts similarity index 58% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts rename to x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts index 592da1ff039a1..85629936d9ad3 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/embeddable_types.ts @@ -3,11 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ - -import { MAP_SAVED_OBJECT_TYPE } from '../../../../../plugins/maps/public'; -import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../src/plugins/visualizations/public'; -import { LENS_EMBEDDABLE_TYPE } from '../../../../../plugins/lens/common/constants'; -import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../src/plugins/discover/public'; +import { MAP_SAVED_OBJECT_TYPE } from '../../../../plugins/maps/public'; +import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../src/plugins/visualizations/public'; +import { LENS_EMBEDDABLE_TYPE } from '../../../../plugins/lens/common/constants'; +import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../src/plugins/discover/public'; export const EmbeddableTypes: { lens: string; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/expression_types/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/expression_types/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/expression_types/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/browser/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/location.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/location.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/location.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/browser/location.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/markdown.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/markdown.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/markdown.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/browser/markdown.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/markdown.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/markdown.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/markdown.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/browser/markdown.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/urlparam.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/urlparam.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/browser/urlparam.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/browser/urlparam.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/compare.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/compare.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/compare.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/compare.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_filters.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_filters.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_filters.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_filters.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_pointseries.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_pointseries.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_pointseries.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_pointseries.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_styles.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_styles.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_styles.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_styles.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_tables.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_tables.ts similarity index 87% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_tables.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_tables.ts index 1f13157a360f3..b5e5836dc5331 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_tables.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/fixtures/test_tables.ts @@ -39,63 +39,63 @@ const testTable: Datatable = { rows: [ { name: 'product1', - time: 1517842800950, //05 Feb 2018 15:00:00 GMT + time: 1517842800950, // 05 Feb 2018 15:00:00 GMT price: 605, quantity: 100, in_stock: true, }, { name: 'product1', - time: 1517929200950, //06 Feb 2018 15:00:00 GMT + time: 1517929200950, // 06 Feb 2018 15:00:00 GMT price: 583, quantity: 200, in_stock: true, }, { name: 'product1', - time: 1518015600950, //07 Feb 2018 15:00:00 GMT + time: 1518015600950, // 07 Feb 2018 15:00:00 GMT price: 420, quantity: 300, in_stock: true, }, { name: 'product2', - time: 1517842800950, //05 Feb 2018 15:00:00 GMT + time: 1517842800950, // 05 Feb 2018 15:00:00 GMT price: 216, quantity: 350, in_stock: false, }, { name: 'product2', - time: 1517929200950, //06 Feb 2018 15:00:00 GMT + time: 1517929200950, // 06 Feb 2018 15:00:00 GMT price: 200, quantity: 256, in_stock: false, }, { name: 'product2', - time: 1518015600950, //07 Feb 2018 15:00:00 GMT + time: 1518015600950, // 07 Feb 2018 15:00:00 GMT price: 190, quantity: 231, in_stock: false, }, { name: 'product3', - time: 1517842800950, //05 Feb 2018 15:00:00 GMT + time: 1517842800950, // 05 Feb 2018 15:00:00 GMT price: 67, quantity: 240, in_stock: true, }, { name: 'product4', - time: 1517842800950, //05 Feb 2018 15:00:00 GMT + time: 1517842800950, // 05 Feb 2018 15:00:00 GMT price: 311, quantity: 447, in_stock: false, }, { name: 'product5', - time: 1517842800950, //05 Feb 2018 15:00:00 GMT + time: 1517842800950, // 05 Feb 2018 15:00:00 GMT price: 288, quantity: 384, in_stock: true, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/image.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/image.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/image.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/image.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/progress.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/progress.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/progress.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/__tests__/progress.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/all.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/all.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/all.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/all.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/all.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/all.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/all.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/all.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/any.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/any.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/any.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/any.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/any.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/any.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/any.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/any.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/as.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/as.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/as.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/as.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/as.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/as.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/as.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/as.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/axisConfig.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/axisConfig.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/axisConfig.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/axisConfig.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/axis_config.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/axis_config.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/axis_config.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/axis_config.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/case.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/case.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/case.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/case.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/case.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/case.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/case.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/case.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/clear.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/clear.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/clear.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/clear.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/clear.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/clear.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/clear.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/clear.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/columns.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/columns.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/columns.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/columns.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/columns.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/columns.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/columns.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/columns.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/compare.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/compare.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/compare.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/compare.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/container_style.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/container_style.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/container_style.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/container_style.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/context.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/context.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/context.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/context.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/context.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/context.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/context.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/context.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/csv.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/csv.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/csv.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/csv.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/csv.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/csv.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/csv.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/csv.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/date.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/date.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/date.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/date.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/date.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/date.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/date.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/date.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/do.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/do.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/do.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/do.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/do.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/do.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/do.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/do.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/dropdownControl.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/dropdownControl.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/dropdownControl.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/dropdownControl.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/dropdown_control.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/dropdown_control.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/dropdown_control.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/dropdown_control.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/eq.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/eq.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/eq.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/eq.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/eq.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/eq.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/eq.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/eq.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/exactly.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/exactly.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/exactly.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/exactly.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/exactly.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/exactly.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/exactly.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/exactly.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/filterrows.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/filterrows.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/filterrows.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/filterrows.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/filterrows.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/filterrows.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/filterrows.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/filterrows.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/formatdate.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/formatdate.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/formatdate.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/formatdate.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/formatdate.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/formatdate.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/formatdate.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/formatdate.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/formatnumber.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/formatnumber.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/formatnumber.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/formatnumber.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/formatnumber.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/formatnumber.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/formatnumber.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/formatnumber.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/getCell.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/getCell.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/getCell.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/getCell.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/getCell.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/getCell.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/getCell.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/getCell.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/get_flot_axis_config.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/get_flot_axis_config.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/get_flot_axis_config.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/get_flot_axis_config.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/get_font_spec.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/get_font_spec.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/get_font_spec.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/get_font_spec.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/get_tick_hash.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/get_tick_hash.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/get_tick_hash.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/get_tick_hash.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/gt.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/gt.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/gt.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/gt.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/gt.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/gt.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/gt.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/gt.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/gte.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/gte.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/gte.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/gte.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/gte.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/gte.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/gte.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/gte.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/head.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/head.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/head.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/head.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/head.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/head.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/head.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/head.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/if.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/if.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/if.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/if.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/if.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/if.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/if.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/if.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/image.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/image.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/image.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/image.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/join_rows.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/join_rows.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/join_rows.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/join_rows.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lt.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/lt.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lt.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/lt.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lt.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/lt.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lt.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/lt.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lte.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/lte.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lte.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/lte.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lte.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/lte.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lte.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/lte.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/mapColumn.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/mapColumn.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/mapColumn.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/mapColumn.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/mapColumn.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/mapColumn.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/mapColumn.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/mapColumn.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/map_center.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/map_center.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/map_center.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/map_center.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/math.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/math.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/math.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/math.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/math.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/math.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/math.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/math.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/metric.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/metric.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/metric.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/metric.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/metric.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/metric.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/metric.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/metric.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/neq.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/neq.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/neq.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/neq.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/neq.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/neq.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/neq.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/neq.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/palette.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/palette.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/palette.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/palette.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/palette.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/palette.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/palette.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/palette.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/pie.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/pie.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/pie.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/pie.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/pie.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/pie.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/pie.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/pie.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts similarity index 98% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts index bdb3c0e8c1b2e..660605c4c54c1 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_flot_axis_config.ts @@ -6,7 +6,7 @@ import { get, map } from 'lodash'; import { Ticks, AxisConfig, isAxisConfig } from '../../../../types'; -import { Style, PointSeriesColumns } from '../../../../../../../../src/plugins/expressions/common'; +import { Style, PointSeriesColumns } from '../../../../../../../src/plugins/expressions/common'; type Position = 'bottom' | 'top' | 'left' | 'right'; interface Config { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/get_font_spec.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_font_spec.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/get_font_spec.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_font_spec.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/get_tick_hash.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_tick_hash.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/get_tick_hash.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/get_tick_hash.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/series_style_to_flot.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/series_style_to_flot.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/series_style_to_flot.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/plot/series_style_to_flot.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/ply.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/ply.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/ply.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/ply.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/ply.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/ply.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/ply.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/ply.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/progress.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/progress.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/progress.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/progress.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/render.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/render.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/render.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/render.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/render.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/render.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/render.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/render.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/repeatImage.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/repeatImage.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/repeatImage.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/repeatImage.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/repeat_image.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/repeat_image.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/repeat_image.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/repeat_image.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/replace.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/replace.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/replace.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/replace.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/replace.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/replace.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/replace.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/replace.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/revealImage.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/revealImage.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/revealImage.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/revealImage.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/reveal_image.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/reveal_image.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/reveal_image.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/reveal_image.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/rounddate.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/rounddate.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/rounddate.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/rounddate.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/rounddate.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/rounddate.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/rounddate.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/rounddate.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/rowCount.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/rowCount.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/rowCount.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/rowCount.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/rowCount.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/rowCount.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/rowCount.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/rowCount.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_lens.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_lens.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_lens.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_lens.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_lens.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_lens.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_lens.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_lens.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_map.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_map.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts similarity index 97% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts index df316d0dd182f..dacdc30e0c6f7 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_map.ts @@ -13,7 +13,7 @@ import { EmbeddableExpression, } from '../../expression_types'; import { getFunctionHelp } from '../../../i18n'; -import { MapEmbeddableInput } from '../../../../../plugins/maps/public'; +import { MapEmbeddableInput } from '../../../../../legacy/plugins/maps/public'; interface Arguments { id: string; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_search.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_search.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_search.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_search.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_search.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_search.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_search.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_search.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/saved_visualization.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/seriesStyle.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/seriesStyle.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/seriesStyle.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/seriesStyle.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/series_style.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/series_style.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/series_style.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/series_style.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/series_style_to_flot.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/series_style_to_flot.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/series_style_to_flot.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/series_style_to_flot.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/shape.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/shape.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/shape.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/shape.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/sort.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/sort.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/sort.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/sort.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/sort.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/sort.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/sort.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/sort.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/staticColumn.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/staticColumn.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/staticColumn.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/staticColumn.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/staticColumn.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/staticColumn.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/staticColumn.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/staticColumn.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/string.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/string.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/string.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/string.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/string.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/string.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/string.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/string.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/switch.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/switch.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/switch.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/switch.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/switch.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/switch.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/switch.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/switch.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/table.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/table.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/table.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/table.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/table.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/table.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/table.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/table.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/tail.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/tail.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/tail.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/tail.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/tail.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/tail.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/tail.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/tail.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/time_range.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/time_range.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/time_range.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/time_range.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilterControl.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilterControl.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilterControl.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilterControl.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter_control.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter_control.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter_control.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/common/timefilter_control.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/ci.json b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/ci.json similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/ci.json rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/ci.json diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/demo_rows_types.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/demo_rows_types.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/demo_rows_types.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/demo_rows_types.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/get_demo_rows.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/get_demo_rows.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/get_demo_rows.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/get_demo_rows.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/shirts.json b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/shirts.json similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/shirts.json rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/shirts.json diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/escount.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/escount.ts similarity index 94% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/escount.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/escount.ts index 2ab48fe002979..142331aabf351 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/escount.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/escount.ts @@ -10,7 +10,7 @@ import { } from 'src/plugins/expressions/common'; /* eslint-disable */ // @ts-ignore untyped local -import { buildESRequest } from '../../../../../../plugins/canvas/server/lib/build_es_request'; +import { buildESRequest } from '../../../server/lib/build_es_request'; /* eslint-enable */ import { getFunctionHelp } from '../../../i18n'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts similarity index 96% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts index 180afc89322c3..1eb0a7c74780c 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts @@ -8,7 +8,7 @@ import squel from 'squel'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions'; /* eslint-disable */ // @ts-ignore untyped local -import { queryEsSQL } from '../../../../../../plugins/canvas/server/lib/query_es_sql'; +import { queryEsSQL } from '../../../server/lib/query_es_sql'; /* eslint-enable */ import { ExpressionValueFilter } from '../../../types'; import { getFunctionHelp } from '../../../i18n'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/essql.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/essql.ts similarity index 94% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/essql.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/essql.ts index 7c9cb92ad009c..c64398d4b3a18 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/essql.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/essql.ts @@ -7,7 +7,7 @@ import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; /* eslint-disable */ // @ts-ignore untyped local -import { queryEsSQL } from '../../../../../../plugins/canvas/server/lib/query_es_sql'; +import { queryEsSQL } from '../../../server/lib/query_es_sql'; /* eslint-enable */ import { ExpressionValueFilter } from '../../../types'; import { getFunctionHelp } from '../../../i18n'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/get_expression_type.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/get_expression_type.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/get_expression_type.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/get_expression_type.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/get_field_names.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/get_field_names.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/get_field_names.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/get_field_names.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/is_column_reference.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/is_column_reference.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/is_column_reference.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/is_column_reference.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries.test.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries.test.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries.test.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/get_expression_type.js b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/get_expression_type.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/get_expression_type.js rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/get_expression_type.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/get_field_names.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/get_field_names.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/get_field_names.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/get_field_names.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/is_column_reference.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/is_column_reference.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/is_column_reference.ts rename to x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/lib/is_column_reference.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/elastic_logo.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/elastic_logo.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/elastic_logo.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/elastic_logo.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/elastic_outline.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/elastic_outline.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/elastic_outline.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/elastic_outline.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/API.md b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/API.md similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/API.md rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/API.md diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/index.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.colorhelpers.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.colorhelpers.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.colorhelpers.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.colorhelpers.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.canvas.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.canvas.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.canvas.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.canvas.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.categories.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.categories.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.categories.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.categories.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.crosshair.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.crosshair.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.crosshair.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.crosshair.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.errorbars.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.errorbars.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.errorbars.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.errorbars.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.fillbetween.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.fillbetween.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.fillbetween.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.fillbetween.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.image.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.image.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.image.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.image.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.navigate.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.navigate.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.navigate.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.navigate.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.resize.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.resize.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.resize.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.resize.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.selection.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.selection.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.selection.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.selection.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.stack.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.stack.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.stack.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.stack.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.symbol.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.symbol.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.symbol.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.symbol.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.threshold.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.threshold.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.threshold.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.threshold.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.time.js b/x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.time.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.time.js rename to x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/jquery.flot.time.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/plugin.ts b/x-pack/plugins/canvas/canvas_plugin_src/plugin.ts similarity index 90% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/plugin.ts rename to x-pack/plugins/canvas/canvas_plugin_src/plugin.ts index 4452e5e9e31fe..c9ce4d065968a 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/plugin.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/plugin.ts @@ -6,9 +6,9 @@ import { CoreSetup, CoreStart, Plugin } from 'src/core/public'; import { CanvasSetup } from '../public'; -import { EmbeddableStart } from '../../../../../src/plugins/embeddable/public'; -import { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; -import { Start as InspectorStart } from '../../../../../src/plugins/inspector/public'; +import { EmbeddableStart } from '../../../../src/plugins/embeddable/public'; +import { UiActionsStart } from '../../../../src/plugins/ui_actions/public'; +import { Start as InspectorStart } from '../../../../src/plugins/inspector/public'; import { functions } from './functions/browser'; import { typeFunctions } from './expression_types'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/__examples__/__snapshots__/advanced_filter.examples.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/__examples__/__snapshots__/advanced_filter.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/__examples__/__snapshots__/advanced_filter.examples.storyshot rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/__examples__/__snapshots__/advanced_filter.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/__examples__/advanced_filter.examples.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/__examples__/advanced_filter.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/__examples__/advanced_filter.examples.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/__examples__/advanced_filter.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/advanced_filter.scss b/x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/advanced_filter.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/advanced_filter.scss rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/advanced_filter.scss diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/advanced_filter.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/advanced_filter.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/advanced_filter.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/advanced_filter.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/component/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/index.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/index.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/advanced_filter/index.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/debug.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/debug.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/debug.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/debug.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/__examples__/__snapshots__/dropdown_filter.examples.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/__examples__/__snapshots__/dropdown_filter.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/__examples__/__snapshots__/dropdown_filter.examples.storyshot rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/__examples__/__snapshots__/dropdown_filter.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/__examples__/dropdown_filter.examples.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/__examples__/dropdown_filter.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/__examples__/dropdown_filter.examples.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/__examples__/dropdown_filter.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/dropdown_filter.scss b/x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/dropdown_filter.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/dropdown_filter.scss rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/dropdown_filter.scss diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/dropdown_filter.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/dropdown_filter.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/dropdown_filter.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/dropdown_filter.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/component/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/index.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/index.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/index.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.scss b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.scss rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.scss diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx similarity index 94% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx index 1e8983a0ca5e5..0e0d5fd1953fe 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx @@ -6,17 +6,17 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { CoreStart } from '../../../../../../../src/core/public'; +import { CoreStart } from '../../../../../../src/core/public'; import { StartDeps } from '../../plugin'; import { IEmbeddable, EmbeddableFactory, EmbeddablePanel, EmbeddableFactoryNotFoundError, -} from '../../../../../../../src/plugins/embeddable/public'; +} from '../../../../../../src/plugins/embeddable/public'; import { EmbeddableExpression } from '../../expression_types/embeddable'; import { RendererStrings } from '../../../i18n'; -import { getSavedObjectFinder } from '../../../../../../../src/plugins/saved_objects/public'; +import { getSavedObjectFinder } from '../../../../../../src/plugins/saved_objects/public'; import { embeddableInputToExpression } from './embeddable_input_to_expression'; import { EmbeddableInput } from '../../expression_types'; import { RendererHandlers } from '../../../types'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable_input_to_expression.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable_input_to_expression.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable_input_to_expression.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable_input_to_expression.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable_input_to_expression.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable_input_to_expression.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable_input_to_expression.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable_input_to_expression.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/lens.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/lens.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/lens.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/lens.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/lens.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/lens.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/lens.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/lens.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts similarity index 96% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts index f9ff94ee7d8f1..e0e0aeaeea272 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.test.ts @@ -5,7 +5,7 @@ */ import { toExpression } from './map'; -import { MapEmbeddableInput } from '../../../../../maps/public'; +import { MapEmbeddableInput } from '../../../../../../legacy/plugins/maps/public'; import { fromExpression, Ast } from '@kbn/interpreter/common'; const baseSavedMapInput = { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts similarity index 92% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts index e0cb71c17774c..1f9bec133488c 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/map.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MapEmbeddableInput } from '../../../../../maps/public'; +import { MapEmbeddableInput } from '../../../../../../legacy/plugins/maps/public'; export function toExpression(input: MapEmbeddableInput): string { const expressionParts = [] as string[]; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/visualization.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/visualization.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/visualization.test.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/visualization.test.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/visualization.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/visualization.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/visualization.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/input_type_to_expression/visualization.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/error/error.scss b/x-pack/plugins/canvas/canvas_plugin_src/renderers/error/error.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/error/error.scss rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/error/error.scss diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/error/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/error/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/error/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/error/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/image.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/image.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/image.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/image.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js similarity index 92% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js index 126699534caad..a7b0f620cf710 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/markdown/index.js @@ -7,7 +7,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { RendererStrings } from '../../../i18n'; -import { Markdown } from '../../../../../../../src/plugins/kibana_react/public'; +import { Markdown } from '../../../../../../src/plugins/kibana_react/public'; const { markdown: strings } = RendererStrings; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/component/__examples__/__snapshots__/metric.stories.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/component/__examples__/__snapshots__/metric.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/component/__examples__/__snapshots__/metric.stories.storyshot rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/component/__examples__/__snapshots__/metric.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/component/__examples__/metric.stories.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/component/__examples__/metric.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/component/__examples__/metric.stories.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/component/__examples__/metric.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/component/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/component/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/component/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/component/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/component/metric.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/component/metric.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/component/metric.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/component/metric.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/index.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/metric/index.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/metric/index.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/pie/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/pie/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/pie/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/pie/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/pie/plugins/pie.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/pie/plugins/pie.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/pie/plugins/pie.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/pie/plugins/pie.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/plot/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/plot/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/plot/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/plot/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/plot/plot.scss b/x-pack/plugins/canvas/canvas_plugin_src/renderers/plot/plot.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/plot/plot.scss rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/plot/plot.scss diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/plot/plugins/size.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/plot/plugins/size.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/plot/plugins/size.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/plot/plugins/size.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/plot/plugins/text.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/plot/plugins/text.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/plot/plugins/text.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/plot/plugins/text.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/gauge.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/gauge.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/gauge.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/gauge.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/horizontal_bar.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/horizontal_bar.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/horizontal_bar.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/horizontal_bar.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/horizontal_pill.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/horizontal_pill.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/horizontal_pill.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/horizontal_pill.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/semicircle.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/semicircle.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/semicircle.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/semicircle.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/unicorn.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/unicorn.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/unicorn.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/unicorn.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/vertical_bar.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/vertical_bar.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/vertical_bar.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/vertical_bar.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/vertical_pill.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/vertical_pill.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/vertical_pill.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/vertical_pill.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/wheel.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/wheel.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/wheel.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/progress/shapes/wheel.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/repeat_image.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/repeat_image.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/repeat_image.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/repeat_image.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/reveal_image/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/reveal_image/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/reveal_image/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/reveal_image/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/reveal_image/reveal_image.scss b/x-pack/plugins/canvas/canvas_plugin_src/renderers/reveal_image/reveal_image.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/reveal_image/reveal_image.scss rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/reveal_image/reveal_image.scss diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/index.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/arrow.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/arrow.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/arrow.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/arrow.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/arrow_multi.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/arrow_multi.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/arrow_multi.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/arrow_multi.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/bookmark.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/bookmark.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/bookmark.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/bookmark.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/circle.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/circle.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/circle.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/circle.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/cross.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/cross.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/cross.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/cross.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/hexagon.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/hexagon.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/hexagon.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/hexagon.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/kite.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/kite.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/kite.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/kite.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/pentagon.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/pentagon.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/pentagon.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/pentagon.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/rhombus.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/rhombus.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/rhombus.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/rhombus.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/semicircle.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/semicircle.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/semicircle.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/semicircle.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/speech_bubble.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/speech_bubble.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/speech_bubble.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/speech_bubble.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/square.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/square.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/square.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/square.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/star.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/star.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/star.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/star.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/tag.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/tag.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/tag.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/tag.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/triangle.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/triangle.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/triangle.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/triangle.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/triangle_right.svg b/x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/triangle_right.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/triangle_right.svg rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/shape/shapes/triangle_right.svg diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/table.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/table.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/table.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/table.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/text.js b/x-pack/plugins/canvas/canvas_plugin_src/renderers/text.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/text.js rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/text.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/__snapshots__/time_filter.examples.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/__snapshots__/time_filter.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/__snapshots__/time_filter.examples.storyshot rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/__snapshots__/time_filter.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/__snapshots__/time_filter.stories.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/__snapshots__/time_filter.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/__snapshots__/time_filter.stories.storyshot rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/__snapshots__/time_filter.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/time_filter.stories.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/time_filter.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/time_filter.stories.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/__examples__/time_filter.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/index.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/index.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/index.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/time_filter.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/time_filter.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/time_filter.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/components/time_filter.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/index.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/index.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/index.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/time_filter.scss b/x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/time_filter.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/time_filter/time_filter.scss rename to x-pack/plugins/canvas/canvas_plugin_src/renderers/time_filter/time_filter.scss diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/templates/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/templates/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/pitch_presentation.json b/x-pack/plugins/canvas/canvas_plugin_src/templates/pitch_presentation.json similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/pitch_presentation.json rename to x-pack/plugins/canvas/canvas_plugin_src/templates/pitch_presentation.json diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/status_report.json b/x-pack/plugins/canvas/canvas_plugin_src/templates/status_report.json similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/status_report.json rename to x-pack/plugins/canvas/canvas_plugin_src/templates/status_report.json diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/summary_report.json b/x-pack/plugins/canvas/canvas_plugin_src/templates/summary_report.json similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/summary_report.json rename to x-pack/plugins/canvas/canvas_plugin_src/templates/summary_report.json diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/theme_dark.json b/x-pack/plugins/canvas/canvas_plugin_src/templates/theme_dark.json similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/theme_dark.json rename to x-pack/plugins/canvas/canvas_plugin_src/templates/theme_dark.json diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/theme_light.json b/x-pack/plugins/canvas/canvas_plugin_src/templates/theme_light.json similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/templates/theme_light.json rename to x-pack/plugins/canvas/canvas_plugin_src/templates/theme_light.json diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/__snapshots__/extended_template.stories.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/__snapshots__/extended_template.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/__snapshots__/extended_template.stories.storyshot rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/__snapshots__/extended_template.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/__snapshots__/simple_template.stories.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/__snapshots__/simple_template.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/__snapshots__/simple_template.stories.storyshot rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/__snapshots__/simple_template.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/extended_template.stories.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/extended_template.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/extended_template.stories.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/extended_template.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/simple_template.stories.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/simple_template.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/simple_template.stories.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/__examples__/simple_template.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/extended_template.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/extended_template.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/extended_template.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/extended_template.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/axis_config/simple_template.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/__tests__/get_form_object.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/__tests__/get_form_object.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/__tests__/get_form_object.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/__tests__/get_form_object.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/get_form_object.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/get_form_object.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/get_form_object.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/get_form_object.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/index.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/simple_math_function.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/simple_math_function.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/simple_math_function.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/datacolumn/simple_math_function.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/__examples__/__snapshots__/date_format.stories.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/__examples__/__snapshots__/date_format.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/__examples__/__snapshots__/date_format.stories.storyshot rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/__examples__/__snapshots__/date_format.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/__examples__/date_format.stories.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/__examples__/date_format.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/__examples__/date_format.stories.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/__examples__/date_format.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/date_format.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/date_format.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/date_format.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/date_format.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/date_format/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/filter_group.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/filter_group.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/filter_group.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/filter_group.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/file.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/file.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/file.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/file.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/index.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/link.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/link.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/link.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/forms/link.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/image_upload.scss b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/image_upload.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/image_upload.scss rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/image_upload.scss diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/index.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/image_upload/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/__examples__/__snapshots__/number_format.stories.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/__examples__/__snapshots__/number_format.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/__examples__/__snapshots__/number_format.stories.storyshot rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/__examples__/__snapshots__/number_format.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/__examples__/number_format.stories.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/__examples__/number_format.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/__examples__/number_format.stories.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/__examples__/number_format.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/number_format.tsx b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/number_format.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/number_format.tsx rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/number_format/number_format.tsx diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/palette.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/palette.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/palette.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/percentage.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/percentage.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/percentage.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/percentage.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/range.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/range.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/range.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/range.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/select.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/select.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/select.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/select.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/shape.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/shape.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/shape.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/shape.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/string.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/string.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/string.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/string.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/textarea.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/textarea.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/textarea.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/textarea.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/toggle.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/toggle.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/arguments/toggle.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/arguments/toggle.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/demodata.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/esdocs.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/index.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/models/index.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/models/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/models/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/models/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/models/math.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/models/math.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/models/math.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/models/math.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/models/point_series.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/models/point_series.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/models/point_series.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/models/point_series.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/tags/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/tags/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/tags/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/tags/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/tags/presentation.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/tags/presentation.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/tags/presentation.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/tags/presentation.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/tags/report.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/tags/report.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/tags/report.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/tags/report.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/formatdate.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/formatdate.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/formatdate.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/formatdate.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/formatnumber.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/formatnumber.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/formatnumber.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/formatnumber.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/index.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/index.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/index.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/rounddate.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/rounddate.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/rounddate.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/rounddate.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/sort.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/sort.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/transforms/sort.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/transforms/sort.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/dropdownControl.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/dropdownControl.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/dropdownControl.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/dropdownControl.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/getCell.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/getCell.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/getCell.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/getCell.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/image.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/image.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/image.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/image.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/index.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/index.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/index.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/markdown.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/markdown.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/markdown.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/markdown.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/metric.ts b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/metric.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/metric.ts rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/metric.ts diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/pie.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/pie.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/pie.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/pie.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/plot.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/plot.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/plot.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/plot.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/progress.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/progress.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/progress.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/progress.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/render.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/render.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/render.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/render.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/repeatImage.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/repeatImage.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/repeatImage.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/repeatImage.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/revealImage.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/revealImage.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/revealImage.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/revealImage.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/shape.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/shape.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/shape.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/shape.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/table.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/table.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/table.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/table.js diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/timefilterControl.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/views/timefilterControl.js similarity index 100% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/uis/views/timefilterControl.js rename to x-pack/plugins/canvas/canvas_plugin_src/uis/views/timefilterControl.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/autocomplete.test.ts b/x-pack/plugins/canvas/common/lib/autocomplete.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/autocomplete.test.ts rename to x-pack/plugins/canvas/common/lib/autocomplete.test.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/autocomplete.ts b/x-pack/plugins/canvas/common/lib/autocomplete.ts similarity index 99% rename from x-pack/legacy/plugins/canvas/common/lib/autocomplete.ts rename to x-pack/plugins/canvas/common/lib/autocomplete.ts index 50341c977d6d9..5ee4d2104a0f7 100644 --- a/x-pack/legacy/plugins/canvas/common/lib/autocomplete.ts +++ b/x-pack/plugins/canvas/common/lib/autocomplete.ts @@ -14,7 +14,7 @@ import { ExpressionFunction, ExpressionFunctionParameter, getByAlias, -} from '../../../../../../src/plugins/expressions'; +} from '../../../../../src/plugins/expressions'; const MARKER = 'CANVAS_SUGGESTION_MARKER'; diff --git a/x-pack/legacy/plugins/canvas/common/lib/constants.ts b/x-pack/plugins/canvas/common/lib/constants.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/constants.ts rename to x-pack/plugins/canvas/common/lib/constants.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/datatable/index.js b/x-pack/plugins/canvas/common/lib/datatable/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/datatable/index.js rename to x-pack/plugins/canvas/common/lib/datatable/index.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/datatable/query.js b/x-pack/plugins/canvas/common/lib/datatable/query.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/datatable/query.js rename to x-pack/plugins/canvas/common/lib/datatable/query.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/dataurl.test.ts b/x-pack/plugins/canvas/common/lib/dataurl.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/dataurl.test.ts rename to x-pack/plugins/canvas/common/lib/dataurl.test.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/dataurl.ts b/x-pack/plugins/canvas/common/lib/dataurl.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/dataurl.ts rename to x-pack/plugins/canvas/common/lib/dataurl.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/errors.js b/x-pack/plugins/canvas/common/lib/errors.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/errors.js rename to x-pack/plugins/canvas/common/lib/errors.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/errors.test.js b/x-pack/plugins/canvas/common/lib/errors.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/errors.test.js rename to x-pack/plugins/canvas/common/lib/errors.test.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/expression_form_handlers.js b/x-pack/plugins/canvas/common/lib/expression_form_handlers.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/expression_form_handlers.js rename to x-pack/plugins/canvas/common/lib/expression_form_handlers.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/expression_form_handlers.test.js b/x-pack/plugins/canvas/common/lib/expression_form_handlers.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/expression_form_handlers.test.js rename to x-pack/plugins/canvas/common/lib/expression_form_handlers.test.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/fetch.test.ts b/x-pack/plugins/canvas/common/lib/fetch.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/fetch.test.ts rename to x-pack/plugins/canvas/common/lib/fetch.test.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/fetch.ts b/x-pack/plugins/canvas/common/lib/fetch.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/fetch.ts rename to x-pack/plugins/canvas/common/lib/fetch.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/fonts.ts b/x-pack/plugins/canvas/common/lib/fonts.ts similarity index 77% rename from x-pack/legacy/plugins/canvas/common/lib/fonts.ts rename to x-pack/plugins/canvas/common/lib/fonts.ts index 14cc403af86ac..e0d39f65f01c2 100644 --- a/x-pack/legacy/plugins/canvas/common/lib/fonts.ts +++ b/x-pack/plugins/canvas/common/lib/fonts.ts @@ -4,4 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export * from '../../../../../../src/plugins/expressions/common/fonts'; +export * from '../../../../../src/plugins/expressions/common/fonts'; diff --git a/x-pack/legacy/plugins/canvas/common/lib/get_colors_from_palette.js b/x-pack/plugins/canvas/common/lib/get_colors_from_palette.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/get_colors_from_palette.js rename to x-pack/plugins/canvas/common/lib/get_colors_from_palette.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/get_colors_from_palette.test.js b/x-pack/plugins/canvas/common/lib/get_colors_from_palette.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/get_colors_from_palette.test.js rename to x-pack/plugins/canvas/common/lib/get_colors_from_palette.test.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/get_field_type.test.ts b/x-pack/plugins/canvas/common/lib/get_field_type.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/get_field_type.test.ts rename to x-pack/plugins/canvas/common/lib/get_field_type.test.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/get_field_type.ts b/x-pack/plugins/canvas/common/lib/get_field_type.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/get_field_type.ts rename to x-pack/plugins/canvas/common/lib/get_field_type.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/get_id.ts b/x-pack/plugins/canvas/common/lib/get_id.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/get_id.ts rename to x-pack/plugins/canvas/common/lib/get_id.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/get_legend_config.js b/x-pack/plugins/canvas/common/lib/get_legend_config.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/get_legend_config.js rename to x-pack/plugins/canvas/common/lib/get_legend_config.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/get_legend_config.test.js b/x-pack/plugins/canvas/common/lib/get_legend_config.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/get_legend_config.test.js rename to x-pack/plugins/canvas/common/lib/get_legend_config.test.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/handlebars.js b/x-pack/plugins/canvas/common/lib/handlebars.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/handlebars.js rename to x-pack/plugins/canvas/common/lib/handlebars.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/handlebars.test.js b/x-pack/plugins/canvas/common/lib/handlebars.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/handlebars.test.js rename to x-pack/plugins/canvas/common/lib/handlebars.test.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/hex_to_rgb.test.ts b/x-pack/plugins/canvas/common/lib/hex_to_rgb.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/hex_to_rgb.test.ts rename to x-pack/plugins/canvas/common/lib/hex_to_rgb.test.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/hex_to_rgb.ts b/x-pack/plugins/canvas/common/lib/hex_to_rgb.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/hex_to_rgb.ts rename to x-pack/plugins/canvas/common/lib/hex_to_rgb.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/httpurl.test.ts b/x-pack/plugins/canvas/common/lib/httpurl.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/httpurl.test.ts rename to x-pack/plugins/canvas/common/lib/httpurl.test.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/httpurl.ts b/x-pack/plugins/canvas/common/lib/httpurl.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/httpurl.ts rename to x-pack/plugins/canvas/common/lib/httpurl.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/index.ts b/x-pack/plugins/canvas/common/lib/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/index.ts rename to x-pack/plugins/canvas/common/lib/index.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/missing_asset.js b/x-pack/plugins/canvas/common/lib/missing_asset.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/missing_asset.js rename to x-pack/plugins/canvas/common/lib/missing_asset.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/palettes.js b/x-pack/plugins/canvas/common/lib/palettes.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/palettes.js rename to x-pack/plugins/canvas/common/lib/palettes.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/pivot_object_array.test.ts b/x-pack/plugins/canvas/common/lib/pivot_object_array.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/pivot_object_array.test.ts rename to x-pack/plugins/canvas/common/lib/pivot_object_array.test.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/pivot_object_array.ts b/x-pack/plugins/canvas/common/lib/pivot_object_array.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/pivot_object_array.ts rename to x-pack/plugins/canvas/common/lib/pivot_object_array.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/resolve_dataurl.js b/x-pack/plugins/canvas/common/lib/resolve_dataurl.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/resolve_dataurl.js rename to x-pack/plugins/canvas/common/lib/resolve_dataurl.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/resolve_dataurl.test.js b/x-pack/plugins/canvas/common/lib/resolve_dataurl.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/resolve_dataurl.test.js rename to x-pack/plugins/canvas/common/lib/resolve_dataurl.test.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/time_units.ts b/x-pack/plugins/canvas/common/lib/time_units.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/time_units.ts rename to x-pack/plugins/canvas/common/lib/time_units.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/unquote_string.test.ts b/x-pack/plugins/canvas/common/lib/unquote_string.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/unquote_string.test.ts rename to x-pack/plugins/canvas/common/lib/unquote_string.test.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/unquote_string.ts b/x-pack/plugins/canvas/common/lib/unquote_string.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/unquote_string.ts rename to x-pack/plugins/canvas/common/lib/unquote_string.ts diff --git a/x-pack/legacy/plugins/canvas/common/lib/url.js b/x-pack/plugins/canvas/common/lib/url.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/url.js rename to x-pack/plugins/canvas/common/lib/url.js diff --git a/x-pack/legacy/plugins/canvas/common/lib/url.test.js b/x-pack/plugins/canvas/common/lib/url.test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/common/lib/url.test.js rename to x-pack/plugins/canvas/common/lib/url.test.js diff --git a/x-pack/legacy/plugins/canvas/i18n/README.md b/x-pack/plugins/canvas/i18n/README.md similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/README.md rename to x-pack/plugins/canvas/i18n/README.md diff --git a/x-pack/legacy/plugins/canvas/i18n/capabilities.ts b/x-pack/plugins/canvas/i18n/capabilities.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/capabilities.ts rename to x-pack/plugins/canvas/i18n/capabilities.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/components.ts b/x-pack/plugins/canvas/i18n/components.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/components.ts rename to x-pack/plugins/canvas/i18n/components.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/constants.ts b/x-pack/plugins/canvas/i18n/constants.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/constants.ts rename to x-pack/plugins/canvas/i18n/constants.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/elements/apply_strings.ts b/x-pack/plugins/canvas/i18n/elements/apply_strings.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/elements/apply_strings.ts rename to x-pack/plugins/canvas/i18n/elements/apply_strings.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/elements/element_strings.test.ts b/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts similarity index 95% rename from x-pack/legacy/plugins/canvas/i18n/elements/element_strings.test.ts rename to x-pack/plugins/canvas/i18n/elements/element_strings.test.ts index c28229bdab33f..1eff73c1525b1 100644 --- a/x-pack/legacy/plugins/canvas/i18n/elements/element_strings.test.ts +++ b/x-pack/plugins/canvas/i18n/elements/element_strings.test.ts @@ -5,7 +5,7 @@ */ import { getElementStrings } from './element_strings'; import { initializeElements } from '../../canvas_plugin_src/elements'; -import { coreMock } from '../../../../../../src/core/public/mocks'; +import { coreMock } from '../../../../../src/core/public/mocks'; const elementSpecs = initializeElements(coreMock.createSetup() as any, {} as any); diff --git a/x-pack/legacy/plugins/canvas/i18n/elements/element_strings.ts b/x-pack/plugins/canvas/i18n/elements/element_strings.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/elements/element_strings.ts rename to x-pack/plugins/canvas/i18n/elements/element_strings.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/elements/index.ts b/x-pack/plugins/canvas/i18n/elements/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/elements/index.ts rename to x-pack/plugins/canvas/i18n/elements/index.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/errors.ts b/x-pack/plugins/canvas/i18n/errors.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/errors.ts rename to x-pack/plugins/canvas/i18n/errors.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/expression_types.ts b/x-pack/plugins/canvas/i18n/expression_types.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/expression_types.ts rename to x-pack/plugins/canvas/i18n/expression_types.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/all.ts b/x-pack/plugins/canvas/i18n/functions/dict/all.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/all.ts rename to x-pack/plugins/canvas/i18n/functions/dict/all.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/alter_column.ts b/x-pack/plugins/canvas/i18n/functions/dict/alter_column.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/alter_column.ts rename to x-pack/plugins/canvas/i18n/functions/dict/alter_column.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/any.ts b/x-pack/plugins/canvas/i18n/functions/dict/any.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/any.ts rename to x-pack/plugins/canvas/i18n/functions/dict/any.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/as.ts b/x-pack/plugins/canvas/i18n/functions/dict/as.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/as.ts rename to x-pack/plugins/canvas/i18n/functions/dict/as.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/asset.ts b/x-pack/plugins/canvas/i18n/functions/dict/asset.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/asset.ts rename to x-pack/plugins/canvas/i18n/functions/dict/asset.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/axis_config.ts b/x-pack/plugins/canvas/i18n/functions/dict/axis_config.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/axis_config.ts rename to x-pack/plugins/canvas/i18n/functions/dict/axis_config.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/case.ts b/x-pack/plugins/canvas/i18n/functions/dict/case.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/case.ts rename to x-pack/plugins/canvas/i18n/functions/dict/case.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/clear.ts b/x-pack/plugins/canvas/i18n/functions/dict/clear.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/clear.ts rename to x-pack/plugins/canvas/i18n/functions/dict/clear.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/columns.ts b/x-pack/plugins/canvas/i18n/functions/dict/columns.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/columns.ts rename to x-pack/plugins/canvas/i18n/functions/dict/columns.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/compare.ts b/x-pack/plugins/canvas/i18n/functions/dict/compare.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/compare.ts rename to x-pack/plugins/canvas/i18n/functions/dict/compare.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/container_style.ts b/x-pack/plugins/canvas/i18n/functions/dict/container_style.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/container_style.ts rename to x-pack/plugins/canvas/i18n/functions/dict/container_style.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/context.ts b/x-pack/plugins/canvas/i18n/functions/dict/context.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/context.ts rename to x-pack/plugins/canvas/i18n/functions/dict/context.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/csv.ts b/x-pack/plugins/canvas/i18n/functions/dict/csv.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/csv.ts rename to x-pack/plugins/canvas/i18n/functions/dict/csv.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/date.ts b/x-pack/plugins/canvas/i18n/functions/dict/date.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/date.ts rename to x-pack/plugins/canvas/i18n/functions/dict/date.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/demodata.ts b/x-pack/plugins/canvas/i18n/functions/dict/demodata.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/demodata.ts rename to x-pack/plugins/canvas/i18n/functions/dict/demodata.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/do.ts b/x-pack/plugins/canvas/i18n/functions/dict/do.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/do.ts rename to x-pack/plugins/canvas/i18n/functions/dict/do.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/dropdown_control.ts b/x-pack/plugins/canvas/i18n/functions/dict/dropdown_control.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/dropdown_control.ts rename to x-pack/plugins/canvas/i18n/functions/dict/dropdown_control.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/eq.ts b/x-pack/plugins/canvas/i18n/functions/dict/eq.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/eq.ts rename to x-pack/plugins/canvas/i18n/functions/dict/eq.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/escount.ts b/x-pack/plugins/canvas/i18n/functions/dict/escount.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/escount.ts rename to x-pack/plugins/canvas/i18n/functions/dict/escount.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/esdocs.ts b/x-pack/plugins/canvas/i18n/functions/dict/esdocs.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/esdocs.ts rename to x-pack/plugins/canvas/i18n/functions/dict/esdocs.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/essql.ts b/x-pack/plugins/canvas/i18n/functions/dict/essql.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/essql.ts rename to x-pack/plugins/canvas/i18n/functions/dict/essql.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/exactly.ts b/x-pack/plugins/canvas/i18n/functions/dict/exactly.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/exactly.ts rename to x-pack/plugins/canvas/i18n/functions/dict/exactly.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/filterrows.ts b/x-pack/plugins/canvas/i18n/functions/dict/filterrows.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/filterrows.ts rename to x-pack/plugins/canvas/i18n/functions/dict/filterrows.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/filters.ts b/x-pack/plugins/canvas/i18n/functions/dict/filters.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/filters.ts rename to x-pack/plugins/canvas/i18n/functions/dict/filters.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/formatdate.ts b/x-pack/plugins/canvas/i18n/functions/dict/formatdate.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/formatdate.ts rename to x-pack/plugins/canvas/i18n/functions/dict/formatdate.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/formatnumber.ts b/x-pack/plugins/canvas/i18n/functions/dict/formatnumber.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/formatnumber.ts rename to x-pack/plugins/canvas/i18n/functions/dict/formatnumber.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/get_cell.ts b/x-pack/plugins/canvas/i18n/functions/dict/get_cell.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/get_cell.ts rename to x-pack/plugins/canvas/i18n/functions/dict/get_cell.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/gt.ts b/x-pack/plugins/canvas/i18n/functions/dict/gt.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/gt.ts rename to x-pack/plugins/canvas/i18n/functions/dict/gt.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/gte.ts b/x-pack/plugins/canvas/i18n/functions/dict/gte.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/gte.ts rename to x-pack/plugins/canvas/i18n/functions/dict/gte.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/head.ts b/x-pack/plugins/canvas/i18n/functions/dict/head.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/head.ts rename to x-pack/plugins/canvas/i18n/functions/dict/head.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/if.ts b/x-pack/plugins/canvas/i18n/functions/dict/if.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/if.ts rename to x-pack/plugins/canvas/i18n/functions/dict/if.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/image.ts b/x-pack/plugins/canvas/i18n/functions/dict/image.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/image.ts rename to x-pack/plugins/canvas/i18n/functions/dict/image.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/join_rows.ts b/x-pack/plugins/canvas/i18n/functions/dict/join_rows.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/join_rows.ts rename to x-pack/plugins/canvas/i18n/functions/dict/join_rows.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/location.ts b/x-pack/plugins/canvas/i18n/functions/dict/location.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/location.ts rename to x-pack/plugins/canvas/i18n/functions/dict/location.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/lt.ts b/x-pack/plugins/canvas/i18n/functions/dict/lt.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/lt.ts rename to x-pack/plugins/canvas/i18n/functions/dict/lt.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/lte.ts b/x-pack/plugins/canvas/i18n/functions/dict/lte.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/lte.ts rename to x-pack/plugins/canvas/i18n/functions/dict/lte.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/map_center.ts b/x-pack/plugins/canvas/i18n/functions/dict/map_center.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/map_center.ts rename to x-pack/plugins/canvas/i18n/functions/dict/map_center.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/map_column.ts b/x-pack/plugins/canvas/i18n/functions/dict/map_column.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/map_column.ts rename to x-pack/plugins/canvas/i18n/functions/dict/map_column.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/markdown.ts b/x-pack/plugins/canvas/i18n/functions/dict/markdown.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/markdown.ts rename to x-pack/plugins/canvas/i18n/functions/dict/markdown.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/math.ts b/x-pack/plugins/canvas/i18n/functions/dict/math.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/math.ts rename to x-pack/plugins/canvas/i18n/functions/dict/math.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/metric.ts b/x-pack/plugins/canvas/i18n/functions/dict/metric.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/metric.ts rename to x-pack/plugins/canvas/i18n/functions/dict/metric.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/neq.ts b/x-pack/plugins/canvas/i18n/functions/dict/neq.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/neq.ts rename to x-pack/plugins/canvas/i18n/functions/dict/neq.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/palette.ts b/x-pack/plugins/canvas/i18n/functions/dict/palette.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/palette.ts rename to x-pack/plugins/canvas/i18n/functions/dict/palette.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/pie.ts b/x-pack/plugins/canvas/i18n/functions/dict/pie.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/pie.ts rename to x-pack/plugins/canvas/i18n/functions/dict/pie.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/plot.ts b/x-pack/plugins/canvas/i18n/functions/dict/plot.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/plot.ts rename to x-pack/plugins/canvas/i18n/functions/dict/plot.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/ply.ts b/x-pack/plugins/canvas/i18n/functions/dict/ply.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/ply.ts rename to x-pack/plugins/canvas/i18n/functions/dict/ply.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/pointseries.ts b/x-pack/plugins/canvas/i18n/functions/dict/pointseries.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/pointseries.ts rename to x-pack/plugins/canvas/i18n/functions/dict/pointseries.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/progress.ts b/x-pack/plugins/canvas/i18n/functions/dict/progress.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/progress.ts rename to x-pack/plugins/canvas/i18n/functions/dict/progress.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/render.ts b/x-pack/plugins/canvas/i18n/functions/dict/render.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/render.ts rename to x-pack/plugins/canvas/i18n/functions/dict/render.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/repeat_image.ts b/x-pack/plugins/canvas/i18n/functions/dict/repeat_image.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/repeat_image.ts rename to x-pack/plugins/canvas/i18n/functions/dict/repeat_image.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/replace.ts b/x-pack/plugins/canvas/i18n/functions/dict/replace.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/replace.ts rename to x-pack/plugins/canvas/i18n/functions/dict/replace.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/reveal_image.ts b/x-pack/plugins/canvas/i18n/functions/dict/reveal_image.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/reveal_image.ts rename to x-pack/plugins/canvas/i18n/functions/dict/reveal_image.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/rounddate.ts b/x-pack/plugins/canvas/i18n/functions/dict/rounddate.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/rounddate.ts rename to x-pack/plugins/canvas/i18n/functions/dict/rounddate.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/row_count.ts b/x-pack/plugins/canvas/i18n/functions/dict/row_count.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/row_count.ts rename to x-pack/plugins/canvas/i18n/functions/dict/row_count.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/saved_lens.ts b/x-pack/plugins/canvas/i18n/functions/dict/saved_lens.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/saved_lens.ts rename to x-pack/plugins/canvas/i18n/functions/dict/saved_lens.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/saved_map.ts b/x-pack/plugins/canvas/i18n/functions/dict/saved_map.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/saved_map.ts rename to x-pack/plugins/canvas/i18n/functions/dict/saved_map.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/saved_search.ts b/x-pack/plugins/canvas/i18n/functions/dict/saved_search.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/saved_search.ts rename to x-pack/plugins/canvas/i18n/functions/dict/saved_search.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/saved_visualization.ts b/x-pack/plugins/canvas/i18n/functions/dict/saved_visualization.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/saved_visualization.ts rename to x-pack/plugins/canvas/i18n/functions/dict/saved_visualization.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/series_style.ts b/x-pack/plugins/canvas/i18n/functions/dict/series_style.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/series_style.ts rename to x-pack/plugins/canvas/i18n/functions/dict/series_style.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/shape.ts b/x-pack/plugins/canvas/i18n/functions/dict/shape.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/shape.ts rename to x-pack/plugins/canvas/i18n/functions/dict/shape.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/sort.ts b/x-pack/plugins/canvas/i18n/functions/dict/sort.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/sort.ts rename to x-pack/plugins/canvas/i18n/functions/dict/sort.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/static_column.ts b/x-pack/plugins/canvas/i18n/functions/dict/static_column.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/static_column.ts rename to x-pack/plugins/canvas/i18n/functions/dict/static_column.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/string.ts b/x-pack/plugins/canvas/i18n/functions/dict/string.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/string.ts rename to x-pack/plugins/canvas/i18n/functions/dict/string.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/switch.ts b/x-pack/plugins/canvas/i18n/functions/dict/switch.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/switch.ts rename to x-pack/plugins/canvas/i18n/functions/dict/switch.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/table.ts b/x-pack/plugins/canvas/i18n/functions/dict/table.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/table.ts rename to x-pack/plugins/canvas/i18n/functions/dict/table.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/tail.ts b/x-pack/plugins/canvas/i18n/functions/dict/tail.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/tail.ts rename to x-pack/plugins/canvas/i18n/functions/dict/tail.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/time_range.ts b/x-pack/plugins/canvas/i18n/functions/dict/time_range.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/time_range.ts rename to x-pack/plugins/canvas/i18n/functions/dict/time_range.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/timefilter.ts b/x-pack/plugins/canvas/i18n/functions/dict/timefilter.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/timefilter.ts rename to x-pack/plugins/canvas/i18n/functions/dict/timefilter.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/timefilter_control.ts b/x-pack/plugins/canvas/i18n/functions/dict/timefilter_control.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/timefilter_control.ts rename to x-pack/plugins/canvas/i18n/functions/dict/timefilter_control.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/timelion.ts b/x-pack/plugins/canvas/i18n/functions/dict/timelion.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/timelion.ts rename to x-pack/plugins/canvas/i18n/functions/dict/timelion.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/to.ts b/x-pack/plugins/canvas/i18n/functions/dict/to.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/to.ts rename to x-pack/plugins/canvas/i18n/functions/dict/to.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/dict/urlparam.ts b/x-pack/plugins/canvas/i18n/functions/dict/urlparam.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/dict/urlparam.ts rename to x-pack/plugins/canvas/i18n/functions/dict/urlparam.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/function_errors.ts b/x-pack/plugins/canvas/i18n/functions/function_errors.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/function_errors.ts rename to x-pack/plugins/canvas/i18n/functions/function_errors.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/function_help.ts b/x-pack/plugins/canvas/i18n/functions/function_help.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/function_help.ts rename to x-pack/plugins/canvas/i18n/functions/function_help.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/functions/index.ts b/x-pack/plugins/canvas/i18n/functions/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/functions/index.ts rename to x-pack/plugins/canvas/i18n/functions/index.ts diff --git a/x-pack/plugins/canvas/i18n/index.ts b/x-pack/plugins/canvas/i18n/index.ts index 8a65a75c0cfb9..864311d34aca0 100644 --- a/x-pack/plugins/canvas/i18n/index.ts +++ b/x-pack/plugins/canvas/i18n/index.ts @@ -4,4 +4,16 @@ * you may not use this file except in compliance with the Elastic License. */ -export * from '../../../legacy/plugins/canvas/i18n'; +export * from './capabilities'; +export * from './components'; +export * from './constants'; +export * from './errors'; +export * from './expression_types'; +export * from './elements'; +export * from './functions'; +export * from './renderers'; +export * from './shortcuts'; +export * from './tags'; +export * from './transitions'; +export * from './ui'; +export * from './units'; diff --git a/x-pack/legacy/plugins/canvas/i18n/renderers.ts b/x-pack/plugins/canvas/i18n/renderers.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/renderers.ts rename to x-pack/plugins/canvas/i18n/renderers.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/shortcuts.ts b/x-pack/plugins/canvas/i18n/shortcuts.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/shortcuts.ts rename to x-pack/plugins/canvas/i18n/shortcuts.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/tags.ts b/x-pack/plugins/canvas/i18n/tags.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/tags.ts rename to x-pack/plugins/canvas/i18n/tags.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/templates/apply_strings.ts b/x-pack/plugins/canvas/i18n/templates/apply_strings.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/templates/apply_strings.ts rename to x-pack/plugins/canvas/i18n/templates/apply_strings.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/templates/index.ts b/x-pack/plugins/canvas/i18n/templates/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/templates/index.ts rename to x-pack/plugins/canvas/i18n/templates/index.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/templates/template_strings.test.ts b/x-pack/plugins/canvas/i18n/templates/template_strings.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/templates/template_strings.test.ts rename to x-pack/plugins/canvas/i18n/templates/template_strings.test.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/templates/template_strings.ts b/x-pack/plugins/canvas/i18n/templates/template_strings.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/templates/template_strings.ts rename to x-pack/plugins/canvas/i18n/templates/template_strings.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/transitions.ts b/x-pack/plugins/canvas/i18n/transitions.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/transitions.ts rename to x-pack/plugins/canvas/i18n/transitions.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/ui.ts b/x-pack/plugins/canvas/i18n/ui.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/ui.ts rename to x-pack/plugins/canvas/i18n/ui.ts diff --git a/x-pack/legacy/plugins/canvas/i18n/units.ts b/x-pack/plugins/canvas/i18n/units.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/i18n/units.ts rename to x-pack/plugins/canvas/i18n/units.ts diff --git a/x-pack/legacy/plugins/canvas/images/canvas.png b/x-pack/plugins/canvas/images/canvas.png similarity index 100% rename from x-pack/legacy/plugins/canvas/images/canvas.png rename to x-pack/plugins/canvas/images/canvas.png diff --git a/x-pack/legacy/plugins/canvas/images/canvas.svg b/x-pack/plugins/canvas/images/canvas.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/images/canvas.svg rename to x-pack/plugins/canvas/images/canvas.svg diff --git a/x-pack/legacy/plugins/canvas/images/canvas_blank.svg b/x-pack/plugins/canvas/images/canvas_blank.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/images/canvas_blank.svg rename to x-pack/plugins/canvas/images/canvas_blank.svg diff --git a/x-pack/legacy/plugins/canvas/images/icon_black.svg b/x-pack/plugins/canvas/images/icon_black.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/images/icon_black.svg rename to x-pack/plugins/canvas/images/icon_black.svg diff --git a/x-pack/legacy/plugins/canvas/images/logo.gif b/x-pack/plugins/canvas/images/logo.gif similarity index 100% rename from x-pack/legacy/plugins/canvas/images/logo.gif rename to x-pack/plugins/canvas/images/logo.gif diff --git a/x-pack/legacy/plugins/canvas/public/__tests__/setup.js b/x-pack/plugins/canvas/public/__tests__/setup.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/__tests__/setup.js rename to x-pack/plugins/canvas/public/__tests__/setup.js diff --git a/x-pack/legacy/plugins/canvas/public/application.tsx b/x-pack/plugins/canvas/public/application.tsx similarity index 94% rename from x-pack/legacy/plugins/canvas/public/application.tsx rename to x-pack/plugins/canvas/public/application.tsx index 8ee65c3386afc..284023e74d137 100644 --- a/x-pack/legacy/plugins/canvas/public/application.tsx +++ b/x-pack/plugins/canvas/public/application.tsx @@ -16,7 +16,7 @@ import { AppMountParameters, CoreStart, CoreSetup } from 'kibana/public'; import { CanvasStartDeps, CanvasSetupDeps } from './plugin'; // @ts-ignore Untyped local import { App } from './components/app'; -import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; +import { KibanaContextProvider } from '../../../../src/plugins/kibana_react/public'; import { initInterpreter, resetInterpreter } from './lib/run_interpreter'; import { registerLanguage } from './lib/monaco_language_def'; import { SetupRegistries } from './plugin_api'; @@ -26,9 +26,9 @@ import { getDocumentationLinks } from './lib/documentation_links'; import { HelpMenu } from './components/help_menu/help_menu'; import { createStore, destroyStore } from './store'; -import { VALUE_CLICK_TRIGGER, ActionByType } from '../../../../../src/plugins/ui_actions/public'; +import { VALUE_CLICK_TRIGGER, ActionByType } from '../../../../src/plugins/ui_actions/public'; /* eslint-disable */ -import { ACTION_VALUE_CLICK } from '../../../../../src/plugins/data/public/actions/value_click_action'; +import { ACTION_VALUE_CLICK } from '../../../../src/plugins/data/public/actions/value_click_action'; /* eslint-enable */ import { init as initStatsReporter } from './lib/ui_metric'; diff --git a/x-pack/legacy/plugins/canvas/public/apps/export/export/__tests__/__snapshots__/export_app.test.tsx.snap b/x-pack/plugins/canvas/public/apps/export/export/__tests__/__snapshots__/export_app.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/export/export/__tests__/__snapshots__/export_app.test.tsx.snap rename to x-pack/plugins/canvas/public/apps/export/export/__tests__/__snapshots__/export_app.test.tsx.snap diff --git a/x-pack/legacy/plugins/canvas/public/apps/export/export/__tests__/export_app.test.tsx b/x-pack/plugins/canvas/public/apps/export/export/__tests__/export_app.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/export/export/__tests__/export_app.test.tsx rename to x-pack/plugins/canvas/public/apps/export/export/__tests__/export_app.test.tsx diff --git a/x-pack/legacy/plugins/canvas/public/apps/export/export/export_app.js b/x-pack/plugins/canvas/public/apps/export/export/export_app.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/export/export/export_app.js rename to x-pack/plugins/canvas/public/apps/export/export/export_app.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/export/export/export_app.scss b/x-pack/plugins/canvas/public/apps/export/export/export_app.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/export/export/export_app.scss rename to x-pack/plugins/canvas/public/apps/export/export/export_app.scss diff --git a/x-pack/legacy/plugins/canvas/public/apps/export/export/index.js b/x-pack/plugins/canvas/public/apps/export/export/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/export/export/index.js rename to x-pack/plugins/canvas/public/apps/export/export/index.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/export/export/load_workpad.js b/x-pack/plugins/canvas/public/apps/export/export/load_workpad.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/export/export/load_workpad.js rename to x-pack/plugins/canvas/public/apps/export/export/load_workpad.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/export/index.js b/x-pack/plugins/canvas/public/apps/export/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/export/index.js rename to x-pack/plugins/canvas/public/apps/export/index.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/export/routes.js b/x-pack/plugins/canvas/public/apps/export/routes.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/export/routes.js rename to x-pack/plugins/canvas/public/apps/export/routes.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/home/home_app/home_app.js b/x-pack/plugins/canvas/public/apps/home/home_app/home_app.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/home/home_app/home_app.js rename to x-pack/plugins/canvas/public/apps/home/home_app/home_app.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/home/home_app/home_app.scss b/x-pack/plugins/canvas/public/apps/home/home_app/home_app.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/home/home_app/home_app.scss rename to x-pack/plugins/canvas/public/apps/home/home_app/home_app.scss diff --git a/x-pack/legacy/plugins/canvas/public/apps/home/home_app/index.js b/x-pack/plugins/canvas/public/apps/home/home_app/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/home/home_app/index.js rename to x-pack/plugins/canvas/public/apps/home/home_app/index.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/home/index.js b/x-pack/plugins/canvas/public/apps/home/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/home/index.js rename to x-pack/plugins/canvas/public/apps/home/index.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/home/routes.js b/x-pack/plugins/canvas/public/apps/home/routes.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/home/routes.js rename to x-pack/plugins/canvas/public/apps/home/routes.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/index.js b/x-pack/plugins/canvas/public/apps/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/index.js rename to x-pack/plugins/canvas/public/apps/index.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/workpad/index.js b/x-pack/plugins/canvas/public/apps/workpad/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/workpad/index.js rename to x-pack/plugins/canvas/public/apps/workpad/index.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/workpad/routes.js b/x-pack/plugins/canvas/public/apps/workpad/routes.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/workpad/routes.js rename to x-pack/plugins/canvas/public/apps/workpad/routes.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/index.js b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/index.js rename to x-pack/plugins/canvas/public/apps/workpad/workpad_app/index.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/load_workpad.js b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/load_workpad.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/load_workpad.js rename to x-pack/plugins/canvas/public/apps/workpad/workpad_app/load_workpad.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.js b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.js rename to x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.js diff --git a/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.scss b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.scss rename to x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.scss diff --git a/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.test.tsx b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.test.tsx rename to x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.test.tsx diff --git a/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.tsx b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.tsx rename to x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/alignment_guide/alignment_guide.js b/x-pack/plugins/canvas/public/components/alignment_guide/alignment_guide.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/alignment_guide/alignment_guide.js rename to x-pack/plugins/canvas/public/components/alignment_guide/alignment_guide.js diff --git a/x-pack/legacy/plugins/canvas/public/components/alignment_guide/alignment_guide.scss b/x-pack/plugins/canvas/public/components/alignment_guide/alignment_guide.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/alignment_guide/alignment_guide.scss rename to x-pack/plugins/canvas/public/components/alignment_guide/alignment_guide.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/alignment_guide/index.js b/x-pack/plugins/canvas/public/components/alignment_guide/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/alignment_guide/index.js rename to x-pack/plugins/canvas/public/components/alignment_guide/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/app/app.js b/x-pack/plugins/canvas/public/components/app/app.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/app/app.js rename to x-pack/plugins/canvas/public/components/app/app.js diff --git a/x-pack/legacy/plugins/canvas/public/components/app/index.js b/x-pack/plugins/canvas/public/components/app/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/app/index.js rename to x-pack/plugins/canvas/public/components/app/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/app/track_route_change.js b/x-pack/plugins/canvas/public/components/app/track_route_change.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/app/track_route_change.js rename to x-pack/plugins/canvas/public/components/app/track_route_change.js diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_add/arg_add.js b/x-pack/plugins/canvas/public/components/arg_add/arg_add.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_add/arg_add.js rename to x-pack/plugins/canvas/public/components/arg_add/arg_add.js diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_add/arg_add.scss b/x-pack/plugins/canvas/public/components/arg_add/arg_add.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_add/arg_add.scss rename to x-pack/plugins/canvas/public/components/arg_add/arg_add.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_add/index.js b/x-pack/plugins/canvas/public/components/arg_add/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_add/index.js rename to x-pack/plugins/canvas/public/components/arg_add/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_add_popover/arg_add_popover.scss b/x-pack/plugins/canvas/public/components/arg_add_popover/arg_add_popover.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_add_popover/arg_add_popover.scss rename to x-pack/plugins/canvas/public/components/arg_add_popover/arg_add_popover.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_add_popover/arg_add_popover.tsx b/x-pack/plugins/canvas/public/components/arg_add_popover/arg_add_popover.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_add_popover/arg_add_popover.tsx rename to x-pack/plugins/canvas/public/components/arg_add_popover/arg_add_popover.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_add_popover/index.ts b/x-pack/plugins/canvas/public/components/arg_add_popover/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_add_popover/index.ts rename to x-pack/plugins/canvas/public/components/arg_add_popover/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_form/advanced_failure.js b/x-pack/plugins/canvas/public/components/arg_form/advanced_failure.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_form/advanced_failure.js rename to x-pack/plugins/canvas/public/components/arg_form/advanced_failure.js diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_form/arg_form.js b/x-pack/plugins/canvas/public/components/arg_form/arg_form.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_form/arg_form.js rename to x-pack/plugins/canvas/public/components/arg_form/arg_form.js diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_form/arg_form.scss b/x-pack/plugins/canvas/public/components/arg_form/arg_form.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_form/arg_form.scss rename to x-pack/plugins/canvas/public/components/arg_form/arg_form.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_form/arg_label.js b/x-pack/plugins/canvas/public/components/arg_form/arg_label.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_form/arg_label.js rename to x-pack/plugins/canvas/public/components/arg_form/arg_label.js diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_form/arg_simple_form.tsx b/x-pack/plugins/canvas/public/components/arg_form/arg_simple_form.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_form/arg_simple_form.tsx rename to x-pack/plugins/canvas/public/components/arg_form/arg_simple_form.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_form/arg_template_form.js b/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_form/arg_template_form.js rename to x-pack/plugins/canvas/public/components/arg_form/arg_template_form.js diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_form/index.js b/x-pack/plugins/canvas/public/components/arg_form/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_form/index.js rename to x-pack/plugins/canvas/public/components/arg_form/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_form/pending_arg_value.js b/x-pack/plugins/canvas/public/components/arg_form/pending_arg_value.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_form/pending_arg_value.js rename to x-pack/plugins/canvas/public/components/arg_form/pending_arg_value.js diff --git a/x-pack/legacy/plugins/canvas/public/components/arg_form/simple_failure.tsx b/x-pack/plugins/canvas/public/components/arg_form/simple_failure.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/arg_form/simple_failure.tsx rename to x-pack/plugins/canvas/public/components/arg_form/simple_failure.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset.examples.storyshot b/x-pack/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset.examples.storyshot rename to x-pack/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset_manager.examples.storyshot b/x-pack/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset_manager.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset_manager.examples.storyshot rename to x-pack/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset_manager.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset_manager.stories.storyshot b/x-pack/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset_manager.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset_manager.stories.storyshot rename to x-pack/plugins/canvas/public/components/asset_manager/__examples__/__snapshots__/asset_manager.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/asset.examples.tsx b/x-pack/plugins/canvas/public/components/asset_manager/__examples__/asset.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/asset.examples.tsx rename to x-pack/plugins/canvas/public/components/asset_manager/__examples__/asset.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/asset_manager.stories.tsx b/x-pack/plugins/canvas/public/components/asset_manager/__examples__/asset_manager.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/__examples__/asset_manager.stories.tsx rename to x-pack/plugins/canvas/public/components/asset_manager/__examples__/asset_manager.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/asset.tsx b/x-pack/plugins/canvas/public/components/asset_manager/asset.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/asset.tsx rename to x-pack/plugins/canvas/public/components/asset_manager/asset.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/asset_manager.scss b/x-pack/plugins/canvas/public/components/asset_manager/asset_manager.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/asset_manager.scss rename to x-pack/plugins/canvas/public/components/asset_manager/asset_manager.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/asset_manager.tsx b/x-pack/plugins/canvas/public/components/asset_manager/asset_manager.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/asset_manager.tsx rename to x-pack/plugins/canvas/public/components/asset_manager/asset_manager.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/asset_modal.tsx b/x-pack/plugins/canvas/public/components/asset_manager/asset_modal.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/asset_modal.tsx rename to x-pack/plugins/canvas/public/components/asset_manager/asset_modal.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_manager/index.ts b/x-pack/plugins/canvas/public/components/asset_manager/index.ts similarity index 97% rename from x-pack/legacy/plugins/canvas/public/components/asset_manager/index.ts rename to x-pack/plugins/canvas/public/components/asset_manager/index.ts index 3fd34d6d2a9bb..49894b9d87414 100644 --- a/x-pack/legacy/plugins/canvas/public/components/asset_manager/index.ts +++ b/x-pack/plugins/canvas/public/components/asset_manager/index.ts @@ -21,7 +21,7 @@ import { getId } from '../../lib/get_id'; // @ts-ignore Untyped Local import { findExistingAsset } from '../../lib/find_existing_asset'; import { VALID_IMAGE_TYPES } from '../../../common/lib/constants'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { WithKibanaProps } from '../../'; import { AssetManager as Component, Props as AssetManagerProps } from './asset_manager'; diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_picker/asset_picker.scss b/x-pack/plugins/canvas/public/components/asset_picker/asset_picker.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_picker/asset_picker.scss rename to x-pack/plugins/canvas/public/components/asset_picker/asset_picker.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_picker/asset_picker.tsx b/x-pack/plugins/canvas/public/components/asset_picker/asset_picker.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_picker/asset_picker.tsx rename to x-pack/plugins/canvas/public/components/asset_picker/asset_picker.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/asset_picker/index.ts b/x-pack/plugins/canvas/public/components/asset_picker/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/asset_picker/index.ts rename to x-pack/plugins/canvas/public/components/asset_picker/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/autocomplete/autocomplete.js b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/autocomplete/autocomplete.js rename to x-pack/plugins/canvas/public/components/autocomplete/autocomplete.js diff --git a/x-pack/legacy/plugins/canvas/public/components/autocomplete/autocomplete.scss b/x-pack/plugins/canvas/public/components/autocomplete/autocomplete.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/autocomplete/autocomplete.scss rename to x-pack/plugins/canvas/public/components/autocomplete/autocomplete.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/autocomplete/index.js b/x-pack/plugins/canvas/public/components/autocomplete/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/autocomplete/index.js rename to x-pack/plugins/canvas/public/components/autocomplete/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/border_connection/border_connection.js b/x-pack/plugins/canvas/public/components/border_connection/border_connection.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/border_connection/border_connection.js rename to x-pack/plugins/canvas/public/components/border_connection/border_connection.js diff --git a/x-pack/legacy/plugins/canvas/public/components/border_connection/border_connection.scss b/x-pack/plugins/canvas/public/components/border_connection/border_connection.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/border_connection/border_connection.scss rename to x-pack/plugins/canvas/public/components/border_connection/border_connection.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/border_connection/index.js b/x-pack/plugins/canvas/public/components/border_connection/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/border_connection/index.js rename to x-pack/plugins/canvas/public/components/border_connection/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/border_resize_handle/border_resize_handle.js b/x-pack/plugins/canvas/public/components/border_resize_handle/border_resize_handle.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/border_resize_handle/border_resize_handle.js rename to x-pack/plugins/canvas/public/components/border_resize_handle/border_resize_handle.js diff --git a/x-pack/legacy/plugins/canvas/public/components/border_resize_handle/border_resize_handle.scss b/x-pack/plugins/canvas/public/components/border_resize_handle/border_resize_handle.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/border_resize_handle/border_resize_handle.scss rename to x-pack/plugins/canvas/public/components/border_resize_handle/border_resize_handle.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/border_resize_handle/index.js b/x-pack/plugins/canvas/public/components/border_resize_handle/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/border_resize_handle/index.js rename to x-pack/plugins/canvas/public/components/border_resize_handle/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/clipboard/clipboard.scss b/x-pack/plugins/canvas/public/components/clipboard/clipboard.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/clipboard/clipboard.scss rename to x-pack/plugins/canvas/public/components/clipboard/clipboard.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/clipboard/clipboard.tsx b/x-pack/plugins/canvas/public/components/clipboard/clipboard.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/clipboard/clipboard.tsx rename to x-pack/plugins/canvas/public/components/clipboard/clipboard.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/clipboard/index.ts b/x-pack/plugins/canvas/public/components/clipboard/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/clipboard/index.ts rename to x-pack/plugins/canvas/public/components/clipboard/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/color_dot/__examples__/__snapshots__/color_dot.stories.storyshot b/x-pack/plugins/canvas/public/components/color_dot/__examples__/__snapshots__/color_dot.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_dot/__examples__/__snapshots__/color_dot.stories.storyshot rename to x-pack/plugins/canvas/public/components/color_dot/__examples__/__snapshots__/color_dot.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/color_dot/__examples__/color_dot.stories.tsx b/x-pack/plugins/canvas/public/components/color_dot/__examples__/color_dot.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_dot/__examples__/color_dot.stories.tsx rename to x-pack/plugins/canvas/public/components/color_dot/__examples__/color_dot.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_dot/color_dot.scss b/x-pack/plugins/canvas/public/components/color_dot/color_dot.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_dot/color_dot.scss rename to x-pack/plugins/canvas/public/components/color_dot/color_dot.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/color_dot/color_dot.tsx b/x-pack/plugins/canvas/public/components/color_dot/color_dot.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_dot/color_dot.tsx rename to x-pack/plugins/canvas/public/components/color_dot/color_dot.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_dot/index.ts b/x-pack/plugins/canvas/public/components/color_dot/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_dot/index.ts rename to x-pack/plugins/canvas/public/components/color_dot/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/color_manager/__examples__/__snapshots__/color_manager.stories.storyshot b/x-pack/plugins/canvas/public/components/color_manager/__examples__/__snapshots__/color_manager.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_manager/__examples__/__snapshots__/color_manager.stories.storyshot rename to x-pack/plugins/canvas/public/components/color_manager/__examples__/__snapshots__/color_manager.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/color_manager/__examples__/color_manager.stories.tsx b/x-pack/plugins/canvas/public/components/color_manager/__examples__/color_manager.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_manager/__examples__/color_manager.stories.tsx rename to x-pack/plugins/canvas/public/components/color_manager/__examples__/color_manager.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_manager/color_manager.tsx b/x-pack/plugins/canvas/public/components/color_manager/color_manager.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_manager/color_manager.tsx rename to x-pack/plugins/canvas/public/components/color_manager/color_manager.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_manager/index.ts b/x-pack/plugins/canvas/public/components/color_manager/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_manager/index.ts rename to x-pack/plugins/canvas/public/components/color_manager/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/color_palette/__examples__/__snapshots__/color_palette.stories.storyshot b/x-pack/plugins/canvas/public/components/color_palette/__examples__/__snapshots__/color_palette.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_palette/__examples__/__snapshots__/color_palette.stories.storyshot rename to x-pack/plugins/canvas/public/components/color_palette/__examples__/__snapshots__/color_palette.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/color_palette/__examples__/color_palette.stories.tsx b/x-pack/plugins/canvas/public/components/color_palette/__examples__/color_palette.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_palette/__examples__/color_palette.stories.tsx rename to x-pack/plugins/canvas/public/components/color_palette/__examples__/color_palette.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_palette/color_palette.scss b/x-pack/plugins/canvas/public/components/color_palette/color_palette.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_palette/color_palette.scss rename to x-pack/plugins/canvas/public/components/color_palette/color_palette.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/color_palette/color_palette.tsx b/x-pack/plugins/canvas/public/components/color_palette/color_palette.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_palette/color_palette.tsx rename to x-pack/plugins/canvas/public/components/color_palette/color_palette.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_palette/index.ts b/x-pack/plugins/canvas/public/components/color_palette/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_palette/index.ts rename to x-pack/plugins/canvas/public/components/color_palette/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/color_picker/__examples__/__snapshots__/color_picker.stories.storyshot b/x-pack/plugins/canvas/public/components/color_picker/__examples__/__snapshots__/color_picker.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_picker/__examples__/__snapshots__/color_picker.stories.storyshot rename to x-pack/plugins/canvas/public/components/color_picker/__examples__/__snapshots__/color_picker.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/color_picker/__examples__/color_picker.stories.tsx b/x-pack/plugins/canvas/public/components/color_picker/__examples__/color_picker.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_picker/__examples__/color_picker.stories.tsx rename to x-pack/plugins/canvas/public/components/color_picker/__examples__/color_picker.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_picker/color_picker.tsx b/x-pack/plugins/canvas/public/components/color_picker/color_picker.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_picker/color_picker.tsx rename to x-pack/plugins/canvas/public/components/color_picker/color_picker.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_picker/index.ts b/x-pack/plugins/canvas/public/components/color_picker/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_picker/index.ts rename to x-pack/plugins/canvas/public/components/color_picker/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/color_picker_popover/__examples__/__snapshots__/color_picker_popover.stories.storyshot b/x-pack/plugins/canvas/public/components/color_picker_popover/__examples__/__snapshots__/color_picker_popover.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_picker_popover/__examples__/__snapshots__/color_picker_popover.stories.storyshot rename to x-pack/plugins/canvas/public/components/color_picker_popover/__examples__/__snapshots__/color_picker_popover.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/color_picker_popover/__examples__/color_picker_popover.stories.tsx b/x-pack/plugins/canvas/public/components/color_picker_popover/__examples__/color_picker_popover.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_picker_popover/__examples__/color_picker_popover.stories.tsx rename to x-pack/plugins/canvas/public/components/color_picker_popover/__examples__/color_picker_popover.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_picker_popover/color_picker_popover.scss b/x-pack/plugins/canvas/public/components/color_picker_popover/color_picker_popover.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_picker_popover/color_picker_popover.scss rename to x-pack/plugins/canvas/public/components/color_picker_popover/color_picker_popover.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/color_picker_popover/color_picker_popover.tsx b/x-pack/plugins/canvas/public/components/color_picker_popover/color_picker_popover.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_picker_popover/color_picker_popover.tsx rename to x-pack/plugins/canvas/public/components/color_picker_popover/color_picker_popover.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/color_picker_popover/index.ts b/x-pack/plugins/canvas/public/components/color_picker_popover/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/color_picker_popover/index.ts rename to x-pack/plugins/canvas/public/components/color_picker_popover/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/confirm_modal/confirm_modal.tsx b/x-pack/plugins/canvas/public/components/confirm_modal/confirm_modal.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/confirm_modal/confirm_modal.tsx rename to x-pack/plugins/canvas/public/components/confirm_modal/confirm_modal.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/confirm_modal/index.ts b/x-pack/plugins/canvas/public/components/confirm_modal/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/confirm_modal/index.ts rename to x-pack/plugins/canvas/public/components/confirm_modal/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/custom_element_modal/__examples__/__snapshots__/custom_element_modal.examples.storyshot b/x-pack/plugins/canvas/public/components/custom_element_modal/__examples__/__snapshots__/custom_element_modal.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/custom_element_modal/__examples__/__snapshots__/custom_element_modal.examples.storyshot rename to x-pack/plugins/canvas/public/components/custom_element_modal/__examples__/__snapshots__/custom_element_modal.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/custom_element_modal/__examples__/custom_element_modal.examples.tsx b/x-pack/plugins/canvas/public/components/custom_element_modal/__examples__/custom_element_modal.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/custom_element_modal/__examples__/custom_element_modal.examples.tsx rename to x-pack/plugins/canvas/public/components/custom_element_modal/__examples__/custom_element_modal.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/custom_element_modal/custom_element_modal.scss b/x-pack/plugins/canvas/public/components/custom_element_modal/custom_element_modal.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/custom_element_modal/custom_element_modal.scss rename to x-pack/plugins/canvas/public/components/custom_element_modal/custom_element_modal.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/custom_element_modal/custom_element_modal.tsx b/x-pack/plugins/canvas/public/components/custom_element_modal/custom_element_modal.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/custom_element_modal/custom_element_modal.tsx rename to x-pack/plugins/canvas/public/components/custom_element_modal/custom_element_modal.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/custom_element_modal/index.tsx b/x-pack/plugins/canvas/public/components/custom_element_modal/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/custom_element_modal/index.tsx rename to x-pack/plugins/canvas/public/components/custom_element_modal/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource.js b/x-pack/plugins/canvas/public/components/datasource/datasource.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datasource/datasource.js rename to x-pack/plugins/canvas/public/components/datasource/datasource.js diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource.scss b/x-pack/plugins/canvas/public/components/datasource/datasource.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datasource/datasource.scss rename to x-pack/plugins/canvas/public/components/datasource/datasource.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js b/x-pack/plugins/canvas/public/components/datasource/datasource_component.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datasource/datasource_component.js rename to x-pack/plugins/canvas/public/components/datasource/datasource_component.js diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.js b/x-pack/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.js rename to x-pack/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.js diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.scss b/x-pack/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.scss rename to x-pack/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_preview/index.js b/x-pack/plugins/canvas/public/components/datasource/datasource_preview/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datasource/datasource_preview/index.js rename to x-pack/plugins/canvas/public/components/datasource/datasource_preview/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js b/x-pack/plugins/canvas/public/components/datasource/datasource_selector.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datasource/datasource_selector.js rename to x-pack/plugins/canvas/public/components/datasource/datasource_selector.js diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/index.js b/x-pack/plugins/canvas/public/components/datasource/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datasource/index.js rename to x-pack/plugins/canvas/public/components/datasource/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/datasource/no_datasource.js b/x-pack/plugins/canvas/public/components/datasource/no_datasource.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datasource/no_datasource.js rename to x-pack/plugins/canvas/public/components/datasource/no_datasource.js diff --git a/x-pack/legacy/plugins/canvas/public/components/datatable/datatable.js b/x-pack/plugins/canvas/public/components/datatable/datatable.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datatable/datatable.js rename to x-pack/plugins/canvas/public/components/datatable/datatable.js diff --git a/x-pack/legacy/plugins/canvas/public/components/datatable/datatable.scss b/x-pack/plugins/canvas/public/components/datatable/datatable.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datatable/datatable.scss rename to x-pack/plugins/canvas/public/components/datatable/datatable.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/datatable/index.js b/x-pack/plugins/canvas/public/components/datatable/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/datatable/index.js rename to x-pack/plugins/canvas/public/components/datatable/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/debug/__examples__/__snapshots__/debug.examples.storyshot b/x-pack/plugins/canvas/public/components/debug/__examples__/__snapshots__/debug.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/debug/__examples__/__snapshots__/debug.examples.storyshot rename to x-pack/plugins/canvas/public/components/debug/__examples__/__snapshots__/debug.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/debug/__examples__/debug.examples.tsx b/x-pack/plugins/canvas/public/components/debug/__examples__/debug.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/debug/__examples__/debug.examples.tsx rename to x-pack/plugins/canvas/public/components/debug/__examples__/debug.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/debug/__examples__/helpers.tsx b/x-pack/plugins/canvas/public/components/debug/__examples__/helpers.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/debug/__examples__/helpers.tsx rename to x-pack/plugins/canvas/public/components/debug/__examples__/helpers.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/debug/debug.scss b/x-pack/plugins/canvas/public/components/debug/debug.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/debug/debug.scss rename to x-pack/plugins/canvas/public/components/debug/debug.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/debug/debug.tsx b/x-pack/plugins/canvas/public/components/debug/debug.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/debug/debug.tsx rename to x-pack/plugins/canvas/public/components/debug/debug.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/debug/index.tsx b/x-pack/plugins/canvas/public/components/debug/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/debug/index.tsx rename to x-pack/plugins/canvas/public/components/debug/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/dom_preview/dom_preview.js b/x-pack/plugins/canvas/public/components/dom_preview/dom_preview.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/dom_preview/dom_preview.js rename to x-pack/plugins/canvas/public/components/dom_preview/dom_preview.js diff --git a/x-pack/legacy/plugins/canvas/public/components/dom_preview/dom_preview.scss b/x-pack/plugins/canvas/public/components/dom_preview/dom_preview.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/dom_preview/dom_preview.scss rename to x-pack/plugins/canvas/public/components/dom_preview/dom_preview.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/dom_preview/index.js b/x-pack/plugins/canvas/public/components/dom_preview/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/dom_preview/index.js rename to x-pack/plugins/canvas/public/components/dom_preview/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/download/__tests__/download.test.tsx b/x-pack/plugins/canvas/public/components/download/__tests__/download.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/download/__tests__/download.test.tsx rename to x-pack/plugins/canvas/public/components/download/__tests__/download.test.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/download/download.tsx b/x-pack/plugins/canvas/public/components/download/download.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/download/download.tsx rename to x-pack/plugins/canvas/public/components/download/download.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/download/index.ts b/x-pack/plugins/canvas/public/components/download/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/download/index.ts rename to x-pack/plugins/canvas/public/components/download/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/dragbox_annotation/dragbox_annotation.js b/x-pack/plugins/canvas/public/components/dragbox_annotation/dragbox_annotation.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/dragbox_annotation/dragbox_annotation.js rename to x-pack/plugins/canvas/public/components/dragbox_annotation/dragbox_annotation.js diff --git a/x-pack/legacy/plugins/canvas/public/components/dragbox_annotation/dragbox_annotation.scss b/x-pack/plugins/canvas/public/components/dragbox_annotation/dragbox_annotation.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/dragbox_annotation/dragbox_annotation.scss rename to x-pack/plugins/canvas/public/components/dragbox_annotation/dragbox_annotation.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/dragbox_annotation/index.js b/x-pack/plugins/canvas/public/components/dragbox_annotation/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/dragbox_annotation/index.js rename to x-pack/plugins/canvas/public/components/dragbox_annotation/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_card/__examples__/__snapshots__/element_card.stories.storyshot b/x-pack/plugins/canvas/public/components/element_card/__examples__/__snapshots__/element_card.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_card/__examples__/__snapshots__/element_card.stories.storyshot rename to x-pack/plugins/canvas/public/components/element_card/__examples__/__snapshots__/element_card.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/element_card/__examples__/__snapshots__/element_controls.examples.storyshot b/x-pack/plugins/canvas/public/components/element_card/__examples__/__snapshots__/element_controls.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_card/__examples__/__snapshots__/element_controls.examples.storyshot rename to x-pack/plugins/canvas/public/components/element_card/__examples__/__snapshots__/element_controls.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/element_card/__examples__/element_card.stories.tsx b/x-pack/plugins/canvas/public/components/element_card/__examples__/element_card.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_card/__examples__/element_card.stories.tsx rename to x-pack/plugins/canvas/public/components/element_card/__examples__/element_card.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/element_card/element_card.scss b/x-pack/plugins/canvas/public/components/element_card/element_card.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_card/element_card.scss rename to x-pack/plugins/canvas/public/components/element_card/element_card.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/element_card/element_card.tsx b/x-pack/plugins/canvas/public/components/element_card/element_card.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_card/element_card.tsx rename to x-pack/plugins/canvas/public/components/element_card/element_card.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/element_card/index.tsx b/x-pack/plugins/canvas/public/components/element_card/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_card/index.tsx rename to x-pack/plugins/canvas/public/components/element_card/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/element_config/element_config.js b/x-pack/plugins/canvas/public/components/element_config/element_config.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_config/element_config.js rename to x-pack/plugins/canvas/public/components/element_config/element_config.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_config/index.js b/x-pack/plugins/canvas/public/components/element_config/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_config/index.js rename to x-pack/plugins/canvas/public/components/element_config/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_content/element_content.js b/x-pack/plugins/canvas/public/components/element_content/element_content.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_content/element_content.js rename to x-pack/plugins/canvas/public/components/element_content/element_content.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_content/element_content.scss b/x-pack/plugins/canvas/public/components/element_content/element_content.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_content/element_content.scss rename to x-pack/plugins/canvas/public/components/element_content/element_content.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/element_content/index.js b/x-pack/plugins/canvas/public/components/element_content/index.js similarity index 92% rename from x-pack/legacy/plugins/canvas/public/components/element_content/index.js rename to x-pack/plugins/canvas/public/components/element_content/index.js index df411b6d11f1c..3d7cca95e10b7 100644 --- a/x-pack/legacy/plugins/canvas/public/components/element_content/index.js +++ b/x-pack/plugins/canvas/public/components/element_content/index.js @@ -9,7 +9,7 @@ import { connect } from 'react-redux'; import { compose, withProps } from 'recompose'; import { get } from 'lodash'; import { getSelectedPage, getPageById } from '../../state/selectors/workpad'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { ElementContent as Component } from './element_content'; const mapStateToProps = state => ({ diff --git a/x-pack/legacy/plugins/canvas/public/components/element_content/invalid_element_type.js b/x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_content/invalid_element_type.js rename to x-pack/plugins/canvas/public/components/element_content/invalid_element_type.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_content/invalid_expression.js b/x-pack/plugins/canvas/public/components/element_content/invalid_expression.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_content/invalid_expression.js rename to x-pack/plugins/canvas/public/components/element_content/invalid_expression.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_share_container/element_share_container.js b/x-pack/plugins/canvas/public/components/element_share_container/element_share_container.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_share_container/element_share_container.js rename to x-pack/plugins/canvas/public/components/element_share_container/element_share_container.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_share_container/index.js b/x-pack/plugins/canvas/public/components/element_share_container/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_share_container/index.js rename to x-pack/plugins/canvas/public/components/element_share_container/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_wrapper/element_wrapper.js b/x-pack/plugins/canvas/public/components/element_wrapper/element_wrapper.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_wrapper/element_wrapper.js rename to x-pack/plugins/canvas/public/components/element_wrapper/element_wrapper.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_wrapper/index.js b/x-pack/plugins/canvas/public/components/element_wrapper/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_wrapper/index.js rename to x-pack/plugins/canvas/public/components/element_wrapper/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/element_wrapper/lib/handlers.js b/x-pack/plugins/canvas/public/components/element_wrapper/lib/handlers.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/element_wrapper/lib/handlers.js rename to x-pack/plugins/canvas/public/components/element_wrapper/lib/handlers.js diff --git a/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx b/x-pack/plugins/canvas/public/components/embeddable_flyout/flyout.tsx similarity index 95% rename from x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx rename to x-pack/plugins/canvas/public/components/embeddable_flyout/flyout.tsx index 4916a27fcbe60..35eedde59a014 100644 --- a/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/flyout.tsx +++ b/x-pack/plugins/canvas/public/components/embeddable_flyout/flyout.tsx @@ -9,9 +9,9 @@ import { EuiFlyout, EuiFlyoutHeader, EuiFlyoutBody, EuiTitle } from '@elastic/eu import { SavedObjectFinderUi, SavedObjectMetaData, -} from '../../../../../../../src/plugins/saved_objects/public/'; +} from '../../../../../../src/plugins/saved_objects/public/'; import { ComponentStrings } from '../../../i18n'; -import { CoreStart } from '../../../../../../../src/core/public'; +import { CoreStart } from '../../../../../../src/core/public'; import { CanvasStartDeps } from '../../plugin'; const { AddEmbeddableFlyout: strings } = ComponentStrings; diff --git a/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/index.tsx b/x-pack/plugins/canvas/public/components/embeddable_flyout/index.tsx similarity index 97% rename from x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/index.tsx rename to x-pack/plugins/canvas/public/components/embeddable_flyout/index.tsx index c13cbfd042237..8e69396f67c2e 100644 --- a/x-pack/legacy/plugins/canvas/public/components/embeddable_flyout/index.tsx +++ b/x-pack/plugins/canvas/public/components/embeddable_flyout/index.tsx @@ -15,7 +15,7 @@ import { addElement } from '../../state/actions/elements'; import { getSelectedPage } from '../../state/selectors/workpad'; import { EmbeddableTypes } from '../../../canvas_plugin_src/expression_types/embeddable'; import { WithKibanaProps } from '../../index'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; const allowedEmbeddables = { [EmbeddableTypes.map]: (id: string) => { diff --git a/x-pack/legacy/plugins/canvas/public/components/enhance/error_boundary.tsx b/x-pack/plugins/canvas/public/components/enhance/error_boundary.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/enhance/error_boundary.tsx rename to x-pack/plugins/canvas/public/components/enhance/error_boundary.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/enhance/stateful_prop.js b/x-pack/plugins/canvas/public/components/enhance/stateful_prop.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/enhance/stateful_prop.js rename to x-pack/plugins/canvas/public/components/enhance/stateful_prop.js diff --git a/x-pack/legacy/plugins/canvas/public/components/error/error.js b/x-pack/plugins/canvas/public/components/error/error.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/error/error.js rename to x-pack/plugins/canvas/public/components/error/error.js diff --git a/x-pack/legacy/plugins/canvas/public/components/error/index.js b/x-pack/plugins/canvas/public/components/error/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/error/index.js rename to x-pack/plugins/canvas/public/components/error/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/error/show_debugging.js b/x-pack/plugins/canvas/public/components/error/show_debugging.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/error/show_debugging.js rename to x-pack/plugins/canvas/public/components/error/show_debugging.js diff --git a/x-pack/legacy/plugins/canvas/public/components/es_field_select/es_field_select.js b/x-pack/plugins/canvas/public/components/es_field_select/es_field_select.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/es_field_select/es_field_select.js rename to x-pack/plugins/canvas/public/components/es_field_select/es_field_select.js diff --git a/x-pack/legacy/plugins/canvas/public/components/es_field_select/index.js b/x-pack/plugins/canvas/public/components/es_field_select/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/es_field_select/index.js rename to x-pack/plugins/canvas/public/components/es_field_select/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/es_fields_select/es_fields_select.js b/x-pack/plugins/canvas/public/components/es_fields_select/es_fields_select.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/es_fields_select/es_fields_select.js rename to x-pack/plugins/canvas/public/components/es_fields_select/es_fields_select.js diff --git a/x-pack/legacy/plugins/canvas/public/components/es_fields_select/index.js b/x-pack/plugins/canvas/public/components/es_fields_select/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/es_fields_select/index.js rename to x-pack/plugins/canvas/public/components/es_fields_select/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/es_index_select/es_index_select.js b/x-pack/plugins/canvas/public/components/es_index_select/es_index_select.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/es_index_select/es_index_select.js rename to x-pack/plugins/canvas/public/components/es_index_select/es_index_select.js diff --git a/x-pack/legacy/plugins/canvas/public/components/es_index_select/index.js b/x-pack/plugins/canvas/public/components/es_index_select/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/es_index_select/index.js rename to x-pack/plugins/canvas/public/components/es_index_select/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/expression/element_not_selected.js b/x-pack/plugins/canvas/public/components/expression/element_not_selected.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/expression/element_not_selected.js rename to x-pack/plugins/canvas/public/components/expression/element_not_selected.js diff --git a/x-pack/legacy/plugins/canvas/public/components/expression/expression.js b/x-pack/plugins/canvas/public/components/expression/expression.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/expression/expression.js rename to x-pack/plugins/canvas/public/components/expression/expression.js diff --git a/x-pack/legacy/plugins/canvas/public/components/expression/expression.scss b/x-pack/plugins/canvas/public/components/expression/expression.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/expression/expression.scss rename to x-pack/plugins/canvas/public/components/expression/expression.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/expression/index.js b/x-pack/plugins/canvas/public/components/expression/index.js similarity index 97% rename from x-pack/legacy/plugins/canvas/public/components/expression/index.js rename to x-pack/plugins/canvas/public/components/expression/index.js index 29d22c0e1804a..c2b559fe03230 100644 --- a/x-pack/legacy/plugins/canvas/public/components/expression/index.js +++ b/x-pack/plugins/canvas/public/components/expression/index.js @@ -15,7 +15,7 @@ import { renderComponent, } from 'recompose'; import { fromExpression } from '@kbn/interpreter/common'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { getSelectedPage, getSelectedElement } from '../../state/selectors/workpad'; import { setExpression, flushContext } from '../../state/actions/elements'; import { ElementNotSelected } from './element_not_selected'; diff --git a/x-pack/legacy/plugins/canvas/public/components/expression_input/__examples__/__snapshots__/expression_input.examples.storyshot b/x-pack/plugins/canvas/public/components/expression_input/__examples__/__snapshots__/expression_input.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/expression_input/__examples__/__snapshots__/expression_input.examples.storyshot rename to x-pack/plugins/canvas/public/components/expression_input/__examples__/__snapshots__/expression_input.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/expression_input/__examples__/expression_input.examples.tsx b/x-pack/plugins/canvas/public/components/expression_input/__examples__/expression_input.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/expression_input/__examples__/expression_input.examples.tsx rename to x-pack/plugins/canvas/public/components/expression_input/__examples__/expression_input.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/expression_input/expression_input.tsx b/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx similarity index 98% rename from x-pack/legacy/plugins/canvas/public/components/expression_input/expression_input.tsx rename to x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx index faac2ae883c13..99e12b14104be 100644 --- a/x-pack/legacy/plugins/canvas/public/components/expression_input/expression_input.tsx +++ b/x-pack/plugins/canvas/public/components/expression_input/expression_input.tsx @@ -9,8 +9,8 @@ import PropTypes from 'prop-types'; import { EuiFormRow } from '@elastic/eui'; import { debounce } from 'lodash'; import { monaco } from '@kbn/ui-shared-deps/monaco'; -import { ExpressionFunction } from '../../../../../../../src/plugins/expressions'; -import { CodeEditor } from '../../../../../../../src/plugins/kibana_react/public'; +import { ExpressionFunction } from '../../../types'; +import { CodeEditor } from '../../../../../../src/plugins/kibana_react/public'; import { AutocompleteSuggestion, getAutocompleteSuggestions, diff --git a/x-pack/legacy/plugins/canvas/public/components/expression_input/index.js b/x-pack/plugins/canvas/public/components/expression_input/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/expression_input/index.js rename to x-pack/plugins/canvas/public/components/expression_input/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/expression_input/reference.ts b/x-pack/plugins/canvas/public/components/expression_input/reference.ts similarity index 97% rename from x-pack/legacy/plugins/canvas/public/components/expression_input/reference.ts rename to x-pack/plugins/canvas/public/components/expression_input/reference.ts index ca3819195fcbd..a24dacf066475 100644 --- a/x-pack/legacy/plugins/canvas/public/components/expression_input/reference.ts +++ b/x-pack/plugins/canvas/public/components/expression_input/reference.ts @@ -8,7 +8,7 @@ import { ComponentStrings } from '../../../i18n'; import { ExpressionFunction, ExpressionFunctionParameter, -} from '../../../../../../../src/plugins/expressions'; +} from '../../../../../../src/plugins/expressions'; const { ExpressionInput: strings } = ComponentStrings; diff --git a/x-pack/legacy/plugins/canvas/public/components/file_upload/__snapshots__/file_upload.stories.storyshot b/x-pack/plugins/canvas/public/components/file_upload/__snapshots__/file_upload.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/file_upload/__snapshots__/file_upload.stories.storyshot rename to x-pack/plugins/canvas/public/components/file_upload/__snapshots__/file_upload.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/file_upload/file_upload.stories.tsx b/x-pack/plugins/canvas/public/components/file_upload/file_upload.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/file_upload/file_upload.stories.tsx rename to x-pack/plugins/canvas/public/components/file_upload/file_upload.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/file_upload/file_upload.tsx b/x-pack/plugins/canvas/public/components/file_upload/file_upload.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/file_upload/file_upload.tsx rename to x-pack/plugins/canvas/public/components/file_upload/file_upload.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/font_picker/__snapshots__/font_picker.stories.storyshot b/x-pack/plugins/canvas/public/components/font_picker/__snapshots__/font_picker.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/font_picker/__snapshots__/font_picker.stories.storyshot rename to x-pack/plugins/canvas/public/components/font_picker/__snapshots__/font_picker.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/font_picker/font_picker.stories.tsx b/x-pack/plugins/canvas/public/components/font_picker/font_picker.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/font_picker/font_picker.stories.tsx rename to x-pack/plugins/canvas/public/components/font_picker/font_picker.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/font_picker/font_picker.tsx b/x-pack/plugins/canvas/public/components/font_picker/font_picker.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/font_picker/font_picker.tsx rename to x-pack/plugins/canvas/public/components/font_picker/font_picker.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/font_picker/index.js b/x-pack/plugins/canvas/public/components/font_picker/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/font_picker/index.js rename to x-pack/plugins/canvas/public/components/font_picker/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/format_select/format_select.tsx b/x-pack/plugins/canvas/public/components/format_select/format_select.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/format_select/format_select.tsx rename to x-pack/plugins/canvas/public/components/format_select/format_select.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/format_select/index.ts b/x-pack/plugins/canvas/public/components/format_select/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/format_select/index.ts rename to x-pack/plugins/canvas/public/components/format_select/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/fullscreen/fullscreen.js b/x-pack/plugins/canvas/public/components/fullscreen/fullscreen.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/fullscreen/fullscreen.js rename to x-pack/plugins/canvas/public/components/fullscreen/fullscreen.js diff --git a/x-pack/legacy/plugins/canvas/public/components/fullscreen/fullscreen.scss b/x-pack/plugins/canvas/public/components/fullscreen/fullscreen.scss similarity index 96% rename from x-pack/legacy/plugins/canvas/public/components/fullscreen/fullscreen.scss rename to x-pack/plugins/canvas/public/components/fullscreen/fullscreen.scss index ddd02074922b7..2c26c7314f377 100644 --- a/x-pack/legacy/plugins/canvas/public/components/fullscreen/fullscreen.scss +++ b/x-pack/plugins/canvas/public/components/fullscreen/fullscreen.scss @@ -5,6 +5,8 @@ body.canvas-isFullscreen { // sass-lint:disable-line no-qualifying-elements } // remove space for global nav elements + // TODO #64541 + // Can delete this block .chrHeaderWrapper ~ .app-wrapper { // Override locked nav at all breakpoints left: 0 !important; // sass-lint:disable-line no-important diff --git a/x-pack/legacy/plugins/canvas/public/components/fullscreen/index.js b/x-pack/plugins/canvas/public/components/fullscreen/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/fullscreen/index.js rename to x-pack/plugins/canvas/public/components/fullscreen/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/function_form/function_form.js b/x-pack/plugins/canvas/public/components/function_form/function_form.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/function_form/function_form.js rename to x-pack/plugins/canvas/public/components/function_form/function_form.js diff --git a/x-pack/legacy/plugins/canvas/public/components/function_form/function_form.scss b/x-pack/plugins/canvas/public/components/function_form/function_form.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/function_form/function_form.scss rename to x-pack/plugins/canvas/public/components/function_form/function_form.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/function_form/function_form_component.js b/x-pack/plugins/canvas/public/components/function_form/function_form_component.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/function_form/function_form_component.js rename to x-pack/plugins/canvas/public/components/function_form/function_form_component.js diff --git a/x-pack/legacy/plugins/canvas/public/components/function_form/function_form_context_error.tsx b/x-pack/plugins/canvas/public/components/function_form/function_form_context_error.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/function_form/function_form_context_error.tsx rename to x-pack/plugins/canvas/public/components/function_form/function_form_context_error.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/function_form/function_form_context_pending.js b/x-pack/plugins/canvas/public/components/function_form/function_form_context_pending.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/function_form/function_form_context_pending.js rename to x-pack/plugins/canvas/public/components/function_form/function_form_context_pending.js diff --git a/x-pack/legacy/plugins/canvas/public/components/function_form/function_unknown.tsx b/x-pack/plugins/canvas/public/components/function_form/function_unknown.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/function_form/function_unknown.tsx rename to x-pack/plugins/canvas/public/components/function_form/function_unknown.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/function_form/index.js b/x-pack/plugins/canvas/public/components/function_form/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/function_form/index.js rename to x-pack/plugins/canvas/public/components/function_form/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/function_form_list/function_form_list.js b/x-pack/plugins/canvas/public/components/function_form_list/function_form_list.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/function_form_list/function_form_list.js rename to x-pack/plugins/canvas/public/components/function_form_list/function_form_list.js diff --git a/x-pack/legacy/plugins/canvas/public/components/function_form_list/index.js b/x-pack/plugins/canvas/public/components/function_form_list/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/function_form_list/index.js rename to x-pack/plugins/canvas/public/components/function_form_list/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/help_menu/help_menu.js b/x-pack/plugins/canvas/public/components/help_menu/help_menu.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/help_menu/help_menu.js rename to x-pack/plugins/canvas/public/components/help_menu/help_menu.js diff --git a/x-pack/legacy/plugins/canvas/public/components/help_menu/index.js b/x-pack/plugins/canvas/public/components/help_menu/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/help_menu/index.js rename to x-pack/plugins/canvas/public/components/help_menu/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/hover_annotation/hover_annotation.js b/x-pack/plugins/canvas/public/components/hover_annotation/hover_annotation.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/hover_annotation/hover_annotation.js rename to x-pack/plugins/canvas/public/components/hover_annotation/hover_annotation.js diff --git a/x-pack/legacy/plugins/canvas/public/components/hover_annotation/hover_annotation.scss b/x-pack/plugins/canvas/public/components/hover_annotation/hover_annotation.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/hover_annotation/hover_annotation.scss rename to x-pack/plugins/canvas/public/components/hover_annotation/hover_annotation.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/hover_annotation/index.js b/x-pack/plugins/canvas/public/components/hover_annotation/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/hover_annotation/index.js rename to x-pack/plugins/canvas/public/components/hover_annotation/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/item_grid/__examples__/__snapshots__/item_grid.stories.storyshot b/x-pack/plugins/canvas/public/components/item_grid/__examples__/__snapshots__/item_grid.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/item_grid/__examples__/__snapshots__/item_grid.stories.storyshot rename to x-pack/plugins/canvas/public/components/item_grid/__examples__/__snapshots__/item_grid.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/item_grid/__examples__/item_grid.stories.tsx b/x-pack/plugins/canvas/public/components/item_grid/__examples__/item_grid.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/item_grid/__examples__/item_grid.stories.tsx rename to x-pack/plugins/canvas/public/components/item_grid/__examples__/item_grid.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/item_grid/index.ts b/x-pack/plugins/canvas/public/components/item_grid/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/item_grid/index.ts rename to x-pack/plugins/canvas/public/components/item_grid/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/item_grid/item_grid.tsx b/x-pack/plugins/canvas/public/components/item_grid/item_grid.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/item_grid/item_grid.tsx rename to x-pack/plugins/canvas/public/components/item_grid/item_grid.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/keyboard_shortcuts_doc/__examples__/__snapshots__/keyboard_shortcuts_doc.stories.storyshot b/x-pack/plugins/canvas/public/components/keyboard_shortcuts_doc/__examples__/__snapshots__/keyboard_shortcuts_doc.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/keyboard_shortcuts_doc/__examples__/__snapshots__/keyboard_shortcuts_doc.stories.storyshot rename to x-pack/plugins/canvas/public/components/keyboard_shortcuts_doc/__examples__/__snapshots__/keyboard_shortcuts_doc.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/keyboard_shortcuts_doc/__examples__/keyboard_shortcuts_doc.stories.tsx b/x-pack/plugins/canvas/public/components/keyboard_shortcuts_doc/__examples__/keyboard_shortcuts_doc.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/keyboard_shortcuts_doc/__examples__/keyboard_shortcuts_doc.stories.tsx rename to x-pack/plugins/canvas/public/components/keyboard_shortcuts_doc/__examples__/keyboard_shortcuts_doc.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/keyboard_shortcuts_doc/index.ts b/x-pack/plugins/canvas/public/components/keyboard_shortcuts_doc/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/keyboard_shortcuts_doc/index.ts rename to x-pack/plugins/canvas/public/components/keyboard_shortcuts_doc/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/keyboard_shortcuts_doc/keyboard_shortcuts_doc.tsx b/x-pack/plugins/canvas/public/components/keyboard_shortcuts_doc/keyboard_shortcuts_doc.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/keyboard_shortcuts_doc/keyboard_shortcuts_doc.tsx rename to x-pack/plugins/canvas/public/components/keyboard_shortcuts_doc/keyboard_shortcuts_doc.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/link/index.js b/x-pack/plugins/canvas/public/components/link/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/link/index.js rename to x-pack/plugins/canvas/public/components/link/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/link/link.js b/x-pack/plugins/canvas/public/components/link/link.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/link/link.js rename to x-pack/plugins/canvas/public/components/link/link.js diff --git a/x-pack/legacy/plugins/canvas/public/components/loading/__tests__/loading.js b/x-pack/plugins/canvas/public/components/loading/__tests__/loading.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/loading/__tests__/loading.js rename to x-pack/plugins/canvas/public/components/loading/__tests__/loading.js diff --git a/x-pack/legacy/plugins/canvas/public/components/loading/index.ts b/x-pack/plugins/canvas/public/components/loading/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/loading/index.ts rename to x-pack/plugins/canvas/public/components/loading/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/loading/loading.scss b/x-pack/plugins/canvas/public/components/loading/loading.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/loading/loading.scss rename to x-pack/plugins/canvas/public/components/loading/loading.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/loading/loading.tsx b/x-pack/plugins/canvas/public/components/loading/loading.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/loading/loading.tsx rename to x-pack/plugins/canvas/public/components/loading/loading.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/navbar/index.js b/x-pack/plugins/canvas/public/components/navbar/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/navbar/index.js rename to x-pack/plugins/canvas/public/components/navbar/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/navbar/navbar.js b/x-pack/plugins/canvas/public/components/navbar/navbar.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/navbar/navbar.js rename to x-pack/plugins/canvas/public/components/navbar/navbar.js diff --git a/x-pack/legacy/plugins/canvas/public/components/navbar/navbar.scss b/x-pack/plugins/canvas/public/components/navbar/navbar.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/navbar/navbar.scss rename to x-pack/plugins/canvas/public/components/navbar/navbar.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/page_config/index.js b/x-pack/plugins/canvas/public/components/page_config/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/page_config/index.js rename to x-pack/plugins/canvas/public/components/page_config/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/page_config/page_config.js b/x-pack/plugins/canvas/public/components/page_config/page_config.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/page_config/page_config.js rename to x-pack/plugins/canvas/public/components/page_config/page_config.js diff --git a/x-pack/legacy/plugins/canvas/public/components/page_manager/index.js b/x-pack/plugins/canvas/public/components/page_manager/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/page_manager/index.js rename to x-pack/plugins/canvas/public/components/page_manager/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/page_manager/page_manager.js b/x-pack/plugins/canvas/public/components/page_manager/page_manager.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/page_manager/page_manager.js rename to x-pack/plugins/canvas/public/components/page_manager/page_manager.js diff --git a/x-pack/legacy/plugins/canvas/public/components/page_manager/page_manager.scss b/x-pack/plugins/canvas/public/components/page_manager/page_manager.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/page_manager/page_manager.scss rename to x-pack/plugins/canvas/public/components/page_manager/page_manager.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/page_preview/index.js b/x-pack/plugins/canvas/public/components/page_preview/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/page_preview/index.js rename to x-pack/plugins/canvas/public/components/page_preview/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/page_preview/page_controls.js b/x-pack/plugins/canvas/public/components/page_preview/page_controls.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/page_preview/page_controls.js rename to x-pack/plugins/canvas/public/components/page_preview/page_controls.js diff --git a/x-pack/legacy/plugins/canvas/public/components/page_preview/page_preview.js b/x-pack/plugins/canvas/public/components/page_preview/page_preview.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/page_preview/page_preview.js rename to x-pack/plugins/canvas/public/components/page_preview/page_preview.js diff --git a/x-pack/legacy/plugins/canvas/public/components/paginate/index.js b/x-pack/plugins/canvas/public/components/paginate/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/paginate/index.js rename to x-pack/plugins/canvas/public/components/paginate/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/paginate/paginate.js b/x-pack/plugins/canvas/public/components/paginate/paginate.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/paginate/paginate.js rename to x-pack/plugins/canvas/public/components/paginate/paginate.js diff --git a/x-pack/legacy/plugins/canvas/public/components/palette_picker/index.js b/x-pack/plugins/canvas/public/components/palette_picker/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/palette_picker/index.js rename to x-pack/plugins/canvas/public/components/palette_picker/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/palette_picker/palette_picker.js b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/palette_picker/palette_picker.js rename to x-pack/plugins/canvas/public/components/palette_picker/palette_picker.js diff --git a/x-pack/legacy/plugins/canvas/public/components/palette_picker/palette_picker.scss b/x-pack/plugins/canvas/public/components/palette_picker/palette_picker.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/palette_picker/palette_picker.scss rename to x-pack/plugins/canvas/public/components/palette_picker/palette_picker.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/palette_swatch/index.js b/x-pack/plugins/canvas/public/components/palette_swatch/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/palette_swatch/index.js rename to x-pack/plugins/canvas/public/components/palette_swatch/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/palette_swatch/palette_swatch.js b/x-pack/plugins/canvas/public/components/palette_swatch/palette_swatch.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/palette_swatch/palette_swatch.js rename to x-pack/plugins/canvas/public/components/palette_swatch/palette_swatch.js diff --git a/x-pack/legacy/plugins/canvas/public/components/palette_swatch/palette_swatch.scss b/x-pack/plugins/canvas/public/components/palette_swatch/palette_swatch.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/palette_swatch/palette_swatch.scss rename to x-pack/plugins/canvas/public/components/palette_swatch/palette_swatch.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/popover/index.ts b/x-pack/plugins/canvas/public/components/popover/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/popover/index.ts rename to x-pack/plugins/canvas/public/components/popover/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/popover/popover.tsx b/x-pack/plugins/canvas/public/components/popover/popover.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/popover/popover.tsx rename to x-pack/plugins/canvas/public/components/popover/popover.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/positionable/index.js b/x-pack/plugins/canvas/public/components/positionable/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/positionable/index.js rename to x-pack/plugins/canvas/public/components/positionable/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/positionable/positionable.js b/x-pack/plugins/canvas/public/components/positionable/positionable.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/positionable/positionable.js rename to x-pack/plugins/canvas/public/components/positionable/positionable.js diff --git a/x-pack/legacy/plugins/canvas/public/components/positionable/positionable.scss b/x-pack/plugins/canvas/public/components/positionable/positionable.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/positionable/positionable.scss rename to x-pack/plugins/canvas/public/components/positionable/positionable.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/render_to_dom/index.js b/x-pack/plugins/canvas/public/components/render_to_dom/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/render_to_dom/index.js rename to x-pack/plugins/canvas/public/components/render_to_dom/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/render_to_dom/render_to_dom.js b/x-pack/plugins/canvas/public/components/render_to_dom/render_to_dom.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/render_to_dom/render_to_dom.js rename to x-pack/plugins/canvas/public/components/render_to_dom/render_to_dom.js diff --git a/x-pack/legacy/plugins/canvas/public/components/render_with_fn/index.js b/x-pack/plugins/canvas/public/components/render_with_fn/index.js similarity index 92% rename from x-pack/legacy/plugins/canvas/public/components/render_with_fn/index.js rename to x-pack/plugins/canvas/public/components/render_with_fn/index.js index cc234d2287c0c..473aaaf9d1ac6 100644 --- a/x-pack/legacy/plugins/canvas/public/components/render_with_fn/index.js +++ b/x-pack/plugins/canvas/public/components/render_with_fn/index.js @@ -7,7 +7,7 @@ import { compose, withProps, withPropsOnChange } from 'recompose'; import PropTypes from 'prop-types'; import isEqual from 'react-fast-compare'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { RenderWithFn as Component } from './render_with_fn'; import { ElementHandlers } from './lib/handlers'; diff --git a/x-pack/legacy/plugins/canvas/public/components/render_with_fn/lib/handlers.js b/x-pack/plugins/canvas/public/components/render_with_fn/lib/handlers.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/render_with_fn/lib/handlers.js rename to x-pack/plugins/canvas/public/components/render_with_fn/lib/handlers.js diff --git a/x-pack/legacy/plugins/canvas/public/components/render_with_fn/render_with_fn.js b/x-pack/plugins/canvas/public/components/render_with_fn/render_with_fn.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/render_with_fn/render_with_fn.js rename to x-pack/plugins/canvas/public/components/render_with_fn/render_with_fn.js diff --git a/x-pack/legacy/plugins/canvas/public/components/rotation_handle/index.js b/x-pack/plugins/canvas/public/components/rotation_handle/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/rotation_handle/index.js rename to x-pack/plugins/canvas/public/components/rotation_handle/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/rotation_handle/rotation_handle.js b/x-pack/plugins/canvas/public/components/rotation_handle/rotation_handle.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/rotation_handle/rotation_handle.js rename to x-pack/plugins/canvas/public/components/rotation_handle/rotation_handle.js diff --git a/x-pack/legacy/plugins/canvas/public/components/rotation_handle/rotation_handle.scss b/x-pack/plugins/canvas/public/components/rotation_handle/rotation_handle.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/rotation_handle/rotation_handle.scss rename to x-pack/plugins/canvas/public/components/rotation_handle/rotation_handle.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/router/canvas_loading.js b/x-pack/plugins/canvas/public/components/router/canvas_loading.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/router/canvas_loading.js rename to x-pack/plugins/canvas/public/components/router/canvas_loading.js diff --git a/x-pack/legacy/plugins/canvas/public/components/router/index.ts b/x-pack/plugins/canvas/public/components/router/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/router/index.ts rename to x-pack/plugins/canvas/public/components/router/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/router/router.js b/x-pack/plugins/canvas/public/components/router/router.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/router/router.js rename to x-pack/plugins/canvas/public/components/router/router.js diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/element_controls.stories.storyshot b/x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/element_controls.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/element_controls.stories.storyshot rename to x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/element_controls.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/element_grid.stories.storyshot b/x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/element_grid.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/element_grid.stories.storyshot rename to x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/element_grid.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/saved_elements_modal.stories.storyshot b/x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/saved_elements_modal.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/saved_elements_modal.stories.storyshot rename to x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/__snapshots__/saved_elements_modal.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/element_controls.stories.tsx b/x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/element_controls.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/element_controls.stories.tsx rename to x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/element_controls.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/element_grid.stories.tsx b/x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/element_grid.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/element_grid.stories.tsx rename to x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/element_grid.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/fixtures/test_elements.tsx b/x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/fixtures/test_elements.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/fixtures/test_elements.tsx rename to x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/fixtures/test_elements.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/saved_elements_modal.stories.tsx b/x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/saved_elements_modal.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/__examples__/saved_elements_modal.stories.tsx rename to x-pack/plugins/canvas/public/components/saved_elements_modal/__examples__/saved_elements_modal.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/element_controls.tsx b/x-pack/plugins/canvas/public/components/saved_elements_modal/element_controls.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/element_controls.tsx rename to x-pack/plugins/canvas/public/components/saved_elements_modal/element_controls.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/element_grid.tsx b/x-pack/plugins/canvas/public/components/saved_elements_modal/element_grid.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/element_grid.tsx rename to x-pack/plugins/canvas/public/components/saved_elements_modal/element_grid.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/index.ts b/x-pack/plugins/canvas/public/components/saved_elements_modal/index.ts similarity index 98% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/index.ts rename to x-pack/plugins/canvas/public/components/saved_elements_modal/index.ts index 60d1d7462daa9..f14fc92e028db 100644 --- a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/index.ts +++ b/x-pack/plugins/canvas/public/components/saved_elements_modal/index.ts @@ -11,7 +11,7 @@ import { camelCase } from 'lodash'; // @ts-ignore Untyped local import { cloneSubgraphs } from '../../lib/clone_subgraphs'; import * as customElementService from '../../lib/custom_element_service'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { WithKibanaProps } from '../../'; // @ts-ignore Untyped local import { selectToplevelNodes } from '../../state/actions/transient'; diff --git a/x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/saved_elements_modal.tsx b/x-pack/plugins/canvas/public/components/saved_elements_modal/saved_elements_modal.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/saved_elements_modal/saved_elements_modal.tsx rename to x-pack/plugins/canvas/public/components/saved_elements_modal/saved_elements_modal.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_picker/__examples__/__snapshots__/shape_picker.stories.storyshot b/x-pack/plugins/canvas/public/components/shape_picker/__examples__/__snapshots__/shape_picker.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_picker/__examples__/__snapshots__/shape_picker.stories.storyshot rename to x-pack/plugins/canvas/public/components/shape_picker/__examples__/__snapshots__/shape_picker.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_picker/__examples__/shape_picker.stories.tsx b/x-pack/plugins/canvas/public/components/shape_picker/__examples__/shape_picker.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_picker/__examples__/shape_picker.stories.tsx rename to x-pack/plugins/canvas/public/components/shape_picker/__examples__/shape_picker.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_picker/index.ts b/x-pack/plugins/canvas/public/components/shape_picker/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_picker/index.ts rename to x-pack/plugins/canvas/public/components/shape_picker/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_picker/shape_picker.scss b/x-pack/plugins/canvas/public/components/shape_picker/shape_picker.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_picker/shape_picker.scss rename to x-pack/plugins/canvas/public/components/shape_picker/shape_picker.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_picker/shape_picker.tsx b/x-pack/plugins/canvas/public/components/shape_picker/shape_picker.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_picker/shape_picker.tsx rename to x-pack/plugins/canvas/public/components/shape_picker/shape_picker.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_picker_popover/__examples__/__snapshots__/shape_picker_popover.stories.storyshot b/x-pack/plugins/canvas/public/components/shape_picker_popover/__examples__/__snapshots__/shape_picker_popover.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_picker_popover/__examples__/__snapshots__/shape_picker_popover.stories.storyshot rename to x-pack/plugins/canvas/public/components/shape_picker_popover/__examples__/__snapshots__/shape_picker_popover.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_picker_popover/__examples__/shape_picker_popover.stories.tsx b/x-pack/plugins/canvas/public/components/shape_picker_popover/__examples__/shape_picker_popover.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_picker_popover/__examples__/shape_picker_popover.stories.tsx rename to x-pack/plugins/canvas/public/components/shape_picker_popover/__examples__/shape_picker_popover.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_picker_popover/index.tsx b/x-pack/plugins/canvas/public/components/shape_picker_popover/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_picker_popover/index.tsx rename to x-pack/plugins/canvas/public/components/shape_picker_popover/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_picker_popover/shape_picker_popover.tsx b/x-pack/plugins/canvas/public/components/shape_picker_popover/shape_picker_popover.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_picker_popover/shape_picker_popover.tsx rename to x-pack/plugins/canvas/public/components/shape_picker_popover/shape_picker_popover.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_preview/__examples__/__snapshots__/shape_preview.stories.storyshot b/x-pack/plugins/canvas/public/components/shape_preview/__examples__/__snapshots__/shape_preview.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_preview/__examples__/__snapshots__/shape_preview.stories.storyshot rename to x-pack/plugins/canvas/public/components/shape_preview/__examples__/__snapshots__/shape_preview.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_preview/__examples__/shape_preview.stories.tsx b/x-pack/plugins/canvas/public/components/shape_preview/__examples__/shape_preview.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_preview/__examples__/shape_preview.stories.tsx rename to x-pack/plugins/canvas/public/components/shape_preview/__examples__/shape_preview.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_preview/index.ts b/x-pack/plugins/canvas/public/components/shape_preview/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_preview/index.ts rename to x-pack/plugins/canvas/public/components/shape_preview/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_preview/shape_preview.scss b/x-pack/plugins/canvas/public/components/shape_preview/shape_preview.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_preview/shape_preview.scss rename to x-pack/plugins/canvas/public/components/shape_preview/shape_preview.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/shape_preview/shape_preview.tsx b/x-pack/plugins/canvas/public/components/shape_preview/shape_preview.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/shape_preview/shape_preview.tsx rename to x-pack/plugins/canvas/public/components/shape_preview/shape_preview.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/__examples__/__snapshots__/group_settings.stories.storyshot b/x-pack/plugins/canvas/public/components/sidebar/__examples__/__snapshots__/group_settings.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/__examples__/__snapshots__/group_settings.stories.storyshot rename to x-pack/plugins/canvas/public/components/sidebar/__examples__/__snapshots__/group_settings.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/__examples__/__snapshots__/multi_element_settings.stories.storyshot b/x-pack/plugins/canvas/public/components/sidebar/__examples__/__snapshots__/multi_element_settings.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/__examples__/__snapshots__/multi_element_settings.stories.storyshot rename to x-pack/plugins/canvas/public/components/sidebar/__examples__/__snapshots__/multi_element_settings.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/__examples__/group_settings.stories.tsx b/x-pack/plugins/canvas/public/components/sidebar/__examples__/group_settings.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/__examples__/group_settings.stories.tsx rename to x-pack/plugins/canvas/public/components/sidebar/__examples__/group_settings.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/__examples__/multi_element_settings.stories.tsx b/x-pack/plugins/canvas/public/components/sidebar/__examples__/multi_element_settings.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/__examples__/multi_element_settings.stories.tsx rename to x-pack/plugins/canvas/public/components/sidebar/__examples__/multi_element_settings.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx b/x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx rename to x-pack/plugins/canvas/public/components/sidebar/element_settings/element_settings.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/element_settings/index.tsx b/x-pack/plugins/canvas/public/components/sidebar/element_settings/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/element_settings/index.tsx rename to x-pack/plugins/canvas/public/components/sidebar/element_settings/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/global_config.tsx b/x-pack/plugins/canvas/public/components/sidebar/global_config.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/global_config.tsx rename to x-pack/plugins/canvas/public/components/sidebar/global_config.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/group_settings.tsx b/x-pack/plugins/canvas/public/components/sidebar/group_settings.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/group_settings.tsx rename to x-pack/plugins/canvas/public/components/sidebar/group_settings.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/index.tsx b/x-pack/plugins/canvas/public/components/sidebar/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/index.tsx rename to x-pack/plugins/canvas/public/components/sidebar/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/multi_element_settings.tsx b/x-pack/plugins/canvas/public/components/sidebar/multi_element_settings.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/multi_element_settings.tsx rename to x-pack/plugins/canvas/public/components/sidebar/multi_element_settings.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar.scss b/x-pack/plugins/canvas/public/components/sidebar/sidebar.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar.scss rename to x-pack/plugins/canvas/public/components/sidebar/sidebar.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar.tsx b/x-pack/plugins/canvas/public/components/sidebar/sidebar.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar.tsx rename to x-pack/plugins/canvas/public/components/sidebar/sidebar.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar_content.js b/x-pack/plugins/canvas/public/components/sidebar/sidebar_content.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar_content.js rename to x-pack/plugins/canvas/public/components/sidebar/sidebar_content.js diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar_section.js b/x-pack/plugins/canvas/public/components/sidebar/sidebar_section.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar_section.js rename to x-pack/plugins/canvas/public/components/sidebar/sidebar_section.js diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar_section_title.js b/x-pack/plugins/canvas/public/components/sidebar/sidebar_section_title.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar/sidebar_section_title.js rename to x-pack/plugins/canvas/public/components/sidebar/sidebar_section_title.js diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar_header/__examples__/__snapshots__/sidebar_header.stories.storyshot b/x-pack/plugins/canvas/public/components/sidebar_header/__examples__/__snapshots__/sidebar_header.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar_header/__examples__/__snapshots__/sidebar_header.stories.storyshot rename to x-pack/plugins/canvas/public/components/sidebar_header/__examples__/__snapshots__/sidebar_header.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar_header/__examples__/sidebar_header.stories.tsx b/x-pack/plugins/canvas/public/components/sidebar_header/__examples__/sidebar_header.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar_header/__examples__/sidebar_header.stories.tsx rename to x-pack/plugins/canvas/public/components/sidebar_header/__examples__/sidebar_header.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar_header/index.js b/x-pack/plugins/canvas/public/components/sidebar_header/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar_header/index.js rename to x-pack/plugins/canvas/public/components/sidebar_header/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar_header/sidebar_header.scss b/x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar_header/sidebar_header.scss rename to x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/sidebar_header/sidebar_header.tsx b/x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/sidebar_header/sidebar_header.tsx rename to x-pack/plugins/canvas/public/components/sidebar_header/sidebar_header.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/tag/__examples__/__snapshots__/tag.stories.storyshot b/x-pack/plugins/canvas/public/components/tag/__examples__/__snapshots__/tag.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tag/__examples__/__snapshots__/tag.stories.storyshot rename to x-pack/plugins/canvas/public/components/tag/__examples__/__snapshots__/tag.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/tag/__examples__/tag.stories.tsx b/x-pack/plugins/canvas/public/components/tag/__examples__/tag.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tag/__examples__/tag.stories.tsx rename to x-pack/plugins/canvas/public/components/tag/__examples__/tag.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/tag/index.tsx b/x-pack/plugins/canvas/public/components/tag/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tag/index.tsx rename to x-pack/plugins/canvas/public/components/tag/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/tag/tag.tsx b/x-pack/plugins/canvas/public/components/tag/tag.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tag/tag.tsx rename to x-pack/plugins/canvas/public/components/tag/tag.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/tag_list/__examples__/__snapshots__/tag_list.stories.storyshot b/x-pack/plugins/canvas/public/components/tag_list/__examples__/__snapshots__/tag_list.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tag_list/__examples__/__snapshots__/tag_list.stories.storyshot rename to x-pack/plugins/canvas/public/components/tag_list/__examples__/__snapshots__/tag_list.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/tag_list/__examples__/tag_list.stories.tsx b/x-pack/plugins/canvas/public/components/tag_list/__examples__/tag_list.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tag_list/__examples__/tag_list.stories.tsx rename to x-pack/plugins/canvas/public/components/tag_list/__examples__/tag_list.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/tag_list/index.tsx b/x-pack/plugins/canvas/public/components/tag_list/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tag_list/index.tsx rename to x-pack/plugins/canvas/public/components/tag_list/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/tag_list/tag_list.tsx b/x-pack/plugins/canvas/public/components/tag_list/tag_list.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tag_list/tag_list.tsx rename to x-pack/plugins/canvas/public/components/tag_list/tag_list.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/text_style_picker/font_sizes.js b/x-pack/plugins/canvas/public/components/text_style_picker/font_sizes.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/text_style_picker/font_sizes.js rename to x-pack/plugins/canvas/public/components/text_style_picker/font_sizes.js diff --git a/x-pack/legacy/plugins/canvas/public/components/text_style_picker/index.js b/x-pack/plugins/canvas/public/components/text_style_picker/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/text_style_picker/index.js rename to x-pack/plugins/canvas/public/components/text_style_picker/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/text_style_picker/text_style_picker.js b/x-pack/plugins/canvas/public/components/text_style_picker/text_style_picker.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/text_style_picker/text_style_picker.js rename to x-pack/plugins/canvas/public/components/text_style_picker/text_style_picker.js diff --git a/x-pack/legacy/plugins/canvas/public/components/tool_tip_shortcut/__examples__/__snapshots__/tool_tip_shortcut.stories.storyshot b/x-pack/plugins/canvas/public/components/tool_tip_shortcut/__examples__/__snapshots__/tool_tip_shortcut.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tool_tip_shortcut/__examples__/__snapshots__/tool_tip_shortcut.stories.storyshot rename to x-pack/plugins/canvas/public/components/tool_tip_shortcut/__examples__/__snapshots__/tool_tip_shortcut.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/tool_tip_shortcut/__examples__/tool_tip_shortcut.stories.tsx b/x-pack/plugins/canvas/public/components/tool_tip_shortcut/__examples__/tool_tip_shortcut.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tool_tip_shortcut/__examples__/tool_tip_shortcut.stories.tsx rename to x-pack/plugins/canvas/public/components/tool_tip_shortcut/__examples__/tool_tip_shortcut.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/tool_tip_shortcut/index.tsx b/x-pack/plugins/canvas/public/components/tool_tip_shortcut/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tool_tip_shortcut/index.tsx rename to x-pack/plugins/canvas/public/components/tool_tip_shortcut/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/tool_tip_shortcut/tool_tip_shortcut.tsx b/x-pack/plugins/canvas/public/components/tool_tip_shortcut/tool_tip_shortcut.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tool_tip_shortcut/tool_tip_shortcut.tsx rename to x-pack/plugins/canvas/public/components/tool_tip_shortcut/tool_tip_shortcut.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/toolbar/__examples__/toolbar.stories.tsx b/x-pack/plugins/canvas/public/components/toolbar/__examples__/toolbar.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/toolbar/__examples__/toolbar.stories.tsx rename to x-pack/plugins/canvas/public/components/toolbar/__examples__/toolbar.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/toolbar/index.js b/x-pack/plugins/canvas/public/components/toolbar/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/toolbar/index.js rename to x-pack/plugins/canvas/public/components/toolbar/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/toolbar/toolbar.scss b/x-pack/plugins/canvas/public/components/toolbar/toolbar.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/toolbar/toolbar.scss rename to x-pack/plugins/canvas/public/components/toolbar/toolbar.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/toolbar/toolbar.tsx b/x-pack/plugins/canvas/public/components/toolbar/toolbar.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/toolbar/toolbar.tsx rename to x-pack/plugins/canvas/public/components/toolbar/toolbar.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/toolbar/tray/index.ts b/x-pack/plugins/canvas/public/components/toolbar/tray/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/toolbar/tray/index.ts rename to x-pack/plugins/canvas/public/components/toolbar/tray/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/toolbar/tray/tray.scss b/x-pack/plugins/canvas/public/components/toolbar/tray/tray.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/toolbar/tray/tray.scss rename to x-pack/plugins/canvas/public/components/toolbar/tray/tray.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/toolbar/tray/tray.tsx b/x-pack/plugins/canvas/public/components/toolbar/tray/tray.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/toolbar/tray/tray.tsx rename to x-pack/plugins/canvas/public/components/toolbar/tray/tray.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/tooltip_annotation/index.js b/x-pack/plugins/canvas/public/components/tooltip_annotation/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tooltip_annotation/index.js rename to x-pack/plugins/canvas/public/components/tooltip_annotation/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/tooltip_annotation/tooltip_annotation.js b/x-pack/plugins/canvas/public/components/tooltip_annotation/tooltip_annotation.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tooltip_annotation/tooltip_annotation.js rename to x-pack/plugins/canvas/public/components/tooltip_annotation/tooltip_annotation.js diff --git a/x-pack/legacy/plugins/canvas/public/components/tooltip_annotation/tooltip_annotation.scss b/x-pack/plugins/canvas/public/components/tooltip_annotation/tooltip_annotation.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tooltip_annotation/tooltip_annotation.scss rename to x-pack/plugins/canvas/public/components/tooltip_annotation/tooltip_annotation.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/tooltip_icon/index.ts b/x-pack/plugins/canvas/public/components/tooltip_icon/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tooltip_icon/index.ts rename to x-pack/plugins/canvas/public/components/tooltip_icon/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/tooltip_icon/tooltip_icon.tsx b/x-pack/plugins/canvas/public/components/tooltip_icon/tooltip_icon.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/tooltip_icon/tooltip_icon.tsx rename to x-pack/plugins/canvas/public/components/tooltip_icon/tooltip_icon.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad/index.js b/x-pack/plugins/canvas/public/components/workpad/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad/index.js rename to x-pack/plugins/canvas/public/components/workpad/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad/workpad.js b/x-pack/plugins/canvas/public/components/workpad/workpad.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad/workpad.js rename to x-pack/plugins/canvas/public/components/workpad/workpad.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad/workpad.scss b/x-pack/plugins/canvas/public/components/workpad/workpad.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad/workpad.scss rename to x-pack/plugins/canvas/public/components/workpad/workpad.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_color_picker/index.ts b/x-pack/plugins/canvas/public/components/workpad_color_picker/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_color_picker/index.ts rename to x-pack/plugins/canvas/public/components/workpad_color_picker/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.tsx b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.tsx rename to x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_config/index.js b/x-pack/plugins/canvas/public/components/workpad_config/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_config/index.js rename to x-pack/plugins/canvas/public/components/workpad_config/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_config/workpad_config.js b/x-pack/plugins/canvas/public/components/workpad_config/workpad_config.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_config/workpad_config.js rename to x-pack/plugins/canvas/public/components/workpad_config/workpad_config.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/__snapshots__/edit_menu.examples.storyshot b/x-pack/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/__snapshots__/edit_menu.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/__snapshots__/edit_menu.examples.storyshot rename to x-pack/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/__snapshots__/edit_menu.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/edit_menu.examples.tsx b/x-pack/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/edit_menu.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/edit_menu.examples.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/edit_menu/__examples__/edit_menu.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/edit_menu/edit_menu.tsx b/x-pack/plugins/canvas/public/components/workpad_header/edit_menu/edit_menu.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/edit_menu/edit_menu.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/edit_menu/edit_menu.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/edit_menu/index.ts b/x-pack/plugins/canvas/public/components/workpad_header/edit_menu/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/edit_menu/index.ts rename to x-pack/plugins/canvas/public/components/workpad_header/edit_menu/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/__examples__/__snapshots__/element_menu.examples.storyshot b/x-pack/plugins/canvas/public/components/workpad_header/element_menu/__examples__/__snapshots__/element_menu.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/__examples__/__snapshots__/element_menu.examples.storyshot rename to x-pack/plugins/canvas/public/components/workpad_header/element_menu/__examples__/__snapshots__/element_menu.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/__examples__/element_menu.examples.tsx b/x-pack/plugins/canvas/public/components/workpad_header/element_menu/__examples__/element_menu.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/__examples__/element_menu.examples.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/element_menu/__examples__/element_menu.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/element_menu.scss b/x-pack/plugins/canvas/public/components/workpad_header/element_menu/element_menu.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/element_menu.scss rename to x-pack/plugins/canvas/public/components/workpad_header/element_menu/element_menu.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/element_menu.tsx b/x-pack/plugins/canvas/public/components/workpad_header/element_menu/element_menu.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/element_menu.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/element_menu/element_menu.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/index.tsx b/x-pack/plugins/canvas/public/components/workpad_header/element_menu/index.tsx similarity index 95% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/index.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/element_menu/index.tsx index 40571a9341f69..a1227b3394678 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_header/element_menu/index.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_header/element_menu/index.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { compose, withProps } from 'recompose'; import { Dispatch } from 'redux'; -import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../src/plugins/kibana_react/public/'; import { State, ElementSpec } from '../../../../types'; // @ts-ignore Untyped local import { elementsRegistry } from '../../../lib/elements_registry'; diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/fullscreen_control/fullscreen_control.tsx b/x-pack/plugins/canvas/public/components/workpad_header/fullscreen_control/fullscreen_control.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/fullscreen_control/fullscreen_control.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/fullscreen_control/fullscreen_control.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/fullscreen_control/index.js b/x-pack/plugins/canvas/public/components/workpad_header/fullscreen_control/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/fullscreen_control/index.js rename to x-pack/plugins/canvas/public/components/workpad_header/fullscreen_control/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/index.tsx b/x-pack/plugins/canvas/public/components/workpad_header/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/index.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/refresh_control/index.ts b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/refresh_control/index.ts rename to x-pack/plugins/canvas/public/components/workpad_header/refresh_control/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.tsx b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/__examples__/__snapshots__/pdf_panel.stories.storyshot b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/__examples__/__snapshots__/pdf_panel.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/__examples__/__snapshots__/pdf_panel.stories.storyshot rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/__examples__/__snapshots__/pdf_panel.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/__examples__/__snapshots__/share_menu.examples.storyshot b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/__examples__/__snapshots__/share_menu.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/__examples__/__snapshots__/share_menu.examples.storyshot rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/__examples__/__snapshots__/share_menu.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/__examples__/pdf_panel.stories.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/__examples__/pdf_panel.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/__examples__/pdf_panel.stories.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/__examples__/pdf_panel.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/__examples__/share_menu.examples.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/__examples__/share_menu.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/__examples__/share_menu.examples.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/__examples__/share_menu.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/__examples__/share_website_flyout.stories.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/__examples__/share_website_flyout.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/__examples__/share_website_flyout.stories.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/__examples__/share_website_flyout.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts similarity index 97% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts index 4377635acac88..1ed39b62cccad 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/index.ts @@ -25,7 +25,7 @@ import { API_ROUTE_SHAREABLE_ZIP } from '../../../../../common/lib/constants'; import { renderFunctionNames } from '../../../../../shareable_runtime/supported_renderers'; import { ComponentStrings } from '../../../../../i18n/components'; -import { withKibana } from '../../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; import { OnCloseFn } from '../share_menu'; import { WithKibanaProps } from '../../../../index'; const { WorkpadHeaderShareMenu: strings } = ComponentStrings; diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/runtime_step.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/runtime_step.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/runtime_step.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/runtime_step.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/share_website_flyout.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/share_website_flyout.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/share_website_flyout.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/share_website_flyout.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/snippets_step.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/snippets_step.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/snippets_step.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/snippets_step.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/workpad_step.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/workpad_step.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/flyout/workpad_step.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/workpad_step.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/index.ts b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/index.ts similarity index 94% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/index.ts rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/index.ts index d6565f0e43db7..9a8936ada6d1e 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/index.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/index.ts @@ -6,14 +6,14 @@ import { connect } from 'react-redux'; import { compose, withProps } from 'recompose'; -import { jobCompletionNotifications } from '../../../../../../../plugins/reporting/public'; +import { jobCompletionNotifications } from '../../../../../../plugins/reporting/public'; import { getWorkpad, getPages } from '../../../state/selectors/workpad'; import { getWindow } from '../../../lib/get_window'; import { downloadWorkpad } from '../../../lib/download_workpad'; import { ShareMenu as Component, Props as ComponentProps } from './share_menu'; import { getPdfUrl, createPdf } from './utils'; import { State, CanvasWorkpad } from '../../../../types'; -import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../src/plugins/kibana_react/public/'; import { WithKibanaProps } from '../../../index'; import { ComponentStrings } from '../../../../i18n'; diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/pdf_panel.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/pdf_panel.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/pdf_panel.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/pdf_panel.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/share_menu.scss b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/share_menu.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/share_menu.scss rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/share_menu.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/share_menu.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/share_menu.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/share_menu.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/share_menu.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/utils.test.ts b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/utils.test.ts rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.test.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/utils.ts b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts similarity index 97% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/utils.ts rename to x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts index dc99c0687f388..8a3438e89e846 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_header/share_menu/utils.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/utils.ts @@ -9,7 +9,7 @@ import rison from 'rison-node'; import { IBasePath } from 'kibana/public'; import { fetch } from '../../../../common/lib/fetch'; import { CanvasWorkpad } from '../../../../types'; -import { url } from '../../../../../../../../src/plugins/kibana_utils/public'; +import { url } from '../../../../../../../src/plugins/kibana_utils/public'; // type of the desired pdf output (print or preserve_layout) const PDF_LAYOUT_TYPE = 'preserve_layout'; diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/__examples__/__snapshots__/view_menu.stories.storyshot b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/__examples__/__snapshots__/view_menu.stories.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/__examples__/__snapshots__/view_menu.stories.storyshot rename to x-pack/plugins/canvas/public/components/workpad_header/view_menu/__examples__/__snapshots__/view_menu.stories.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/__examples__/view_menu.stories.tsx b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/__examples__/view_menu.stories.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/__examples__/view_menu.stories.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/view_menu/__examples__/view_menu.stories.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/auto_refresh_controls.tsx b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/auto_refresh_controls.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/auto_refresh_controls.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/view_menu/auto_refresh_controls.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/custom_interval.tsx b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/custom_interval.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/custom_interval.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/view_menu/custom_interval.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/index.ts b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/index.ts similarity index 97% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/index.ts rename to x-pack/plugins/canvas/public/components/workpad_header/view_menu/index.ts index e1ad9782c8aef..e561607cb101e 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/index.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/index.ts @@ -7,7 +7,7 @@ import { connect } from 'react-redux'; import { compose, withHandlers } from 'recompose'; import { Dispatch } from 'redux'; -import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../src/plugins/kibana_react/public/'; import { zoomHandlerCreators } from '../../../lib/app_handler_creators'; import { State, CanvasWorkpadBoundingBox } from '../../../../types'; // @ts-ignore Untyped local diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/kiosk_controls.tsx b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/kiosk_controls.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/kiosk_controls.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/view_menu/kiosk_controls.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/lib/get_fit_zoom_scale.ts b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/lib/get_fit_zoom_scale.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/lib/get_fit_zoom_scale.ts rename to x-pack/plugins/canvas/public/components/workpad_header/view_menu/lib/get_fit_zoom_scale.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/view_menu.scss b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/view_menu.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/view_menu.scss rename to x-pack/plugins/canvas/public/components/workpad_header/view_menu/view_menu.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/view_menu.tsx b/x-pack/plugins/canvas/public/components/workpad_header/view_menu/view_menu.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/view_menu/view_menu.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/view_menu/view_menu.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_header.tsx b/x-pack/plugins/canvas/public/components/workpad_header/workpad_header.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_header.tsx rename to x-pack/plugins/canvas/public/components/workpad_header/workpad_header.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/index.js b/x-pack/plugins/canvas/public/components/workpad_loader/index.js similarity index 98% rename from x-pack/legacy/plugins/canvas/public/components/workpad_loader/index.js rename to x-pack/plugins/canvas/public/components/workpad_loader/index.js index 9379379e54d97..8b190338db49e 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/index.js +++ b/x-pack/plugins/canvas/public/components/workpad_loader/index.js @@ -14,7 +14,7 @@ import { getWorkpad } from '../../state/selectors/workpad'; import { getId } from '../../lib/get_id'; import { downloadWorkpad } from '../../lib/download_workpad'; import { ComponentStrings, ErrorStrings } from '../../../i18n'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { WorkpadLoader as Component } from './workpad_loader'; const { WorkpadLoader: strings } = ComponentStrings; diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/upload_workpad.js b/x-pack/plugins/canvas/public/components/workpad_loader/upload_workpad.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_loader/upload_workpad.js rename to x-pack/plugins/canvas/public/components/workpad_loader/upload_workpad.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_create.js b/x-pack/plugins/canvas/public/components/workpad_loader/workpad_create.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_create.js rename to x-pack/plugins/canvas/public/components/workpad_loader/workpad_create.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_dropzone/index.js b/x-pack/plugins/canvas/public/components/workpad_loader/workpad_dropzone/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_dropzone/index.js rename to x-pack/plugins/canvas/public/components/workpad_loader/workpad_dropzone/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_dropzone/workpad_dropzone.js b/x-pack/plugins/canvas/public/components/workpad_loader/workpad_dropzone/workpad_dropzone.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_dropzone/workpad_dropzone.js rename to x-pack/plugins/canvas/public/components/workpad_loader/workpad_dropzone/workpad_dropzone.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_dropzone/workpad_dropzone.scss b/x-pack/plugins/canvas/public/components/workpad_loader/workpad_dropzone/workpad_dropzone.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_dropzone/workpad_dropzone.scss rename to x-pack/plugins/canvas/public/components/workpad_loader/workpad_dropzone/workpad_dropzone.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_loader.js b/x-pack/plugins/canvas/public/components/workpad_loader/workpad_loader.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_loader.js rename to x-pack/plugins/canvas/public/components/workpad_loader/workpad_loader.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_loader.scss b/x-pack/plugins/canvas/public/components/workpad_loader/workpad_loader.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_loader.scss rename to x-pack/plugins/canvas/public/components/workpad_loader/workpad_loader.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_search.js b/x-pack/plugins/canvas/public/components/workpad_loader/workpad_search.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_loader/workpad_search.js rename to x-pack/plugins/canvas/public/components/workpad_loader/workpad_search.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_manager/index.js b/x-pack/plugins/canvas/public/components/workpad_manager/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_manager/index.js rename to x-pack/plugins/canvas/public/components/workpad_manager/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_manager/workpad_manager.js b/x-pack/plugins/canvas/public/components/workpad_manager/workpad_manager.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_manager/workpad_manager.js rename to x-pack/plugins/canvas/public/components/workpad_manager/workpad_manager.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/index.js b/x-pack/plugins/canvas/public/components/workpad_page/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/index.js rename to x-pack/plugins/canvas/public/components/workpad_page/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/integration_utils.js b/x-pack/plugins/canvas/public/components/workpad_page/integration_utils.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/integration_utils.js rename to x-pack/plugins/canvas/public/components/workpad_page/integration_utils.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/positioning_utils.ts b/x-pack/plugins/canvas/public/components/workpad_page/positioning_utils.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/positioning_utils.ts rename to x-pack/plugins/canvas/public/components/workpad_page/positioning_utils.ts diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/prop_types.js b/x-pack/plugins/canvas/public/components/workpad_page/prop_types.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/prop_types.js rename to x-pack/plugins/canvas/public/components/workpad_page/prop_types.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/utils.js b/x-pack/plugins/canvas/public/components/workpad_page/utils.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/utils.js rename to x-pack/plugins/canvas/public/components/workpad_page/utils.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.js b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.js rename to x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/index.js b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/index.js rename to x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interaction_boundary.tsx b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interaction_boundary.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interaction_boundary.tsx rename to x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interaction_boundary.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interactive_workpad_page.js b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interactive_workpad_page.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interactive_workpad_page.js rename to x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/interactive_workpad_page.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/workpad_interactive_page.scss b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/workpad_interactive_page.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_interactive_page/workpad_interactive_page.scss rename to x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/workpad_interactive_page.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_page.scss b/x-pack/plugins/canvas/public/components/workpad_page/workpad_page.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_page.scss rename to x-pack/plugins/canvas/public/components/workpad_page/workpad_page.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_static_page/index.js b/x-pack/plugins/canvas/public/components/workpad_page/workpad_static_page/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_static_page/index.js rename to x-pack/plugins/canvas/public/components/workpad_page/workpad_static_page/index.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_static_page/static_workpad_page.js b/x-pack/plugins/canvas/public/components/workpad_page/workpad_static_page/static_workpad_page.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_static_page/static_workpad_page.js rename to x-pack/plugins/canvas/public/components/workpad_page/workpad_static_page/static_workpad_page.js diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_static_page/workpad_static_page.scss b/x-pack/plugins/canvas/public/components/workpad_page/workpad_static_page/workpad_static_page.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_page/workpad_static_page/workpad_static_page.scss rename to x-pack/plugins/canvas/public/components/workpad_page/workpad_static_page/workpad_static_page.scss diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_shortcuts/index.tsx b/x-pack/plugins/canvas/public/components/workpad_shortcuts/index.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_shortcuts/index.tsx rename to x-pack/plugins/canvas/public/components/workpad_shortcuts/index.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_shortcuts/workpad_shortcuts.tsx b/x-pack/plugins/canvas/public/components/workpad_shortcuts/workpad_shortcuts.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_shortcuts/workpad_shortcuts.tsx rename to x-pack/plugins/canvas/public/components/workpad_shortcuts/workpad_shortcuts.tsx diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_templates/index.js b/x-pack/plugins/canvas/public/components/workpad_templates/index.js similarity index 94% rename from x-pack/legacy/plugins/canvas/public/components/workpad_templates/index.js rename to x-pack/plugins/canvas/public/components/workpad_templates/index.js index 1890ca1f9d2d6..a17b77b74e499 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_templates/index.js +++ b/x-pack/plugins/canvas/public/components/workpad_templates/index.js @@ -9,7 +9,7 @@ import { compose, getContext, withHandlers, withProps } from 'recompose'; import * as workpadService from '../../lib/workpad_service'; import { getId } from '../../lib/get_id'; import { templatesRegistry } from '../../lib/templates_registry'; -import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; +import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { WorkpadTemplates as Component } from './workpad_templates'; export const WorkpadTemplates = compose( diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_templates/workpad_templates.js b/x-pack/plugins/canvas/public/components/workpad_templates/workpad_templates.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/components/workpad_templates/workpad_templates.js rename to x-pack/plugins/canvas/public/components/workpad_templates/workpad_templates.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg.js b/x-pack/plugins/canvas/public/expression_types/arg.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg.js rename to x-pack/plugins/canvas/public/expression_types/arg.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_type.js b/x-pack/plugins/canvas/public/expression_types/arg_type.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_type.js rename to x-pack/plugins/canvas/public/expression_types/arg_type.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/color.js b/x-pack/plugins/canvas/public/expression_types/arg_types/color.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/color.js rename to x-pack/plugins/canvas/public/expression_types/arg_types/color.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/__snapshots__/extended_template.examples.storyshot b/x-pack/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/__snapshots__/extended_template.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/__snapshots__/extended_template.examples.storyshot rename to x-pack/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/__snapshots__/extended_template.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/__snapshots__/simple_template.examples.storyshot b/x-pack/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/__snapshots__/simple_template.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/__snapshots__/simple_template.examples.storyshot rename to x-pack/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/__snapshots__/simple_template.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/extended_template.examples.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/extended_template.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/extended_template.examples.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/extended_template.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/simple_template.examples.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/simple_template.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/simple_template.examples.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/container_style/__examples__/simple_template.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/appearance_form.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/container_style/appearance_form.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/appearance_form.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/container_style/appearance_form.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/border_form.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/container_style/border_form.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/border_form.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/container_style/border_form.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/extended_template.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/container_style/extended_template.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/extended_template.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/container_style/extended_template.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/index.ts b/x-pack/plugins/canvas/public/expression_types/arg_types/container_style/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/index.ts rename to x-pack/plugins/canvas/public/expression_types/arg_types/container_style/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/simple_template.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/container_style/simple_template.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/container_style/simple_template.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/container_style/simple_template.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/font.js b/x-pack/plugins/canvas/public/expression_types/arg_types/font.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/font.js rename to x-pack/plugins/canvas/public/expression_types/arg_types/font.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/index.js b/x-pack/plugins/canvas/public/expression_types/arg_types/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/index.js rename to x-pack/plugins/canvas/public/expression_types/arg_types/index.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/__snapshots__/extended_template.examples.storyshot b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/__snapshots__/extended_template.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/__snapshots__/extended_template.examples.storyshot rename to x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/__snapshots__/extended_template.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/__snapshots__/simple_template.examples.storyshot b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/__snapshots__/simple_template.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/__snapshots__/simple_template.examples.storyshot rename to x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/__snapshots__/simple_template.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/extended_template.examples.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/extended_template.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/extended_template.examples.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/extended_template.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/simple_template.examples.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/simple_template.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/simple_template.examples.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/series_style/__examples__/simple_template.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/extended_template.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/extended_template.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/extended_template.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/series_style/extended_template.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/index.ts b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/index.ts rename to x-pack/plugins/canvas/public/expression_types/arg_types/series_style/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/simple_template.tsx b/x-pack/plugins/canvas/public/expression_types/arg_types/series_style/simple_template.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/arg_types/series_style/simple_template.tsx rename to x-pack/plugins/canvas/public/expression_types/arg_types/series_style/simple_template.tsx diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/base_form.js b/x-pack/plugins/canvas/public/expression_types/base_form.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/base_form.js rename to x-pack/plugins/canvas/public/expression_types/base_form.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/datasource.js b/x-pack/plugins/canvas/public/expression_types/datasource.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/datasource.js rename to x-pack/plugins/canvas/public/expression_types/datasource.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/function_form.js b/x-pack/plugins/canvas/public/expression_types/function_form.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/function_form.js rename to x-pack/plugins/canvas/public/expression_types/function_form.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/index.js b/x-pack/plugins/canvas/public/expression_types/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/index.js rename to x-pack/plugins/canvas/public/expression_types/index.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/model.js b/x-pack/plugins/canvas/public/expression_types/model.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/model.js rename to x-pack/plugins/canvas/public/expression_types/model.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/transform.js b/x-pack/plugins/canvas/public/expression_types/transform.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/transform.js rename to x-pack/plugins/canvas/public/expression_types/transform.js diff --git a/x-pack/legacy/plugins/canvas/public/expression_types/view.js b/x-pack/plugins/canvas/public/expression_types/view.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/expression_types/view.js rename to x-pack/plugins/canvas/public/expression_types/view.js diff --git a/x-pack/legacy/plugins/canvas/public/feature_catalogue_entry.ts b/x-pack/plugins/canvas/public/feature_catalogue_entry.ts similarity index 87% rename from x-pack/legacy/plugins/canvas/public/feature_catalogue_entry.ts rename to x-pack/plugins/canvas/public/feature_catalogue_entry.ts index f610bd0299832..41506bdd71e3c 100644 --- a/x-pack/legacy/plugins/canvas/public/feature_catalogue_entry.ts +++ b/x-pack/plugins/canvas/public/feature_catalogue_entry.ts @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; +import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public'; export const featureCatalogueEntry = { id: 'canvas', diff --git a/x-pack/legacy/plugins/canvas/public/functions/__tests__/asset.js b/x-pack/plugins/canvas/public/functions/__tests__/asset.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/functions/__tests__/asset.js rename to x-pack/plugins/canvas/public/functions/__tests__/asset.js diff --git a/x-pack/legacy/plugins/canvas/public/functions/asset.ts b/x-pack/plugins/canvas/public/functions/asset.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/functions/asset.ts rename to x-pack/plugins/canvas/public/functions/asset.ts diff --git a/x-pack/legacy/plugins/canvas/public/functions/filters.ts b/x-pack/plugins/canvas/public/functions/filters.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/functions/filters.ts rename to x-pack/plugins/canvas/public/functions/filters.ts diff --git a/x-pack/legacy/plugins/canvas/public/functions/index.ts b/x-pack/plugins/canvas/public/functions/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/functions/index.ts rename to x-pack/plugins/canvas/public/functions/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/functions/timelion.ts b/x-pack/plugins/canvas/public/functions/timelion.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/functions/timelion.ts rename to x-pack/plugins/canvas/public/functions/timelion.ts diff --git a/x-pack/legacy/plugins/canvas/public/functions/to.ts b/x-pack/plugins/canvas/public/functions/to.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/functions/to.ts rename to x-pack/plugins/canvas/public/functions/to.ts diff --git a/x-pack/legacy/plugins/canvas/public/icon.svg b/x-pack/plugins/canvas/public/icon.svg similarity index 100% rename from x-pack/legacy/plugins/canvas/public/icon.svg rename to x-pack/plugins/canvas/public/icon.svg diff --git a/x-pack/plugins/canvas/public/index.ts b/x-pack/plugins/canvas/public/index.ts index 736d5ccc0f8e5..d36f89354934a 100644 --- a/x-pack/plugins/canvas/public/index.ts +++ b/x-pack/plugins/canvas/public/index.ts @@ -5,6 +5,16 @@ */ import { PluginInitializerContext } from 'kibana/public'; -import { CanvasPlugin } from '../../../legacy/plugins/canvas/public/plugin'; +import { CoreStart } from '../../../../src/core/public'; +import { CanvasServices } from './services'; +import { CanvasSetup, CanvasStart, CanvasStartDeps, CanvasPlugin } from './plugin'; + +export { CanvasSetup, CanvasStart }; + +export interface WithKibanaProps { + kibana: { + services: CoreStart & CanvasStartDeps & { canvas: CanvasServices }; + }; +} export const plugin = (initializerContext: PluginInitializerContext) => new CanvasPlugin(); diff --git a/x-pack/legacy/plugins/canvas/public/lib/__tests__/find_expression_type.js b/x-pack/plugins/canvas/public/lib/__tests__/find_expression_type.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/__tests__/find_expression_type.js rename to x-pack/plugins/canvas/public/lib/__tests__/find_expression_type.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/__tests__/get_pretty_shortcut.test.ts b/x-pack/plugins/canvas/public/lib/__tests__/get_pretty_shortcut.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/__tests__/get_pretty_shortcut.test.ts rename to x-pack/plugins/canvas/public/lib/__tests__/get_pretty_shortcut.test.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/__tests__/history_provider.js b/x-pack/plugins/canvas/public/lib/__tests__/history_provider.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/__tests__/history_provider.js rename to x-pack/plugins/canvas/public/lib/__tests__/history_provider.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/__tests__/modify_path.js b/x-pack/plugins/canvas/public/lib/__tests__/modify_path.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/__tests__/modify_path.js rename to x-pack/plugins/canvas/public/lib/__tests__/modify_path.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/__tests__/readable_color.test.ts b/x-pack/plugins/canvas/public/lib/__tests__/readable_color.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/__tests__/readable_color.test.ts rename to x-pack/plugins/canvas/public/lib/__tests__/readable_color.test.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/__tests__/resolved_arg.js b/x-pack/plugins/canvas/public/lib/__tests__/resolved_arg.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/__tests__/resolved_arg.js rename to x-pack/plugins/canvas/public/lib/__tests__/resolved_arg.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/__tests__/time_interval.test.ts b/x-pack/plugins/canvas/public/lib/__tests__/time_interval.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/__tests__/time_interval.test.ts rename to x-pack/plugins/canvas/public/lib/__tests__/time_interval.test.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts b/x-pack/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts rename to x-pack/plugins/canvas/public/lib/aeroelastic/__fixtures__/typescript/typespec_tests.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/common.js b/x-pack/plugins/canvas/public/lib/aeroelastic/common.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/common.js rename to x-pack/plugins/canvas/public/lib/aeroelastic/common.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/functional.js b/x-pack/plugins/canvas/public/lib/aeroelastic/functional.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/functional.js rename to x-pack/plugins/canvas/public/lib/aeroelastic/functional.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/geometry.js b/x-pack/plugins/canvas/public/lib/aeroelastic/geometry.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/geometry.js rename to x-pack/plugins/canvas/public/lib/aeroelastic/geometry.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/gestures.js b/x-pack/plugins/canvas/public/lib/aeroelastic/gestures.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/gestures.js rename to x-pack/plugins/canvas/public/lib/aeroelastic/gestures.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/index.d.ts b/x-pack/plugins/canvas/public/lib/aeroelastic/index.d.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/index.d.ts rename to x-pack/plugins/canvas/public/lib/aeroelastic/index.d.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/layout.js b/x-pack/plugins/canvas/public/lib/aeroelastic/layout.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/layout.js rename to x-pack/plugins/canvas/public/lib/aeroelastic/layout.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/layout_functions.js b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/layout_functions.js rename to x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/matrix.ts b/x-pack/plugins/canvas/public/lib/aeroelastic/matrix.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/matrix.ts rename to x-pack/plugins/canvas/public/lib/aeroelastic/matrix.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/matrix2d.ts b/x-pack/plugins/canvas/public/lib/aeroelastic/matrix2d.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/matrix2d.ts rename to x-pack/plugins/canvas/public/lib/aeroelastic/matrix2d.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/select.ts b/x-pack/plugins/canvas/public/lib/aeroelastic/select.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/select.ts rename to x-pack/plugins/canvas/public/lib/aeroelastic/select.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/store.ts b/x-pack/plugins/canvas/public/lib/aeroelastic/store.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/store.ts rename to x-pack/plugins/canvas/public/lib/aeroelastic/store.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/tsconfig.json b/x-pack/plugins/canvas/public/lib/aeroelastic/tsconfig.json similarity index 87% rename from x-pack/legacy/plugins/canvas/public/lib/aeroelastic/tsconfig.json rename to x-pack/plugins/canvas/public/lib/aeroelastic/tsconfig.json index ae5eb9321a59f..3b61e4b414626 100644 --- a/x-pack/legacy/plugins/canvas/public/lib/aeroelastic/tsconfig.json +++ b/x-pack/plugins/canvas/public/lib/aeroelastic/tsconfig.json @@ -15,7 +15,7 @@ "paths": { "layout/*": ["aeroelastic/*"] }, - "types": ["@kbn/x-pack/legacy/plugins/canvas/public/lib/aeroelastic"] + "types": ["@kbn/x-pack/plugins/canvas/public/lib/aeroelastic"] }, "exclude": ["node_modules", "**/*.spec.ts", "node_modules/@types/mocha"] } diff --git a/x-pack/legacy/plugins/canvas/public/lib/app_handler_creators.ts b/x-pack/plugins/canvas/public/lib/app_handler_creators.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/app_handler_creators.ts rename to x-pack/plugins/canvas/public/lib/app_handler_creators.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/app_state.ts b/x-pack/plugins/canvas/public/lib/app_state.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/app_state.ts rename to x-pack/plugins/canvas/public/lib/app_state.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/arg_helpers.js b/x-pack/plugins/canvas/public/lib/arg_helpers.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/arg_helpers.js rename to x-pack/plugins/canvas/public/lib/arg_helpers.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/breadcrumbs.ts b/x-pack/plugins/canvas/public/lib/breadcrumbs.ts similarity index 92% rename from x-pack/legacy/plugins/canvas/public/lib/breadcrumbs.ts rename to x-pack/plugins/canvas/public/lib/breadcrumbs.ts index 57b513affd781..96412ef50c79d 100644 --- a/x-pack/legacy/plugins/canvas/public/lib/breadcrumbs.ts +++ b/x-pack/plugins/canvas/public/lib/breadcrumbs.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ChromeBreadcrumb } from '../../../../../../src/core/public'; +import { ChromeBreadcrumb } from '../../../../../src/core/public'; import { platformService } from '../services'; export const getBaseBreadcrumb = () => ({ diff --git a/x-pack/legacy/plugins/canvas/public/lib/build_bool_array.js b/x-pack/plugins/canvas/public/lib/build_bool_array.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/build_bool_array.js rename to x-pack/plugins/canvas/public/lib/build_bool_array.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/build_embeddable_filters.test.ts b/x-pack/plugins/canvas/public/lib/build_embeddable_filters.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/build_embeddable_filters.test.ts rename to x-pack/plugins/canvas/public/lib/build_embeddable_filters.test.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/build_embeddable_filters.ts b/x-pack/plugins/canvas/public/lib/build_embeddable_filters.ts similarity index 92% rename from x-pack/legacy/plugins/canvas/public/lib/build_embeddable_filters.ts rename to x-pack/plugins/canvas/public/lib/build_embeddable_filters.ts index aa915d0d3d02a..9aa7477523c9a 100644 --- a/x-pack/legacy/plugins/canvas/public/lib/build_embeddable_filters.ts +++ b/x-pack/plugins/canvas/public/lib/build_embeddable_filters.ts @@ -7,11 +7,7 @@ import { ExpressionValueFilter } from '../../types'; // @ts-ignore Untyped Local import { buildBoolArray } from './build_bool_array'; -import { - TimeRange, - esFilters, - Filter as DataFilter, -} from '../../../../../../src/plugins/data/public'; +import { TimeRange, esFilters, Filter as DataFilter } from '../../../../../src/plugins/data/public'; export interface EmbeddableFilterInput { filters: DataFilter[]; diff --git a/x-pack/legacy/plugins/canvas/public/lib/clipboard.test.ts b/x-pack/plugins/canvas/public/lib/clipboard.test.ts similarity index 86% rename from x-pack/legacy/plugins/canvas/public/lib/clipboard.test.ts rename to x-pack/plugins/canvas/public/lib/clipboard.test.ts index 54c3000dae36c..d10964003ed39 100644 --- a/x-pack/legacy/plugins/canvas/public/lib/clipboard.test.ts +++ b/x-pack/plugins/canvas/public/lib/clipboard.test.ts @@ -3,9 +3,9 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -jest.mock('../../../../../../src/plugins/kibana_utils/public'); +jest.mock('../../../../../src/plugins/kibana_utils/public'); -import { Storage } from '../../../../../../src/plugins/kibana_utils/public'; +import { Storage } from '../../../../../src/plugins/kibana_utils/public'; import { setClipboardData, getClipboardData } from './clipboard'; import { LOCALSTORAGE_CLIPBOARD } from '../../common/lib/constants'; import { elements } from '../../__tests__/fixtures/workpads'; diff --git a/x-pack/legacy/plugins/canvas/public/lib/clipboard.ts b/x-pack/plugins/canvas/public/lib/clipboard.ts similarity index 90% rename from x-pack/legacy/plugins/canvas/public/lib/clipboard.ts rename to x-pack/plugins/canvas/public/lib/clipboard.ts index 50c5cdd0042fd..11755807aa533 100644 --- a/x-pack/legacy/plugins/canvas/public/lib/clipboard.ts +++ b/x-pack/plugins/canvas/public/lib/clipboard.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Storage } from '../../../../../../src/plugins/kibana_utils/public'; +import { Storage } from '../../../../../src/plugins/kibana_utils/public'; import { LOCALSTORAGE_CLIPBOARD } from '../../common/lib/constants'; import { getWindow } from './get_window'; diff --git a/x-pack/legacy/plugins/canvas/public/lib/clone_subgraphs.js b/x-pack/plugins/canvas/public/lib/clone_subgraphs.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/clone_subgraphs.js rename to x-pack/plugins/canvas/public/lib/clone_subgraphs.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/custom_element_service.ts b/x-pack/plugins/canvas/public/lib/custom_element_service.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/custom_element_service.ts rename to x-pack/plugins/canvas/public/lib/custom_element_service.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/doc_title.js b/x-pack/plugins/canvas/public/lib/doc_title.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/doc_title.js rename to x-pack/plugins/canvas/public/lib/doc_title.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/documentation_links.ts b/x-pack/plugins/canvas/public/lib/documentation_links.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/documentation_links.ts rename to x-pack/plugins/canvas/public/lib/documentation_links.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/dom.ts b/x-pack/plugins/canvas/public/lib/dom.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/dom.ts rename to x-pack/plugins/canvas/public/lib/dom.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/download_workpad.ts b/x-pack/plugins/canvas/public/lib/download_workpad.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/download_workpad.ts rename to x-pack/plugins/canvas/public/lib/download_workpad.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/elastic_logo.ts b/x-pack/plugins/canvas/public/lib/elastic_logo.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/elastic_logo.ts rename to x-pack/plugins/canvas/public/lib/elastic_logo.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/elastic_outline.js b/x-pack/plugins/canvas/public/lib/elastic_outline.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/elastic_outline.js rename to x-pack/plugins/canvas/public/lib/elastic_outline.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/element.ts b/x-pack/plugins/canvas/public/lib/element.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/element.ts rename to x-pack/plugins/canvas/public/lib/element.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/element_handler_creators.ts b/x-pack/plugins/canvas/public/lib/element_handler_creators.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/element_handler_creators.ts rename to x-pack/plugins/canvas/public/lib/element_handler_creators.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/elements_registry.js b/x-pack/plugins/canvas/public/lib/elements_registry.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/elements_registry.js rename to x-pack/plugins/canvas/public/lib/elements_registry.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/es_service.ts b/x-pack/plugins/canvas/public/lib/es_service.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/es_service.ts rename to x-pack/plugins/canvas/public/lib/es_service.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/extract_search.js b/x-pack/plugins/canvas/public/lib/extract_search.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/extract_search.js rename to x-pack/plugins/canvas/public/lib/extract_search.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/filters.js b/x-pack/plugins/canvas/public/lib/filters.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/filters.js rename to x-pack/plugins/canvas/public/lib/filters.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/find_existing_asset.js b/x-pack/plugins/canvas/public/lib/find_existing_asset.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/find_existing_asset.js rename to x-pack/plugins/canvas/public/lib/find_existing_asset.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/find_expression_type.js b/x-pack/plugins/canvas/public/lib/find_expression_type.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/find_expression_type.js rename to x-pack/plugins/canvas/public/lib/find_expression_type.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/flatten_panel_tree.ts b/x-pack/plugins/canvas/public/lib/flatten_panel_tree.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/flatten_panel_tree.ts rename to x-pack/plugins/canvas/public/lib/flatten_panel_tree.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/fullscreen.js b/x-pack/plugins/canvas/public/lib/fullscreen.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/fullscreen.js rename to x-pack/plugins/canvas/public/lib/fullscreen.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/get_client_platform.ts b/x-pack/plugins/canvas/public/lib/get_client_platform.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/get_client_platform.ts rename to x-pack/plugins/canvas/public/lib/get_client_platform.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/get_es_filter.js b/x-pack/plugins/canvas/public/lib/get_es_filter.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/get_es_filter.js rename to x-pack/plugins/canvas/public/lib/get_es_filter.js diff --git a/x-pack/legacy/plugins/canvas/public/legacy_register_feature.ts b/x-pack/plugins/canvas/public/lib/get_id.ts similarity index 53% rename from x-pack/legacy/plugins/canvas/public/legacy_register_feature.ts rename to x-pack/plugins/canvas/public/lib/get_id.ts index 00f788f267d4b..0927a277f7caa 100644 --- a/x-pack/legacy/plugins/canvas/public/legacy_register_feature.ts +++ b/x-pack/plugins/canvas/public/lib/get_id.ts @@ -4,11 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { npSetup } from 'ui/new_platform'; -import { featureCatalogueEntry } from './feature_catalogue_entry'; +import uuid from 'uuid/v4'; -const { - plugins: { home }, -} = npSetup; - -home.featureCatalogue.register(featureCatalogueEntry); +export function getId(type: string): string { + return `${type}-${uuid()}`; +} diff --git a/x-pack/legacy/plugins/canvas/public/lib/get_pretty_shortcut.ts b/x-pack/plugins/canvas/public/lib/get_pretty_shortcut.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/get_pretty_shortcut.ts rename to x-pack/plugins/canvas/public/lib/get_pretty_shortcut.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/get_tags_filter.tsx b/x-pack/plugins/canvas/public/lib/get_tags_filter.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/get_tags_filter.tsx rename to x-pack/plugins/canvas/public/lib/get_tags_filter.tsx diff --git a/x-pack/legacy/plugins/canvas/public/lib/get_window.ts b/x-pack/plugins/canvas/public/lib/get_window.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/get_window.ts rename to x-pack/plugins/canvas/public/lib/get_window.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/history_provider.js b/x-pack/plugins/canvas/public/lib/history_provider.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/history_provider.js rename to x-pack/plugins/canvas/public/lib/history_provider.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/is_text_input.ts b/x-pack/plugins/canvas/public/lib/is_text_input.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/is_text_input.ts rename to x-pack/plugins/canvas/public/lib/is_text_input.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/keymap.ts b/x-pack/plugins/canvas/public/lib/keymap.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/keymap.ts rename to x-pack/plugins/canvas/public/lib/keymap.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/legend_options.js b/x-pack/plugins/canvas/public/lib/legend_options.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/legend_options.js rename to x-pack/plugins/canvas/public/lib/legend_options.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/load_expression_types.js b/x-pack/plugins/canvas/public/lib/load_expression_types.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/load_expression_types.js rename to x-pack/plugins/canvas/public/lib/load_expression_types.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/load_transitions.js b/x-pack/plugins/canvas/public/lib/load_transitions.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/load_transitions.js rename to x-pack/plugins/canvas/public/lib/load_transitions.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/loading_indicator.ts b/x-pack/plugins/canvas/public/lib/loading_indicator.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/loading_indicator.ts rename to x-pack/plugins/canvas/public/lib/loading_indicator.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/modify_path.js b/x-pack/plugins/canvas/public/lib/modify_path.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/modify_path.js rename to x-pack/plugins/canvas/public/lib/modify_path.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/modify_url.ts b/x-pack/plugins/canvas/public/lib/modify_url.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/modify_url.ts rename to x-pack/plugins/canvas/public/lib/modify_url.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/monaco_language_def.ts b/x-pack/plugins/canvas/public/lib/monaco_language_def.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/monaco_language_def.ts rename to x-pack/plugins/canvas/public/lib/monaco_language_def.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/parse_single_function_chain.js b/x-pack/plugins/canvas/public/lib/parse_single_function_chain.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/parse_single_function_chain.js rename to x-pack/plugins/canvas/public/lib/parse_single_function_chain.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/readable_color.ts b/x-pack/plugins/canvas/public/lib/readable_color.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/readable_color.ts rename to x-pack/plugins/canvas/public/lib/readable_color.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/resolved_arg.js b/x-pack/plugins/canvas/public/lib/resolved_arg.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/resolved_arg.js rename to x-pack/plugins/canvas/public/lib/resolved_arg.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/router_provider.js b/x-pack/plugins/canvas/public/lib/router_provider.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/router_provider.js rename to x-pack/plugins/canvas/public/lib/router_provider.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/run_interpreter.ts b/x-pack/plugins/canvas/public/lib/run_interpreter.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/run_interpreter.ts rename to x-pack/plugins/canvas/public/lib/run_interpreter.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/shortcut_manager.js b/x-pack/plugins/canvas/public/lib/shortcut_manager.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/shortcut_manager.js rename to x-pack/plugins/canvas/public/lib/shortcut_manager.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/sync_filter_expression.ts b/x-pack/plugins/canvas/public/lib/sync_filter_expression.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/sync_filter_expression.ts rename to x-pack/plugins/canvas/public/lib/sync_filter_expression.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/tag.ts b/x-pack/plugins/canvas/public/lib/tag.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/tag.ts rename to x-pack/plugins/canvas/public/lib/tag.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/tags_registry.ts b/x-pack/plugins/canvas/public/lib/tags_registry.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/tags_registry.ts rename to x-pack/plugins/canvas/public/lib/tags_registry.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/template.js b/x-pack/plugins/canvas/public/lib/template.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/template.js rename to x-pack/plugins/canvas/public/lib/template.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/template_from_react_component.tsx b/x-pack/plugins/canvas/public/lib/template_from_react_component.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/template_from_react_component.tsx rename to x-pack/plugins/canvas/public/lib/template_from_react_component.tsx diff --git a/x-pack/legacy/plugins/canvas/public/lib/templates_registry.js b/x-pack/plugins/canvas/public/lib/templates_registry.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/templates_registry.js rename to x-pack/plugins/canvas/public/lib/templates_registry.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/time_duration.ts b/x-pack/plugins/canvas/public/lib/time_duration.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/time_duration.ts rename to x-pack/plugins/canvas/public/lib/time_duration.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/time_interval.ts b/x-pack/plugins/canvas/public/lib/time_interval.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/time_interval.ts rename to x-pack/plugins/canvas/public/lib/time_interval.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/transitions_registry.js b/x-pack/plugins/canvas/public/lib/transitions_registry.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/transitions_registry.js rename to x-pack/plugins/canvas/public/lib/transitions_registry.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/ui_metric.ts b/x-pack/plugins/canvas/public/lib/ui_metric.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/ui_metric.ts rename to x-pack/plugins/canvas/public/lib/ui_metric.ts diff --git a/x-pack/legacy/plugins/canvas/public/lib/window_error_handler.js b/x-pack/plugins/canvas/public/lib/window_error_handler.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/window_error_handler.js rename to x-pack/plugins/canvas/public/lib/window_error_handler.js diff --git a/x-pack/legacy/plugins/canvas/public/lib/workpad_service.js b/x-pack/plugins/canvas/public/lib/workpad_service.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/lib/workpad_service.js rename to x-pack/plugins/canvas/public/lib/workpad_service.js diff --git a/x-pack/legacy/plugins/canvas/public/plugin.tsx b/x-pack/plugins/canvas/public/plugin.tsx similarity index 79% rename from x-pack/legacy/plugins/canvas/public/plugin.tsx rename to x-pack/plugins/canvas/public/plugin.tsx index 1e85aad6328a5..bd39dcfb39fe2 100644 --- a/x-pack/legacy/plugins/canvas/public/plugin.tsx +++ b/x-pack/plugins/canvas/public/plugin.tsx @@ -10,20 +10,19 @@ import { Plugin, AppMountParameters, DEFAULT_APP_CATEGORIES, -} from '../../../../../src/core/public'; -import { HomePublicPluginSetup } from '../../../../../src/plugins/home/public'; +} from '../../../../src/core/public'; +import { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; import { initLoadingIndicator } from './lib/loading_indicator'; import { featureCatalogueEntry } from './feature_catalogue_entry'; -import { ExpressionsSetup, ExpressionsStart } from '../../../../../src/plugins/expressions/public'; -import { DataPublicPluginSetup } from '../../../../../src/plugins/data/public'; -import { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; -import { EmbeddableStart } from '../../../../../src/plugins/embeddable/public'; -import { UsageCollectionSetup } from '../../../../../src/plugins/usage_collection/public'; -import { Start as InspectorStart } from '../../../../../src/plugins/inspector/public'; +import { ExpressionsSetup, ExpressionsStart } from '../../../../src/plugins/expressions/public'; +import { DataPublicPluginSetup } from '../../../../src/plugins/data/public'; +import { UiActionsStart } from '../../../../src/plugins/ui_actions/public'; +import { EmbeddableStart } from '../../../../src/plugins/embeddable/public'; +import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public'; +import { Start as InspectorStart } from '../../../../src/plugins/inspector/public'; // @ts-ignore untyped local import { argTypeSpecs } from './expression_types/arg_types'; import { transitions } from './transitions'; -import { legacyRegistries } from './legacy_plugin_support'; import { getPluginApi, CanvasApi } from './plugin_api'; import { initFunctions } from './functions'; import { CanvasSrcPlugin } from '../canvas_plugin_src/plugin'; @@ -70,7 +69,7 @@ export class CanvasPlugin this.srcPlugin.setup(core, { canvas: canvasApi }); core.application.register({ - category: DEFAULT_APP_CATEGORIES.analyze, + category: DEFAULT_APP_CATEGORIES.kibana, id: 'canvas', title: 'Canvas', euiIconType: 'canvasApp', @@ -95,11 +94,6 @@ export class CanvasPlugin plugins.home.featureCatalogue.register(featureCatalogueEntry); - // Register Legacy plugin stuff - canvasApi.addFunctions(legacyRegistries.browserFunctions.getOriginalFns()); - canvasApi.addElements(legacyRegistries.elements.getOriginalFns()); - canvasApi.addTypes(legacyRegistries.types.getOriginalFns()); - // Register core canvas stuff canvasApi.addFunctions( initFunctions({ diff --git a/x-pack/legacy/plugins/canvas/public/plugin_api.ts b/x-pack/plugins/canvas/public/plugin_api.ts similarity index 97% rename from x-pack/legacy/plugins/canvas/public/plugin_api.ts rename to x-pack/plugins/canvas/public/plugin_api.ts index a7346c0b4376e..738b319d29c0b 100644 --- a/x-pack/legacy/plugins/canvas/public/plugin_api.ts +++ b/x-pack/plugins/canvas/public/plugin_api.ts @@ -9,7 +9,7 @@ import { RendererFactory, } from '../types'; import { ElementFactory } from '../types'; -import { ExpressionsSetup } from '../../../../../src/plugins/expressions/public'; +import { ExpressionsSetup } from '../../../../src/plugins/expressions/public'; type AddToRegistry<T extends any> = (add: T[]) => void; diff --git a/x-pack/legacy/plugins/canvas/public/registries.ts b/x-pack/plugins/canvas/public/registries.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/registries.ts rename to x-pack/plugins/canvas/public/registries.ts diff --git a/x-pack/legacy/plugins/canvas/public/services/index.ts b/x-pack/plugins/canvas/public/services/index.ts similarity index 96% rename from x-pack/legacy/plugins/canvas/public/services/index.ts rename to x-pack/plugins/canvas/public/services/index.ts index 17d836f1441c9..abc46beaa3e64 100644 --- a/x-pack/legacy/plugins/canvas/public/services/index.ts +++ b/x-pack/plugins/canvas/public/services/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CoreSetup, CoreStart } from '../../../../../../src/core/public'; +import { CoreSetup, CoreStart } from '../../../../../src/core/public'; import { CanvasSetupDeps, CanvasStartDeps } from '../plugin'; import { notifyServiceFactory } from './notify'; import { platformServiceFactory } from './platform'; diff --git a/x-pack/legacy/plugins/canvas/public/services/notify.ts b/x-pack/plugins/canvas/public/services/notify.ts similarity index 91% rename from x-pack/legacy/plugins/canvas/public/services/notify.ts rename to x-pack/plugins/canvas/public/services/notify.ts index 3e18e2178a818..5454a0f87c3f0 100644 --- a/x-pack/legacy/plugins/canvas/public/services/notify.ts +++ b/x-pack/plugins/canvas/public/services/notify.ts @@ -6,8 +6,8 @@ import { get } from 'lodash'; import { CanvasServiceFactory } from '.'; -import { formatMsg } from '../../../../../../src/plugins/kibana_legacy/public'; -import { ToastInputFields } from '../../../../../../src/core/public'; +import { formatMsg } from '../../../../../src/plugins/kibana_legacy/public'; +import { ToastInputFields } from '../../../../../src/core/public'; const getToast = (err: Error | string, opts: ToastInputFields = {}) => { const errData = (get(err, 'response') || err) as Error | string; diff --git a/x-pack/legacy/plugins/canvas/public/services/platform.ts b/x-pack/plugins/canvas/public/services/platform.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/services/platform.ts rename to x-pack/plugins/canvas/public/services/platform.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/__tests__/elements.get_sibling_context.js b/x-pack/plugins/canvas/public/state/actions/__tests__/elements.get_sibling_context.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/__tests__/elements.get_sibling_context.js rename to x-pack/plugins/canvas/public/state/actions/__tests__/elements.get_sibling_context.js diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/app.js b/x-pack/plugins/canvas/public/state/actions/app.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/app.js rename to x-pack/plugins/canvas/public/state/actions/app.js diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/assets.js b/x-pack/plugins/canvas/public/state/actions/assets.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/assets.js rename to x-pack/plugins/canvas/public/state/actions/assets.js diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/elements.js b/x-pack/plugins/canvas/public/state/actions/elements.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/elements.js rename to x-pack/plugins/canvas/public/state/actions/elements.js diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/embeddable.ts b/x-pack/plugins/canvas/public/state/actions/embeddable.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/embeddable.ts rename to x-pack/plugins/canvas/public/state/actions/embeddable.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/history.js b/x-pack/plugins/canvas/public/state/actions/history.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/history.js rename to x-pack/plugins/canvas/public/state/actions/history.js diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/pages.js b/x-pack/plugins/canvas/public/state/actions/pages.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/pages.js rename to x-pack/plugins/canvas/public/state/actions/pages.js diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/resolved_args.ts b/x-pack/plugins/canvas/public/state/actions/resolved_args.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/resolved_args.ts rename to x-pack/plugins/canvas/public/state/actions/resolved_args.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/transient.js b/x-pack/plugins/canvas/public/state/actions/transient.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/transient.js rename to x-pack/plugins/canvas/public/state/actions/transient.js diff --git a/x-pack/legacy/plugins/canvas/public/state/actions/workpad.js b/x-pack/plugins/canvas/public/state/actions/workpad.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/actions/workpad.js rename to x-pack/plugins/canvas/public/state/actions/workpad.js diff --git a/x-pack/legacy/plugins/canvas/public/state/defaults.js b/x-pack/plugins/canvas/public/state/defaults.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/defaults.js rename to x-pack/plugins/canvas/public/state/defaults.js diff --git a/x-pack/legacy/plugins/canvas/public/state/initial_state.js b/x-pack/plugins/canvas/public/state/initial_state.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/initial_state.js rename to x-pack/plugins/canvas/public/state/initial_state.js diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/__tests__/in_flight.test.ts b/x-pack/plugins/canvas/public/state/middleware/__tests__/in_flight.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/__tests__/in_flight.test.ts rename to x-pack/plugins/canvas/public/state/middleware/__tests__/in_flight.test.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/__tests__/workpad_autoplay.test.ts b/x-pack/plugins/canvas/public/state/middleware/__tests__/workpad_autoplay.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/__tests__/workpad_autoplay.test.ts rename to x-pack/plugins/canvas/public/state/middleware/__tests__/workpad_autoplay.test.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/__tests__/workpad_refresh.test.ts b/x-pack/plugins/canvas/public/state/middleware/__tests__/workpad_refresh.test.ts similarity index 99% rename from x-pack/legacy/plugins/canvas/public/state/middleware/__tests__/workpad_refresh.test.ts rename to x-pack/plugins/canvas/public/state/middleware/__tests__/workpad_refresh.test.ts index 2123c9606f1f0..f90f570bc6ebf 100644 --- a/x-pack/legacy/plugins/canvas/public/state/middleware/__tests__/workpad_refresh.test.ts +++ b/x-pack/plugins/canvas/public/state/middleware/__tests__/workpad_refresh.test.ts @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -jest.mock('../../../legacy'); jest.mock('ui/new_platform'); // actions/elements has some dependencies on ui/new_platform. jest.mock('../../../lib/app_state'); diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/app_ready.js b/x-pack/plugins/canvas/public/state/middleware/app_ready.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/app_ready.js rename to x-pack/plugins/canvas/public/state/middleware/app_ready.js diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/breadcrumbs.js b/x-pack/plugins/canvas/public/state/middleware/breadcrumbs.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/breadcrumbs.js rename to x-pack/plugins/canvas/public/state/middleware/breadcrumbs.js diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/element_stats.js b/x-pack/plugins/canvas/public/state/middleware/element_stats.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/element_stats.js rename to x-pack/plugins/canvas/public/state/middleware/element_stats.js diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/es_persist.js b/x-pack/plugins/canvas/public/state/middleware/es_persist.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/es_persist.js rename to x-pack/plugins/canvas/public/state/middleware/es_persist.js diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/fullscreen.js b/x-pack/plugins/canvas/public/state/middleware/fullscreen.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/fullscreen.js rename to x-pack/plugins/canvas/public/state/middleware/fullscreen.js diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/history.js b/x-pack/plugins/canvas/public/state/middleware/history.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/history.js rename to x-pack/plugins/canvas/public/state/middleware/history.js diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/in_flight.ts b/x-pack/plugins/canvas/public/state/middleware/in_flight.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/in_flight.ts rename to x-pack/plugins/canvas/public/state/middleware/in_flight.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/index.js b/x-pack/plugins/canvas/public/state/middleware/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/index.js rename to x-pack/plugins/canvas/public/state/middleware/index.js diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/resolved_args.js b/x-pack/plugins/canvas/public/state/middleware/resolved_args.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/resolved_args.js rename to x-pack/plugins/canvas/public/state/middleware/resolved_args.js diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/workpad_autoplay.ts b/x-pack/plugins/canvas/public/state/middleware/workpad_autoplay.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/workpad_autoplay.ts rename to x-pack/plugins/canvas/public/state/middleware/workpad_autoplay.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/workpad_refresh.ts b/x-pack/plugins/canvas/public/state/middleware/workpad_refresh.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/workpad_refresh.ts rename to x-pack/plugins/canvas/public/state/middleware/workpad_refresh.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/middleware/workpad_update.js b/x-pack/plugins/canvas/public/state/middleware/workpad_update.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/middleware/workpad_update.js rename to x-pack/plugins/canvas/public/state/middleware/workpad_update.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/__tests__/elements.js b/x-pack/plugins/canvas/public/state/reducers/__tests__/elements.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/__tests__/elements.js rename to x-pack/plugins/canvas/public/state/reducers/__tests__/elements.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/__tests__/fixtures/action_creator.js b/x-pack/plugins/canvas/public/state/reducers/__tests__/fixtures/action_creator.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/__tests__/fixtures/action_creator.js rename to x-pack/plugins/canvas/public/state/reducers/__tests__/fixtures/action_creator.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/__tests__/resolved_args.js b/x-pack/plugins/canvas/public/state/reducers/__tests__/resolved_args.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/__tests__/resolved_args.js rename to x-pack/plugins/canvas/public/state/reducers/__tests__/resolved_args.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/app.js b/x-pack/plugins/canvas/public/state/reducers/app.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/app.js rename to x-pack/plugins/canvas/public/state/reducers/app.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/assets.js b/x-pack/plugins/canvas/public/state/reducers/assets.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/assets.js rename to x-pack/plugins/canvas/public/state/reducers/assets.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/elements.js b/x-pack/plugins/canvas/public/state/reducers/elements.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/elements.js rename to x-pack/plugins/canvas/public/state/reducers/elements.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/embeddable.ts b/x-pack/plugins/canvas/public/state/reducers/embeddable.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/embeddable.ts rename to x-pack/plugins/canvas/public/state/reducers/embeddable.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/embeddables.test.ts b/x-pack/plugins/canvas/public/state/reducers/embeddables.test.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/embeddables.test.ts rename to x-pack/plugins/canvas/public/state/reducers/embeddables.test.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/history.js b/x-pack/plugins/canvas/public/state/reducers/history.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/history.js rename to x-pack/plugins/canvas/public/state/reducers/history.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/index.js b/x-pack/plugins/canvas/public/state/reducers/index.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/index.js rename to x-pack/plugins/canvas/public/state/reducers/index.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/pages.js b/x-pack/plugins/canvas/public/state/reducers/pages.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/pages.js rename to x-pack/plugins/canvas/public/state/reducers/pages.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/resolved_args.js b/x-pack/plugins/canvas/public/state/reducers/resolved_args.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/resolved_args.js rename to x-pack/plugins/canvas/public/state/reducers/resolved_args.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/transient.js b/x-pack/plugins/canvas/public/state/reducers/transient.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/transient.js rename to x-pack/plugins/canvas/public/state/reducers/transient.js diff --git a/x-pack/legacy/plugins/canvas/public/state/reducers/workpad.js b/x-pack/plugins/canvas/public/state/reducers/workpad.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/reducers/workpad.js rename to x-pack/plugins/canvas/public/state/reducers/workpad.js diff --git a/x-pack/legacy/plugins/canvas/public/state/selectors/__tests__/resolved_args.js b/x-pack/plugins/canvas/public/state/selectors/__tests__/resolved_args.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/selectors/__tests__/resolved_args.js rename to x-pack/plugins/canvas/public/state/selectors/__tests__/resolved_args.js diff --git a/x-pack/legacy/plugins/canvas/public/state/selectors/__tests__/workpad.js b/x-pack/plugins/canvas/public/state/selectors/__tests__/workpad.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/selectors/__tests__/workpad.js rename to x-pack/plugins/canvas/public/state/selectors/__tests__/workpad.js diff --git a/x-pack/legacy/plugins/canvas/public/state/selectors/app.ts b/x-pack/plugins/canvas/public/state/selectors/app.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/selectors/app.ts rename to x-pack/plugins/canvas/public/state/selectors/app.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/selectors/assets.ts b/x-pack/plugins/canvas/public/state/selectors/assets.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/selectors/assets.ts rename to x-pack/plugins/canvas/public/state/selectors/assets.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/selectors/resolved_args.ts b/x-pack/plugins/canvas/public/state/selectors/resolved_args.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/selectors/resolved_args.ts rename to x-pack/plugins/canvas/public/state/selectors/resolved_args.ts diff --git a/x-pack/legacy/plugins/canvas/public/state/selectors/workpad.ts b/x-pack/plugins/canvas/public/state/selectors/workpad.ts similarity index 99% rename from x-pack/legacy/plugins/canvas/public/state/selectors/workpad.ts rename to x-pack/plugins/canvas/public/state/selectors/workpad.ts index 80a7c34e8bef5..ae5c0fee52062 100644 --- a/x-pack/legacy/plugins/canvas/public/state/selectors/workpad.ts +++ b/x-pack/plugins/canvas/public/state/selectors/workpad.ts @@ -16,12 +16,10 @@ import { CanvasGroup, PositionedElement, CanvasWorkpadBoundingBox, -} from '../../../types'; -import { ExpressionAstArgument, ExpressionAstFunction, ExpressionAstExpression, -} from '../../../../../../../src/plugins/expressions/common'; +} from '../../../types'; type Modify<T, R> = Pick<T, Exclude<keyof T, keyof R>> & R; type WorkpadInfo = Modify<CanvasWorkpad, { pages: undefined }>; diff --git a/x-pack/legacy/plugins/canvas/public/state/store.js b/x-pack/plugins/canvas/public/state/store.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/state/store.js rename to x-pack/plugins/canvas/public/state/store.js diff --git a/x-pack/legacy/plugins/canvas/public/store.ts b/x-pack/plugins/canvas/public/store.ts similarity index 94% rename from x-pack/legacy/plugins/canvas/public/store.ts rename to x-pack/plugins/canvas/public/store.ts index 1460932101725..8560e612de4db 100644 --- a/x-pack/legacy/plugins/canvas/public/store.ts +++ b/x-pack/plugins/canvas/public/store.ts @@ -9,7 +9,7 @@ import { createStore as createReduxStore, destroyStore as destroy } from './stat // @ts-ignore Untyped local import { getInitialState } from './state/initial_state'; -import { CoreSetup } from '../../../../../src/core/public'; +import { CoreSetup } from '../../../../src/core/public'; import { CanvasSetupDeps } from './plugin'; export async function createStore(core: CoreSetup, plugins: CanvasSetupDeps) { diff --git a/x-pack/legacy/plugins/canvas/public/style/hackery.scss b/x-pack/plugins/canvas/public/style/hackery.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/style/hackery.scss rename to x-pack/plugins/canvas/public/style/hackery.scss diff --git a/x-pack/legacy/plugins/canvas/public/style/index.scss b/x-pack/plugins/canvas/public/style/index.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/style/index.scss rename to x-pack/plugins/canvas/public/style/index.scss diff --git a/x-pack/legacy/plugins/canvas/public/style/main.scss b/x-pack/plugins/canvas/public/style/main.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/style/main.scss rename to x-pack/plugins/canvas/public/style/main.scss diff --git a/x-pack/legacy/plugins/canvas/public/transitions/fade/fade.scss b/x-pack/plugins/canvas/public/transitions/fade/fade.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/fade/fade.scss rename to x-pack/plugins/canvas/public/transitions/fade/fade.scss diff --git a/x-pack/legacy/plugins/canvas/public/transitions/fade/index.ts b/x-pack/plugins/canvas/public/transitions/fade/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/fade/index.ts rename to x-pack/plugins/canvas/public/transitions/fade/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/transitions/index.ts b/x-pack/plugins/canvas/public/transitions/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/index.ts rename to x-pack/plugins/canvas/public/transitions/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/transitions/rotate/index.ts b/x-pack/plugins/canvas/public/transitions/rotate/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/rotate/index.ts rename to x-pack/plugins/canvas/public/transitions/rotate/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/transitions/rotate/rotate.scss b/x-pack/plugins/canvas/public/transitions/rotate/rotate.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/rotate/rotate.scss rename to x-pack/plugins/canvas/public/transitions/rotate/rotate.scss diff --git a/x-pack/legacy/plugins/canvas/public/transitions/slide/index.ts b/x-pack/plugins/canvas/public/transitions/slide/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/slide/index.ts rename to x-pack/plugins/canvas/public/transitions/slide/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/transitions/slide/slide.scss b/x-pack/plugins/canvas/public/transitions/slide/slide.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/slide/slide.scss rename to x-pack/plugins/canvas/public/transitions/slide/slide.scss diff --git a/x-pack/legacy/plugins/canvas/public/transitions/transition.js b/x-pack/plugins/canvas/public/transitions/transition.js similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/transition.js rename to x-pack/plugins/canvas/public/transitions/transition.js diff --git a/x-pack/legacy/plugins/canvas/public/transitions/zoom/index.ts b/x-pack/plugins/canvas/public/transitions/zoom/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/zoom/index.ts rename to x-pack/plugins/canvas/public/transitions/zoom/index.ts diff --git a/x-pack/legacy/plugins/canvas/public/transitions/zoom/zoom.scss b/x-pack/plugins/canvas/public/transitions/zoom/zoom.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/public/transitions/zoom/zoom.scss rename to x-pack/plugins/canvas/public/transitions/zoom/zoom.scss diff --git a/x-pack/legacy/plugins/canvas/scripts/_helpers.js b/x-pack/plugins/canvas/scripts/_helpers.js similarity index 78% rename from x-pack/legacy/plugins/canvas/scripts/_helpers.js rename to x-pack/plugins/canvas/scripts/_helpers.js index dea58e90cc60b..0f4b07d988308 100644 --- a/x-pack/legacy/plugins/canvas/scripts/_helpers.js +++ b/x-pack/plugins/canvas/scripts/_helpers.js @@ -7,19 +7,19 @@ const { resolve } = require('path'); exports.runGulpTask = function(name) { - process.chdir(resolve(__dirname, '../../../..')); + process.chdir(resolve(__dirname, '../../..')); process.argv.splice(1, 1, require.resolve('gulp/bin/gulp'), name); require('gulp/bin/gulp'); }; exports.runKibanaScript = function(name, args = []) { - process.chdir(resolve(__dirname, '../../../../..')); + process.chdir(resolve(__dirname, '../../../..')); process.argv.splice(2, 0, ...args); - require('../../../../../scripts/' + name); // eslint-disable-line import/no-dynamic-require + require('../../../../scripts/' + name); // eslint-disable-line import/no-dynamic-require }; exports.runXPackScript = function(name, args = []) { - process.chdir(resolve(__dirname, '../../../..')); + process.chdir(resolve(__dirname, '../../..')); process.argv.splice(2, 0, ...args); - require('../../../../scripts/' + name); // eslint-disable-line import/no-dynamic-require + require('../../../scripts/' + name); // eslint-disable-line import/no-dynamic-require }; diff --git a/x-pack/legacy/plugins/canvas/scripts/jest.js b/x-pack/plugins/canvas/scripts/jest.js similarity index 94% rename from x-pack/legacy/plugins/canvas/scripts/jest.js rename to x-pack/plugins/canvas/scripts/jest.js index 133f775c7192f..b30cb02d2c99a 100644 --- a/x-pack/legacy/plugins/canvas/scripts/jest.js +++ b/x-pack/plugins/canvas/scripts/jest.js @@ -19,9 +19,9 @@ run( if (path) { log.info(`Limiting tests to ${path}...`); - path = 'legacy/plugins/canvas/' + path; + path = 'plugins/canvas/' + path; } else { - path = 'legacy/plugins/canvas'; + path = 'plugins/canvas'; } if (coverage) { @@ -49,7 +49,7 @@ run( '--collectCoverageFrom', // Include TS/X files `${path}/**/*.ts*`, '--coverageDirectory', // Output to canvas/coverage - 'legacy/plugins/canvas/coverage', + 'plugins/canvas/coverage', ]; } // Mitigation for https://github.com/facebook/jest/issues/7267 @@ -60,7 +60,7 @@ run( if (all) { log.info('Running all available tests. This will take a while...'); } else if (storybook) { - path = 'legacy/plugins/canvas/.storybook'; + path = 'plugins/canvas/.storybook'; log.info('Running Storybook Snapshot tests...'); } else { log.info('Running tests. This does not include Storybook Snapshots...'); diff --git a/x-pack/legacy/plugins/canvas/scripts/kbn.js b/x-pack/plugins/canvas/scripts/kbn.js similarity index 100% rename from x-pack/legacy/plugins/canvas/scripts/kbn.js rename to x-pack/plugins/canvas/scripts/kbn.js diff --git a/x-pack/legacy/plugins/canvas/scripts/lint.js b/x-pack/plugins/canvas/scripts/lint.js similarity index 69% rename from x-pack/legacy/plugins/canvas/scripts/lint.js rename to x-pack/plugins/canvas/scripts/lint.js index effc654712e6c..6d40c100ddfb5 100644 --- a/x-pack/legacy/plugins/canvas/scripts/lint.js +++ b/x-pack/plugins/canvas/scripts/lint.js @@ -4,6 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -require('./_helpers').runKibanaScript('eslint', [ - 'x-pack/legacy/plugins/canvas/**/*.{js,jsx,ts,tsx}', -]); +require('./_helpers').runKibanaScript('eslint', ['x-pack/plugins/canvas/**/*.{js,jsx,ts,tsx}']); diff --git a/x-pack/legacy/plugins/canvas/scripts/shareable_runtime.js b/x-pack/plugins/canvas/scripts/shareable_runtime.js similarity index 100% rename from x-pack/legacy/plugins/canvas/scripts/shareable_runtime.js rename to x-pack/plugins/canvas/scripts/shareable_runtime.js diff --git a/x-pack/legacy/plugins/canvas/scripts/storybook.js b/x-pack/plugins/canvas/scripts/storybook.js similarity index 92% rename from x-pack/legacy/plugins/canvas/scripts/storybook.js rename to x-pack/plugins/canvas/scripts/storybook.js index a6369d1e72fac..c9e6c6c65436c 100644 --- a/x-pack/legacy/plugins/canvas/scripts/storybook.js +++ b/x-pack/plugins/canvas/scripts/storybook.js @@ -37,7 +37,7 @@ run( // Ensure SASS dependencies have been built before doing anything. execa.sync(process.execPath, ['scripts/build_sass'], { - cwd: path.resolve(__dirname, '../../../../..'), + cwd: path.resolve(__dirname, '../../../..'), ...options, }); @@ -51,14 +51,14 @@ run( [ 'webpack', '--config', - 'x-pack/legacy/plugins/canvas/.storybook/webpack.dll.config.js', + 'x-pack/plugins/canvas/.storybook/webpack.dll.config.js', '--progress', '--hide-modules', '--display-entrypoints', 'false', ], { - cwd: path.resolve(__dirname, '../../../../..'), + cwd: path.resolve(__dirname, '../../../..'), stdio: ['ignore', 'inherit', 'inherit'], buffer: false, } @@ -96,7 +96,7 @@ run( // Watch the SASS sheets for changes execa(process.execPath, ['scripts/build_sass', '--watch'], { - cwd: path.resolve(__dirname, '../../../../..'), + cwd: path.resolve(__dirname, '../../../..'), ...options, }); diff --git a/x-pack/legacy/plugins/canvas/scripts/storybook_new.js b/x-pack/plugins/canvas/scripts/storybook_new.js similarity index 100% rename from x-pack/legacy/plugins/canvas/scripts/storybook_new.js rename to x-pack/plugins/canvas/scripts/storybook_new.js diff --git a/x-pack/legacy/plugins/canvas/scripts/test.js b/x-pack/plugins/canvas/scripts/test.js similarity index 100% rename from x-pack/legacy/plugins/canvas/scripts/test.js rename to x-pack/plugins/canvas/scripts/test.js diff --git a/x-pack/legacy/plugins/canvas/scripts/test_browser.js b/x-pack/plugins/canvas/scripts/test_browser.js similarity index 100% rename from x-pack/legacy/plugins/canvas/scripts/test_browser.js rename to x-pack/plugins/canvas/scripts/test_browser.js diff --git a/x-pack/legacy/plugins/canvas/scripts/test_common.js b/x-pack/plugins/canvas/scripts/test_common.js similarity index 100% rename from x-pack/legacy/plugins/canvas/scripts/test_common.js rename to x-pack/plugins/canvas/scripts/test_common.js diff --git a/x-pack/legacy/plugins/canvas/scripts/test_dev.js b/x-pack/plugins/canvas/scripts/test_dev.js similarity index 100% rename from x-pack/legacy/plugins/canvas/scripts/test_dev.js rename to x-pack/plugins/canvas/scripts/test_dev.js diff --git a/x-pack/legacy/plugins/canvas/scripts/test_plugins.js b/x-pack/plugins/canvas/scripts/test_plugins.js similarity index 100% rename from x-pack/legacy/plugins/canvas/scripts/test_plugins.js rename to x-pack/plugins/canvas/scripts/test_plugins.js diff --git a/x-pack/legacy/plugins/canvas/scripts/test_server.js b/x-pack/plugins/canvas/scripts/test_server.js similarity index 100% rename from x-pack/legacy/plugins/canvas/scripts/test_server.js rename to x-pack/plugins/canvas/scripts/test_server.js diff --git a/x-pack/plugins/canvas/server/collectors/collector.ts b/x-pack/plugins/canvas/server/collectors/collector.ts index 8e9e5ede2e7f2..88e5e43dc2af1 100644 --- a/x-pack/plugins/canvas/server/collectors/collector.ts +++ b/x-pack/plugins/canvas/server/collectors/collector.ts @@ -6,7 +6,7 @@ import { CallCluster } from 'src/legacy/core_plugins/elasticsearch'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; -import { CANVAS_USAGE_TYPE } from '../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_USAGE_TYPE } from '../../common/lib/constants'; import { TelemetryCollector } from '../../types'; import { workpadCollector } from './workpad_collector'; diff --git a/x-pack/plugins/canvas/server/collectors/workpad_collector.test.ts b/x-pack/plugins/canvas/server/collectors/workpad_collector.test.ts index 70bc074ff3df8..420b785771bfe 100644 --- a/x-pack/plugins/canvas/server/collectors/workpad_collector.test.ts +++ b/x-pack/plugins/canvas/server/collectors/workpad_collector.test.ts @@ -6,7 +6,7 @@ import clonedeep from 'lodash.clonedeep'; import { summarizeWorkpads } from './workpad_collector'; -import { workpads } from '../../../../legacy/plugins/canvas/__tests__/fixtures/workpads'; +import { workpads } from '../../__tests__/fixtures/workpads'; describe('usage collector handle es response data', () => { it('should summarize workpads, pages, and elements', () => { diff --git a/x-pack/plugins/canvas/server/collectors/workpad_collector.ts b/x-pack/plugins/canvas/server/collectors/workpad_collector.ts index 9c088958c748f..b14a35ded4781 100644 --- a/x-pack/plugins/canvas/server/collectors/workpad_collector.ts +++ b/x-pack/plugins/canvas/server/collectors/workpad_collector.ts @@ -6,7 +6,7 @@ import { SearchParams } from 'elasticsearch'; import { sum as arraySum, min as arrayMin, max as arrayMax, get } from 'lodash'; -import { CANVAS_TYPE } from '../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../common/lib/constants'; import { collectFns } from './collector_helpers'; import { TelemetryCollector, CanvasWorkpad } from '../../types'; import { parseExpression } from '../../../../../src/plugins/expressions/common'; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/create.test.ts b/x-pack/plugins/canvas/server/routes/custom_elements/create.test.ts index d3a69c01732fa..c260d6ca8ac16 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/create.test.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/create.test.ts @@ -11,7 +11,7 @@ import { httpServerMock, loggingServiceMock, } from 'src/core/server/mocks'; -import { CUSTOM_ELEMENT_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE } from '../../../common/lib/constants'; import { initializeCreateCustomElementRoute } from './create'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/create.ts b/x-pack/plugins/canvas/server/routes/custom_elements/create.ts index b882829124696..1c3b9221c52cd 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/create.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/create.ts @@ -5,11 +5,8 @@ */ import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; -import { getId } from '../../../../../legacy/plugins/canvas/public/lib/get_id'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; +import { getId } from '../../../common/lib/get_id'; import { CustomElementSchema } from './custom_element_schema'; import { CustomElementAttributes } from './custom_element_attributes'; import { okResponse } from '../ok_response'; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/custom_element_attributes.ts b/x-pack/plugins/canvas/server/routes/custom_elements/custom_element_attributes.ts index e76526eeeb27b..772ebb1d79a5e 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/custom_element_attributes.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/custom_element_attributes.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { CustomElement } from '../../../../../legacy/plugins/canvas/types'; +import { CustomElement } from '../../../types'; // Exclude ID attribute for the type used for SavedObjectClient export type CustomElementAttributes = Pick<CustomElement, Exclude<keyof CustomElement, 'id'>> & { diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/delete.test.ts b/x-pack/plugins/canvas/server/routes/custom_elements/delete.test.ts index c108f2316db27..e70fae5d18eaf 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/delete.test.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/delete.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CUSTOM_ELEMENT_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE } from '../../../common/lib/constants'; import { initializeDeleteCustomElementRoute } from './delete'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/delete.ts b/x-pack/plugins/canvas/server/routes/custom_elements/delete.ts index 5867539b95b53..b9d52ccfbac80 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/delete.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/delete.ts @@ -6,10 +6,7 @@ import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; import { okResponse } from '../ok_response'; import { catchErrorHandler } from '../catch_error_handler'; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/find.ts b/x-pack/plugins/canvas/server/routes/custom_elements/find.ts index 5041ceb3e4711..964618adf165d 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/find.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/find.ts @@ -7,10 +7,7 @@ import { schema } from '@kbn/config-schema'; import { SavedObjectAttributes } from 'src/core/server'; import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; export function initializeFindCustomElementsRoute(deps: RouteInitializerDeps) { const { router } = deps; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/get.test.ts b/x-pack/plugins/canvas/server/routes/custom_elements/get.test.ts index 5e8d536f779a9..03ae6048801bf 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/get.test.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/get.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CUSTOM_ELEMENT_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE } from '../../../common/lib/constants'; import { initializeGetCustomElementRoute } from './get'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/get.ts b/x-pack/plugins/canvas/server/routes/custom_elements/get.ts index f092b001e141f..bb8e320a7c124 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/get.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/get.ts @@ -6,10 +6,7 @@ import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; import { CustomElementAttributes } from './custom_element_attributes'; import { catchErrorHandler } from '../catch_error_handler'; diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/update.test.ts b/x-pack/plugins/canvas/server/routes/custom_elements/update.test.ts index 285a998030cf6..e67e42c26cd2b 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/update.test.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/update.test.ts @@ -5,8 +5,8 @@ */ import sinon from 'sinon'; -import { CustomElement } from '../../../../../legacy/plugins/canvas/types'; -import { CUSTOM_ELEMENT_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CustomElement } from '../../../types'; +import { CUSTOM_ELEMENT_TYPE } from '../../../common/lib/constants'; import { initializeUpdateCustomElementRoute } from './update'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/custom_elements/update.ts b/x-pack/plugins/canvas/server/routes/custom_elements/update.ts index 51c363249dd79..a65d23d8c1406 100644 --- a/x-pack/plugins/canvas/server/routes/custom_elements/update.ts +++ b/x-pack/plugins/canvas/server/routes/custom_elements/update.ts @@ -7,10 +7,7 @@ import { schema } from '@kbn/config-schema'; import { omit } from 'lodash'; import { RouteInitializerDeps } from '../'; -import { - CUSTOM_ELEMENT_TYPE, - API_ROUTE_CUSTOM_ELEMENT, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE, API_ROUTE_CUSTOM_ELEMENT } from '../../../common/lib/constants'; import { CustomElementUpdateSchema } from './custom_element_schema'; import { CustomElementAttributes } from './custom_element_attributes'; import { okResponse } from '../ok_response'; diff --git a/x-pack/plugins/canvas/server/routes/es_fields/es_fields.ts b/x-pack/plugins/canvas/server/routes/es_fields/es_fields.ts index 5282a246de6b6..5ebf20095bf3e 100644 --- a/x-pack/plugins/canvas/server/routes/es_fields/es_fields.ts +++ b/x-pack/plugins/canvas/server/routes/es_fields/es_fields.ts @@ -6,7 +6,7 @@ import { mapValues, keys } from 'lodash'; import { schema } from '@kbn/config-schema'; -import { API_ROUTE } from '../../../../../legacy/plugins/canvas/common/lib'; +import { API_ROUTE } from '../../../common/lib'; import { catchErrorHandler } from '../catch_error_handler'; // @ts-ignore unconverted lib import { normalizeType } from '../../lib/normalize_type'; diff --git a/x-pack/plugins/canvas/server/routes/shareables/download.ts b/x-pack/plugins/canvas/server/routes/shareables/download.ts index 08bec1e4881ae..3f331c1635e16 100644 --- a/x-pack/plugins/canvas/server/routes/shareables/download.ts +++ b/x-pack/plugins/canvas/server/routes/shareables/download.ts @@ -5,9 +5,9 @@ */ import { readFileSync } from 'fs'; -import { SHAREABLE_RUNTIME_FILE } from '../../../../../legacy/plugins/canvas/shareable_runtime/constants'; +import { SHAREABLE_RUNTIME_FILE } from '../../../shareable_runtime/constants'; import { RouteInitializerDeps } from '../'; -import { API_ROUTE_SHAREABLE_RUNTIME_DOWNLOAD } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { API_ROUTE_SHAREABLE_RUNTIME_DOWNLOAD } from '../../../common/lib/constants'; export function initializeDownloadShareableWorkpadRoute(deps: RouteInitializerDeps) { const { router } = deps; diff --git a/x-pack/plugins/canvas/server/routes/shareables/zip.test.ts b/x-pack/plugins/canvas/server/routes/shareables/zip.test.ts index edb59694a7400..63776f897a04c 100644 --- a/x-pack/plugins/canvas/server/routes/shareables/zip.test.ts +++ b/x-pack/plugins/canvas/server/routes/shareables/zip.test.ts @@ -15,12 +15,12 @@ import { } from 'src/core/server'; import { httpServiceMock, httpServerMock, loggingServiceMock } from 'src/core/server/mocks'; import { initializeZipShareableWorkpadRoute } from './zip'; -import { API_ROUTE_SHAREABLE_ZIP } from '../../../../../legacy/plugins/canvas/common/lib'; +import { API_ROUTE_SHAREABLE_ZIP } from '../../../common/lib'; import { SHAREABLE_RUNTIME_FILE, SHAREABLE_RUNTIME_SRC, SHAREABLE_RUNTIME_NAME, -} from '../../../../../legacy/plugins/canvas/shareable_runtime/constants'; +} from '../../../shareable_runtime/constants'; const mockRouteContext = {} as RequestHandlerContext; const mockWorkpad = {}; diff --git a/x-pack/plugins/canvas/server/routes/shareables/zip.ts b/x-pack/plugins/canvas/server/routes/shareables/zip.ts index e25b96cce96ff..99f401cd4c142 100644 --- a/x-pack/plugins/canvas/server/routes/shareables/zip.ts +++ b/x-pack/plugins/canvas/server/routes/shareables/zip.ts @@ -5,12 +5,12 @@ */ import archiver from 'archiver'; -import { API_ROUTE_SHAREABLE_ZIP } from '../../../../../legacy/plugins/canvas/common/lib'; +import { API_ROUTE_SHAREABLE_ZIP } from '../../../common/lib'; import { SHAREABLE_RUNTIME_FILE, SHAREABLE_RUNTIME_NAME, SHAREABLE_RUNTIME_SRC, -} from '../../../../../legacy/plugins/canvas/shareable_runtime/constants'; +} from '../../../shareable_runtime/constants'; import { RenderedWorkpadSchema } from './rendered_workpad_schema'; import { RouteInitializerDeps } from '..'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/create.test.ts b/x-pack/plugins/canvas/server/routes/workpad/create.test.ts index dbad1a97dc458..02b6376ece2ed 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/create.test.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/create.test.ts @@ -11,7 +11,7 @@ import { httpServerMock, loggingServiceMock, } from 'src/core/server/mocks'; -import { CANVAS_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../../common/lib/constants'; import { initializeCreateWorkpadRoute } from './create'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/workpad/create.ts b/x-pack/plugins/canvas/server/routes/workpad/create.ts index 1e9a320c0eeef..5a693c05b3112 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/create.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/create.ts @@ -5,12 +5,9 @@ */ import { RouteInitializerDeps } from '../'; -import { - CANVAS_TYPE, - API_ROUTE_WORKPAD, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; -import { CanvasWorkpad } from '../../../../../legacy/plugins/canvas/types'; -import { getId } from '../../../../../legacy/plugins/canvas/public/lib/get_id'; +import { CANVAS_TYPE, API_ROUTE_WORKPAD } from '../../../common/lib/constants'; +import { CanvasWorkpad } from '../../../types'; +import { getId } from '../../../common/lib/get_id'; import { WorkpadAttributes } from './workpad_attributes'; import { WorkpadSchema } from './workpad_schema'; import { okResponse } from '../ok_response'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/delete.test.ts b/x-pack/plugins/canvas/server/routes/workpad/delete.test.ts index e693840826b7a..57df4e7cffda6 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/delete.test.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/delete.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CANVAS_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../../common/lib/constants'; import { initializeDeleteWorkpadRoute } from './delete'; import { IRouter, diff --git a/x-pack/plugins/canvas/server/routes/workpad/delete.ts b/x-pack/plugins/canvas/server/routes/workpad/delete.ts index 8de4ea0f9a27f..52c95c2f42d30 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/delete.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/delete.ts @@ -6,10 +6,7 @@ import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '../'; -import { - CANVAS_TYPE, - API_ROUTE_WORKPAD, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE, API_ROUTE_WORKPAD } from '../../../common/lib/constants'; import { okResponse } from '../ok_response'; import { catchErrorHandler } from '../catch_error_handler'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/find.ts b/x-pack/plugins/canvas/server/routes/workpad/find.ts index a528a75611609..ec5c068a1fa24 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/find.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/find.ts @@ -7,10 +7,7 @@ import { schema } from '@kbn/config-schema'; import { SavedObjectAttributes } from 'src/core/server'; import { RouteInitializerDeps } from '../'; -import { - CANVAS_TYPE, - API_ROUTE_WORKPAD, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE, API_ROUTE_WORKPAD } from '../../../common/lib/constants'; export function initializeFindWorkpadsRoute(deps: RouteInitializerDeps) { const { router } = deps; diff --git a/x-pack/plugins/canvas/server/routes/workpad/get.test.ts b/x-pack/plugins/canvas/server/routes/workpad/get.test.ts index a31293f572c75..6741f2b3fc9d6 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/get.test.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/get.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CANVAS_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../../common/lib/constants'; import { initializeGetWorkpadRoute } from './get'; import { IRouter, @@ -18,8 +18,8 @@ import { httpServerMock, loggingServiceMock, } from 'src/core/server/mocks'; -import { workpadWithGroupAsElement } from '../../../../../legacy/plugins/canvas/__tests__/fixtures/workpads'; -import { CanvasWorkpad } from '../../../../../legacy/plugins/canvas/types'; +import { workpadWithGroupAsElement } from '../../../__tests__/fixtures/workpads'; +import { CanvasWorkpad } from '../../../types'; const mockRouteContext = ({ core: { diff --git a/x-pack/plugins/canvas/server/routes/workpad/get.ts b/x-pack/plugins/canvas/server/routes/workpad/get.ts index d7a5e77670f6e..7dc1252063e90 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/get.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/get.ts @@ -6,10 +6,7 @@ import { schema } from '@kbn/config-schema'; import { RouteInitializerDeps } from '../'; -import { - CANVAS_TYPE, - API_ROUTE_WORKPAD, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE, API_ROUTE_WORKPAD } from '../../../common/lib/constants'; import { WorkpadAttributes } from './workpad_attributes'; import { catchErrorHandler } from '../catch_error_handler'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/update.test.ts b/x-pack/plugins/canvas/server/routes/workpad/update.test.ts index de098dd9717ed..a6b34e7165121 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/update.test.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/update.test.ts @@ -5,7 +5,7 @@ */ import sinon from 'sinon'; -import { CANVAS_TYPE } from '../../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../../common/lib/constants'; import { initializeUpdateWorkpadRoute, initializeUpdateWorkpadAssetsRoute } from './update'; import { IRouter, @@ -19,7 +19,7 @@ import { httpServerMock, loggingServiceMock, } from 'src/core/server/mocks'; -import { workpads } from '../../../../../legacy/plugins/canvas/__tests__/fixtures/workpads'; +import { workpads } from '../../../__tests__/fixtures/workpads'; import { okResponse } from '../ok_response'; const mockRouteContext = ({ diff --git a/x-pack/plugins/canvas/server/routes/workpad/update.ts b/x-pack/plugins/canvas/server/routes/workpad/update.ts index 64736bcd57fd5..021ac41d88d19 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/update.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/update.ts @@ -13,7 +13,7 @@ import { API_ROUTE_WORKPAD, API_ROUTE_WORKPAD_STRUCTURES, API_ROUTE_WORKPAD_ASSETS, -} from '../../../../../legacy/plugins/canvas/common/lib/constants'; +} from '../../../common/lib/constants'; import { WorkpadAttributes } from './workpad_attributes'; import { WorkpadSchema, WorkpadAssetSchema } from './workpad_schema'; import { okResponse } from '../ok_response'; diff --git a/x-pack/plugins/canvas/server/routes/workpad/workpad_attributes.ts b/x-pack/plugins/canvas/server/routes/workpad/workpad_attributes.ts index 2b7b6cca4ba2b..fd811adeebbd8 100644 --- a/x-pack/plugins/canvas/server/routes/workpad/workpad_attributes.ts +++ b/x-pack/plugins/canvas/server/routes/workpad/workpad_attributes.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { CanvasWorkpad } from '../../../../../legacy/plugins/canvas/types'; +import { CanvasWorkpad } from '../../../types'; export type WorkpadAttributes = Pick<CanvasWorkpad, Exclude<keyof CanvasWorkpad, 'id'>> & { '@timestamp': string; diff --git a/x-pack/plugins/canvas/server/saved_objects/custom_element.ts b/x-pack/plugins/canvas/server/saved_objects/custom_element.ts index d26f6dd8fb16e..5fe48e98f28da 100644 --- a/x-pack/plugins/canvas/server/saved_objects/custom_element.ts +++ b/x-pack/plugins/canvas/server/saved_objects/custom_element.ts @@ -5,7 +5,7 @@ */ import { SavedObjectsType } from 'src/core/server'; -import { CUSTOM_ELEMENT_TYPE } from '../../../../legacy/plugins/canvas/common/lib/constants'; +import { CUSTOM_ELEMENT_TYPE } from '../../common/lib/constants'; export const customElementType: SavedObjectsType = { name: CUSTOM_ELEMENT_TYPE, diff --git a/x-pack/plugins/canvas/server/saved_objects/workpad.ts b/x-pack/plugins/canvas/server/saved_objects/workpad.ts index 2e9570b1b83be..3c8486f3246b2 100644 --- a/x-pack/plugins/canvas/server/saved_objects/workpad.ts +++ b/x-pack/plugins/canvas/server/saved_objects/workpad.ts @@ -5,7 +5,7 @@ */ import { SavedObjectsType } from 'src/core/server'; -import { CANVAS_TYPE } from '../../../../legacy/plugins/canvas/common/lib/constants'; +import { CANVAS_TYPE } from '../../common/lib/constants'; import { removeAttributesId } from './migrations/remove_attributes_id'; export const workpadType: SavedObjectsType = { diff --git a/x-pack/plugins/canvas/server/setup_interpreter.ts b/x-pack/plugins/canvas/server/setup_interpreter.ts index 74dd8decbea69..79bc2f3c1996b 100644 --- a/x-pack/plugins/canvas/server/setup_interpreter.ts +++ b/x-pack/plugins/canvas/server/setup_interpreter.ts @@ -5,7 +5,7 @@ */ import { ExpressionsServerSetup } from 'src/plugins/expressions/server'; -import { functions } from '../../../legacy/plugins/canvas/canvas_plugin_src/functions/server'; +import { functions } from '../canvas_plugin_src/functions/server'; export function setupInterpreter(expressions: ExpressionsServerSetup) { expressions.__LEGACY.register({ types: [], serverFunctions: functions }); diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/README.md b/x-pack/plugins/canvas/shareable_runtime/README.md similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/README.md rename to x-pack/plugins/canvas/shareable_runtime/README.md diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/__mocks__/supported_renderers.js b/x-pack/plugins/canvas/shareable_runtime/__mocks__/supported_renderers.js similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/__mocks__/supported_renderers.js rename to x-pack/plugins/canvas/shareable_runtime/__mocks__/supported_renderers.js diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/api/__tests__/__snapshots__/shareable.test.tsx.snap b/x-pack/plugins/canvas/shareable_runtime/api/__tests__/__snapshots__/shareable.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/api/__tests__/__snapshots__/shareable.test.tsx.snap rename to x-pack/plugins/canvas/shareable_runtime/api/__tests__/__snapshots__/shareable.test.tsx.snap diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/api/__tests__/shareable.test.tsx b/x-pack/plugins/canvas/shareable_runtime/api/__tests__/shareable.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/api/__tests__/shareable.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/api/__tests__/shareable.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/api/index.ts b/x-pack/plugins/canvas/shareable_runtime/api/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/api/index.ts rename to x-pack/plugins/canvas/shareable_runtime/api/index.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/api/shareable.tsx b/x-pack/plugins/canvas/shareable_runtime/api/shareable.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/api/shareable.tsx rename to x-pack/plugins/canvas/shareable_runtime/api/shareable.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/canvas.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/canvas.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/canvas.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/canvas.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/page.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/page.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/page.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/page.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/rendered_element.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/rendered_element.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/rendered_element.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/__examples__/__snapshots__/rendered_element.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/canvas.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/__examples__/canvas.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/canvas.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/__examples__/canvas.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/page.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/__examples__/page.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/page.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/__examples__/page.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/rendered_element.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/__examples__/rendered_element.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__examples__/rendered_element.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/__examples__/rendered_element.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__tests__/__snapshots__/app.test.tsx.snap b/x-pack/plugins/canvas/shareable_runtime/components/__tests__/__snapshots__/app.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__tests__/__snapshots__/app.test.tsx.snap rename to x-pack/plugins/canvas/shareable_runtime/components/__tests__/__snapshots__/app.test.tsx.snap diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__tests__/app.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/__tests__/app.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__tests__/app.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/__tests__/app.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__tests__/canvas.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/__tests__/canvas.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__tests__/canvas.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/__tests__/canvas.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/__tests__/page.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/__tests__/page.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/__tests__/page.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/__tests__/page.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/app.tsx b/x-pack/plugins/canvas/shareable_runtime/components/app.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/app.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/app.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/canvas.module.scss b/x-pack/plugins/canvas/shareable_runtime/components/canvas.module.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/canvas.module.scss rename to x-pack/plugins/canvas/shareable_runtime/components/canvas.module.scss diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/canvas.tsx b/x-pack/plugins/canvas/shareable_runtime/components/canvas.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/canvas.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/canvas.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/footer.components.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/footer.components.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/footer.components.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/footer.components.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/footer.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/footer.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/footer.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/footer.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/page_controls.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/page_controls.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/page_controls.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/page_controls.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/scrubber.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/scrubber.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/scrubber.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/scrubber.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/title.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/title.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/title.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/__snapshots__/title.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/footer.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/footer.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/footer.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/footer.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/page_controls.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/page_controls.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/page_controls.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/page_controls.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/scrubber.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/scrubber.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/scrubber.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/scrubber.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/title.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/title.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__examples__/title.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__examples__/title.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/footer.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/footer.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/footer.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/footer.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/page_controls.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/page_controls.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/page_controls.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/page_controls.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/page_preview.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/page_preview.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/page_preview.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/page_preview.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/scrubber.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/scrubber.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/scrubber.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/scrubber.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/title.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/title.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/__tests__/title.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/__tests__/title.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/footer.module.scss b/x-pack/plugins/canvas/shareable_runtime/components/footer/footer.module.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/footer.module.scss rename to x-pack/plugins/canvas/shareable_runtime/components/footer/footer.module.scss diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/footer.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/footer.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/footer.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/footer.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/index.ts b/x-pack/plugins/canvas/shareable_runtime/components/footer/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/index.ts rename to x-pack/plugins/canvas/shareable_runtime/components/footer/index.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/page_controls.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/page_controls.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/page_controls.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/page_controls.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/page_preview.module.scss b/x-pack/plugins/canvas/shareable_runtime/components/footer/page_preview.module.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/page_preview.module.scss rename to x-pack/plugins/canvas/shareable_runtime/components/footer/page_preview.module.scss diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/page_preview.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/page_preview.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/page_preview.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/page_preview.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/scrubber.module.scss b/x-pack/plugins/canvas/shareable_runtime/components/footer/scrubber.module.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/scrubber.module.scss rename to x-pack/plugins/canvas/shareable_runtime/components/footer/scrubber.module.scss diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/scrubber.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/scrubber.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/scrubber.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/scrubber.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/autoplay_settings.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/autoplay_settings.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/autoplay_settings.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/autoplay_settings.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/settings.components.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/settings.components.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/settings.components.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/settings.components.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/settings.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/settings.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/settings.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/settings.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/toolbar_settings.examples.storyshot b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/toolbar_settings.examples.storyshot similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/toolbar_settings.examples.storyshot rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/__snapshots__/toolbar_settings.examples.storyshot diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/autoplay_settings.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/autoplay_settings.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/autoplay_settings.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/autoplay_settings.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/settings.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/settings.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/settings.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/settings.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/toolbar_settings.examples.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/toolbar_settings.examples.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/toolbar_settings.examples.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__examples__/toolbar_settings.examples.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/__snapshots__/settings.test.tsx.snap b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/__snapshots__/settings.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/__snapshots__/settings.test.tsx.snap rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/__snapshots__/settings.test.tsx.snap diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/autoplay_settings.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/autoplay_settings.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/autoplay_settings.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/autoplay_settings.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/settings.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/settings.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/settings.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/settings.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/toolbar_settings.test.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/toolbar_settings.test.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/toolbar_settings.test.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/__tests__/toolbar_settings.test.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/autoplay_settings.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/autoplay_settings.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/autoplay_settings.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/autoplay_settings.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/index.ts b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/index.ts rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/index.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/settings.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/settings.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/settings.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/settings.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/toolbar_settings.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/settings/toolbar_settings.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/settings/toolbar_settings.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/settings/toolbar_settings.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/title.tsx b/x-pack/plugins/canvas/shareable_runtime/components/footer/title.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/footer/title.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/footer/title.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/page.module.scss b/x-pack/plugins/canvas/shareable_runtime/components/page.module.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/page.module.scss rename to x-pack/plugins/canvas/shareable_runtime/components/page.module.scss diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/page.tsx b/x-pack/plugins/canvas/shareable_runtime/components/page.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/page.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/page.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/rendered_element.module.scss b/x-pack/plugins/canvas/shareable_runtime/components/rendered_element.module.scss similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/rendered_element.module.scss rename to x-pack/plugins/canvas/shareable_runtime/components/rendered_element.module.scss diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/components/rendered_element.tsx b/x-pack/plugins/canvas/shareable_runtime/components/rendered_element.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/components/rendered_element.tsx rename to x-pack/plugins/canvas/shareable_runtime/components/rendered_element.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/constants.d.ts b/x-pack/plugins/canvas/shareable_runtime/constants.d.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/constants.d.ts rename to x-pack/plugins/canvas/shareable_runtime/constants.d.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/constants.js b/x-pack/plugins/canvas/shareable_runtime/constants.js similarity index 92% rename from x-pack/legacy/plugins/canvas/shareable_runtime/constants.js rename to x-pack/plugins/canvas/shareable_runtime/constants.js index 2ac92f57a90ed..98abc7ca5a95f 100644 --- a/x-pack/legacy/plugins/canvas/shareable_runtime/constants.js +++ b/x-pack/plugins/canvas/shareable_runtime/constants.js @@ -7,8 +7,8 @@ const path = require('path'); const { LIBRARY_NAME, SHAREABLE_RUNTIME_NAME } = require('./constants_static'); -const KIBANA_ROOT_PATH = '../../../../..'; -const CANVAS_ROOT_PATH = 'x-pack/legacy/plugins/canvas'; +const KIBANA_ROOT_PATH = '../../../..'; +const CANVAS_ROOT_PATH = 'x-pack/plugins/canvas'; const SHAREABLE_RUNTIME_PATH = 'shareable_runtime'; const SHAREABLE_RUNTIME_OUTPUT_PATH = 'shareable_runtime/build'; const SHAREABLE_RUNTIME_FILE_PATH = 'shareable_runtime/build/kbn_canvas.js'; diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/constants_static.d.ts b/x-pack/plugins/canvas/shareable_runtime/constants_static.d.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/constants_static.d.ts rename to x-pack/plugins/canvas/shareable_runtime/constants_static.d.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/constants_static.js b/x-pack/plugins/canvas/shareable_runtime/constants_static.js similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/constants_static.js rename to x-pack/plugins/canvas/shareable_runtime/constants_static.js diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/context/actions.ts b/x-pack/plugins/canvas/shareable_runtime/context/actions.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/context/actions.ts rename to x-pack/plugins/canvas/shareable_runtime/context/actions.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/context/index.ts b/x-pack/plugins/canvas/shareable_runtime/context/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/context/index.ts rename to x-pack/plugins/canvas/shareable_runtime/context/index.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/context/reducer.ts b/x-pack/plugins/canvas/shareable_runtime/context/reducer.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/context/reducer.ts rename to x-pack/plugins/canvas/shareable_runtime/context/reducer.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/context/state.tsx b/x-pack/plugins/canvas/shareable_runtime/context/state.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/context/state.tsx rename to x-pack/plugins/canvas/shareable_runtime/context/state.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/css_modules.d.ts b/x-pack/plugins/canvas/shareable_runtime/css_modules.d.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/css_modules.d.ts rename to x-pack/plugins/canvas/shareable_runtime/css_modules.d.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/index.html b/x-pack/plugins/canvas/shareable_runtime/index.html similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/index.html rename to x-pack/plugins/canvas/shareable_runtime/index.html diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/index.ts b/x-pack/plugins/canvas/shareable_runtime/index.ts similarity index 81% rename from x-pack/legacy/plugins/canvas/shareable_runtime/index.ts rename to x-pack/plugins/canvas/shareable_runtime/index.ts index 2398a348f5a31..8b29b23c4442f 100644 --- a/x-pack/legacy/plugins/canvas/shareable_runtime/index.ts +++ b/x-pack/plugins/canvas/shareable_runtime/index.ts @@ -5,13 +5,13 @@ */ export * from './api'; -import '../../../../../built_assets/css/plugins/kibana/index.light.css'; +import '../../../../built_assets/css/plugins/kibana/index.light.css'; import '../public/style/index.scss'; import '@elastic/eui/dist/eui_theme_light.css'; import '@kbn/ui-framework/dist/kui_light.css'; const css = require.context( - '../../../../../built_assets/css', + '../../../../built_assets/css', true, /\.\/plugins\/(?!canvas).*light\.css/ ); @@ -20,7 +20,7 @@ css.keys().forEach(filename => { }); const uiStyles = require.context( - '../../../../../src/legacy/ui/public/styles', + '../../../../src/legacy/ui/public/styles', false, /[\/\\](?!mixins|variables|_|\.|bootstrap_(light|dark))[^\/\\]+\.less/ ); diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/postcss.config.js b/x-pack/plugins/canvas/shareable_runtime/postcss.config.js similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/postcss.config.js rename to x-pack/plugins/canvas/shareable_runtime/postcss.config.js diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/supported_renderers.d.ts b/x-pack/plugins/canvas/shareable_runtime/supported_renderers.d.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/supported_renderers.d.ts rename to x-pack/plugins/canvas/shareable_runtime/supported_renderers.d.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/supported_renderers.js b/x-pack/plugins/canvas/shareable_runtime/supported_renderers.js similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/supported_renderers.js rename to x-pack/plugins/canvas/shareable_runtime/supported_renderers.js diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/template.html b/x-pack/plugins/canvas/shareable_runtime/template.html similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/template.html rename to x-pack/plugins/canvas/shareable_runtime/template.html diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/context.tsx b/x-pack/plugins/canvas/shareable_runtime/test/context.tsx similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/context.tsx rename to x-pack/plugins/canvas/shareable_runtime/test/context.tsx diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/context_example.ts b/x-pack/plugins/canvas/shareable_runtime/test/context_example.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/context_example.ts rename to x-pack/plugins/canvas/shareable_runtime/test/context_example.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/context_jest.ts b/x-pack/plugins/canvas/shareable_runtime/test/context_jest.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/context_jest.ts rename to x-pack/plugins/canvas/shareable_runtime/test/context_jest.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/index.ts b/x-pack/plugins/canvas/shareable_runtime/test/index.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/index.ts rename to x-pack/plugins/canvas/shareable_runtime/test/index.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/interactions.ts b/x-pack/plugins/canvas/shareable_runtime/test/interactions.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/interactions.ts rename to x-pack/plugins/canvas/shareable_runtime/test/interactions.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/selectors.ts b/x-pack/plugins/canvas/shareable_runtime/test/selectors.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/selectors.ts rename to x-pack/plugins/canvas/shareable_runtime/test/selectors.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/utils.ts b/x-pack/plugins/canvas/shareable_runtime/test/utils.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/utils.ts rename to x-pack/plugins/canvas/shareable_runtime/test/utils.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/workpads/austin.json b/x-pack/plugins/canvas/shareable_runtime/test/workpads/austin.json similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/workpads/austin.json rename to x-pack/plugins/canvas/shareable_runtime/test/workpads/austin.json diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/workpads/hello.json b/x-pack/plugins/canvas/shareable_runtime/test/workpads/hello.json similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/workpads/hello.json rename to x-pack/plugins/canvas/shareable_runtime/test/workpads/hello.json diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/test/workpads/test.json b/x-pack/plugins/canvas/shareable_runtime/test/workpads/test.json similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/test/workpads/test.json rename to x-pack/plugins/canvas/shareable_runtime/test/workpads/test.json diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/types.ts b/x-pack/plugins/canvas/shareable_runtime/types.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/types.ts rename to x-pack/plugins/canvas/shareable_runtime/types.ts diff --git a/x-pack/legacy/plugins/canvas/shareable_runtime/webpack.config.js b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js similarity index 100% rename from x-pack/legacy/plugins/canvas/shareable_runtime/webpack.config.js rename to x-pack/plugins/canvas/shareable_runtime/webpack.config.js diff --git a/x-pack/legacy/plugins/canvas/tasks/mocks/customElementService.js b/x-pack/plugins/canvas/tasks/mocks/customElementService.js similarity index 100% rename from x-pack/legacy/plugins/canvas/tasks/mocks/customElementService.js rename to x-pack/plugins/canvas/tasks/mocks/customElementService.js diff --git a/x-pack/legacy/plugins/canvas/tasks/mocks/downloadWorkpad.js b/x-pack/plugins/canvas/tasks/mocks/downloadWorkpad.js similarity index 100% rename from x-pack/legacy/plugins/canvas/tasks/mocks/downloadWorkpad.js rename to x-pack/plugins/canvas/tasks/mocks/downloadWorkpad.js diff --git a/x-pack/legacy/plugins/canvas/tasks/mocks/uiAbsoluteToParsedUrl.ts b/x-pack/plugins/canvas/tasks/mocks/uiAbsoluteToParsedUrl.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/tasks/mocks/uiAbsoluteToParsedUrl.ts rename to x-pack/plugins/canvas/tasks/mocks/uiAbsoluteToParsedUrl.ts diff --git a/x-pack/legacy/plugins/canvas/tasks/mocks/uiChrome.js b/x-pack/plugins/canvas/tasks/mocks/uiChrome.js similarity index 100% rename from x-pack/legacy/plugins/canvas/tasks/mocks/uiChrome.js rename to x-pack/plugins/canvas/tasks/mocks/uiChrome.js diff --git a/x-pack/legacy/plugins/canvas/tasks/mocks/uiMetric.js b/x-pack/plugins/canvas/tasks/mocks/uiMetric.js similarity index 100% rename from x-pack/legacy/plugins/canvas/tasks/mocks/uiMetric.js rename to x-pack/plugins/canvas/tasks/mocks/uiMetric.js diff --git a/x-pack/legacy/plugins/canvas/tasks/mocks/uiNotify.js b/x-pack/plugins/canvas/tasks/mocks/uiNotify.js similarity index 100% rename from x-pack/legacy/plugins/canvas/tasks/mocks/uiNotify.js rename to x-pack/plugins/canvas/tasks/mocks/uiNotify.js diff --git a/x-pack/legacy/plugins/canvas/tasks/mocks/uiNotifyFormatMsg.js b/x-pack/plugins/canvas/tasks/mocks/uiNotifyFormatMsg.js similarity index 100% rename from x-pack/legacy/plugins/canvas/tasks/mocks/uiNotifyFormatMsg.js rename to x-pack/plugins/canvas/tasks/mocks/uiNotifyFormatMsg.js diff --git a/x-pack/legacy/plugins/canvas/types/arguments.ts b/x-pack/plugins/canvas/types/arguments.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/arguments.ts rename to x-pack/plugins/canvas/types/arguments.ts diff --git a/x-pack/legacy/plugins/canvas/types/assets.ts b/x-pack/plugins/canvas/types/assets.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/assets.ts rename to x-pack/plugins/canvas/types/assets.ts diff --git a/x-pack/legacy/plugins/canvas/types/canvas.ts b/x-pack/plugins/canvas/types/canvas.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/canvas.ts rename to x-pack/plugins/canvas/types/canvas.ts diff --git a/x-pack/legacy/plugins/canvas/types/elements.ts b/x-pack/plugins/canvas/types/elements.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/elements.ts rename to x-pack/plugins/canvas/types/elements.ts diff --git a/x-pack/legacy/plugins/canvas/types/functions.ts b/x-pack/plugins/canvas/types/functions.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/functions.ts rename to x-pack/plugins/canvas/types/functions.ts diff --git a/x-pack/legacy/plugins/canvas/types/global.d.ts b/x-pack/plugins/canvas/types/global.d.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/global.d.ts rename to x-pack/plugins/canvas/types/global.d.ts diff --git a/x-pack/plugins/canvas/types/index.ts b/x-pack/plugins/canvas/types/index.ts index 014b203754a21..0799627ce9b5a 100644 --- a/x-pack/plugins/canvas/types/index.ts +++ b/x-pack/plugins/canvas/types/index.ts @@ -4,4 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -export * from '../../../legacy/plugins/canvas/types'; +export * from '../../../../src/plugins/expressions/common'; +export * from './assets'; +export * from './canvas'; +export * from './elements'; +export * from './functions'; +export * from './renderers'; +export * from './shortcuts'; +export * from './state'; +export * from './style'; +export * from './telemetry'; diff --git a/x-pack/legacy/plugins/canvas/types/react_moment_prototypes.d.ts b/x-pack/plugins/canvas/types/react_moment_prototypes.d.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/react_moment_prototypes.d.ts rename to x-pack/plugins/canvas/types/react_moment_prototypes.d.ts diff --git a/x-pack/legacy/plugins/canvas/types/renderers.ts b/x-pack/plugins/canvas/types/renderers.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/renderers.ts rename to x-pack/plugins/canvas/types/renderers.ts diff --git a/x-pack/legacy/plugins/canvas/types/shortcuts.ts b/x-pack/plugins/canvas/types/shortcuts.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/shortcuts.ts rename to x-pack/plugins/canvas/types/shortcuts.ts diff --git a/x-pack/legacy/plugins/canvas/types/state.ts b/x-pack/plugins/canvas/types/state.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/state.ts rename to x-pack/plugins/canvas/types/state.ts diff --git a/x-pack/legacy/plugins/canvas/types/style.ts b/x-pack/plugins/canvas/types/style.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/style.ts rename to x-pack/plugins/canvas/types/style.ts diff --git a/x-pack/legacy/plugins/canvas/types/telemetry.ts b/x-pack/plugins/canvas/types/telemetry.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/telemetry.ts rename to x-pack/plugins/canvas/types/telemetry.ts diff --git a/x-pack/legacy/plugins/canvas/types/transforms.ts b/x-pack/plugins/canvas/types/transforms.ts similarity index 100% rename from x-pack/legacy/plugins/canvas/types/transforms.ts rename to x-pack/plugins/canvas/types/transforms.ts diff --git a/x-pack/plugins/case/server/routes/api/cases/push_case.test.ts b/x-pack/plugins/case/server/routes/api/cases/push_case.test.ts new file mode 100644 index 0000000000000..c68b4b0c91735 --- /dev/null +++ b/x-pack/plugins/case/server/routes/api/cases/push_case.test.ts @@ -0,0 +1,110 @@ +/* + * 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. + */ + +import { kibanaResponseFactory, RequestHandler } from 'src/core/server'; +import { httpServerMock } from 'src/core/server/mocks'; + +import { + createMockSavedObjectsRepository, + createRoute, + createRouteContext, + mockCases, +} from '../__fixtures__'; +import { initPushCaseUserActionApi } from './push_case'; +import { CASE_DETAILS_URL } from '../../../../common/constants'; +import { mockCaseConfigure } from '../__fixtures__/mock_saved_objects'; + +describe('Push case', () => { + let routeHandler: RequestHandler<any, any, any>; + const mockDate = '2019-11-25T21:54:48.952Z'; + const caseExternalServiceRequestBody = { + connector_id: 'connector_id', + connector_name: 'connector_name', + external_id: 'external_id', + external_title: 'external_title', + external_url: 'external_url', + }; + beforeAll(async () => { + routeHandler = await createRoute(initPushCaseUserActionApi, 'post'); + const spyOnDate = jest.spyOn(global, 'Date') as jest.SpyInstance<{}, []>; + spyOnDate.mockImplementation(() => ({ + toISOString: jest.fn().mockReturnValue(mockDate), + })); + }); + it(`Pushes a case`, async () => { + const request = httpServerMock.createKibanaRequest({ + path: `${CASE_DETAILS_URL}/_push`, + method: 'post', + params: { + case_id: 'mock-id-3', + }, + body: caseExternalServiceRequestBody, + }); + + const theContext = createRouteContext( + createMockSavedObjectsRepository({ + caseSavedObject: mockCases, + }) + ); + + const response = await routeHandler(theContext, request, kibanaResponseFactory); + expect(response.status).toEqual(200); + expect(response.payload.external_service.pushed_at).toEqual(mockDate); + expect(response.payload.external_service.connector_id).toEqual('connector_id'); + expect(response.payload.closed_at).toEqual(null); + }); + it(`Pushes a case and closes when closure_type: 'close-by-pushing'`, async () => { + const request = httpServerMock.createKibanaRequest({ + path: `${CASE_DETAILS_URL}/_push`, + method: 'post', + params: { + case_id: 'mock-id-3', + }, + body: caseExternalServiceRequestBody, + }); + + const theContext = createRouteContext( + createMockSavedObjectsRepository({ + caseSavedObject: mockCases, + caseConfigureSavedObject: [ + { + ...mockCaseConfigure[0], + attributes: { + ...mockCaseConfigure[0].attributes, + closure_type: 'close-by-pushing', + }, + }, + ], + }) + ); + + const response = await routeHandler(theContext, request, kibanaResponseFactory); + expect(response.status).toEqual(200); + expect(response.payload.external_service.pushed_at).toEqual(mockDate); + expect(response.payload.external_service.connector_id).toEqual('connector_id'); + expect(response.payload.closed_at).toEqual(mockDate); + }); + + it(`Returns an error if pushCaseUserAction throws`, async () => { + const request = httpServerMock.createKibanaRequest({ + path: `${CASE_DETAILS_URL}/_push`, + method: 'post', + body: { + notagoodbody: 'Throw an error', + }, + }); + + const theContext = createRouteContext( + createMockSavedObjectsRepository({ + caseSavedObject: mockCases, + }) + ); + + const response = await routeHandler(theContext, request, kibanaResponseFactory); + expect(response.status).toEqual(400); + expect(response.payload.isBoom).toEqual(true); + }); +}); diff --git a/x-pack/plugins/case/server/routes/api/cases/push_case.ts b/x-pack/plugins/case/server/routes/api/cases/push_case.ts index c6638d292a197..5be36d34549b7 100644 --- a/x-pack/plugins/case/server/routes/api/cases/push_case.ts +++ b/x-pack/plugins/case/server/routes/api/cases/push_case.ts @@ -94,7 +94,8 @@ export function initPushCaseUserActionApi({ client, caseId, updatedAttributes: { - ...(myCaseConfigure.saved_objects[0].attributes.closure_type === 'close-by-pushing' + ...(myCaseConfigure.total > 0 && + myCaseConfigure.saved_objects[0].attributes.closure_type === 'close-by-pushing' ? { status: 'closed', closed_at: pushedDate, @@ -124,7 +125,8 @@ export function initPushCaseUserActionApi({ userActionService.postUserActions({ client, actions: [ - ...(myCaseConfigure.saved_objects[0].attributes.closure_type === 'close-by-pushing' + ...(myCaseConfigure.total > 0 && + myCaseConfigure.saved_objects[0].attributes.closure_type === 'close-by-pushing' ? [ buildCaseUserActionItem({ action: 'update', diff --git a/x-pack/plugins/drilldowns/public/components/flyout_frame/flyout_frame.story.tsx b/x-pack/plugins/drilldowns/public/components/flyout_frame/flyout_frame.story.tsx index cb223db556f56..7ef0bc5a8bee4 100644 --- a/x-pack/plugins/drilldowns/public/components/flyout_frame/flyout_frame.story.tsx +++ b/x-pack/plugins/drilldowns/public/components/flyout_frame/flyout_frame.story.tsx @@ -33,7 +33,7 @@ storiesOf('components/FlyoutFrame', module) }) .add('open in flyout', () => { return ( - <EuiFlyout> + <EuiFlyout onClose={() => {}}> <FlyoutFrame title="Create drilldown" footer={<EuiButton>Save</EuiButton>} diff --git a/x-pack/plugins/endpoint/common/generate_data.test.ts b/x-pack/plugins/endpoint/common/generate_data.test.ts index e1a2401849301..f99fa5c871d89 100644 --- a/x-pack/plugins/endpoint/common/generate_data.test.ts +++ b/x-pack/plugins/endpoint/common/generate_data.test.ts @@ -101,20 +101,38 @@ describe('data generator', () => { }); it('with n-1 process events', () => { - for (let i = 1; i < events.length - 1; i++) { - expect(events[i].process.parent?.entity_id).toEqual(events[i - 1].process.entity_id); - expect(events[i].event.kind).toEqual('event'); - expect(events[i].event.category).toEqual('process'); + for (let i = events.length - 2; i > 0; ) { + const parentEntityIdOfChild = events[i].process.parent?.entity_id; + for ( + ; + --i >= -1 && (events[i].event.kind !== 'event' || events[i].event.category !== 'process'); + + ) { + // related event - skip it + } + expect(i).toBeGreaterThanOrEqual(0); + expect(parentEntityIdOfChild).toEqual(events[i].process.entity_id); } }); it('with a corresponding alert at the end', () => { + let previousProcessEventIndex = events.length - 2; + for ( + ; + previousProcessEventIndex >= -1 && + (events[previousProcessEventIndex].event.kind !== 'event' || + events[previousProcessEventIndex].event.category !== 'process'); + previousProcessEventIndex-- + ) { + // related event - skip it + } + expect(previousProcessEventIndex).toBeGreaterThanOrEqual(0); // The alert should be last and have the same entity_id as the previous process event expect(events[events.length - 1].process.entity_id).toEqual( - events[events.length - 2].process.entity_id + events[previousProcessEventIndex].process.entity_id ); expect(events[events.length - 1].process.parent?.entity_id).toEqual( - events[events.length - 2].process.parent?.entity_id + events[previousProcessEventIndex].process.parent?.entity_id ); expect(events[events.length - 1].event.kind).toEqual('alert'); expect(events[events.length - 1].event.category).toEqual('malware'); diff --git a/x-pack/plugins/endpoint/common/generate_data.ts b/x-pack/plugins/endpoint/common/generate_data.ts index 840574063d3f3..9e7aedcc90bb5 100644 --- a/x-pack/plugins/endpoint/common/generate_data.ts +++ b/x-pack/plugins/endpoint/common/generate_data.ts @@ -339,13 +339,17 @@ export class EndpointDocGenerator { percentNodesWithRelated?: number, percentChildrenTerminated?: number ) { - const ancestry = this.createAlertEventAncestry(alertAncestors); + const ancestry = this.createAlertEventAncestry( + alertAncestors, + relatedEventsPerNode, + percentNodesWithRelated + ); for (let i = 0; i < ancestry.length; i++) { yield ancestry[i]; } - // ancestry will always have at least 2 elements, and the second to last element will be the process associated with the alert + // ancestry will always have at least 2 elements, and the last element will be the alert yield* this.descendantsTreeGenerator( - ancestry[ancestry.length - 2], + ancestry[ancestry.length - 1], childGenerations, maxChildrenPerNode, relatedEventsPerNode, @@ -358,18 +362,44 @@ export class EndpointDocGenerator { * Creates an alert event and associated process ancestry. The alert event will always be the last event in the return array. * @param alertAncestors - number of ancestor generations to create */ - public createAlertEventAncestry(alertAncestors = 3): Event[] { + public createAlertEventAncestry( + alertAncestors = 3, + relatedEventsPerNode = 5, + pctWithRelated = 30 + ): Event[] { const events = []; const startDate = new Date().getTime(); const root = this.generateEvent({ timestamp: startDate + 1000 }); events.push(root); let ancestor = root; + // generate related alerts for root + const processDuration: number = 6 * 3600; + if (this.randomN(100) < pctWithRelated) { + for (const relatedEvent of this.relatedEventsGenerator( + ancestor, + relatedEventsPerNode, + processDuration + )) { + events.push(relatedEvent); + } + } for (let i = 0; i < alertAncestors; i++) { ancestor = this.generateEvent({ timestamp: startDate + 1000 * (i + 1), parentEntityID: ancestor.process.entity_id, }); events.push(ancestor); + + // generate related alerts for ancestor + if (this.randomN(100) < pctWithRelated) { + for (const relatedEvent of this.relatedEventsGenerator( + ancestor, + relatedEventsPerNode, + processDuration + )) { + events.push(relatedEvent); + } + } } events.push( this.generateAlert( @@ -530,7 +560,7 @@ export class EndpointDocGenerator { applied: { actions: { configure_elasticsearch_connection: { - message: 'elasticsearch comms configured successfully', + message: 'elasticsearch comes configured successfully', status: HostPolicyResponseActionStatus.success, }, configure_kernel: { @@ -618,7 +648,7 @@ export class EndpointDocGenerator { response: { configurations: { events: { - concerned_actions: this.randomHostPolicyResponseActions(), + concerned_actions: ['download_model'], status: this.randomHostPolicyResponseActionStatus(), }, logging: { diff --git a/x-pack/plugins/endpoint/common/types.ts b/x-pack/plugins/endpoint/common/types.ts index a1ddc97a90d29..181b0e7ab3884 100644 --- a/x-pack/plugins/endpoint/common/types.ts +++ b/x-pack/plugins/endpoint/common/types.ts @@ -25,7 +25,7 @@ export type Immutable<T> = T extends undefined | null | boolean | string | numbe ? ImmutableSet<M> : ImmutableObject<T>; -type ImmutableArray<T> = ReadonlyArray<Immutable<T>>; +export type ImmutableArray<T> = ReadonlyArray<Immutable<T>>; type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>; type ImmutableSet<T> = ReadonlySet<Immutable<T>>; type ImmutableObject<T> = { readonly [K in keyof T]: Immutable<T[K]> }; @@ -644,6 +644,8 @@ export interface HostPolicyResponseActions { read_malware_config: HostPolicyResponseActionDetails; } +export type HostPolicyResponseConfiguration = HostPolicyResponse['endpoint']['policy']['applied']['response']['configurations']; + interface HostPolicyResponseConfigurationStatus { status: HostPolicyResponseActionStatus; concerned_actions: Array<keyof HostPolicyResponseActions>; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts index bcfd6b96c9eb8..a5378a02ed6fb 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HostResultList } from '../../../../../common/types'; +import { HostResultList, HostPolicyResponseActionStatus } from '../../../../../common/types'; import { isOnHostPage, hasSelectedHost, uiQueryParams, listData } from './selectors'; import { HostState } from '../../types'; import { ImmutableMiddlewareFactory } from '../../types'; @@ -77,7 +77,31 @@ export const hostMiddlewareFactory: ImmutableMiddlewareFactory<HostState> = core endpoint: { policy: { applied: { - status: 'success', + version: '1.0.0', + status: HostPolicyResponseActionStatus.success, + id: '17d4b81d-9940-4b64-9de5-3e03ef1fb5cf', + actions: { + download_model: { + status: 'success', + message: 'Model downloaded', + }, + ingest_events_config: { + status: 'failure', + message: 'No action taken', + }, + }, + response: { + configurations: { + malware: { + status: 'success', + concerned_actions: ['download_model'], + }, + events: { + status: 'failure', + concerned_actions: ['ingest_events_config'], + }, + }, + }, }, }, }, diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/selectors.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/selectors.ts index b0711baf9cdff..e16d4ff5d18c2 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/selectors.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/selectors.ts @@ -5,7 +5,12 @@ */ import querystring from 'querystring'; import { createSelector } from 'reselect'; -import { Immutable } from '../../../../../common/types'; +import { + Immutable, + HostPolicyResponseActions, + HostPolicyResponseConfiguration, + HostPolicyResponseActionStatus, +} from '../../../../../common/types'; import { HostState, HostIndexUIQueryParams } from '../../types'; const PAGE_SIZES = Object.freeze([10, 20, 50]); @@ -28,6 +33,61 @@ export const detailsLoading = (state: Immutable<HostState>): boolean => state.de export const detailsError = (state: Immutable<HostState>) => state.detailsError; +/** + * Returns the full policy response from the endpoint after a user modifies a policy. + */ +const detailsPolicyAppliedResponse = (state: Immutable<HostState>) => + state.policyResponse && state.policyResponse.endpoint.policy.applied; + +/** + * Returns the response configurations from the endpoint after a user modifies a policy. + */ +export const policyResponseConfigurations: ( + state: Immutable<HostState> +) => undefined | Immutable<HostPolicyResponseConfiguration> = createSelector( + detailsPolicyAppliedResponse, + applied => { + return applied?.response?.configurations; + } +); + +/** + * Returns a map of the number of failed and warning policy response actions per configuration. + */ +export const policyResponseFailedOrWarningActionCount: ( + state: Immutable<HostState> +) => Map<string, number> = createSelector(detailsPolicyAppliedResponse, applied => { + const failureOrWarningByConfigType = new Map<string, number>(); + if (applied?.response?.configurations !== undefined && applied?.actions !== undefined) { + Object.entries(applied.response.configurations).map(([key, val]) => { + let count = 0; + for (const action of val.concerned_actions) { + const actionStatus = applied.actions[action]?.status; + if ( + actionStatus === HostPolicyResponseActionStatus.failure || + actionStatus === HostPolicyResponseActionStatus.warning + ) { + count += 1; + } + } + return failureOrWarningByConfigType.set(key, count); + }); + } + return failureOrWarningByConfigType; +}); + +/** + * Returns the actions taken by the endpoint for each response configuration after a user modifies a policy. + */ +export const policyResponseActions: ( + state: Immutable<HostState> +) => undefined | Partial<HostPolicyResponseActions> = createSelector( + detailsPolicyAppliedResponse, + applied => { + return applied?.actions; + } +); + export const isOnHostPage = (state: Immutable<HostState>) => state.location ? state.location.pathname === '/hosts' : false; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/components/flyout_sub_header.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/components/flyout_sub_header.tsx index 02f91307c988e..9abb54e8b1807 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/components/flyout_sub_header.tsx +++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/components/flyout_sub_header.tsx @@ -9,7 +9,7 @@ import { EuiFlyoutHeader, CommonProps, EuiButtonEmpty } from '@elastic/eui'; import styled from 'styled-components'; export type FlyoutSubHeaderProps = CommonProps & { - children: React.ReactNode; + children?: React.ReactNode; backButton?: { title: string; onClick: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>; @@ -25,6 +25,9 @@ const StyledEuiFlyoutHeader = styled(EuiFlyoutHeader)` padding-bottom: ${props => props.theme.eui.paddingSizes.s}; } + .flyoutSubHeaderBackButton { + font-size: ${props => props.theme.eui.euiFontSizeXS}; + } .back-button-content { padding-left: 0; &-text { @@ -48,7 +51,7 @@ const BUTTON_TEXT_PROPS = Object.freeze({ className: 'back-button-content-text' export const FlyoutSubHeader = memo<FlyoutSubHeaderProps>( ({ children, backButton, ...otherProps }) => { return ( - <StyledEuiFlyoutHeader hasBorder {...otherProps} className={backButton && `hasButtons`}> + <StyledEuiFlyoutHeader {...otherProps} className={backButton && `hasButtons`}> {backButton && ( <div className="buttons"> {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} @@ -60,6 +63,7 @@ export const FlyoutSubHeader = memo<FlyoutSubHeaderProps>( size="xs" href={backButton?.href ?? ''} onClick={backButton?.onClick} + className="flyoutSubHeaderBackButton" > {backButton?.title} </EuiButtonEmpty> diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_constants.ts b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_constants.ts new file mode 100644 index 0000000000000..5250eeaf028d5 --- /dev/null +++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_constants.ts @@ -0,0 +1,15 @@ +/* + * 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. + */ + +import { HostPolicyResponseActionStatus } from '../../../../../../common/types'; + +export const POLICY_STATUS_TO_HEALTH_COLOR = Object.freeze< + { [key in keyof typeof HostPolicyResponseActionStatus]: string } +>({ + success: 'success', + warning: 'warning', + failure: 'danger', +}); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_details.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_details.tsx index 7d948f54bd0bc..ee1c7543d7e0a 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_details.tsx +++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/host_details.tsx @@ -16,13 +16,14 @@ import { import React, { memo, useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { HostMetadata, HostPolicyResponseActionStatus } from '../../../../../../common/types'; +import { HostMetadata } from '../../../../../../common/types'; import { FormattedDateAndTime } from '../../formatted_date_time'; import { LinkToApp } from '../../components/link_to_app'; import { useHostSelector, useHostLogsUrl } from '../hooks'; import { urlFromQueryParams } from '../url_from_query_params'; import { policyResponseStatus, uiQueryParams } from '../../../store/hosts/selectors'; import { useNavigateByRouterEventHandler } from '../../hooks/use_navigate_by_router_event_handler'; +import { POLICY_STATUS_TO_HEALTH_COLOR } from './host_constants'; const HostIds = styled(EuiListGroupItem)` margin-top: 0; @@ -31,14 +32,6 @@ const HostIds = styled(EuiListGroupItem)` } `; -const POLICY_STATUS_TO_HEALTH_COLOR = Object.freeze< - { [key in keyof typeof HostPolicyResponseActionStatus]: string } ->({ - success: 'success', - warning: 'warning', - failure: 'danger', -}); - export const HostDetails = memo(({ details }: { details: HostMetadata }) => { const { appId, appPath, url } = useHostLogsUrl(details.host.id); const queryParams = useHostSelector(uiQueryParams); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/index.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/index.tsx index e44a45f300daa..017ce9a66f8c5 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/index.tsx +++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/index.tsx @@ -9,8 +9,9 @@ import { EuiFlyout, EuiFlyoutBody, EuiFlyoutHeader, - EuiTitle, EuiLoadingContent, + EuiTitle, + EuiText, EuiSpacer, } from '@elastic/eui'; import { useHistory } from 'react-router-dom'; @@ -25,6 +26,9 @@ import { detailsError, showView, detailsLoading, + policyResponseConfigurations, + policyResponseActions, + policyResponseFailedOrWarningActionCount, } from '../../../store/hosts/selectors'; import { HostDetails } from './host_details'; import { PolicyResponse } from './policy_response'; @@ -101,6 +105,9 @@ const PolicyResponseFlyoutPanel = memo<{ hostMeta: HostMetadata; }>(({ hostMeta }) => { const { show, ...queryParams } = useHostSelector(uiQueryParams); + const responseConfig = useHostSelector(policyResponseConfigurations); + const responseActionStatus = useHostSelector(policyResponseActions); + const responseAttentionCount = useHostSelector(policyResponseFailedOrWarningActionCount); const detailsUri = useMemo( () => urlFromQueryParams({ @@ -125,18 +132,28 @@ const PolicyResponseFlyoutPanel = memo<{ <FlyoutSubHeader backButton={backButtonProp} data-test-subj="hostDetailsPolicyResponseFlyoutHeader" - > - <EuiTitle size="xxs" data-test-subj="hostDetailsPolicyResponseFlyoutTitle"> - <h3> + /> + <EuiFlyoutBody data-test-subj="hostDetailsPolicyResponseFlyoutBody"> + <EuiText data-test-subj="hostDetailsPolicyResponseFlyoutTitle"> + <h4> <FormattedMessage id="xpack.endpoint.host.policyResponse.title" defaultMessage="Policy Response" /> - </h3> - </EuiTitle> - </FlyoutSubHeader> - <EuiFlyoutBody data-test-subj="hostDetailsPolicyResponseFlyoutBody"> - <PolicyResponse /> + </h4> + </EuiText> + {responseConfig !== undefined && responseActionStatus !== undefined ? ( + <PolicyResponse + responseConfig={responseConfig} + responseActionStatus={responseActionStatus} + responseAttentionCount={responseAttentionCount} + /> + ) : ( + <FormattedMessage + id="xpack.endpoint.hostDetails.noPolicyResponse" + defaultMessage="No Policy Response Available" + /> + )} </EuiFlyoutBody> </> ); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response.tsx index eacb6a52d3184..aa04f2fdff57f 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response.tsx +++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response.tsx @@ -3,8 +3,145 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { memo } from 'react'; +import React, { memo, useMemo } from 'react'; +import styled from 'styled-components'; +import { EuiAccordion, EuiNotificationBadge, EuiHealth } from '@elastic/eui'; +import { EuiText } from '@elastic/eui'; +import { htmlIdGenerator } from '@elastic/eui'; +import { + HostPolicyResponseActions, + HostPolicyResponseConfiguration, + Immutable, + ImmutableArray, +} from '../../../../../../common/types'; +import { formatResponse } from './policy_response_friendly_names'; +import { POLICY_STATUS_TO_HEALTH_COLOR } from './host_constants'; -export const PolicyResponse = memo(() => { - return <div>Policy Status to be displayed here soon.</div>; -}); +/** + * Nested accordion in the policy response detailing any concerned + * actions the endpoint took to apply the policy configuration. + */ +const PolicyResponseConfigAccordion = styled(EuiAccordion)` + > .euiAccordion__triggerWrapper { + padding: ${props => props.theme.eui.paddingSizes.s}; + } + &.euiAccordion-isOpen { + background-color: ${props => props.theme.eui.euiFocusBackgroundColor}; + } + .euiAccordion__childWrapper { + background-color: ${props => props.theme.eui.euiColorLightestShade}; + } + .policyResponseAttentionBadge { + background-color: ${props => props.theme.eui.euiColorDanger}; + color: ${props => props.theme.eui.euiColorEmptyShade}; + } + .euiAccordion__button { + :hover, + :focus { + text-decoration: none; + } + } + :hover:not(.euiAccordion-isOpen) { + background-color: ${props => props.theme.eui.euiColorLightestShade}; + } +`; + +const ResponseActions = memo( + ({ + actions, + actionStatus, + }: { + actions: ImmutableArray<keyof HostPolicyResponseActions>; + actionStatus: Partial<HostPolicyResponseActions>; + }) => { + return ( + <> + {actions.map((action, index) => { + const statuses = actionStatus[action]; + if (statuses === undefined) { + return undefined; + } + return ( + <EuiAccordion + id={action + index} + key={action + index} + data-test-subj="hostDetailsPolicyResponseActionsAccordion" + buttonContent={ + <EuiText size="xs" data-test-subj="policyResponseAction"> + <h4>{formatResponse(action)}</h4> + </EuiText> + } + paddingSize="s" + extraAction={ + <EuiHealth + color={POLICY_STATUS_TO_HEALTH_COLOR[statuses.status]} + data-test-subj="policyResponseStatusHealth" + > + <EuiText size="xs"> + <p>{formatResponse(statuses.status)}</p> + </EuiText> + </EuiHealth> + } + > + <EuiText size="xs" data-test-subj="policyResponseMessage"> + <p>{statuses.message}</p> + </EuiText> + </EuiAccordion> + ); + })} + </> + ); + } +); + +/** + * A policy response is returned by the endpoint and shown in the host details after a user modifies a policy + */ +export const PolicyResponse = memo( + ({ + responseConfig, + responseActionStatus, + responseAttentionCount, + }: { + responseConfig: Immutable<HostPolicyResponseConfiguration>; + responseActionStatus: Partial<HostPolicyResponseActions>; + responseAttentionCount: Map<string, number>; + }) => { + return ( + <> + {Object.entries(responseConfig).map(([key, val]) => { + const attentionCount = responseAttentionCount.get(key); + return ( + <PolicyResponseConfigAccordion + id={useMemo(() => htmlIdGenerator()(), [])} + key={useMemo(() => htmlIdGenerator()(), [])} + data-test-subj="hostDetailsPolicyResponseConfigAccordion" + buttonContent={ + <EuiText size="s"> + <p>{formatResponse(key)}</p> + </EuiText> + } + paddingSize="m" + extraAction={ + attentionCount && + attentionCount > 0 && ( + <EuiNotificationBadge + className="policyResponseAttentionBadge" + data-test-subj="hostDetailsPolicyResponseAttentionBadge" + > + {attentionCount} + </EuiNotificationBadge> + ) + } + > + <ResponseActions + actions={val.concerned_actions} + actionStatus={responseActionStatus} + /> + </PolicyResponseConfigAccordion> + ); + })} + </> + ); + } +); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response_friendly_names.ts b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response_friendly_names.ts new file mode 100644 index 0000000000000..251b3e86bc3f9 --- /dev/null +++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/details/policy_response_friendly_names.ts @@ -0,0 +1,170 @@ +/* + * 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. + */ + +import { i18n } from '@kbn/i18n'; + +const responseMap = new Map(); +responseMap.set( + 'success', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.success', { + defaultMessage: 'Success', + }) +); +responseMap.set( + 'warning', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.warning', { + defaultMessage: 'Warning', + }) +); +responseMap.set( + 'failure', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.failed', { + defaultMessage: 'Failed', + }) +); +responseMap.set( + 'malware', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.malware', { + defaultMessage: 'Malware', + }) +); +responseMap.set( + 'events', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.events', { + defaultMessage: 'Events', + }) +); +responseMap.set( + 'configure_elasticsearch_connection', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.configureElasticSearchConnection', { + defaultMessage: 'Configure Elastic Search Connection', + }) +); +responseMap.set( + 'configure_logging', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.configureLogging', { + defaultMessage: 'Configure Logging', + }) +); +responseMap.set( + 'configure_kernel', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.configureKernel', { + defaultMessage: 'Configure Kernel', + }) +); +responseMap.set( + 'configure_malware', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.configureMalware', { + defaultMessage: 'Configure Malware', + }) +); +responseMap.set( + 'connect_kernel', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.connectKernel', { + defaultMessage: 'Connect Kernel', + }) +); +responseMap.set( + 'detect_file_open_events', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.detectFileOpenEvents', { + defaultMessage: 'Detect File Open Events', + }) +); +responseMap.set( + 'detect_file_write_events', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.detectFileWriteEvents', { + defaultMessage: 'Detect File Write Events', + }) +); +responseMap.set( + 'detect_image_load_events', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.detectImageLoadEvents', { + defaultMessage: 'Detect Image Load Events', + }) +); +responseMap.set( + 'detect_process_events', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.detectProcessEvents', { + defaultMessage: 'Detect Process Events', + }) +); +responseMap.set( + 'download_global_artifacts', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.downloadGlobalArtifacts', { + defaultMessage: 'Download Global Artifacts', + }) +); +responseMap.set( + 'load_config', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.loadConfig', { + defaultMessage: 'Load Config', + }) +); +responseMap.set( + 'load_malware_model', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.loadMalwareModel', { + defaultMessage: 'Load Malware Model', + }) +); +responseMap.set( + 'read_elasticsearch_config', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.readElasticSearchConfig', { + defaultMessage: 'Read ElasticSearch Config', + }) +); +responseMap.set( + 'read_events_config', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.readEventsConfig', { + defaultMessage: 'Read Events Config', + }) +); +responseMap.set( + 'read_kernel_config', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.readKernelConfig', { + defaultMessage: 'Read Kernel Config', + }) +); +responseMap.set( + 'read_logging_config', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.readLoggingConfig', { + defaultMessage: 'Read Logging Config', + }) +); +responseMap.set( + 'read_malware_config', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.readMalwareConfig', { + defaultMessage: 'Read Malware Config', + }) +); +responseMap.set( + 'workflow', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.workflow', { + defaultMessage: 'Workflow', + }) +); +responseMap.set( + 'download_model', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.downloadModel', { + defaultMessage: 'Download Model', + }) +); +responseMap.set( + 'ingest_events_config', + i18n.translate('xpack.endpoint.hostDetails.policyResponse.injestEventsConfig', { + defaultMessage: 'Injest Events Config', + }) +); + +/** + * Takes in the snake-cased response from the API and + * removes the underscores and capitalizes the string. + */ +export function formatResponse(responseString: string) { + if (responseMap.has(responseString)) { + return responseMap.get(responseString); + } + return responseString; +} diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.test.tsx b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.test.tsx index 5a8765110c909..aaeff935b32b4 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.test.tsx +++ b/x-pack/plugins/endpoint/public/applications/endpoint/view/hosts/index.test.tsx @@ -25,7 +25,7 @@ describe('when on the hosts page', () => { let coreStart: AppContextTestRender['coreStart']; let middlewareSpy: AppContextTestRender['middlewareSpy']; - beforeEach(async () => { + beforeEach(() => { const mockedContext = createAppRootMockRenderer(); ({ history, store, coreStart, middlewareSpy } = mockedContext); render = () => mockedContext.render(<HostList />); @@ -127,6 +127,14 @@ describe('when on the hosts page', () => { ) => { const policyResponse = docGenerator.generatePolicyResponse(); policyResponse.endpoint.policy.applied.status = overallStatus; + policyResponse.endpoint.policy.applied.response.configurations.malware.status = overallStatus; + policyResponse.endpoint.policy.applied.actions.download_model!.status = overallStatus; + if ( + overallStatus === HostPolicyResponseActionStatus.failure || + overallStatus === HostPolicyResponseActionStatus.warning + ) { + policyResponse.endpoint.policy.applied.actions.download_model!.message = 'no action taken'; + } store.dispatch({ type: 'serverReturnedHostPolicyResponse', payload: { @@ -281,6 +289,9 @@ describe('when on the hosts page', () => { fireEvent.click(policyStatusLink); }); await userChangedUrlChecker; + reactTestingLibrary.act(() => { + dispatchServerReturnedHostPolicyResponse(); + }); }); it('should hide the host details panel', async () => { const hostDetailsFlyout = await renderResult.queryByTestId('hostDetailsFlyoutBody'); @@ -299,6 +310,43 @@ describe('when on the hosts page', () => { (await renderResult.findByTestId('hostDetailsPolicyResponseFlyoutTitle')).textContent ).toBe('Policy Response'); }); + it('should show a configuration section for each protection', async () => { + const configAccordions = await renderResult.findAllByTestId( + 'hostDetailsPolicyResponseConfigAccordion' + ); + expect(configAccordions).not.toBeNull(); + }); + it('should show an actions section for each configuration', async () => { + const actionAccordions = await renderResult.findAllByTestId( + 'hostDetailsPolicyResponseActionsAccordion' + ); + const action = await renderResult.findAllByTestId('policyResponseAction'); + const statusHealth = await renderResult.findAllByTestId('policyResponseStatusHealth'); + const message = await renderResult.findAllByTestId('policyResponseMessage'); + expect(actionAccordions).not.toBeNull(); + expect(action).not.toBeNull(); + expect(statusHealth).not.toBeNull(); + expect(message).not.toBeNull(); + }); + it('should not show any numbered badges if all actions are succesful', () => { + return renderResult.findByTestId('hostDetailsPolicyResponseAttentionBadge').catch(e => { + expect(e).not.toBeNull(); + }); + }); + it('should show a numbered badge if at least one action failed', () => { + reactTestingLibrary.act(() => { + dispatchServerReturnedHostPolicyResponse(HostPolicyResponseActionStatus.failure); + }); + const attentionBadge = renderResult.findByTestId('hostDetailsPolicyResponseAttentionBadge'); + expect(attentionBadge).not.toBeNull(); + }); + it('should show a numbered badge if at least one action has a warning', () => { + reactTestingLibrary.act(() => { + dispatchServerReturnedHostPolicyResponse(HostPolicyResponseActionStatus.warning); + }); + const attentionBadge = renderResult.findByTestId('hostDetailsPolicyResponseAttentionBadge'); + expect(attentionBadge).not.toBeNull(); + }); it('should include the back to details link', async () => { const subHeaderBackLink = await renderResult.findByTestId('flyoutSubHeaderBackButton'); expect(subHeaderBackLink.textContent).toBe('Endpoint Details'); diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/graph_controls.tsx b/x-pack/plugins/endpoint/public/embeddables/resolver/view/graph_controls.tsx index a1cd003949a22..32c3f73ced287 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/graph_controls.tsx +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/view/graph_controls.tsx @@ -85,40 +85,66 @@ export const GraphControls = styled( <div className={className}> <EuiPanel className="panning-controls" paddingSize="none" hasShadow> <div className="panning-controls-top"> - <button className="north-button" title="North" onClick={handleNorth}> + <button + className="north-button" + data-test-subj="north-button" + title="North" + onClick={handleNorth} + > <EuiIcon type="arrowUp" /> </button> </div> <div className="panning-controls-middle"> - <button className="west-button" title="West" onClick={handleWest}> + <button + className="west-button" + data-test-subj="west-button" + title="West" + onClick={handleWest} + > <EuiIcon type="arrowLeft" /> </button> - <button className="center-button" title="Center" onClick={handleCenterClick}> + <button + className="center-button" + data-test-subj="center-button" + title="Center" + onClick={handleCenterClick} + > <EuiIcon type="bullseye" /> </button> - <button className="east-button" title="East" onClick={handleEast}> + <button + className="east-button" + data-test-subj="east-button" + title="East" + onClick={handleEast} + > <EuiIcon type="arrowRight" /> </button> </div> <div className="panning-controls-bottom"> - <button className="south-button" title="South" onClick={handleSouth}> + <button + className="south-button" + data-test-subj="south-button" + title="South" + onClick={handleSouth} + > <EuiIcon type="arrowDown" /> </button> </div> </EuiPanel> <EuiPanel className="zoom-controls" paddingSize="none" hasShadow> - <button title="Zoom In" onClick={handleZoomInClick}> + <button title="Zoom In" data-test-subj="zoom-in" onClick={handleZoomInClick}> <EuiIcon type="plusInCircle" /> </button> <EuiRange className="zoom-slider" + data-test-subj="zoom-slider" min={0} max={1} step={0.01} value={scalingFactor} onChange={handleZoomAmountChange} /> - <button title="Zoom Out" onClick={handleZoomOutClick}> + <button title="Zoom Out" data-test-subj="zoom-out" onClick={handleZoomOutClick}> <EuiIcon type="minusInCircle" /> </button> </EuiPanel> diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/process_event_dot.tsx b/x-pack/plugins/endpoint/public/embeddables/resolver/view/process_event_dot.tsx index 3201e83164dba..27844f09e2272 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/process_event_dot.tsx +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/view/process_event_dot.tsx @@ -142,20 +142,27 @@ export const ProcessEventDot = styled( const activeDescendantId = useSelector(selectors.uiActiveDescendantId); const selectedDescendantId = useSelector(selectors.uiSelectedDescendantId); + const logicalProcessNodeViewWidth = 360; + const logicalProcessNodeViewHeight = 120; + /** + * The `left` and `top` values represent the 'center' point of the process node. + * Since the view has content to the left and above the 'center' point, offset the + * position to accomodate for that. This aligns the logical center of the process node + * with the correct position on the map. + */ + const processNodeViewXOffset = -0.172413 * logicalProcessNodeViewWidth * magFactorX; + const processNodeViewYOffset = -0.73684 * logicalProcessNodeViewHeight * magFactorX; + const nodeViewportStyle = useMemo( () => ({ - left: `${left}px`, - top: `${top}px`, + left: `${left + processNodeViewXOffset}px`, + top: `${top + processNodeViewYOffset}px`, // Width of symbol viewport scaled to fit - width: `${360 * magFactorX}px`, + width: `${logicalProcessNodeViewWidth * magFactorX}px`, // Height according to symbol viewbox AR - height: `${120 * magFactorX}px`, - // Adjusted to position/scale with camera - transform: `translateX(-${0.172413 * 360 * magFactorX + 10}px) translateY(-${0.73684 * - 120 * - magFactorX}px)`, + height: `${logicalProcessNodeViewHeight * magFactorX}px`, }), - [left, magFactorX, top] + [left, magFactorX, processNodeViewXOffset, processNodeViewYOffset, top] ); /** @@ -202,32 +209,26 @@ export const ProcessEventDot = styled( const dispatch = useResolverDispatch(); - const handleFocus = useCallback( - (focusEvent: React.FocusEvent<HTMLDivElement>) => { - dispatch({ - type: 'userFocusedOnResolverNode', - payload: { - nodeId, - }, - }); - }, - [dispatch, nodeId] - ); + const handleFocus = useCallback(() => { + dispatch({ + type: 'userFocusedOnResolverNode', + payload: { + nodeId, + }, + }); + }, [dispatch, nodeId]); - const handleClick = useCallback( - (clickEvent: React.MouseEvent<HTMLDivElement, MouseEvent>) => { - if (animationTarget.current !== null) { - (animationTarget.current as any).beginElement(); - } - dispatch({ - type: 'userSelectedResolverNode', - payload: { - nodeId, - }, - }); - }, - [animationTarget, dispatch, nodeId] - ); + const handleClick = useCallback(() => { + if (animationTarget.current !== null) { + (animationTarget.current as any).beginElement(); + } + dispatch({ + type: 'userSelectedResolverNode', + payload: { + nodeId, + }, + }); + }, [animationTarget, dispatch, nodeId]); /* eslint-disable jsx-a11y/click-events-have-key-events */ /** @@ -351,7 +352,9 @@ export const ProcessEventDot = styled( }} > <span className="euiButton__content"> - <span className="euiButton__text">{eventModel.eventName(event)}</span> + <span className="euiButton__text" data-test-subj={'euiButton__text'}> + {eventModel.eventName(event)} + </span> </span> </div> {magFactorX >= 2 && ( @@ -373,13 +376,11 @@ export const ProcessEventDot = styled( ) )` position: absolute; - display: block; text-align: left; font-size: 10px; user-select: none; box-sizing: border-box; border-radius: 10%; - padding: 4px; white-space: nowrap; will-change: left, top, width, height; contain: strict; diff --git a/x-pack/plugins/features/server/plugin.ts b/x-pack/plugins/features/server/plugin.ts index 83cc9e1eb7cc8..2405f05768a2f 100644 --- a/x-pack/plugins/features/server/plugin.ts +++ b/x-pack/plugins/features/server/plugin.ts @@ -11,7 +11,7 @@ import { RecursiveReadonly, } from '../../../../src/core/server'; import { Capabilities as UICapabilities } from '../../../../src/core/server'; -import { deepFreeze } from '../../../../src/core/utils'; +import { deepFreeze } from '../../../../src/core/server'; import { XPackInfo } from '../../../legacy/plugins/xpack_main/server/lib/xpack_info'; import { PluginSetupContract as TimelionSetupContract } from '../../../../src/plugins/vis_type_timelion/server'; import { FeatureRegistry } from './feature_registry'; diff --git a/x-pack/plugins/graph/common/check_license.ts b/x-pack/plugins/graph/common/check_license.ts index f9a663f35ed47..38d6c272f2784 100644 --- a/x-pack/plugins/graph/common/check_license.ts +++ b/x-pack/plugins/graph/common/check_license.ts @@ -6,7 +6,12 @@ import { i18n } from '@kbn/i18n'; import { ILicense } from '../../licensing/common/types'; -import { assertNever } from '../../../../src/core/utils'; + +// Can be used in switch statements to ensure we perform exhaustive checks, see +// https://www.typescriptlang.org/docs/handbook/advanced-types.html#exhaustiveness-checking +export function assertNever(x: never): never { + throw new Error(`Unexpected object: ${x}`); +} export interface GraphLicenseInformation { showAppLink: boolean; diff --git a/x-pack/plugins/graph/public/plugin.ts b/x-pack/plugins/graph/public/plugin.ts index 5521de705b6ec..89367a67867d7 100644 --- a/x-pack/plugins/graph/public/plugin.ts +++ b/x-pack/plugins/graph/public/plugin.ts @@ -21,7 +21,7 @@ import { FeatureCatalogueCategory, HomePublicPluginSetup, } from '../../../../src/plugins/home/public'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import { ConfigSchema } from '../config'; export interface GraphPluginSetupDependencies { @@ -66,10 +66,10 @@ export class GraphPlugin core.application.register({ id: 'graph', title: 'Graph', - order: 9000, + order: 6000, appRoute: '/app/graph', euiIconType: 'graphApp', - category: DEFAULT_APP_CATEGORIES.analyze, + category: DEFAULT_APP_CATEGORIES.kibana, mount: async (params: AppMountParameters) => { const [coreStart, pluginsStart] = await core.getStartServices(); const { renderApp } = await import('./application'); diff --git a/x-pack/plugins/graph/public/state_management/url_templates.ts b/x-pack/plugins/graph/public/state_management/url_templates.ts index a0fb9503421a4..1701fc244ab52 100644 --- a/x-pack/plugins/graph/public/state_management/url_templates.ts +++ b/x-pack/plugins/graph/public/state_management/url_templates.ts @@ -17,7 +17,7 @@ import { setDatasource, IndexpatternDatasource, requestDatasource } from './data import { outlinkEncoders } from '../helpers/outlink_encoders'; import { urlTemplatePlaceholder } from '../helpers/url_template'; import { matchesOne } from './helpers'; -import { modifyUrl } from '../../../../../src/core/utils'; +import { modifyUrl } from '../../../../../src/core/public'; const actionCreator = actionCreatorFactory('x-pack/graph/urlTemplates'); diff --git a/x-pack/plugins/infra/public/plugin.ts b/x-pack/plugins/infra/public/plugin.ts index d61ef7fc4a631..ead5644d19fa2 100644 --- a/x-pack/plugins/infra/public/plugin.ts +++ b/x-pack/plugins/infra/public/plugin.ts @@ -12,7 +12,7 @@ import { PluginInitializerContext, AppMountParameters, } from 'kibana/public'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import { registerStartSingleton } from './legacy_singletons'; import { registerFeatures } from './register_feature'; import { HomePublicPluginSetup } from '../../../../src/plugins/home/public'; @@ -64,7 +64,7 @@ export class Plugin defaultMessage: 'Logs', }), euiIconType: 'logsApp', - order: 8001, + order: 8000, appRoute: '/app/logs', category: DEFAULT_APP_CATEGORIES.observability, mount: async (params: AppMountParameters) => { @@ -89,7 +89,7 @@ export class Plugin defaultMessage: 'Metrics', }), euiIconType: 'metricsApp', - order: 8000, + order: 8001, appRoute: '/app/metrics', category: DEFAULT_APP_CATEGORIES.observability, mount: async (params: AppMountParameters) => { diff --git a/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.test.ts b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.test.ts new file mode 100644 index 0000000000000..995d415ef3c8f --- /dev/null +++ b/x-pack/plugins/infra/server/lib/alerting/log_threshold/log_threshold_executor.test.ts @@ -0,0 +1,311 @@ +/* + * 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. + */ + +import { createLogThresholdExecutor } from './log_threshold_executor'; +import { + Comparator, + AlertStates, + LogDocumentCountAlertParams, + Criterion, +} from '../../../../common/alerting/logs/types'; +import { AlertExecutorOptions } from '../../../../../alerting/server'; +import { + alertsMock, + AlertInstanceMock, + AlertServicesMock, +} from '../../../../../alerting/server/mocks'; +import { libsMock } from './mocks'; + +interface AlertTestInstance { + instance: AlertInstanceMock; + actionQueue: any[]; + state: any; +} + +/* + * Mocks + */ +const alertInstances = new Map(); + +const services: AlertServicesMock = alertsMock.createAlertServices(); +services.alertInstanceFactory.mockImplementation((instanceId: string) => { + const alertInstance: AlertTestInstance = { + instance: alertsMock.createAlertInstanceFactory(), + actionQueue: [], + state: {}, + }; + alertInstance.instance.replaceState.mockImplementation((newState: any) => { + alertInstance.state = newState; + return alertInstance.instance; + }); + alertInstance.instance.scheduleActions.mockImplementation((id: string, action: any) => { + alertInstance.actionQueue.push({ id, action }); + return alertInstance.instance; + }); + + alertInstances.set(instanceId, alertInstance); + + return alertInstance.instance; +}); + +/* + * Helper functions + */ +function getAlertState(instanceId: string): AlertStates { + const alert = alertInstances.get(instanceId); + if (alert) { + return alert.state.alertState; + } else { + throw new Error('Could not find alert instance `' + instanceId + '`'); + } +} + +/* + * Executor instance (our test subject) + */ +const executor = (createLogThresholdExecutor('test', libsMock) as unknown) as (opts: { + params: LogDocumentCountAlertParams; + services: { callCluster: AlertExecutorOptions['params']['callCluster'] }; +}) => Promise<void>; + +// Wrapper to test +type Comparison = [number, Comparator, number]; +async function callExecutor( + [value, comparator, threshold]: Comparison, + criteria: Criterion[] = [] +) { + services.callCluster.mockImplementationOnce(async (..._) => ({ count: value })); + + return await executor({ + services, + params: { + count: { value: threshold, comparator }, + timeSize: 1, + timeUnit: 'm', + criteria, + }, + }); +} + +describe('Comparators trigger alerts correctly', () => { + it('does not alert when counts do not reach the threshold', async () => { + await callExecutor([0, Comparator.GT, 1]); + expect(getAlertState('test')).toBe(AlertStates.OK); + + await callExecutor([0, Comparator.GT_OR_EQ, 1]); + expect(getAlertState('test')).toBe(AlertStates.OK); + + await callExecutor([1, Comparator.LT, 0]); + expect(getAlertState('test')).toBe(AlertStates.OK); + + await callExecutor([1, Comparator.LT_OR_EQ, 0]); + expect(getAlertState('test')).toBe(AlertStates.OK); + }); + + it('alerts when counts reach the threshold', async () => { + await callExecutor([2, Comparator.GT, 1]); + expect(getAlertState('test')).toBe(AlertStates.ALERT); + + await callExecutor([1, Comparator.GT_OR_EQ, 1]); + expect(getAlertState('test')).toBe(AlertStates.ALERT); + + await callExecutor([1, Comparator.LT, 2]); + expect(getAlertState('test')).toBe(AlertStates.ALERT); + + await callExecutor([2, Comparator.LT_OR_EQ, 2]); + expect(getAlertState('test')).toBe(AlertStates.ALERT); + }); +}); + +describe('Comparators create the correct ES queries', () => { + beforeEach(() => { + services.callCluster.mockReset(); + }); + + it('Works with `Comparator.EQ`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.EQ, value: 'bar' }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must: [{ term: { foo: { value: 'bar' } } }], + }, + }, + }); + }); + + it('works with `Comparator.NOT_EQ`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.NOT_EQ, value: 'bar' }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must_not: [{ term: { foo: { value: 'bar' } } }], + }, + }, + }); + }); + + it('works with `Comparator.MATCH`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.MATCH, value: 'bar' }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must: [{ match: { foo: 'bar' } }], + }, + }, + }); + }); + + it('works with `Comparator.NOT_MATCH`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.NOT_MATCH, value: 'bar' }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must_not: [{ match: { foo: 'bar' } }], + }, + }, + }); + }); + + it('works with `Comparator.MATCH_PHRASE`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.MATCH_PHRASE, value: 'bar' }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must: [{ match_phrase: { foo: 'bar' } }], + }, + }, + }); + }); + + it('works with `Comparator.NOT_MATCH_PHRASE`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.NOT_MATCH_PHRASE, value: 'bar' }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must_not: [{ match_phrase: { foo: 'bar' } }], + }, + }, + }); + }); + + it('works with `Comparator.GT`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.GT, value: 1 }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must: [{ range: { foo: { gt: 1 } } }], + }, + }, + }); + }); + + it('works with `Comparator.GT_OR_EQ`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.GT_OR_EQ, value: 1 }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must: [{ range: { foo: { gte: 1 } } }], + }, + }, + }); + }); + + it('works with `Comparator.LT`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.LT, value: 1 }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must: [{ range: { foo: { lt: 1 } } }], + }, + }, + }); + }); + + it('works with `Comparator.LT_OR_EQ`', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [{ field: 'foo', comparator: Comparator.LT_OR_EQ, value: 1 }] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must: [{ range: { foo: { lte: 1 } } }], + }, + }, + }); + }); +}); + +describe('Multiple criteria create the right ES query', () => { + beforeEach(() => { + services.callCluster.mockReset(); + }); + it('works', async () => { + await callExecutor( + [2, Comparator.GT, 1], // Not relevant + [ + { field: 'foo', comparator: Comparator.EQ, value: 'bar' }, + { field: 'http.status', comparator: Comparator.LT, value: 400 }, + ] + ); + + const query = services.callCluster.mock.calls[0][1]!; + expect(query.body).toMatchObject({ + query: { + bool: { + must: [{ term: { foo: { value: 'bar' } } }, { range: { 'http.status': { lt: 400 } } }], + }, + }, + }); + }); +}); diff --git a/x-pack/plugins/infra/server/lib/alerting/log_threshold/mocks/index.ts b/x-pack/plugins/infra/server/lib/alerting/log_threshold/mocks/index.ts new file mode 100644 index 0000000000000..449bc03a922cf --- /dev/null +++ b/x-pack/plugins/infra/server/lib/alerting/log_threshold/mocks/index.ts @@ -0,0 +1,20 @@ +/* + * 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. + */ +import { InfraBackendLibs } from '../../../infra_types'; + +export const libsMock = { + sources: { + getSourceConfiguration: (savedObjectsClient: any, sourceId: string) => { + return Promise.resolve({ + id: sourceId, + configuration: { + logAlias: 'filebeat-*', + fields: { timestamp: '@timestamp' }, + }, + }); + }, + }, +} as InfraBackendLibs; diff --git a/x-pack/plugins/ingest_manager/common/constants/epm.ts b/x-pack/plugins/ingest_manager/common/constants/epm.ts index 4fb259609493d..97b5cca369298 100644 --- a/x-pack/plugins/ingest_manager/common/constants/epm.ts +++ b/x-pack/plugins/ingest_manager/common/constants/epm.ts @@ -7,3 +7,4 @@ export const PACKAGES_SAVED_OBJECT_TYPE = 'epm-packages'; export const INDEX_PATTERN_SAVED_OBJECT_TYPE = 'index-pattern'; export const DEFAULT_REGISTRY_URL = 'https://epr.elastic.co'; +export const INDEX_PATTERN_PLACEHOLDER_SUFFIX = '-index_pattern_placeholder'; diff --git a/x-pack/plugins/ingest_manager/common/constants/routes.ts b/x-pack/plugins/ingest_manager/common/constants/routes.ts index 35e3be98e3982..abb266da9f066 100644 --- a/x-pack/plugins/ingest_manager/common/constants/routes.ts +++ b/x-pack/plugins/ingest_manager/common/constants/routes.ts @@ -61,6 +61,11 @@ export const SETTINGS_API_ROUTES = { UPDATE_PATTERN: `${API_ROOT}/settings`, }; +// App API routes +export const APP_API_ROUTES = { + CHECK_PERMISSIONS_PATTERN: `${API_ROOT}/check-permissions`, +}; + // Agent API routes export const AGENT_API_ROUTES = { LIST_PATTERN: `${FLEET_API_ROOT}/agents`, diff --git a/x-pack/plugins/ingest_manager/common/services/decode_cloud_id.test.ts b/x-pack/plugins/ingest_manager/common/services/decode_cloud_id.test.ts new file mode 100644 index 0000000000000..dcec54f47440a --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/services/decode_cloud_id.test.ts @@ -0,0 +1,100 @@ +/* + * 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. + */ +import { decodeCloudId } from './decode_cloud_id'; + +describe('Ingest Manager - decodeCloudId', () => { + it('parses various CloudID formats', () => { + const tests = [ + { + cloudID: + 'staging:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==', + expectedEsURL: 'https://cec6f261a74bf24ce33bb8811b84294f.us-east-1.aws.found.io:443', + expectedKibanaURL: 'https://c6c2ca6d042249af0cc7d7a9e9625743.us-east-1.aws.found.io:443', + }, + { + cloudID: + 'dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==', + expectedEsURL: 'https://cec6f261a74bf24ce33bb8811b84294f.us-east-1.aws.found.io:443', + expectedKibanaURL: 'https://c6c2ca6d042249af0cc7d7a9e9625743.us-east-1.aws.found.io:443', + }, + { + cloudID: + ':dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==', + expectedEsURL: 'https://cec6f261a74bf24ce33bb8811b84294f.us-east-1.aws.found.io:443', + expectedKibanaURL: 'https://c6c2ca6d042249af0cc7d7a9e9625743.us-east-1.aws.found.io:443', + }, + { + cloudID: + 'gcp-cluster:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvJDhhMDI4M2FmMDQxZjE5NWY3NzI5YmMwNGM2NmEwZmNlJDBjZDVjZDU2OGVlYmU1M2M4OWViN2NhZTViYWM4YjM3', + expectedEsURL: 'https://8a0283af041f195f7729bc04c66a0fce.us-central1.gcp.cloud.es.io:443', + expectedKibanaURL: + 'https://0cd5cd568eebe53c89eb7cae5bac8b37.us-central1.gcp.cloud.es.io:443', + }, + { + cloudID: + 'custom-port:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvOjkyNDMkYWMzMWViYjkwMjQxNzczMTU3MDQzYzM0ZmQyNmZkNDYkYTRjMDYyMzBlNDhjOGZjZTdiZTg4YTA3NGEzYmIzZTA=', + expectedEsURL: 'https://ac31ebb90241773157043c34fd26fd46.us-central1.gcp.cloud.es.io:9243', + expectedKibanaURL: + 'https://a4c06230e48c8fce7be88a074a3bb3e0.us-central1.gcp.cloud.es.io:9243', + }, + { + cloudID: + 'different-es-kb-port:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvJGFjMzFlYmI5MDI0MTc3MzE1NzA0M2MzNGZkMjZmZDQ2OjkyNDMkYTRjMDYyMzBlNDhjOGZjZTdiZTg4YTA3NGEzYmIzZTA6OTI0NA==', + expectedEsURL: 'https://ac31ebb90241773157043c34fd26fd46.us-central1.gcp.cloud.es.io:9243', + expectedKibanaURL: + 'https://a4c06230e48c8fce7be88a074a3bb3e0.us-central1.gcp.cloud.es.io:9244', + }, + { + cloudID: + 'only-kb-set:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvJGFjMzFlYmI5MDI0MTc3MzE1NzA0M2MzNGZkMjZmZDQ2JGE0YzA2MjMwZTQ4YzhmY2U3YmU4OGEwNzRhM2JiM2UwOjkyNDQ=', + expectedEsURL: 'https://ac31ebb90241773157043c34fd26fd46.us-central1.gcp.cloud.es.io:443', + expectedKibanaURL: + 'https://a4c06230e48c8fce7be88a074a3bb3e0.us-central1.gcp.cloud.es.io:9244', + }, + { + cloudID: + 'host-and-kb-set:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvOjkyNDMkYWMzMWViYjkwMjQxNzczMTU3MDQzYzM0ZmQyNmZkNDYkYTRjMDYyMzBlNDhjOGZjZTdiZTg4YTA3NGEzYmIzZTA6OTI0NA==', + expectedEsURL: 'https://ac31ebb90241773157043c34fd26fd46.us-central1.gcp.cloud.es.io:9243', + expectedKibanaURL: + 'https://a4c06230e48c8fce7be88a074a3bb3e0.us-central1.gcp.cloud.es.io:9244', + }, + { + cloudID: + 'extra-items:dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvJGFjMzFlYmI5MDI0MTc3MzE1NzA0M2MzNGZkMjZmZDQ2JGE0YzA2MjMwZTQ4YzhmY2U3YmU4OGEwNzRhM2JiM2UwJGFub3RoZXJpZCRhbmRhbm90aGVy', + expectedEsURL: 'https://ac31ebb90241773157043c34fd26fd46.us-central1.gcp.cloud.es.io:443', + expectedKibanaURL: + 'https://a4c06230e48c8fce7be88a074a3bb3e0.us-central1.gcp.cloud.es.io:443', + }, + ]; + + for (const test of tests) { + const decoded = decodeCloudId(test.cloudID); + expect(decoded).toBeTruthy(); + expect(decoded?.elasticsearchUrl === test.expectedEsURL).toBe(true); + expect(decoded?.kibanaUrl === test.expectedKibanaURL).toBe(true); + } + }); + + it('returns undefined for invalid formats', () => { + const tests = [ + { + cloudID: + 'staging:garbagedXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRjZWM2ZjI2MWE3NGJmMjRjZTMzYmI4ODExYjg0Mjk0ZiRjNmMyY2E2ZDA0MjI0OWFmMGNjN2Q3YTllOTYyNTc0Mw==', + errorMsg: 'base64 decoding failed', + }, + { + cloudID: 'dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvJDhhMDI4M2FmMDQxZjE5NWY3NzI5YmMwNGM2NmEwZg==', + errorMsg: 'Expected at least 3 parts', + }, + ]; + + for (const test of tests) { + const decoded = decodeCloudId(test.cloudID); + expect(decoded).toBe(undefined); + // decodeCloudId currently only logs; not throws errors + } + }); +}); diff --git a/x-pack/plugins/ingest_manager/common/services/decode_cloud_id.ts b/x-pack/plugins/ingest_manager/common/services/decode_cloud_id.ts new file mode 100644 index 0000000000000..67389e554ed24 --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/services/decode_cloud_id.ts @@ -0,0 +1,65 @@ +/* + * 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. + */ + +// decodeCloudId decodes the c.id into c.esURL and c.kibURL +export function decodeCloudId( + cid: string +): + | { + host: string; + defaultPort: string; + elasticsearchUrl: string; + kibanaUrl: string; + } + | undefined { + // 1. Ignore anything before `:`. + const id = cid.split(':').pop(); + if (!id) { + // throw new Error(`Unable to decode ${id}`); + // eslint-disable-next-line no-console + console.debug(`Unable to decode ${id}`); + return; + } + + // 2. base64 decode + let decoded: string | undefined; + try { + decoded = Buffer.from(id, 'base64').toString('utf8'); + } catch { + // throw new Error(`base64 decoding failed on ${id}`); + // eslint-disable-next-line no-console + console.debug(`base64 decoding failed on ${id}`); + return; + } + + // 3. separate based on `$` + const words = decoded.split('$'); + if (words.length < 3) { + // throw new Error(`Expected at least 3 parts in ${decoded}`); + // eslint-disable-next-line no-console + console.debug(`Expected at least 3 parts in ${decoded}`); + return; + } + // 4. extract port from the ES and Kibana host + const [host, defaultPort] = extractPortFromName(words[0]); + const [esId, esPort] = extractPortFromName(words[1], defaultPort); + const [kbId, kbPort] = extractPortFromName(words[2], defaultPort); + // 5. form the URLs + const esUrl = `https://${esId}.${host}:${esPort}`; + const kbUrl = `https://${kbId}.${host}:${kbPort}`; + return { + host, + defaultPort, + elasticsearchUrl: esUrl, + kibanaUrl: kbUrl, + }; +} +// extractPortFromName takes a string in the form `id:port` and returns the +// Id and the port. If there's no `:`, the default port is returned +function extractPortFromName(word: string, defaultPort = '443') { + const [host, port = defaultPort] = word.split(':'); + return [host, port]; +} diff --git a/x-pack/plugins/ingest_manager/common/services/index.ts b/x-pack/plugins/ingest_manager/common/services/index.ts index 8e704bb717257..91dbbdd515c3e 100644 --- a/x-pack/plugins/ingest_manager/common/services/index.ts +++ b/x-pack/plugins/ingest_manager/common/services/index.ts @@ -9,3 +9,4 @@ export * from './routes'; export { packageToConfigDatasourceInputs, packageToConfigDatasource } from './package_to_config'; export { storedDatasourceToAgentDatasource } from './datasource_to_agent_datasource'; export { AgentStatusKueryHelper }; +export { decodeCloudId } from './decode_cloud_id'; diff --git a/x-pack/plugins/ingest_manager/common/services/routes.ts b/x-pack/plugins/ingest_manager/common/services/routes.ts index 1a1bd7c65aa25..20d040ac6eaee 100644 --- a/x-pack/plugins/ingest_manager/common/services/routes.ts +++ b/x-pack/plugins/ingest_manager/common/services/routes.ts @@ -15,6 +15,7 @@ import { SETUP_API_ROUTE, OUTPUT_API_ROUTES, SETTINGS_API_ROUTES, + APP_API_ROUTES, } from '../constants'; export const epmRouteService = { @@ -126,6 +127,10 @@ export const settingsRoutesService = { getUpdatePath: () => SETTINGS_API_ROUTES.UPDATE_PATTERN, }; +export const appRoutesService = { + getCheckPermissionsPath: () => APP_API_ROUTES.CHECK_PERMISSIONS_PATTERN, +}; + export const enrollmentAPIKeyRouteService = { getListPath: () => ENROLLMENT_API_KEY_ROUTES.LIST_PATTERN, getCreatePath: () => ENROLLMENT_API_KEY_ROUTES.CREATE_PATTERN, diff --git a/x-pack/plugins/ingest_manager/common/types/index.ts b/x-pack/plugins/ingest_manager/common/types/index.ts index b357d0c2d75f4..800e77a6a2742 100644 --- a/x-pack/plugins/ingest_manager/common/types/index.ts +++ b/x-pack/plugins/ingest_manager/common/types/index.ts @@ -15,7 +15,6 @@ export interface IngestManagerConfigType { fleet: { enabled: boolean; tlsCheckDisabled: boolean; - defaultOutputHost: string; kibana: { host?: string; ca_sha256?: string; diff --git a/x-pack/plugins/ingest_manager/common/types/rest_spec/app.ts b/x-pack/plugins/ingest_manager/common/types/rest_spec/app.ts new file mode 100644 index 0000000000000..b3a1a46fc54ef --- /dev/null +++ b/x-pack/plugins/ingest_manager/common/types/rest_spec/app.ts @@ -0,0 +1,10 @@ +/* + * 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. + */ + +export interface CheckPermissionsResponse { + error?: 'MISSING_SECURITY' | 'MISSING_SUPERUSER_ROLE'; + success: boolean; +} diff --git a/x-pack/plugins/ingest_manager/common/types/rest_spec/index.ts b/x-pack/plugins/ingest_manager/common/types/rest_spec/index.ts index 763fb7d820b2a..eb212050ef53e 100644 --- a/x-pack/plugins/ingest_manager/common/types/rest_spec/index.ts +++ b/x-pack/plugins/ingest_manager/common/types/rest_spec/index.ts @@ -14,3 +14,4 @@ export * from './enrollment_api_key'; export * from './install_script'; export * from './output'; export * from './settings'; +export * from './app'; diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/app.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/app.ts new file mode 100644 index 0000000000000..713535acbabca --- /dev/null +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/app.ts @@ -0,0 +1,16 @@ +/* + * 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. + */ + +import { sendRequest } from './use_request'; +import { appRoutesService } from '../../services'; +import { CheckPermissionsResponse } from '../../types'; + +export const sendGetPermissionsCheck = () => { + return sendRequest<CheckPermissionsResponse>({ + path: appRoutesService.getCheckPermissionsPath(), + method: 'get', + }); +}; diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/index.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/index.ts index 25cdffc5c6651..8aec20d15c888 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/index.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_request/index.ts @@ -13,3 +13,4 @@ export * from './epm'; export * from './outputs'; export * from './settings'; export * from './setup'; +export * from './app'; diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx index f0a0c90a18c24..3612497e723cd 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/index.tsx @@ -7,8 +7,10 @@ import React, { useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; import { useObservable } from 'react-use'; import { HashRouter as Router, Redirect, Switch, Route, RouteProps } from 'react-router-dom'; +import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiErrorBoundary } from '@elastic/eui'; +import styled from 'styled-components'; +import { EuiErrorBoundary, EuiPanel, EuiEmptyPrompt, EuiCode } from '@elastic/eui'; import { CoreStart, AppMountParameters } from 'src/core/public'; import { EuiThemeProvider } from '../../../../../legacy/common/eui_styled_components'; import { @@ -22,7 +24,7 @@ import { Loading, Error } from './components'; import { IngestManagerOverview, EPMApp, AgentConfigApp, FleetApp, DataStreamApp } from './sections'; import { CoreContext, DepsContext, ConfigContext, setHttpClient, useConfig } from './hooks'; import { PackageInstallProvider } from './sections/epm/hooks'; -import { sendSetup } from './hooks/use_request/setup'; +import { useCore, sendSetup, sendGetPermissionsCheck } from './hooks'; import { FleetStatusProvider } from './hooks/use_fleet_status'; import './index.scss'; @@ -39,86 +41,175 @@ export const ProtectedRoute: React.FunctionComponent<ProtectedRouteProps> = ({ return isAllowed ? <Route {...routeProps} /> : <Redirect to={{ pathname: restrictedPath }} />; }; +const Panel = styled(EuiPanel)` + max-width: 500px; + margin-right: auto; + margin-left: auto; +`; + +const ErrorLayout = ({ children }: { children: JSX.Element }) => ( + <EuiErrorBoundary> + <DefaultLayout showSettings={false}> + <WithoutHeaderLayout>{children}</WithoutHeaderLayout> + </DefaultLayout> + </EuiErrorBoundary> +); + const IngestManagerRoutes = ({ ...rest }) => { const { epm, fleet } = useConfig(); + const { notifications } = useCore(); + const [isPermissionsLoading, setIsPermissionsLoading] = useState<boolean>(false); + const [permissionsError, setPermissionsError] = useState<string>(); const [isInitialized, setIsInitialized] = useState(false); const [initializationError, setInitializationError] = useState<Error | null>(null); useEffect(() => { (async () => { + setIsPermissionsLoading(false); + setPermissionsError(undefined); setIsInitialized(false); setInitializationError(null); try { - const res = await sendSetup(); - if (res.error) { - setInitializationError(res.error); + setIsPermissionsLoading(true); + const permissionsResponse = await sendGetPermissionsCheck(); + setIsPermissionsLoading(false); + if (permissionsResponse.data?.success) { + try { + const setupResponse = await sendSetup(); + if (setupResponse.error) { + setInitializationError(setupResponse.error); + } + } catch (err) { + setInitializationError(err); + } + setIsInitialized(true); + } else { + setPermissionsError(permissionsResponse.data?.error || 'REQUEST_ERROR'); } } catch (err) { - setInitializationError(err); + setPermissionsError('REQUEST_ERROR'); } - setIsInitialized(true); })(); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + if (isPermissionsLoading || permissionsError) { + return ( + <ErrorLayout> + {isPermissionsLoading ? ( + <Loading /> + ) : permissionsError === 'REQUEST_ERROR' ? ( + <Error + title={ + <FormattedMessage + id="xpack.ingestManager.permissionsRequestErrorMessageTitle" + defaultMessage="Unable to check permissions" + /> + } + error={i18n.translate('xpack.ingestManager.permissionsRequestErrorMessageDescription', { + defaultMessage: 'There was a problem checking Ingest Manager permissions', + })} + /> + ) : ( + <Panel> + <EuiEmptyPrompt + iconType="securityApp" + title={ + <h2> + {permissionsError === 'MISSING_SUPERUSER_ROLE' ? ( + <FormattedMessage + id="xpack.ingestManager.permissionDeniedErrorTitle" + defaultMessage="Permission denied" + /> + ) : ( + <FormattedMessage + id="xpack.ingestManager.securityRequiredErrorTitle" + defaultMessage="Security is not enabled" + /> + )} + </h2> + } + body={ + <p> + {permissionsError === 'MISSING_SUPERUSER_ROLE' ? ( + <FormattedMessage + id="xpack.ingestManager.permissionDeniedErrorMessage" + defaultMessage="You are not authorized to access Ingest Manager. Ingest Manager requires {roleName} privileges." + values={{ roleName: <EuiCode>superuser</EuiCode> }} + /> + ) : ( + <FormattedMessage + id="xpack.ingestManager.securityRequiredErrorMessage" + defaultMessage="You must enable security in Kibana and Elasticsearch to use Ingest Manager." + /> + )} + </p> + } + /> + </Panel> + )} + </ErrorLayout> + ); + } + if (!isInitialized || initializationError) { return ( - <EuiErrorBoundary> - <DefaultLayout> - <WithoutHeaderLayout> - {initializationError ? ( - <Error - title={ - <FormattedMessage - id="xpack.ingestManager.initializationErrorMessageTitle" - defaultMessage="Unable to initialize Ingest Manager" - /> - } - error={initializationError} + <ErrorLayout> + {initializationError ? ( + <Error + title={ + <FormattedMessage + id="xpack.ingestManager.initializationErrorMessageTitle" + defaultMessage="Unable to initialize Ingest Manager" /> - ) : ( - <Loading /> - )} - </WithoutHeaderLayout> - </DefaultLayout> - </EuiErrorBoundary> + } + error={initializationError} + /> + ) : ( + <Loading /> + )} + </ErrorLayout> ); } return ( - <EuiErrorBoundary> - <Router {...rest}> - <Switch> - <ProtectedRoute path={EPM_PATH} isAllowed={epm.enabled}> - <DefaultLayout section="epm"> - <EPMApp /> - </DefaultLayout> - </ProtectedRoute> - <Route path={AGENT_CONFIG_PATH}> - <DefaultLayout section="agent_config"> - <AgentConfigApp /> - </DefaultLayout> - </Route> - <Route path={DATA_STREAM_PATH}> - <DefaultLayout section="data_stream"> - <DataStreamApp /> - </DefaultLayout> - </Route> - <ProtectedRoute path={FLEET_PATH} isAllowed={fleet.enabled}> - <DefaultLayout section="fleet"> - <FleetApp /> - </DefaultLayout> - </ProtectedRoute> - <Route exact path="/"> - <DefaultLayout section="overview"> - <IngestManagerOverview /> - </DefaultLayout> - </Route> - <Redirect to="/" /> - </Switch> - </Router> - </EuiErrorBoundary> + <PackageInstallProvider notifications={notifications}> + <FleetStatusProvider> + <EuiErrorBoundary> + <Router {...rest}> + <Switch> + <ProtectedRoute path={EPM_PATH} isAllowed={epm.enabled}> + <DefaultLayout section="epm"> + <EPMApp /> + </DefaultLayout> + </ProtectedRoute> + <Route path={AGENT_CONFIG_PATH}> + <DefaultLayout section="agent_config"> + <AgentConfigApp /> + </DefaultLayout> + </Route> + <Route path={DATA_STREAM_PATH}> + <DefaultLayout section="data_stream"> + <DataStreamApp /> + </DefaultLayout> + </Route> + <ProtectedRoute path={FLEET_PATH} isAllowed={fleet.enabled}> + <DefaultLayout section="fleet"> + <FleetApp /> + </DefaultLayout> + </ProtectedRoute> + <Route exact path="/"> + <DefaultLayout section="overview"> + <IngestManagerOverview /> + </DefaultLayout> + </Route> + <Redirect to="/" /> + </Switch> + </Router> + </EuiErrorBoundary> + </FleetStatusProvider> + </PackageInstallProvider> ); }; @@ -142,11 +233,7 @@ const IngestManagerApp = ({ <DepsContext.Provider value={{ setup: setupDeps, start: startDeps }}> <ConfigContext.Provider value={config}> <EuiThemeProvider darkMode={isDarkMode}> - <PackageInstallProvider notifications={coreStart.notifications}> - <FleetStatusProvider> - <IngestManagerRoutes basepath={basepath} /> - </FleetStatusProvider> - </PackageInstallProvider> + <IngestManagerRoutes basepath={basepath} /> </EuiThemeProvider> </ConfigContext.Provider> </DepsContext.Provider> diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/layouts/default.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/layouts/default.tsx index 4a9cfe02b74ac..e9d7fcb1cf5c5 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/layouts/default.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/layouts/default.tsx @@ -13,6 +13,7 @@ import { useLink, useConfig } from '../hooks'; import { EPM_PATH, FLEET_PATH, AGENT_CONFIG_PATH, DATA_STREAM_PATH } from '../constants'; interface Props { + showSettings?: boolean; section?: Section; children?: React.ReactNode; } @@ -33,7 +34,11 @@ const Nav = styled.nav` } `; -export const DefaultLayout: React.FunctionComponent<Props> = ({ section, children }) => { +export const DefaultLayout: React.FunctionComponent<Props> = ({ + showSettings = true, + section, + children, +}) => { const { epm, fleet } = useConfig(); const [isSettingsFlyoutOpen, setIsSettingsFlyoutOpen] = React.useState(false); @@ -109,14 +114,16 @@ export const DefaultLayout: React.FunctionComponent<Props> = ({ section, childre /> </EuiButtonEmpty> </EuiFlexItem> - <EuiFlexItem> - <EuiButtonEmpty iconType="gear" onClick={() => setIsSettingsFlyoutOpen(true)}> - <FormattedMessage - id="xpack.ingestManager.appNavigation.settingsButton" - defaultMessage="Settings" - /> - </EuiButtonEmpty> - </EuiFlexItem> + {showSettings ? ( + <EuiFlexItem> + <EuiButtonEmpty iconType="gear" onClick={() => setIsSettingsFlyoutOpen(true)}> + <FormattedMessage + id="xpack.ingestManager.appNavigation.settingsButton" + defaultMessage="Settings" + /> + </EuiButtonEmpty> + </EuiFlexItem> + ) : null} </EuiFlexGroup> </EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/services/index.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/services/index.ts index e4791cc816d04..64669b5cd123a 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/services/index.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/services/index.ts @@ -17,6 +17,7 @@ export { setupRouteService, outputRoutesService, settingsRoutesService, + appRoutesService, packageToConfigDatasourceInputs, storedDatasourceToAgentDatasource, AgentStatusKueryHelper, diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/types/index.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/types/index.ts index ca5bf999aa81a..0a26a16d35cfd 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/types/index.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/types/index.ts @@ -62,6 +62,8 @@ export { GetSettingsResponse, PutSettingsRequest, PutSettingsResponse, + // API schemas - app + CheckPermissionsResponse, // EPM types AssetReference, AssetsGroupedByServiceByType, diff --git a/x-pack/plugins/ingest_manager/public/plugin.ts b/x-pack/plugins/ingest_manager/public/plugin.ts index 77bba0bb0f990..2c6ed9d81744e 100644 --- a/x-pack/plugins/ingest_manager/public/plugin.ts +++ b/x-pack/plugins/ingest_manager/public/plugin.ts @@ -11,13 +11,13 @@ import { CoreStart, } from 'src/core/public'; import { i18n } from '@kbn/i18n'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import { DataPublicPluginSetup, DataPublicPluginStart } from '../../../../src/plugins/data/public'; import { LicensingPluginSetup } from '../../licensing/public'; import { PLUGIN_ID } from '../common/constants'; import { IngestManagerConfigType } from '../common/types'; -import { setupRouteService } from '../common'; +import { setupRouteService, appRoutesService } from '../common'; export { IngestManagerConfigType } from '../common/types'; @@ -72,8 +72,13 @@ export class IngestManagerPlugin public async start(core: CoreStart): Promise<IngestManagerStart> { try { - const { isInitialized: success } = await core.http.post(setupRouteService.getSetupPath()); - return { success }; + const permissionsResponse = await core.http.get(appRoutesService.getCheckPermissionsPath()); + if (permissionsResponse.success) { + const { isInitialized: success } = await core.http.post(setupRouteService.getSetupPath()); + return { success }; + } else { + throw new Error(permissionsResponse.error); + } } catch (error) { return { success: false, error: { message: error.body?.message || 'Unknown error' } }; } diff --git a/x-pack/plugins/ingest_manager/server/constants/index.ts b/x-pack/plugins/ingest_manager/server/constants/index.ts index 75c14ffc8fa84..6e633c04ed816 100644 --- a/x-pack/plugins/ingest_manager/server/constants/index.ts +++ b/x-pack/plugins/ingest_manager/server/constants/index.ts @@ -9,6 +9,7 @@ export { AGENT_TYPE_TEMPORARY, AGENT_POLLING_THRESHOLD_MS, AGENT_POLLING_INTERVAL, + INDEX_PATTERN_PLACEHOLDER_SUFFIX, // Routes PLUGIN_ID, EPM_API_ROUTES, @@ -22,6 +23,7 @@ export { OUTPUT_API_ROUTES, SETUP_API_ROUTE, SETTINGS_API_ROUTES, + APP_API_ROUTES, // Saved object types AGENT_SAVED_OBJECT_TYPE, AGENT_EVENT_SAVED_OBJECT_TYPE, diff --git a/x-pack/plugins/ingest_manager/server/index.ts b/x-pack/plugins/ingest_manager/server/index.ts index 6096af8d80801..84408b60d3edb 100644 --- a/x-pack/plugins/ingest_manager/server/index.ts +++ b/x-pack/plugins/ingest_manager/server/index.ts @@ -32,7 +32,7 @@ export const config = { ca_sha256: schema.maybe(schema.string()), }), elasticsearch: schema.object({ - host: schema.string({ defaultValue: 'http://localhost:9200' }), + host: schema.maybe(schema.string()), ca_sha256: schema.maybe(schema.string()), }), }), diff --git a/x-pack/plugins/ingest_manager/server/plugin.ts b/x-pack/plugins/ingest_manager/server/plugin.ts index d70e136d67ef5..24f3a11789dc7 100644 --- a/x-pack/plugins/ingest_manager/server/plugin.ts +++ b/x-pack/plugins/ingest_manager/server/plugin.ts @@ -42,6 +42,7 @@ import { registerInstallScriptRoutes, registerOutputRoutes, registerSettingsRoutes, + registerAppRoutes, } from './routes'; import { IngestManagerConfigType } from '../common'; import { @@ -164,26 +165,31 @@ export class IngestManagerPlugin const router = core.http.createRouter(); const config = await this.config$.pipe(first()).toPromise(); - // Register routes - registerSetupRoutes(router, config); - registerAgentConfigRoutes(router); - registerDatasourceRoutes(router); - registerOutputRoutes(router); - registerSettingsRoutes(router); - registerDataStreamRoutes(router); - - // Conditional routes - if (config.epm.enabled) { - registerEPMRoutes(router); - } - - if (config.fleet.enabled) { - registerAgentRoutes(router); - registerEnrollmentApiKeyRoutes(router); - registerInstallScriptRoutes({ - router, - basePath: core.http.basePath, - }); + // Always register app routes for permissions checking + registerAppRoutes(router); + + // Register rest of routes only if security is enabled + if (this.security) { + registerSetupRoutes(router, config); + registerAgentConfigRoutes(router); + registerDatasourceRoutes(router); + registerOutputRoutes(router); + registerSettingsRoutes(router); + registerDataStreamRoutes(router); + + // Conditional config routes + if (config.epm.enabled) { + registerEPMRoutes(router); + } + + if (config.fleet.enabled) { + registerAgentRoutes(router); + registerEnrollmentApiKeyRoutes(router); + registerInstallScriptRoutes({ + router, + basePath: core.http.basePath, + }); + } } } diff --git a/x-pack/plugins/ingest_manager/server/routes/app/index.ts b/x-pack/plugins/ingest_manager/server/routes/app/index.ts new file mode 100644 index 0000000000000..9d666efc7e9ce --- /dev/null +++ b/x-pack/plugins/ingest_manager/server/routes/app/index.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ +import { IRouter, RequestHandler } from 'src/core/server'; +import { PLUGIN_ID, APP_API_ROUTES } from '../../constants'; +import { appContextService } from '../../services'; +import { CheckPermissionsResponse } from '../../../common'; + +export const getCheckPermissionsHandler: RequestHandler = async (context, request, response) => { + const body: CheckPermissionsResponse = { success: true }; + try { + const security = await appContextService.getSecurity(); + const user = security.authc.getCurrentUser(request); + + if (!user?.roles.includes('superuser')) { + body.success = false; + body.error = 'MISSING_SUPERUSER_ROLE'; + return response.ok({ + body, + }); + } + + return response.ok({ body: { success: true } }); + } catch (e) { + body.success = false; + body.error = 'MISSING_SECURITY'; + return response.ok({ + body, + }); + } +}; + +export const registerRoutes = (router: IRouter) => { + router.get( + { + path: APP_API_ROUTES.CHECK_PERMISSIONS_PATTERN, + validate: {}, + options: { tags: [`access:${PLUGIN_ID}-read`] }, + }, + getCheckPermissionsHandler + ); +}; diff --git a/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts index ad81076e34e4b..80a33c26d86da 100644 --- a/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts @@ -70,12 +70,6 @@ export const getListHandler: RequestHandler = async (context, request, response) size: 1, }, }, - package: { - terms: { - field: 'event.module', - size: 1, - }, - }, last_activity: { max: { field: '@timestamp', @@ -110,11 +104,15 @@ export const getListHandler: RequestHandler = async (context, request, response) dataset: { buckets: datasetBuckets }, namespace: { buckets: namespaceBuckets }, type: { buckets: typeBuckets }, - package: { buckets: packageBuckets }, last_activity: { value_as_string: lastActivity }, } = result; - const pkg = packageBuckets.length ? packageBuckets[0].key : ''; + // We don't have a reliable way to associate index with package ID, so + // this is a hack to extract the package ID from the first part of the dataset name + // with fallback to extraction from index name + const pkg = datasetBuckets.length + ? datasetBuckets[0].key.split('.')[0] + : indexName.split('-')[1].split('.')[0]; const pkgSavedObject = packageSavedObjects.saved_objects.filter(p => p.id === pkg); // if diff --git a/x-pack/plugins/ingest_manager/server/routes/index.ts b/x-pack/plugins/ingest_manager/server/routes/index.ts index 3ce34d15de46c..0978c2aa57bf6 100644 --- a/x-pack/plugins/ingest_manager/server/routes/index.ts +++ b/x-pack/plugins/ingest_manager/server/routes/index.ts @@ -13,3 +13,4 @@ export { registerRoutes as registerEnrollmentApiKeyRoutes } from './enrollment_a export { registerRoutes as registerInstallScriptRoutes } from './install_script'; export { registerRoutes as registerOutputRoutes } from './output'; export { registerRoutes as registerSettingsRoutes } from './settings'; +export { registerRoutes as registerAppRoutes } from './app'; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/__snapshots__/install.test.ts.snap b/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/__snapshots__/install.test.ts.snap index d063ebe92f938..029e278b5aa93 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/__snapshots__/install.test.ts.snap +++ b/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/__snapshots__/install.test.ts.snap @@ -40,7 +40,7 @@ exports[`creating index patterns from yaml fields createIndexPattern function cr { "title": "logs-*", "timeFieldName": "@timestamp", - "fields": "[{\\"name\\":\\"coredns.id\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.allParams\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.query.length\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.query.size\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.query.class\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.query.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.query.type\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.response.code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.response.flags\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.response.size\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.dnssec_ok\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"boolean\\"},{\\"name\\":\\"@timestamp\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"date\\"},{\\"name\\":\\"labels\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"message\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"tags\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.ephemeral_id\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.id\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.type\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.version\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"as.number\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"as.organization.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"nginx.access.remote_ip_list\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.body_sent.bytes\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.user_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.method\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.url\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.http_version\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.response_code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.referrer\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.agent\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.user_agent.device\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.user_agent.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.user_agent.os\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.user_agent.os_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.user_agent.original\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.geoip.continent_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"nginx.access.geoip.country_iso_code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.geoip.location\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.geoip.region_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.geoip.city_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"nginx.access.geoip.region_iso_code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true},{\\"name\\":\\"source.geo.continent_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"country\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"country.keyword\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"country.text\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"type\\":\\"string\\"}]", + "fields": "[{\\"name\\":\\"coredns.id\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.allParams\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.query.length\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.query.size\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.query.class\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.query.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.query.type\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.response.code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.response.flags\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"coredns.response.size\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"coredns.dnssec_ok\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"boolean\\"},{\\"name\\":\\"@timestamp\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"date\\"},{\\"name\\":\\"labels\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"message\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"tags\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.ephemeral_id\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.id\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.type\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"agent.version\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"as.number\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"number\\"},{\\"name\\":\\"as.organization.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"nginx.access.remote_ip_list\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.body_sent.bytes\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.method\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.url\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.http_version\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.response_code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.referrer\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.agent\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.device\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.os\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.os_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.user_agent.original\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.continent_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"nginx.access.geoip.country_iso_code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.location\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.region_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.city_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"nginx.access.geoip.region_iso_code\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true},{\\"name\\":\\"source.geo.continent_name\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"country\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"country.keyword\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":true,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"},{\\"name\\":\\"country.text\\",\\"count\\":0,\\"scripted\\":false,\\"indexed\\":true,\\"analyzed\\":false,\\"searchable\\":true,\\"aggregatable\\":false,\\"doc_values\\":true,\\"readFromDocValues\\":true,\\"type\\":\\"string\\"}]", "fieldFormatMap": "{\\"coredns.allParams\\":{\\"id\\":\\"bytes\\",\\"params\\":{\\"pattern\\":\\"patternValQueryWeight\\",\\"inputFormat\\":\\"inputFormatVal,\\",\\"outputFormat\\":\\"outputFormalVal,\\",\\"outputPrecision\\":\\"3,\\",\\"labelTemplate\\":\\"labelTemplateVal,\\",\\"urlTemplate\\":\\"urlTemplateVal,\\"}},\\"coredns.query.length\\":{\\"params\\":{\\"pattern\\":\\"patternValQueryLength\\"}},\\"coredns.query.size\\":{\\"id\\":\\"bytes\\",\\"params\\":{\\"pattern\\":\\"patternValQuerySize\\"}},\\"coredns.response.size\\":{\\"id\\":\\"bytes\\"}}" } `; @@ -57,6 +57,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -68,6 +69,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "number" }, { @@ -79,6 +81,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "number" }, { @@ -90,6 +93,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "number" }, { @@ -101,6 +105,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -112,6 +117,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -123,6 +129,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -134,6 +141,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -145,6 +153,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -156,6 +165,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "number" }, { @@ -167,6 +177,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "boolean" }, { @@ -178,6 +189,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "date" }, { @@ -188,7 +200,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "message", @@ -199,6 +212,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": false, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -210,6 +224,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -221,6 +236,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -232,6 +248,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -243,6 +260,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -254,6 +272,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -265,6 +284,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -276,6 +296,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "number" }, { @@ -287,6 +308,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -297,7 +319,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.body_sent.bytes", @@ -307,7 +330,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.user_name", @@ -317,7 +341,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.method", @@ -327,7 +352,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.url", @@ -337,7 +363,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.http_version", @@ -347,7 +374,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.response_code", @@ -357,7 +385,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.referrer", @@ -367,7 +396,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.agent", @@ -377,7 +407,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.user_agent.device", @@ -387,7 +418,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.user_agent.name", @@ -397,7 +429,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.user_agent.os", @@ -407,7 +440,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.user_agent.os_name", @@ -417,7 +451,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.user_agent.original", @@ -427,7 +462,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.geoip.continent_name", @@ -438,6 +474,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": false, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -448,7 +485,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.geoip.location", @@ -458,7 +496,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.geoip.region_name", @@ -468,7 +507,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.geoip.city_name", @@ -478,7 +518,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "nginx.access.geoip.region_iso_code", @@ -488,7 +529,8 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "analyzed": false, "searchable": true, "aggregatable": true, - "doc_values": true + "doc_values": true, + "readFromDocValues": true }, { "name": "source.geo.continent_name", @@ -499,6 +541,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": false, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -510,6 +553,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -521,6 +565,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": true, "doc_values": true, + "readFromDocValues": true, "type": "string" }, { @@ -532,6 +577,7 @@ exports[`creating index patterns from yaml fields createIndexPatternFields funct "searchable": true, "aggregatable": false, "doc_values": true, + "readFromDocValues": true, "type": "string" } ], diff --git a/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/install.ts b/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/install.ts index ec657820a2225..f6db5dfe353ea 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/install.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/install.ts @@ -5,11 +5,14 @@ */ import { SavedObjectsClientContract } from 'src/core/server'; -import { INDEX_PATTERN_SAVED_OBJECT_TYPE } from '../../../../constants'; +import { + INDEX_PATTERN_SAVED_OBJECT_TYPE, + INDEX_PATTERN_PLACEHOLDER_SUFFIX, +} from '../../../../constants'; import * as Registry from '../../registry'; import { loadFieldsFromYaml, Fields, Field } from '../../fields/field'; import { getPackageKeysByStatus } from '../../packages/get'; -import { InstallationStatus, RegistryPackage } from '../../../../types'; +import { InstallationStatus, RegistryPackage, CallESAsCurrentUser } from '../../../../types'; interface FieldFormatMap { [key: string]: FieldFormatMapItem; @@ -63,6 +66,7 @@ export interface IndexPatternField { enabled?: boolean; script?: string; lang?: string; + readFromDocValues: boolean; } export enum IndexPatternType { logs = 'logs', @@ -234,6 +238,7 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa searchable: field.searchable ?? true, aggregatable: field.aggregatable ?? true, doc_values: field.doc_values ?? true, + readFromDocValues: field.doc_values ?? true, }; // if type exists, check if it exists in the map @@ -251,6 +256,7 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa newField.aggregatable = false; newField.analyzed = false; newField.doc_values = field.doc_values ?? false; + newField.readFromDocValues = field.doc_values ?? false; newField.indexed = false; newField.searchable = false; } @@ -262,6 +268,7 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa newField.aggregatable = false; newField.analyzed = false; newField.doc_values = false; + newField.readFromDocValues = false; newField.indexed = false; newField.searchable = false; } @@ -276,6 +283,7 @@ export const transformField = (field: Field, i: number, fields: Fields): IndexPa newField.script = field.script; newField.lang = 'painless'; newField.doc_values = false; + newField.readFromDocValues = false; } return newField; @@ -357,3 +365,42 @@ const getFieldFormatParams = (field: Field): FieldFormatParams => { if (field.open_link_in_current_tab) params.openLinkInCurrentTab = field.open_link_in_current_tab; return params; }; + +export const ensureDefaultIndices = async (callCluster: CallESAsCurrentUser) => + // create placeholder indices to supress errors in the kibana Dashboards app + // that no matching indices exist https://github.com/elastic/kibana/issues/62343 + Promise.all( + Object.keys(IndexPatternType).map(async indexPattern => { + const defaultIndexPatternName = indexPattern + INDEX_PATTERN_PLACEHOLDER_SUFFIX; + const indexExists = await doesIndexExist(defaultIndexPatternName, callCluster); + if (!indexExists) { + try { + await callCluster('transport.request', { + method: 'PUT', + path: `/${defaultIndexPatternName}`, + body: { + mappings: { + properties: { + '@timestamp': { type: 'date' }, + }, + }, + }, + }); + } catch (putErr) { + throw new Error(`${defaultIndexPatternName} could not be created`); + } + } + }) + ); + +export const doesIndexExist = async (indexName: string, callCluster: CallESAsCurrentUser) => { + try { + await callCluster('transport.request', { + method: 'HEAD', + path: indexName, + }); + return true; + } catch (err) { + return false; + } +}; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/tests/test_data.ts b/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/tests/test_data.ts index 13bef1b6ddb2c..879db91bfacaa 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/tests/test_data.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/kibana/index_pattern/tests/test_data.ts @@ -15,6 +15,7 @@ export const dupeFields: IndexPatternField[] = [ count: 0, indexed: true, doc_values: true, + readFromDocValues: true, scripted: false, analyzed: true, }, @@ -26,6 +27,7 @@ export const dupeFields: IndexPatternField[] = [ count: 0, indexed: true, doc_values: true, + readFromDocValues: true, scripted: false, analyzed: true, }, @@ -37,6 +39,7 @@ export const dupeFields: IndexPatternField[] = [ count: 0, indexed: true, doc_values: true, + readFromDocValues: true, scripted: false, analyzed: true, }, @@ -48,6 +51,7 @@ export const dupeFields: IndexPatternField[] = [ count: 2, indexed: true, doc_values: true, + readFromDocValues: true, scripted: false, analyzed: true, }, @@ -59,6 +63,7 @@ export const dupeFields: IndexPatternField[] = [ count: 0, indexed: true, doc_values: true, + readFromDocValues: true, scripted: false, analyzed: true, }, @@ -70,6 +75,7 @@ export const dupeFields: IndexPatternField[] = [ count: 0, indexed: true, doc_values: true, + readFromDocValues: true, scripted: false, analyzed: true, }, @@ -81,6 +87,7 @@ export const dupeFields: IndexPatternField[] = [ count: 0, indexed: true, doc_values: true, + readFromDocValues: true, scripted: false, analyzed: true, }, @@ -92,6 +99,7 @@ export const dupeFields: IndexPatternField[] = [ count: 1, indexed: true, doc_values: true, + readFromDocValues: true, scripted: false, analyzed: false, }, diff --git a/x-pack/plugins/ingest_manager/server/services/output.ts b/x-pack/plugins/ingest_manager/server/services/output.ts index 3628c5bd9e183..ce6f1f2e27130 100644 --- a/x-pack/plugins/ingest_manager/server/services/output.ts +++ b/x-pack/plugins/ingest_manager/server/services/output.ts @@ -7,6 +7,7 @@ import { SavedObjectsClientContract } from 'src/core/server'; import { NewOutput, Output } from '../types'; import { DEFAULT_OUTPUT, OUTPUT_SAVED_OBJECT_TYPE } from '../constants'; import { appContextService } from './app_context'; +import { decodeCloudId } from '../../common'; const SAVED_OBJECT_TYPE = OUTPUT_SAVED_OBJECT_TYPE; @@ -16,11 +17,17 @@ class OutputService { type: OUTPUT_SAVED_OBJECT_TYPE, filter: `${OUTPUT_SAVED_OBJECT_TYPE}.attributes.is_default:true`, }); + const cloud = appContextService.getCloud(); + const cloudId = cloud?.isCloudEnabled && cloud.cloudId; + const cloudUrl = cloudId && decodeCloudId(cloudId)?.elasticsearchUrl; + const flagsUrl = appContextService.getConfig()!.fleet.elasticsearch.host; + const defaultUrl = 'http://localhost:9200'; + const defaultOutputUrl = cloudUrl || flagsUrl || defaultUrl; if (!outputs.saved_objects.length) { const newDefaultOutput = { ...DEFAULT_OUTPUT, - hosts: [appContextService.getConfig()!.fleet.elasticsearch.host], + hosts: [defaultOutputUrl], ca_sha256: appContextService.getConfig()!.fleet.elasticsearch.ca_sha256, } as NewOutput; diff --git a/x-pack/plugins/ingest_manager/server/services/setup.ts b/x-pack/plugins/ingest_manager/server/services/setup.ts index 22acce8d4a51c..2861458fde9d7 100644 --- a/x-pack/plugins/ingest_manager/server/services/setup.ts +++ b/x-pack/plugins/ingest_manager/server/services/setup.ts @@ -11,6 +11,7 @@ import { CallESAsCurrentUser } from '../types'; import { agentConfigService } from './agent_config'; import { outputService } from './output'; import { ensureInstalledDefaultPackages } from './epm/packages/install'; +import { ensureDefaultIndices } from './epm/kibana/index_pattern/install'; import { packageToConfigDatasource, Datasource, @@ -18,6 +19,7 @@ import { Installation, Output, DEFAULT_AGENT_CONFIGS_PACKAGES, + decodeCloudId, } from '../../common'; import { getPackageInfo } from './epm/packages'; import { datasourceService } from './datasource'; @@ -37,13 +39,18 @@ export async function setupIngestManager( ensureInstalledDefaultPackages(soClient, callCluster), outputService.ensureDefaultOutput(soClient), agentConfigService.ensureDefaultAgentConfig(soClient), + ensureDefaultIndices(callCluster), settingsService.getSettings(soClient).catch((e: any) => { if (e.isBoom && e.output.statusCode === 404) { const http = appContextService.getHttpSetup(); const serverInfo = http.getServerInfo(); const basePath = http.basePath; - const defaultKibanaUrl = url.format({ + const cloud = appContextService.getCloud(); + const cloudId = cloud?.isCloudEnabled && cloud.cloudId; + const cloudUrl = cloudId && decodeCloudId(cloudId)?.kibanaUrl; + const flagsUrl = appContextService.getConfig()?.fleet?.kibana?.host; + const defaultUrl = url.format({ protocol: serverInfo.protocol, hostname: serverInfo.host, port: serverInfo.port, @@ -53,7 +60,7 @@ export async function setupIngestManager( return settingsService.saveSettings(soClient, { agent_auto_upgrade: true, package_auto_upgrade: true, - kibana_url: appContextService.getConfig()?.fleet?.kibana?.host ?? defaultKibanaUrl, + kibana_url: cloudUrl || flagsUrl || defaultUrl, }); } diff --git a/x-pack/plugins/ingest_pipelines/public/application/app.tsx b/x-pack/plugins/ingest_pipelines/public/application/app.tsx index ba7675b507596..98b49bafd6ed6 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/app.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/app.tsx @@ -71,7 +71,7 @@ export const App: FunctionComponent = () => { title={ <FormattedMessage id="xpack.ingestPipelines.app.deniedPrivilegeTitle" - defaultMessage="You're missing cluster privileges" + defaultMessage="Cluster privileges required" /> } message={ diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx index 045afd52204fa..b90683426887f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx @@ -95,7 +95,7 @@ export const PipelineFormFields: React.FunctionComponent<Props> = ({ description={ <FormattedMessage id="xpack.ingestPipelines.form.descriptionFieldDescription" - defaultMessage="The description to apply to the pipeline." + defaultMessage="A description of what this pipeline does." /> } > @@ -122,12 +122,16 @@ export const PipelineFormFields: React.FunctionComponent<Props> = ({ <> <FormattedMessage id="xpack.ingestPipelines.form.processorsFieldDescription" - defaultMessage="The processors used to pre-process documents before indexing. {learnMoreLink}" + defaultMessage="The processors to use to transform the documents before indexing. {learnMoreLink}" values={{ learnMoreLink: ( - <EuiLink href={services.documentation.getProcessorsUrl()} target="_blank"> + <EuiLink + href={services.documentation.getProcessorsUrl()} + target="_blank" + external + > {i18n.translate('xpack.ingestPipelines.form.processorsDocumentionLink', { - defaultMessage: 'Learn more.', + defaultMessage: 'Learn more', })} </EuiLink> ), @@ -172,12 +176,16 @@ export const PipelineFormFields: React.FunctionComponent<Props> = ({ <> <FormattedMessage id="xpack.ingestPipelines.form.onFailureDescription" - defaultMessage="The processors to be executed following a failed processor. {learnMoreLink}" + defaultMessage="The alternate processors to execute after a processor fails. {learnMoreLink}" values={{ learnMoreLink: ( - <EuiLink href={services.documentation.getHandlingFailureUrl()} target="_blank"> + <EuiLink + href={services.documentation.getHandlingFailureUrl()} + target="_blank" + external + > {i18n.translate('xpack.ingestPipelines.form.onFailureDocumentionLink', { - defaultMessage: 'Learn more.', + defaultMessage: 'Learn more', })} </EuiLink> ), @@ -188,7 +196,7 @@ export const PipelineFormFields: React.FunctionComponent<Props> = ({ label={ <FormattedMessage id="xpack.ingestPipelines.form.onFailureToggleDescription" - defaultMessage="Add on-failure processors" + defaultMessage="Add failure processors" /> } checked={isOnFailureEditorVisible} @@ -207,7 +215,7 @@ export const PipelineFormFields: React.FunctionComponent<Props> = ({ euiCodeEditorProps: { height: '300px', 'aria-label': i18n.translate('xpack.ingestPipelines.form.onFailureFieldAriaLabel', { - defaultMessage: 'On-failure processors JSON editor', + defaultMessage: 'Failure processors JSON editor', }), }, }} diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx index 58e86695808b1..7cfe887d68d52 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx @@ -65,7 +65,7 @@ export const PipelineRequestFlyout: React.FunctionComponent<Props> = ({ <p> <FormattedMessage id="xpack.ingestPipelines.requestFlyout.descriptionText" - defaultMessage="This Elasticsearch request will create or update this pipeline." + defaultMessage="This Elasticsearch request will create or update the pipeline." /> </p> </EuiText> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_documents.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_documents.tsx index 97bf03dbdc068..4b5ed7d115a51 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_documents.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_documents.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { EuiSpacer, EuiText, EuiButton, EuiHorizontalRule, EuiLink } from '@elastic/eui'; +import { EuiSpacer, EuiText, EuiButton, EuiLink } from '@elastic/eui'; import { getUseField, @@ -72,14 +72,18 @@ export const DocumentsTab: React.FunctionComponent<Props> = ({ <p> <FormattedMessage id="xpack.ingestPipelines.testPipelineFlyout.documentsTab.tabDescriptionText" - defaultMessage="Provide an array of documents to be ingested by the pipeline. {learnMoreLink}" + defaultMessage="Provide an array of documents for the pipeline to ingest. {learnMoreLink}" values={{ learnMoreLink: ( - <EuiLink href={services.documentation.getSimulatePipelineApiUrl()} target="_blank"> + <EuiLink + href={services.documentation.getSimulatePipelineApiUrl()} + target="_blank" + external + > {i18n.translate( 'xpack.ingestPipelines.testPipelineFlyout.documentsTab.simulateDocumentionLink', { - defaultMessage: 'Learn more.', + defaultMessage: 'Learn more', } )} </EuiLink> @@ -115,17 +119,6 @@ export const DocumentsTab: React.FunctionComponent<Props> = ({ }} /> - <EuiHorizontalRule /> - - <EuiText> - <p> - <FormattedMessage - id="xpack.ingestPipelines.testPipelineFlyout.documentsTab.runDescriptionText" - defaultMessage="Execute the pipeline." - /> - </p> - </EuiText> - <EuiSpacer size="m" /> <EuiButton @@ -142,7 +135,7 @@ export const DocumentsTab: React.FunctionComponent<Props> = ({ ) : ( <FormattedMessage id="xpack.ingestPipelines.testPipelineFlyout.documentsTab.runButtonLabel" - defaultMessage="Run" + defaultMessage="Run the pipeline" /> )} </EuiButton> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_output.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_output.tsx index aa80f8c86ad8b..bcaf186e62129 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_output.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_test_flyout/tabs/tab_output.tsx @@ -11,10 +11,10 @@ import { EuiSpacer, EuiText, EuiSwitch, - EuiLink, - EuiIcon, + EuiButton, EuiLoadingSpinner, - EuiIconTip, + EuiFlexGroup, + EuiFlexItem, } from '@elastic/eui'; import { useTestConfigContext } from '../../test_config_context'; @@ -59,44 +59,39 @@ export const OutputTab: React.FunctionComponent<Props> = ({ <p> <FormattedMessage id="xpack.ingestPipelines.testPipelineFlyout.outputTab.descriptionText" - defaultMessage="The output of the executed pipeline. {runLink}" - values={{ - runLink: ( - <EuiLink onClick={() => handleExecute(cachedDocuments!, cachedVerbose)}> - <FormattedMessage - id="xpack.ingestPipelines.testPipelineFlyout.outputTab.descriptionLinkLabel" - defaultMessage="Refresh output" - />{' '} - <EuiIcon type="refresh" /> - </EuiLink> - ), - }} + defaultMessage="View the output data, or see how each processor affects the document as it passes through the pipeline." /> </p> </EuiText> - <EuiSpacer size="m" /> + <EuiSpacer size="l" /> - <EuiSwitch - label={ - <> + <EuiFlexGroup justifyContent="spaceBetween" alignItems="center"> + <EuiFlexItem grow={false}> + <EuiSwitch + label={ + <FormattedMessage + id="xpack.ingestPipelines.testPipelineFlyout.outputTab.verboseSwitchLabel" + defaultMessage="View verbose output" + /> + } + checked={cachedVerbose} + onChange={e => onEnableVerbose(e.target.checked)} + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButton + size="s" + onClick={() => handleExecute(cachedDocuments!, cachedVerbose)} + iconType="refresh" + > <FormattedMessage - id="xpack.ingestPipelines.testPipelineFlyout.outputTab.verboseSwitchLabel" - defaultMessage="View verbose output" - />{' '} - <EuiIconTip - content={ - <FormattedMessage - id="xpack.ingestPipelines.testPipelineFlyout.outputTab.verboseSwitchTooltipLabel" - defaultMessage="Include output data for each processor in the executed pipeline response" - /> - } + id="xpack.ingestPipelines.testPipelineFlyout.outputTab.descriptionLinkLabel" + defaultMessage="Refresh output" /> - </> - } - checked={cachedVerbose} - onChange={e => onEnableVerbose(e.target.checked)} - /> + </EuiButton> + </EuiFlexItem> + </EuiFlexGroup> <EuiSpacer size="m" /> diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/schema.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/schema.tsx index 2e2689f41527a..f222d48c11af0 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/schema.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/schema.tsx @@ -25,7 +25,7 @@ export const pipelineFormSchema: FormSchema = { { validator: emptyField( i18n.translate('xpack.ingestPipelines.form.pipelineNameRequiredError', { - defaultMessage: 'A pipeline name is required.', + defaultMessage: 'Name is required.', }) ), }, @@ -40,7 +40,7 @@ export const pipelineFormSchema: FormSchema = { { validator: emptyField( i18n.translate('xpack.ingestPipelines.form.pipelineDescriptionRequiredError', { - defaultMessage: 'A pipeline description is required.', + defaultMessage: 'A description is required.', }) ), }, @@ -83,7 +83,7 @@ export const pipelineFormSchema: FormSchema = { { validator: isJsonField( i18n.translate('xpack.ingestPipelines.form.processorsJsonError', { - defaultMessage: 'The processors JSON is not valid.', + defaultMessage: 'The input is not valid.', }) ), }, @@ -91,7 +91,7 @@ export const pipelineFormSchema: FormSchema = { }, on_failure: { label: i18n.translate('xpack.ingestPipelines.form.onFailureFieldLabel', { - defaultMessage: 'On-failure processors (optional)', + defaultMessage: 'Failure processors (optional)', }), helpText: ( <FormattedMessage @@ -130,7 +130,7 @@ export const pipelineFormSchema: FormSchema = { } return isJsonField( i18n.translate('xpack.ingestPipelines.form.onFailureProcessorsJsonError', { - defaultMessage: 'The on-failure processors JSON is not valid.', + defaultMessage: 'The input is not valid.', }) )(validationArg); }, diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details_flyout.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details_flyout.tsx index 0ccc097505e5d..74355fb531437 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details_flyout.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details_flyout.tsx @@ -142,7 +142,7 @@ export const PipelineDetailsFlyout: FunctionComponent<Props> = ({ {/* Processors JSON */} <EuiDescriptionListTitle> {i18n.translate('xpack.ingestPipelines.list.pipelineDetails.processorsTitle', { - defaultMessage: 'Processors JSON', + defaultMessage: 'Processors', })} </EuiDescriptionListTitle> <EuiDescriptionListDescription> @@ -156,7 +156,7 @@ export const PipelineDetailsFlyout: FunctionComponent<Props> = ({ {i18n.translate( 'xpack.ingestPipelines.list.pipelineDetails.failureProcessorsTitle', { - defaultMessage: 'On failure processors JSON', + defaultMessage: 'Failure processors', } )} </EuiDescriptionListTitle> diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx index ef64fb33a6a55..318a9219b2010 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx @@ -5,25 +5,49 @@ */ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiButton, EuiEmptyPrompt, EuiLink, EuiPageBody, EuiPageContent } from '@elastic/eui'; import { BASE_PATH } from '../../../../common/constants'; +import { useKibana } from '../../../shared_imports'; -export const EmptyList: FunctionComponent = () => ( - <EuiEmptyPrompt - iconType="managementApp" - title={ - <h2> - {i18n.translate('xpack.ingestPipelines.list.table.emptyPromptTitle', { - defaultMessage: 'Start by creating a pipeline', - })} - </h2> - } - actions={ - <EuiButton href={`#${BASE_PATH}/create`} iconType="plusInCircle" fill> - {i18n.translate('xpack.ingestPipelines.list.table.emptyPrompt.createButtonLabel', { - defaultMessage: 'Create a pipeline', - })} - </EuiButton> - } - /> -); +export const EmptyList: FunctionComponent = () => { + const { services } = useKibana(); + + return ( + <EuiPageBody> + <EuiPageContent> + <EuiEmptyPrompt + iconType="managementApp" + title={ + <h2> + {i18n.translate('xpack.ingestPipelines.list.table.emptyPromptTitle', { + defaultMessage: 'Start by creating a pipeline', + })} + </h2> + } + body={ + <p> + <FormattedMessage + id="xpack.ingestPipelines.list.table.emptyPromptDescription" + defaultMessage="For example, you might create a pipeline with one processor that removes a field and another processor that renames a field." + /> + <br /> + <EuiLink href={services.documentation.getIngestNodeUrl()} target="_blank" external> + {i18n.translate('xpack.ingestPipelines.list.table.emptyPromptDocumentionLink', { + defaultMessage: 'Learn more', + })} + </EuiLink> + </p> + } + actions={ + <EuiButton href={`#${BASE_PATH}/create`} iconType="plusInCircle" fill> + {i18n.translate('xpack.ingestPipelines.list.table.emptyPrompt.createButtonLabel', { + defaultMessage: 'Create a pipeline', + })} + </EuiButton> + } + /> + </EuiPageContent> + </EuiPageBody> + ); +}; diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx index 0d38905c0fb49..23d105c807c8b 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx @@ -6,7 +6,6 @@ import React, { useEffect, useState } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { Location } from 'history'; import { parse } from 'query-string'; @@ -19,10 +18,11 @@ import { EuiFlexItem, EuiButtonEmpty, EuiCallOut, + EuiLink, + EuiSpacer, + EuiText, } from '@elastic/eui'; -import { EuiSpacer, EuiText } from '@elastic/eui'; - import { Pipeline } from '../../../../common/types'; import { BASE_PATH } from '../../../../common/constants'; import { useKibana, SectionLoading } from '../../../shared_imports'; @@ -102,7 +102,7 @@ export const PipelinesList: React.FunctionComponent<RouteComponentProps> = ({ /> ); } else { - content = <EmptyList />; + return <EmptyList />; } const renderFlyout = (): React.ReactNode => { @@ -162,7 +162,7 @@ export const PipelinesList: React.FunctionComponent<RouteComponentProps> = ({ <EuiText color="subdued"> <FormattedMessage id="xpack.ingestPipelines.list.pipelinesDescription" - defaultMessage="Use ingest node pipelines to pre-process documents before indexing." + defaultMessage="Define a pipeline for preprocessing documents before indexing." /> </EuiText> </EuiTitle> @@ -172,9 +172,22 @@ export const PipelinesList: React.FunctionComponent<RouteComponentProps> = ({ <EuiCallOut iconType="faceSad" color="danger" - title={i18n.translate('xpack.ingestPipelines.list.loadErrorTitle', { - defaultMessage: 'Cannot load pipelines, please refresh the page to try again.', - })} + title={ + <FormattedMessage + id="xpack.ingestPipelines.list.loadErrorTitle" + defaultMessage="Unable to load pipelines. {reloadLink}" + values={{ + reloadLink: ( + <EuiLink onClick={sendRequest}> + <FormattedMessage + id="xpack.ingestPipelines.list.loadErrorReloadLinkLabel" + defaultMessage="Try again." + /> + </EuiLink> + ), + }} + /> + } /> ) : ( content diff --git a/x-pack/plugins/lens/public/app_plugin/app.test.tsx b/x-pack/plugins/lens/public/app_plugin/app.test.tsx index 41d0e3a7aa9a0..888854a4e83b8 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.test.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.test.tsx @@ -104,8 +104,8 @@ describe('Lens App', () => { storage: Storage; docId?: string; docStorage: SavedObjectStore; - redirectTo: (id?: string) => void; - addToDashboardMode?: boolean; + redirectTo: (id?: string, returnToOrigin?: boolean, newlyCreated?: boolean) => void; + originatingApp: string | undefined; }> { return ({ navigation: navigationStartMock, @@ -140,7 +140,7 @@ describe('Lens App', () => { load: jest.fn(), save: jest.fn(), }, - redirectTo: jest.fn(id => {}), + redirectTo: jest.fn((id?: string, returnToOrigin?: boolean, newlyCreated?: boolean) => {}), } as unknown) as jest.Mocked<{ navigation: typeof navigationStartMock; editorFrame: EditorFrameInstance; @@ -149,8 +149,8 @@ describe('Lens App', () => { storage: Storage; docId?: string; docStorage: SavedObjectStore; - redirectTo: (id?: string) => void; - addToDashboardMode?: boolean; + redirectTo: (id?: string, returnToOrigin?: boolean, newlyCreated?: boolean) => void; + originatingApp: string | undefined; }>; } @@ -336,6 +336,7 @@ describe('Lens App', () => { describe('save button', () => { interface SaveProps { newCopyOnSave: boolean; + returnToOrigin?: boolean; newTitle: string; } @@ -347,8 +348,8 @@ describe('Lens App', () => { storage: Storage; docId?: string; docStorage: SavedObjectStore; - redirectTo: (id?: string) => void; - addToDashboardMode?: boolean; + redirectTo: (id?: string, returnToOrigin?: boolean, newlyCreated?: boolean) => void; + originatingApp: string | undefined; }>; beforeEach(() => { @@ -374,32 +375,25 @@ describe('Lens App', () => { async function testSave(inst: ReactWrapper, saveProps: SaveProps) { await getButton(inst).run(inst.getDOMNode()); - inst.update(); - - const handler = inst.findWhere(el => el.prop('onSave')).prop('onSave') as ( + const handler = inst.find('[data-test-subj="lnsApp_saveModalOrigin"]').prop('onSave') as ( p: unknown ) => void; handler(saveProps); } async function save({ - initialDocId, - addToDashboardMode, lastKnownDoc = { expression: 'kibana 3' }, + initialDocId, ...saveProps }: SaveProps & { lastKnownDoc?: object; initialDocId?: string; - addToDashboardMode?: boolean; }) { const args = { ...defaultArgs, docId: initialDocId, }; - if (addToDashboardMode) { - args.addToDashboardMode = addToDashboardMode; - } args.editorFrame = frame; (args.docStorage.load as jest.Mock).mockResolvedValue({ id: '1234', @@ -438,7 +432,7 @@ describe('Lens App', () => { expect(getButton(instance).disableButton).toEqual(false); await act(async () => { - testSave(instance, saveProps); + testSave(instance, { ...saveProps }); }); return { args, instance }; @@ -527,7 +521,7 @@ describe('Lens App', () => { expression: 'kibana 3', }); - expect(args.redirectTo).toHaveBeenCalledWith('aaa'); + expect(args.redirectTo).toHaveBeenCalledWith('aaa', undefined, true); inst.setProps({ docId: 'aaa' }); @@ -547,7 +541,7 @@ describe('Lens App', () => { expression: 'kibana 3', }); - expect(args.redirectTo).toHaveBeenCalledWith('aaa'); + expect(args.redirectTo).toHaveBeenCalledWith('aaa', undefined, true); inst.setProps({ docId: 'aaa' }); @@ -601,10 +595,10 @@ describe('Lens App', () => { expect(getButton(instance).disableButton).toEqual(false); }); - it('saves new doc and redirects to dashboard', async () => { + it('saves new doc and redirects to originating app', async () => { const { args } = await save({ initialDocId: undefined, - addToDashboardMode: true, + returnToOrigin: true, newCopyOnSave: false, newTitle: 'hello there', }); @@ -615,7 +609,7 @@ describe('Lens App', () => { title: 'hello there', }); - expect(args.redirectTo).toHaveBeenCalledWith('aaa'); + expect(args.redirectTo).toHaveBeenCalledWith('aaa', true, true); }); it('saves app filters and does not save pinned filters', async () => { @@ -666,7 +660,6 @@ describe('Lens App', () => { }) ); instance.update(); - await act(async () => getButton(instance).run(instance.getDOMNode())); instance.update(); @@ -684,7 +677,7 @@ describe('Lens App', () => { storage: Storage; docId?: string; docStorage: SavedObjectStore; - redirectTo: (id?: string) => void; + redirectTo: (id?: string, returnToOrigin?: boolean, newlyCreated?: boolean) => void; }>; beforeEach(() => { diff --git a/x-pack/plugins/lens/public/app_plugin/app.tsx b/x-pack/plugins/lens/public/app_plugin/app.tsx index 28135dd12a724..6b8248fa2030b 100644 --- a/x-pack/plugins/lens/public/app_plugin/app.tsx +++ b/x-pack/plugins/lens/public/app_plugin/app.tsx @@ -12,9 +12,11 @@ import { Query, DataPublicPluginStart } from 'src/plugins/data/public'; import { NavigationPublicPluginStart } from 'src/plugins/navigation/public'; import { AppMountContext, NotificationsStart } from 'kibana/public'; import { IStorageWrapper } from 'src/plugins/kibana_utils/public'; -import { FormattedMessage } from '@kbn/i18n/react'; import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; -import { SavedObjectSaveModal } from '../../../../../src/plugins/saved_objects/public'; +import { + SavedObjectSaveModalOrigin, + OnSaveProps, +} from '../../../../../src/plugins/saved_objects/public'; import { Document, SavedObjectStore } from '../persistence'; import { EditorFrameInstance } from '../types'; import { NativeRenderer } from '../native_renderer'; @@ -52,7 +54,7 @@ export function App({ docId, docStorage, redirectTo, - addToDashboardMode, + originatingApp, navigation, }: { editorFrame: EditorFrameInstance; @@ -62,8 +64,8 @@ export function App({ storage: IStorageWrapper; docId?: string; docStorage: SavedObjectStore; - redirectTo: (id?: string) => void; - addToDashboardMode?: boolean; + redirectTo: (id?: string, returnToOrigin?: boolean, newlyCreated?: boolean) => void; + originatingApp?: string | undefined; }) { const language = storage.get('kibana.userQueryLanguage') || core.uiSettings.get('search:queryLanguage'); @@ -182,6 +184,63 @@ export function App({ lastKnownDoc.expression.length > 0 && core.application.capabilities.visualize.save; + const runSave = ( + saveProps: Omit<OnSaveProps, 'onTitleDuplicate' | 'newDescription'> & { + returnToOrigin: boolean; + } + ) => { + if (!lastKnownDoc) { + return; + } + const [pinnedFilters, appFilters] = _.partition( + lastKnownDoc.state?.filters, + esFilters.isFilterPinned + ); + const lastDocWithoutPinned = pinnedFilters?.length + ? { + ...lastKnownDoc, + state: { + ...lastKnownDoc.state, + filters: appFilters, + }, + } + : lastKnownDoc; + + const doc = { + ...lastDocWithoutPinned, + id: saveProps.newCopyOnSave ? undefined : lastKnownDoc.id, + title: saveProps.newTitle, + }; + + const newlyCreated: boolean = saveProps.newCopyOnSave || !lastKnownDoc?.id; + docStorage + .save(doc) + .then(({ id }) => { + // Prevents unnecessary network request and disables save button + const newDoc = { ...doc, id }; + setState(s => ({ + ...s, + isSaveModalVisible: false, + persistedDoc: newDoc, + lastKnownDoc: newDoc, + })); + if (docId !== id || saveProps.returnToOrigin) { + redirectTo(id, saveProps.returnToOrigin, newlyCreated); + } + }) + .catch(e => { + // eslint-disable-next-line no-console + console.dir(e); + trackUiEvent('save_failed'); + core.notifications.toasts.addDanger( + i18n.translate('xpack.lens.app.docSavingError', { + defaultMessage: 'Error saving document', + }) + ); + setState(s => ({ ...s, isSaveModalVisible: false })); + }); + }; + const onError = useCallback( (e: { message: string }) => core.notifications.toasts.addDanger({ @@ -192,13 +251,6 @@ export function App({ const { TopNavMenu } = navigation.ui; - const confirmButton = addToDashboardMode ? ( - <FormattedMessage - id="xpack.lens.app.saveAddToDashboard" - defaultMessage="Save and add to dashboard" - /> - ) : null; - return ( <I18nProvider> <KibanaContextProvider @@ -213,10 +265,39 @@ export function App({ <div className="lnsApp__header"> <TopNavMenu config={[ + ...(!!originatingApp && lastKnownDoc?.id + ? [ + { + label: i18n.translate('xpack.lens.app.saveAndReturn', { + defaultMessage: 'Save and return', + }), + emphasize: true, + iconType: 'check', + run: () => { + if (isSaveable && lastKnownDoc) { + runSave({ + newTitle: lastKnownDoc.title, + newCopyOnSave: false, + isTitleDuplicateConfirmed: false, + returnToOrigin: true, + }); + } + }, + testId: 'lnsApp_saveAndReturnButton', + disableButton: !isSaveable, + }, + ] + : []), { - label: i18n.translate('xpack.lens.app.save', { - defaultMessage: 'Save', - }), + label: + lastKnownDoc?.id && !!originatingApp + ? i18n.translate('xpack.lens.app.saveAs', { + defaultMessage: 'Save as', + }) + : i18n.translate('xpack.lens.app.save', { + defaultMessage: 'Save', + }), + emphasize: !originatingApp || !lastKnownDoc?.id, run: () => { if (isSaveable && lastKnownDoc) { setState(s => ({ ...s, isSaveModalVisible: true })); @@ -336,63 +417,18 @@ export function App({ )} </div> {lastKnownDoc && state.isSaveModalVisible && ( - <SavedObjectSaveModal - onSave={props => { - const [pinnedFilters, appFilters] = _.partition( - lastKnownDoc.state?.filters, - esFilters.isFilterPinned - ); - const lastDocWithoutPinned = pinnedFilters?.length - ? { - ...lastKnownDoc, - state: { - ...lastKnownDoc.state, - filters: appFilters, - }, - } - : lastKnownDoc; - - const doc = { - ...lastDocWithoutPinned, - id: props.newCopyOnSave ? undefined : lastKnownDoc.id, - title: props.newTitle, - }; - - docStorage - .save(doc) - .then(({ id }) => { - // Prevents unnecessary network request and disables save button - const newDoc = { ...doc, id }; - setState(s => ({ - ...s, - isSaveModalVisible: false, - persistedDoc: newDoc, - lastKnownDoc: newDoc, - })); - if (docId !== id) { - redirectTo(id); - } - }) - .catch(e => { - // eslint-disable-next-line no-console - console.dir(e); - trackUiEvent('save_failed'); - core.notifications.toasts.addDanger( - i18n.translate('xpack.lens.app.docSavingError', { - defaultMessage: 'Error saving document', - }) - ); - setState(s => ({ ...s, isSaveModalVisible: false })); - }); - }} + <SavedObjectSaveModalOrigin + originatingApp={originatingApp} + onSave={props => runSave(props)} onClose={() => setState(s => ({ ...s, isSaveModalVisible: false }))} - title={lastKnownDoc.title || ''} - showCopyOnSave={!!lastKnownDoc.id && !addToDashboardMode} + documentInfo={{ + id: lastKnownDoc.id, + title: lastKnownDoc.title || '', + }} objectType={i18n.translate('xpack.lens.app.saveModalType', { defaultMessage: 'Lens visualization', })} - showDescription={false} - confirmButtonLabel={confirmButton} + data-test-subj="lnsApp_saveModalOrigin" /> )} </KibanaContextProvider> diff --git a/x-pack/plugins/lens/public/app_plugin/mounter.tsx b/x-pack/plugins/lens/public/app_plugin/mounter.tsx index f295f88a58e5f..74bc5821aa713 100644 --- a/x-pack/plugins/lens/public/app_plugin/mounter.tsx +++ b/x-pack/plugins/lens/public/app_plugin/mounter.tsx @@ -11,8 +11,8 @@ import { HashRouter, Route, RouteComponentProps, Switch } from 'react-router-dom import { render, unmountComponentAtNode } from 'react-dom'; import rison from 'rison-node'; -import { DashboardConstants } from '../../../../../src/plugins/dashboard/public'; -import { Storage } from '../../../../../src/plugins/kibana_utils/public'; +import { parse } from 'query-string'; +import { Storage, removeQueryParam } from '../../../../../src/plugins/kibana_utils/public'; import { LensReportManager, setReportManager, trackUiEvent } from '../lens_ui_telemetry'; @@ -52,33 +52,48 @@ export async function mountApp( }; const redirectTo = ( routeProps: RouteComponentProps<{ id?: string }>, - addToDashboardMode: boolean, - id?: string + originatingApp: string, + id?: string, + returnToOrigin?: boolean, + newlyCreated?: boolean ) => { + if (!!originatingApp && !returnToOrigin) { + removeQueryParam(routeProps.history, 'embeddableOriginatingApp'); + } + if (!id) { routeProps.history.push('/lens'); - } else if (!addToDashboardMode) { + } else if (!originatingApp) { routeProps.history.push(`/lens/edit/${id}`); - } else if (addToDashboardMode && id) { + } else if (!!originatingApp && id && returnToOrigin) { routeProps.history.push(`/lens/edit/${id}`); - const lastDashboardLink = coreStart.chrome.navLinks.get('kibana:dashboard'); - if (!lastDashboardLink || !lastDashboardLink.url) { - throw new Error('Cannot get last dashboard url'); + const originatingAppLink = coreStart.chrome.navLinks.get(originatingApp); + if (!originatingAppLink || !originatingAppLink.url) { + throw new Error('Cannot get originating app url'); + } + + // TODO: Remove this and use application.redirectTo after https://github.com/elastic/kibana/pull/63443 + if (originatingApp === 'kibana:dashboard') { + const addLensId = newlyCreated ? id : ''; + const urlVars = getUrlVars(originatingAppLink.url); + updateUrlTime(urlVars); // we need to pass in timerange in query params directly + const dashboardUrl = addEmbeddableToDashboardUrl( + originatingAppLink.url, + addLensId, + urlVars + ); + window.history.pushState({}, '', dashboardUrl); + } else { + window.location.href = originatingAppLink.url; } - const urlVars = getUrlVars(lastDashboardLink.url); - updateUrlTime(urlVars); // we need to pass in timerange in query params directly - const dashboardUrl = addEmbeddableToDashboardUrl(lastDashboardLink.url, id, urlVars); - window.history.pushState({}, '', dashboardUrl); } }; const renderEditor = (routeProps: RouteComponentProps<{ id?: string }>) => { trackUiEvent('loaded'); - const addToDashboardMode = - !!routeProps.location.search && - routeProps.location.search.includes( - DashboardConstants.ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM - ); + const urlParams = parse(routeProps.location.search) as Record<string, string>; + const originatingApp = urlParams.embeddableOriginatingApp; + return ( <App core={coreStart} @@ -88,8 +103,10 @@ export async function mountApp( storage={new Storage(localStorage)} docId={routeProps.match.params.id} docStorage={new SavedObjectIndexStore(savedObjectsClient)} - redirectTo={id => redirectTo(routeProps, addToDashboardMode, id)} - addToDashboardMode={addToDashboardMode} + redirectTo={(id, returnToOrigin, newlyCreated) => + redirectTo(routeProps, originatingApp, id, returnToOrigin, newlyCreated) + } + originatingApp={originatingApp} /> ); }; diff --git a/x-pack/plugins/lens/public/helpers/url_helper.ts b/x-pack/plugins/lens/public/helpers/url_helper.ts index 0a97ba4b2edf7..2ffc381c4f62f 100644 --- a/x-pack/plugins/lens/public/helpers/url_helper.ts +++ b/x-pack/plugins/lens/public/helpers/url_helper.ts @@ -37,8 +37,10 @@ export function addEmbeddableToDashboardUrl(url: string, embeddableId: string, u keys.forEach(key => { dashboardParsedUrl.query[key] = urlVars[key]; }); - dashboardParsedUrl.query[DashboardConstants.ADD_EMBEDDABLE_TYPE] = 'lens'; - dashboardParsedUrl.query[DashboardConstants.ADD_EMBEDDABLE_ID] = embeddableId; + if (embeddableId) { + dashboardParsedUrl.query[DashboardConstants.ADD_EMBEDDABLE_TYPE] = 'lens'; + dashboardParsedUrl.query[DashboardConstants.ADD_EMBEDDABLE_ID] = embeddableId; + } const query = stringify(dashboardParsedUrl.query); return `${dashboardParsedUrl.url}?${query}`; diff --git a/x-pack/plugins/maps/public/_main.scss b/x-pack/plugins/maps/public/_main.scss index ac33223ba11a8..36efe4cf3ab67 100644 --- a/x-pack/plugins/maps/public/_main.scss +++ b/x-pack/plugins/maps/public/_main.scss @@ -4,7 +4,7 @@ #maps-plugin { display: flex; flex-direction: column; - height: calc(100vh - #{$euiHeaderChildSize}); + height: calc(100vh - #{$euiHeaderHeightCompensation}); width: 100%; overflow: hidden; } diff --git a/x-pack/plugins/maps/public/index_pattern_util.js b/x-pack/plugins/maps/public/index_pattern_util.js index 6cb02c7605e28..bbea4a9e3ab2a 100644 --- a/x-pack/plugins/maps/public/index_pattern_util.js +++ b/x-pack/plugins/maps/public/index_pattern_util.js @@ -32,14 +32,18 @@ export function getTermsFields(fields) { export const AGGREGATABLE_GEO_FIELD_TYPES = [ES_GEO_FIELD_TYPE.GEO_POINT]; -export function getAggregatableGeoFields(fields) { - return fields.filter(field => { - return ( - field.aggregatable && - !indexPatterns.isNestedField(field) && - AGGREGATABLE_GEO_FIELD_TYPES.includes(field.type) - ); - }); +export function getFieldsWithGeoTileAgg(fields) { + return fields.filter(supportsGeoTileAgg); +} + +export function supportsGeoTileAgg(field) { + // TODO add geo_shape support with license check + return ( + field && + field.aggregatable && + !indexPatterns.isNestedField(field) && + field.type === ES_GEO_FIELD_TYPE.GEO_POINT + ); } // Returns filtered fields list containing only fields that exist in _source. diff --git a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js index 265606dc87e0f..77d2ffb8c577e 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_geo_grid_source/create_source_editor.js @@ -14,10 +14,7 @@ import { NoIndexPatternCallout } from '../../../components/no_index_pattern_call import { i18n } from '@kbn/i18n'; import { EuiFormRow, EuiSpacer } from '@elastic/eui'; -import { - AGGREGATABLE_GEO_FIELD_TYPES, - getAggregatableGeoFields, -} from '../../../index_pattern_util'; +import { AGGREGATABLE_GEO_FIELD_TYPES, getFieldsWithGeoTileAgg } from '../../../index_pattern_util'; import { RenderAsSelect } from './render_as_select'; export class CreateSourceEditor extends Component { @@ -90,7 +87,7 @@ export class CreateSourceEditor extends Component { }); //make default selection - const geoFields = getAggregatableGeoFields(indexPattern.fields); + const geoFields = getFieldsWithGeoTileAgg(indexPattern.fields); if (geoFields[0]) { this._onGeoFieldSelect(geoFields[0].name); } @@ -145,7 +142,7 @@ export class CreateSourceEditor extends Component { onChange={this._onGeoFieldSelect} fields={ this.state.indexPattern - ? getAggregatableGeoFields(this.state.indexPattern.fields) + ? getFieldsWithGeoTileAgg(this.state.indexPattern.fields) : undefined } /> diff --git a/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js index a4af1a3c19c83..78c16130891b8 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_pew_pew_source/create_source_editor.js @@ -14,10 +14,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiFormRow, EuiCallOut } from '@elastic/eui'; -import { - AGGREGATABLE_GEO_FIELD_TYPES, - getAggregatableGeoFields, -} from '../../../index_pattern_util'; +import { AGGREGATABLE_GEO_FIELD_TYPES, getFieldsWithGeoTileAgg } from '../../../index_pattern_util'; export class CreateSourceEditor extends Component { static propTypes = { @@ -86,7 +83,7 @@ export class CreateSourceEditor extends Component { return; } - const geoFields = getAggregatableGeoFields(indexPattern.fields); + const geoFields = getFieldsWithGeoTileAgg(indexPattern.fields); this.setState({ isLoadingIndexPattern: false, indexPattern: indexPattern, @@ -128,7 +125,7 @@ export class CreateSourceEditor extends Component { } const fields = this.state.indexPattern - ? getAggregatableGeoFields(this.state.indexPattern.fields) + ? getFieldsWithGeoTileAgg(this.state.indexPattern.fields) : undefined; return ( <Fragment> diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js index aeb3835354f07..3a25bd90384e9 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/create_source_editor.js @@ -17,7 +17,7 @@ import { ES_GEO_FIELD_TYPE, SCALING_TYPES } from '../../../../common/constants'; import { DEFAULT_FILTER_BY_MAP_BOUNDS } from './constants'; import { indexPatterns } from '../../../../../../../src/plugins/data/public'; import { ScalingForm } from './scaling_form'; -import { getTermsFields } from '../../../index_pattern_util'; +import { getTermsFields, supportsGeoTileAgg } from '../../../index_pattern_util'; function getGeoFields(fields) { return fields.filter(field => { @@ -28,13 +28,8 @@ function getGeoFields(fields) { }); } -function isGeoFieldAggregatable(indexPattern, geoFieldName) { - if (!indexPattern) { - return false; - } - - const geoField = indexPattern.fields.getByName(geoFieldName); - return geoField && geoField.aggregatable; +function doesGeoFieldSupportGeoTileAgg(indexPattern, geoFieldName) { + return indexPattern ? supportsGeoTileAgg(indexPattern.fields.getByName(geoFieldName)) : false; } const RESET_INDEX_PATTERN_STATE = { @@ -133,7 +128,7 @@ export class CreateSourceEditor extends Component { // Respect previous scaling type selection unless newly selected geo field does not support clustering. const scalingType = this.state.scalingType === SCALING_TYPES.CLUSTERS && - !isGeoFieldAggregatable(this.state.indexPattern, geoFieldName) + !doesGeoFieldSupportGeoTileAgg(this.state.indexPattern, geoFieldName) ? SCALING_TYPES.LIMIT : this.state.scalingType; this.setState( @@ -218,7 +213,7 @@ export class CreateSourceEditor extends Component { indexPatternId={this.state.indexPatternId} onChange={this._onScalingPropChange} scalingType={this.state.scalingType} - supportsClustering={isGeoFieldAggregatable( + supportsClustering={doesGeoFieldSupportGeoTileAgg( this.state.indexPattern, this.state.geoFieldName )} diff --git a/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js index cb6255afd0a42..59b41c2a79532 100644 --- a/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js +++ b/x-pack/plugins/maps/public/layers/sources/es_search_source/update_source_editor.js @@ -12,7 +12,7 @@ import { TooltipSelector } from '../../../components/tooltip_selector'; import { getIndexPatternService } from '../../../kibana_services'; import { i18n } from '@kbn/i18n'; -import { getTermsFields, getSourceFields } from '../../../index_pattern_util'; +import { getTermsFields, getSourceFields, supportsGeoTileAgg } from '../../../index_pattern_util'; import { SORT_ORDER } from '../../../../common/constants'; import { ESDocField } from '../../fields/es_doc_field'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -90,7 +90,7 @@ export class UpdateSourceEditor extends Component { }); this.setState({ - supportsClustering: geoField.aggregatable, + supportsClustering: supportsGeoTileAgg(geoField), sourceFields: sourceFields, termFields: getTermsFields(indexPattern.fields), //todo change term fields to use fields sortFields: indexPattern.fields.filter( diff --git a/x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts b/x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts index bf8e3031db975..bc55c7549c589 100644 --- a/x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts +++ b/x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts @@ -26,6 +26,7 @@ export interface Job { groups: string[]; model_plot_config?: ModelPlotConfig; model_snapshot_retention_days?: number; + daily_model_snapshot_retention_after_days?: number; renormalization_window_days?: number; results_index_name?: string; results_retention_days?: number; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/__snapshots__/rule_editor_flyout.test.js.snap b/x-pack/plugins/ml/public/application/components/rule_editor/__snapshots__/rule_editor_flyout.test.js.snap index 3b14025e9cb7b..f3acc7074d277 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/__snapshots__/rule_editor_flyout.test.js.snap +++ b/x-pack/plugins/ml/public/application/components/rule_editor/__snapshots__/rule_editor_flyout.test.js.snap @@ -9,12 +9,7 @@ exports[`RuleEditorFlyout renders the flyout after adding a condition to a rule <EuiFlyout aria-labelledby="flyoutTitle" className="ml-rule-editor-flyout" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -259,12 +254,7 @@ exports[`RuleEditorFlyout renders the flyout after setting the rule to edit 1`] <EuiFlyout aria-labelledby="flyoutTitle" className="ml-rule-editor-flyout" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -523,12 +513,7 @@ exports[`RuleEditorFlyout renders the flyout for creating a rule with conditions <EuiFlyout aria-labelledby="flyoutTitle" className="ml-rule-editor-flyout" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -765,12 +750,7 @@ exports[`RuleEditorFlyout renders the select action component for a detector wit <EuiFlyout aria-labelledby="flyoutTitle" className="ml-rule-editor-flyout" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.test.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.test.ts index 2463da054d140..9221f8c500326 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.test.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.test.ts @@ -92,6 +92,7 @@ describe('Analytics job clone action', () => { training_percent: 20, randomize_seed: -2228827740028660200, num_top_feature_importance_values: 4, + loss_function: 'mse', }, }, analyzed_fields: { @@ -192,6 +193,7 @@ describe('Analytics job clone action', () => { training_percent: 20, randomize_seed: -2228827740028660200, num_top_feature_importance_values: 4, + loss_function: 'mse', }, }, analyzed_fields: { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx index cc75ddbe08cfb..cfb11856670c4 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx @@ -179,6 +179,10 @@ const getAnalyticsJobMeta = (config: CloneDataFrameAnalyticsConfig): AnalyticsJo // By default it is randomly generated ignore: true, }, + loss_function: { + optional: true, + defaultValue: 'mse', + }, }, } : {}), diff --git a/x-pack/plugins/ml/public/application/explorer/hooks/use_selected_cells.ts b/x-pack/plugins/ml/public/application/explorer/hooks/use_selected_cells.ts index 043b762334da9..a19750494afdc 100644 --- a/x-pack/plugins/ml/public/application/explorer/hooks/use_selected_cells.ts +++ b/x-pack/plugins/ml/public/application/explorer/hooks/use_selected_cells.ts @@ -33,12 +33,13 @@ export const useSelectedCells = (): [ const setSelectedCells = (swimlaneSelectedCells: AppStateSelectedCells) => { const mlExplorerSwimlane = { ...appState.mlExplorerSwimlane }; + if (swimlaneSelectedCells !== undefined) { swimlaneSelectedCells.showTopFieldValues = false; const currentSwimlaneType = selectedCells?.type; const currentShowTopFieldValues = selectedCells?.showTopFieldValues; - const newSwimlaneType = selectedCells?.type; + const newSwimlaneType = swimlaneSelectedCells?.type; if ( (currentSwimlaneType === SWIMLANE_TYPE.OVERALL && diff --git a/x-pack/plugins/ml/public/plugin.ts b/x-pack/plugins/ml/public/plugin.ts index a30dc9e2dda95..fe9f602bc3637 100644 --- a/x-pack/plugins/ml/public/plugin.ts +++ b/x-pack/plugins/ml/public/plugin.ts @@ -20,6 +20,7 @@ import { LicenseManagementUIPluginSetup } from '../../license_management/public' import { setDependencyCache } from './application/util/dependency_cache'; import { PLUGIN_ID, PLUGIN_ICON } from '../common/constants/app'; import { registerFeature } from './register_feature'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import { registerEmbeddables } from './embeddables'; import { UiActionsSetup } from '../../../../src/plugins/ui_actions/public'; import { registerMlUiActions } from './ui_actions'; @@ -46,9 +47,10 @@ export class MlPlugin implements Plugin<MlPluginSetup, MlPluginStart> { title: i18n.translate('xpack.ml.plugin.title', { defaultMessage: 'Machine Learning', }), - order: 30, + order: 5000, euiIconType: PLUGIN_ICON, appRoute: '/app/ml', + category: DEFAULT_APP_CATEGORIES.kibana, mount: async (params: AppMountParameters) => { const [coreStart, pluginsStart] = await core.getStartServices(); const { renderApp } = await import('./application/app'); diff --git a/x-pack/plugins/ml/server/routes/schemas/anomaly_detectors_schema.ts b/x-pack/plugins/ml/server/routes/schemas/anomaly_detectors_schema.ts index 9b86e3e06096e..88b86de322e3c 100644 --- a/x-pack/plugins/ml/server/routes/schemas/anomaly_detectors_schema.ts +++ b/x-pack/plugins/ml/server/routes/schemas/anomaly_detectors_schema.ts @@ -112,6 +112,7 @@ export const anomalyDetectionJobSchema = { model_snapshot_id: schema.maybe(schema.string()), model_snapshot_min_version: schema.maybe(schema.string()), model_snapshot_retention_days: schema.maybe(schema.number()), + daily_model_snapshot_retention_after_days: schema.maybe(schema.number()), renormalization_window_days: schema.maybe(schema.number()), results_index_name: schema.maybe(schema.string()), results_retention_days: schema.maybe(schema.number()), diff --git a/x-pack/plugins/monitoring/public/components/alerts/__snapshots__/status.test.tsx.snap b/x-pack/plugins/monitoring/public/components/alerts/__snapshots__/status.test.tsx.snap index 4cf1f4df2eb2e..5562d4bae9b14 100644 --- a/x-pack/plugins/monitoring/public/components/alerts/__snapshots__/status.test.tsx.snap +++ b/x-pack/plugins/monitoring/public/components/alerts/__snapshots__/status.test.tsx.snap @@ -3,12 +3,7 @@ exports[`Status should render a flyout when clicking the link 1`] = ` <EuiFlyout aria-labelledby="flyoutTitle" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap index e35bb6970bcf9..070d926efc6d1 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/__test__/__snapshots__/detail_drawer.test.js.snap @@ -2,11 +2,7 @@ exports[`DetailDrawer component If vertices shows basic info and no stats for if 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} size="s" > <EuiFlyoutHeader> @@ -61,11 +57,7 @@ exports[`DetailDrawer component If vertices shows basic info and no stats for if exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID shows basic info and stats for plugin, suggesting that user set explicit ID 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} size="s" > <EuiFlyoutHeader> @@ -318,11 +310,7 @@ exports[`DetailDrawer component Plugin vertices Plugin does not have explicit ID exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows basic info and stats for plugin, including explicit ID 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} size="s" > <EuiFlyoutHeader> @@ -569,11 +557,7 @@ exports[`DetailDrawer component Plugin vertices Plugin has explicit ID shows bas exports[`DetailDrawer component Queue vertices shows basic info and no stats for queue 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} size="s" > <EuiFlyoutHeader> @@ -620,11 +604,7 @@ exports[`DetailDrawer component Queue vertices shows basic info and no stats for exports[`DetailDrawer component shows vertex title 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[MockFunction]} - ownFocus={false} size="s" > <EuiFlyoutHeader> diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap b/x-pack/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap index 4a7537166bd8a..a4b2ea8c25020 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/flyout/__snapshots__/flyout.test.js.snap @@ -3,12 +3,7 @@ exports[`Flyout apm part one should render normally 1`] = ` <EuiFlyout aria-labelledby="flyoutTitle" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -342,12 +337,7 @@ exports[`Flyout apm part two should show instructions to migrate to metricbeat 1 exports[`Flyout beats part one should render normally 1`] = ` <EuiFlyout aria-labelledby="flyoutTitle" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -723,12 +713,7 @@ exports[`Flyout beats part two should show instructions to migrate to metricbeat exports[`Flyout elasticsearch part one should render normally 1`] = ` <EuiFlyout aria-labelledby="flyoutTitle" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -1064,12 +1049,7 @@ exports[`Flyout elasticsearch part two should show instructions to migrate to me exports[`Flyout kibana part one should render normally 1`] = ` <EuiFlyout aria-labelledby="flyoutTitle" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} @@ -1412,12 +1392,7 @@ exports[`Flyout kibana part two should show instructions to migrate to metricbea exports[`Flyout logstash part one should render normally 1`] = ` <EuiFlyout aria-labelledby="flyoutTitle" - closeButtonAriaLabel="Closes this dialog" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} - size="m" > <EuiFlyoutHeader hasBorder={true} diff --git a/x-pack/plugins/monitoring/public/plugin.ts b/x-pack/plugins/monitoring/public/plugin.ts index 63f0c46c14096..8e2fe2c869ea1 100644 --- a/x-pack/plugins/monitoring/public/plugin.ts +++ b/x-pack/plugins/monitoring/public/plugin.ts @@ -17,7 +17,7 @@ import { FeatureCatalogueCategory, HomePublicPluginSetup, } from '../../../../src/plugins/home/public'; -import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; +import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import { MonitoringPluginDependencies, MonitoringConfig } from './types'; import { MONITORING_CONFIG_ALERTING_EMAIL_ADDRESS, diff --git a/x-pack/plugins/painless_lab/public/application/components/main.tsx b/x-pack/plugins/painless_lab/public/application/components/main.tsx index 5aed3f25a51b9..3a1e0cd6948b3 100644 --- a/x-pack/plugins/painless_lab/public/application/components/main.tsx +++ b/x-pack/plugins/painless_lab/public/application/components/main.tsx @@ -7,6 +7,7 @@ import React, { useState, useEffect } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { NavType } from 'src/core/public'; import { formatRequestPayload, formatJson } from '../lib/format'; import { exampleScript } from '../constants'; import { PayloadFormat } from '../types'; @@ -23,7 +24,7 @@ export const Main: React.FunctionComponent = () => { updatePayload, services: { http, - chrome: { getIsNavDrawerLocked$ }, + chrome: { getIsNavDrawerLocked$, getNavType$ }, }, links, } = useAppContext(); @@ -43,6 +44,7 @@ export const Main: React.FunctionComponent = () => { }; const [isNavDrawerLocked, setIsNavDrawerLocked] = useState(false); + const [isNavLegacy, setIsNavLegacy] = useState(false); useEffect(() => { const subscription = getIsNavDrawerLocked$().subscribe((newIsNavDrawerLocked: boolean) => { @@ -52,6 +54,14 @@ export const Main: React.FunctionComponent = () => { return () => subscription.unsubscribe(); }); + useEffect(() => { + const subscription = getNavType$().subscribe((navType: NavType) => { + setIsNavLegacy(navType === 'legacy'); + }); + + return () => subscription.unsubscribe(); + }); + return ( <div className="painlessLabMainContainer"> <EuiFlexGroup className="painlessLabPanelsContainer" responsive={false} gutterSize="none"> @@ -78,6 +88,7 @@ export const Main: React.FunctionComponent = () => { toggleRequestFlyout={toggleRequestFlyout} isRequestFlyoutOpen={isRequestFlyoutOpen} isNavDrawerLocked={isNavDrawerLocked} + isNavLegacy={isNavLegacy} reset={() => updatePayload({ code: exampleScript })} /> diff --git a/x-pack/plugins/painless_lab/public/application/components/main_controls.tsx b/x-pack/plugins/painless_lab/public/application/components/main_controls.tsx index 6307c21e26dc4..7018cfd27c509 100644 --- a/x-pack/plugins/painless_lab/public/application/components/main_controls.tsx +++ b/x-pack/plugins/painless_lab/public/application/components/main_controls.tsx @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ import React, { useState } from 'react'; -import classNames from 'classnames'; import { EuiPopover, EuiBottomBar, @@ -15,7 +14,7 @@ import { EuiButtonEmpty, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; - +import classNames from 'classnames'; import { Links } from '../../links'; interface Props { @@ -25,6 +24,7 @@ interface Props { reset: () => void; links: Links; isNavDrawerLocked: boolean; + isNavLegacy: boolean; } export function MainControls({ @@ -33,6 +33,7 @@ export function MainControls({ reset, links, isNavDrawerLocked, + isNavLegacy, }: Props) { const [isHelpOpen, setIsHelpOpen] = useState(false); @@ -87,9 +88,14 @@ export function MainControls({ </EuiContextMenuItem>, ]; - const classes = classNames('painlessLab__bottomBar', { - 'painlessLab__bottomBar-isNavDrawerLocked': isNavDrawerLocked, - }); + // TODO #64541 + // Can delete all this class stuff + let classes = ''; + if (isNavLegacy) { + classes = classNames('painlessLab__bottomBar', { + 'painlessLab__bottomBar-isNavDrawerLocked': isNavDrawerLocked, + }); + } return ( <EuiBottomBar paddingSize="s" className={classes}> @@ -116,7 +122,7 @@ export function MainControls({ closePopover={() => setIsHelpOpen(false)} panelPaddingSize="none" withTitle - anchorPosition="upRight" + anchorPosition="upLeft" > <EuiContextMenuPanel items={items} /> </EuiPopover> diff --git a/x-pack/plugins/painless_lab/public/styles/_index.scss b/x-pack/plugins/painless_lab/public/styles/_index.scss index cad0d8229524b..df68a6450c191 100644 --- a/x-pack/plugins/painless_lab/public/styles/_index.scss +++ b/x-pack/plugins/painless_lab/public/styles/_index.scss @@ -8,7 +8,7 @@ $bottomBarHeight: calc(#{$euiSize} * 3); .painlessLabBottomBarPlaceholder { - height: $bottomBarHeight + height: $bottomBarHeight; } .painlessLabLeftPane { diff --git a/x-pack/plugins/reporting/public/components/buttons/__snapshots__/report_info_button.test.tsx.snap b/x-pack/plugins/reporting/public/components/buttons/__snapshots__/report_info_button.test.tsx.snap index 8957e081742e8..eacc2fd4de7d0 100644 --- a/x-pack/plugins/reporting/public/components/buttons/__snapshots__/report_info_button.test.tsx.snap +++ b/x-pack/plugins/reporting/public/components/buttons/__snapshots__/report_info_button.test.tsx.snap @@ -28,10 +28,7 @@ exports[`ReportInfoButton opens flyout with fetch error info 1`] = ` Array [ <EuiFlyout aria-labelledby="flyoutTitle" - closeButtonAriaLabel="Closes this dialog" data-test-subj="reportInfoFlyout" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} ownFocus={true} size="s" @@ -136,7 +133,7 @@ Array [ tabindex="0" > <button - aria-label="Closes this dialog" + aria-label="Close this dialog" class="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" data-test-subj="euiFlyoutCloseButton" type="button" @@ -196,7 +193,7 @@ Array [ tabindex="0" > <button - aria-label="Closes this dialog" + aria-label="Close this dialog" class="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" data-test-subj="euiFlyoutCloseButton" type="button" @@ -249,36 +246,41 @@ Array [ role="dialog" tabIndex={0} > - <EuiButtonIcon - aria-label="Closes this dialog" - className="euiFlyout__closeButton" - color="text" - data-test-subj="euiFlyoutCloseButton" - iconType="cross" - onClick={[Function]} + <EuiI18n + default="Close this dialog" + token="euiFlyout.closeAriaLabel" > - <button - aria-label="Closes this dialog" - className="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" + <EuiButtonIcon + aria-label="Close this dialog" + className="euiFlyout__closeButton" + color="text" data-test-subj="euiFlyoutCloseButton" + iconType="cross" onClick={[Function]} - type="button" > - <EuiIcon - aria-hidden="true" - className="euiButtonIcon__icon" - size="m" - type="cross" + <button + aria-label="Close this dialog" + className="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" + data-test-subj="euiFlyoutCloseButton" + onClick={[Function]} + type="button" > - <div + <EuiIcon aria-hidden="true" className="euiButtonIcon__icon" - data-euiicon-type="cross" size="m" - /> - </EuiIcon> - </button> - </EuiButtonIcon> + type="cross" + > + <div + aria-hidden="true" + className="euiButtonIcon__icon" + data-euiicon-type="cross" + size="m" + /> + </EuiIcon> + </button> + </EuiButtonIcon> + </EuiI18n> <EuiFlyoutHeader hasBorder={true} > @@ -348,36 +350,41 @@ Array [ role="dialog" tabIndex={0} > - <EuiButtonIcon - aria-label="Closes this dialog" - className="euiFlyout__closeButton" - color="text" - data-test-subj="euiFlyoutCloseButton" - iconType="cross" - onClick={[Function]} + <EuiI18n + default="Close this dialog" + token="euiFlyout.closeAriaLabel" > - <button - aria-label="Closes this dialog" - className="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" + <EuiButtonIcon + aria-label="Close this dialog" + className="euiFlyout__closeButton" + color="text" data-test-subj="euiFlyoutCloseButton" + iconType="cross" onClick={[Function]} - type="button" > - <EuiIcon - aria-hidden="true" - className="euiButtonIcon__icon" - size="m" - type="cross" + <button + aria-label="Close this dialog" + className="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" + data-test-subj="euiFlyoutCloseButton" + onClick={[Function]} + type="button" > - <div + <EuiIcon aria-hidden="true" className="euiButtonIcon__icon" - data-euiicon-type="cross" size="m" - /> - </EuiIcon> - </button> - </EuiButtonIcon> + type="cross" + > + <div + aria-hidden="true" + className="euiButtonIcon__icon" + data-euiicon-type="cross" + size="m" + /> + </EuiIcon> + </button> + </EuiButtonIcon> + </EuiI18n> <EuiFlyoutHeader hasBorder={true} > @@ -425,10 +432,7 @@ exports[`ReportInfoButton opens flyout with info 1`] = ` Array [ <EuiFlyout aria-labelledby="flyoutTitle" - closeButtonAriaLabel="Closes this dialog" data-test-subj="reportInfoFlyout" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} ownFocus={true} size="s" @@ -533,7 +537,7 @@ Array [ tabindex="0" > <button - aria-label="Closes this dialog" + aria-label="Close this dialog" class="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" data-test-subj="euiFlyoutCloseButton" type="button" @@ -591,7 +595,7 @@ Array [ tabindex="0" > <button - aria-label="Closes this dialog" + aria-label="Close this dialog" class="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" data-test-subj="euiFlyoutCloseButton" type="button" @@ -642,36 +646,41 @@ Array [ role="dialog" tabIndex={0} > - <EuiButtonIcon - aria-label="Closes this dialog" - className="euiFlyout__closeButton" - color="text" - data-test-subj="euiFlyoutCloseButton" - iconType="cross" - onClick={[Function]} + <EuiI18n + default="Close this dialog" + token="euiFlyout.closeAriaLabel" > - <button - aria-label="Closes this dialog" - className="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" + <EuiButtonIcon + aria-label="Close this dialog" + className="euiFlyout__closeButton" + color="text" data-test-subj="euiFlyoutCloseButton" + iconType="cross" onClick={[Function]} - type="button" > - <EuiIcon - aria-hidden="true" - className="euiButtonIcon__icon" - size="m" - type="cross" + <button + aria-label="Close this dialog" + className="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" + data-test-subj="euiFlyoutCloseButton" + onClick={[Function]} + type="button" > - <div + <EuiIcon aria-hidden="true" className="euiButtonIcon__icon" - data-euiicon-type="cross" size="m" - /> - </EuiIcon> - </button> - </EuiButtonIcon> + type="cross" + > + <div + aria-hidden="true" + className="euiButtonIcon__icon" + data-euiicon-type="cross" + size="m" + /> + </EuiIcon> + </button> + </EuiButtonIcon> + </EuiI18n> <EuiFlyoutHeader hasBorder={true} > @@ -739,36 +748,41 @@ Array [ role="dialog" tabIndex={0} > - <EuiButtonIcon - aria-label="Closes this dialog" - className="euiFlyout__closeButton" - color="text" - data-test-subj="euiFlyoutCloseButton" - iconType="cross" - onClick={[Function]} + <EuiI18n + default="Close this dialog" + token="euiFlyout.closeAriaLabel" > - <button - aria-label="Closes this dialog" - className="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" + <EuiButtonIcon + aria-label="Close this dialog" + className="euiFlyout__closeButton" + color="text" data-test-subj="euiFlyoutCloseButton" + iconType="cross" onClick={[Function]} - type="button" > - <EuiIcon - aria-hidden="true" - className="euiButtonIcon__icon" - size="m" - type="cross" + <button + aria-label="Close this dialog" + className="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" + data-test-subj="euiFlyoutCloseButton" + onClick={[Function]} + type="button" > - <div + <EuiIcon aria-hidden="true" className="euiButtonIcon__icon" - data-euiicon-type="cross" size="m" - /> - </EuiIcon> - </button> - </EuiButtonIcon> + type="cross" + > + <div + aria-hidden="true" + className="euiButtonIcon__icon" + data-euiicon-type="cross" + size="m" + /> + </EuiIcon> + </button> + </EuiButtonIcon> + </EuiI18n> <EuiFlyoutHeader hasBorder={true} > diff --git a/x-pack/plugins/security/public/authentication/login/__snapshots__/login_page.test.tsx.snap b/x-pack/plugins/security/public/authentication/login/__snapshots__/login_page.test.tsx.snap index bbc6bfa1faddc..8af75633776e8 100644 --- a/x-pack/plugins/security/public/authentication/login/__snapshots__/login_page.test.tsx.snap +++ b/x-pack/plugins/security/public/authentication/login/__snapshots__/login_page.test.tsx.snap @@ -278,25 +278,12 @@ exports[`LoginPage page renders as expected 1`] = ` > <h1> <FormattedMessage - defaultMessage="Welcome to Elastic Kibana" + defaultMessage="Welcome to Elastic" id="xpack.security.loginPage.welcomeTitle" values={Object {}} /> </h1> </EuiTitle> - <EuiText - className="loginWelcome__subtitle" - color="subdued" - size="s" - > - <p> - <FormattedMessage - defaultMessage="Your window into the Elastic Stack" - id="xpack.security.loginPage.welcomeDescription" - values={Object {}} - /> - </p> - </EuiText> <EuiSpacer size="xl" /> diff --git a/x-pack/plugins/security/public/authentication/login/login_page.tsx b/x-pack/plugins/security/public/authentication/login/login_page.tsx index d24a301ed24ec..be152b21e2701 100644 --- a/x-pack/plugins/security/public/authentication/login/login_page.tsx +++ b/x-pack/plugins/security/public/authentication/login/login_page.tsx @@ -11,7 +11,7 @@ import ReactDOM from 'react-dom'; import classNames from 'classnames'; import { BehaviorSubject } from 'rxjs'; import { parse } from 'url'; -import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSpacer, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; import { CoreStart, FatalErrorsStart, HttpStart, NotificationsStart } from 'src/core/public'; @@ -39,7 +39,7 @@ const infoMessageMap = new Map([ [ 'LOGGED_OUT', i18n.translate('xpack.security.login.loggedOutDescription', { - defaultMessage: 'You have logged out of Kibana.', + defaultMessage: 'You have logged out of Elastic.', }), ], ]); @@ -93,18 +93,10 @@ export class LoginPage extends Component<Props, State> { <h1> <FormattedMessage id="xpack.security.loginPage.welcomeTitle" - defaultMessage="Welcome to Elastic Kibana" + defaultMessage="Welcome to Elastic" /> </h1> </EuiTitle> - <EuiText size="s" color="subdued" className="loginWelcome__subtitle"> - <p> - <FormattedMessage - id="xpack.security.loginPage.welcomeDescription" - defaultMessage="Your window into the Elastic Stack" - /> - </p> - </EuiText> <EuiSpacer size="xl" /> </div> </header> diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/field_rule_editor.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/field_rule_editor.tsx index 168c0e97d4f27..6022c836c6904 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/field_rule_editor.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/field_rule_editor.tsx @@ -151,7 +151,7 @@ export class FieldRuleEditor extends Component<Props, {}> { )} /> ) : ( - <EuiIcon size="l" type="empty" aria-hidden={true} /> + <EuiIcon size="l" type="empty" /> )} </EuiFormRow> </EuiFlexItem> diff --git a/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx b/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx index c1c6a9f69b6ec..ad69fa7ce0d3a 100644 --- a/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx +++ b/x-pack/plugins/security/public/nav_control/nav_control_component.test.tsx @@ -22,7 +22,7 @@ describe('SecurityNavControl', () => { const wrapper = shallowWithIntl(<SecurityNavControl {...props} />); const { button } = wrapper.find(EuiPopover).props(); expect(button).toMatchInlineSnapshot(` - <EuiHeaderSectionItemButton + <ForwardRef aria-controls="headerUserMenu" aria-expanded={false} aria-haspopup="true" @@ -33,7 +33,7 @@ describe('SecurityNavControl', () => { <EuiLoadingSpinner size="m" /> - </EuiHeaderSectionItemButton> + </ForwardRef> `); }); @@ -49,7 +49,7 @@ describe('SecurityNavControl', () => { wrapper.update(); const { button } = wrapper.find(EuiPopover).props(); expect(button).toMatchInlineSnapshot(` - <EuiHeaderSectionItemButton + <ForwardRef aria-controls="headerUserMenu" aria-expanded={false} aria-haspopup="true" @@ -61,7 +61,7 @@ describe('SecurityNavControl', () => { name="foo" size="s" /> - </EuiHeaderSectionItemButton> + </ForwardRef> `); }); diff --git a/x-pack/plugins/security/server/authentication/providers/base.ts b/x-pack/plugins/security/server/authentication/providers/base.ts index 48a73586a6fed..d2d2e82951a3e 100644 --- a/x-pack/plugins/security/server/authentication/providers/base.ts +++ b/x-pack/plugins/security/server/authentication/providers/base.ts @@ -11,7 +11,7 @@ import { IClusterClient, Headers, } from '../../../../../../src/core/server'; -import { deepFreeze } from '../../../../../../src/core/utils'; +import { deepFreeze } from '../../../../../../src/core/server'; import { AuthenticatedUser } from '../../../common/model'; import { AuthenticationResult } from '../authentication_result'; import { DeauthenticationResult } from '../deauthentication_result'; diff --git a/x-pack/plugins/security/server/plugin.ts b/x-pack/plugins/security/server/plugin.ts index 97f5aea888dc7..77a2d716e6d87 100644 --- a/x-pack/plugins/security/server/plugin.ts +++ b/x-pack/plugins/security/server/plugin.ts @@ -13,7 +13,7 @@ import { Logger, PluginInitializerContext, } from '../../../../src/core/server'; -import { deepFreeze } from '../../../../src/core/utils'; +import { deepFreeze } from '../../../../src/core/server'; import { SpacesPluginSetup } from '../../spaces/server'; import { PluginSetupContract as FeaturesSetupContract } from '../../features/server'; import { LicensingPluginSetup } from '../../licensing/server'; diff --git a/x-pack/plugins/siem/cypress/integration/timeline_data_providers.spec.ts b/x-pack/plugins/siem/cypress/integration/timeline_data_providers.spec.ts index 4889d40ae7d39..08eb3df57c7a0 100644 --- a/x-pack/plugins/siem/cypress/integration/timeline_data_providers.spec.ts +++ b/x-pack/plugins/siem/cypress/integration/timeline_data_providers.spec.ts @@ -49,7 +49,7 @@ describe('timeline data providers', () => { .first() .invoke('text') .should(hostname => { - expect(dataProviderText).to.eq(`host.name: "${hostname}"`); + expect(dataProviderText).to.eq(`host.name: "${hostname}"AND`); }); }); }); diff --git a/x-pack/plugins/siem/public/components/drag_and_drop/drag_drop_context_wrapper.tsx b/x-pack/plugins/siem/public/components/drag_and_drop/drag_drop_context_wrapper.tsx index 248ae671550ef..8e6743ad8f92e 100644 --- a/x-pack/plugins/siem/public/components/drag_and_drop/drag_drop_context_wrapper.tsx +++ b/x-pack/plugins/siem/public/components/drag_and_drop/drag_drop_context_wrapper.tsx @@ -12,9 +12,15 @@ import { Dispatch } from 'redux'; import { BeforeCapture } from './drag_drop_context'; import { BrowserFields } from '../../containers/source'; -import { dragAndDropModel, dragAndDropSelectors } from '../../store'; +import { dragAndDropModel, dragAndDropSelectors, timelineSelectors } from '../../store'; import { IdToDataProvider } from '../../store/drag_and_drop/model'; import { State } from '../../store/reducer'; +import { DataProvider } from '../timeline/data_providers/data_provider'; +import { reArrangeProviders } from '../timeline/data_providers/helpers'; +import { ACTIVE_TIMELINE_REDUX_ID } from '../top_n'; +import { ADDED_TO_TIMELINE_MESSAGE } from '../../hooks/translations'; +import { useAddToTimelineSensor } from '../../hooks/use_add_to_timeline'; +import { displaySuccessToast, useStateToaster } from '../toasters'; import { addFieldToTimelineColumns, @@ -23,8 +29,8 @@ import { IS_DRAGGING_CLASS_NAME, IS_TIMELINE_FIELD_DRAGGING_CLASS_NAME, providerWasDroppedOnTimeline, - providerWasDroppedOnTimelineButton, draggableIsField, + userIsReArrangingProviders, } from './helpers'; // @ts-ignore @@ -37,58 +43,92 @@ interface Props { } interface OnDragEndHandlerParams { + activeTimelineDataProviders: DataProvider[]; browserFields: BrowserFields; dataProviders: IdToDataProvider; dispatch: Dispatch; + onAddedToTimeline: (fieldOrValue: string) => void; result: DropResult; } const onDragEndHandler = ({ + activeTimelineDataProviders, browserFields, dataProviders, dispatch, + onAddedToTimeline, result, }: OnDragEndHandlerParams) => { - if (providerWasDroppedOnTimeline(result)) { - addProviderToTimeline({ dataProviders, result, dispatch }); - } else if (providerWasDroppedOnTimelineButton(result)) { - addProviderToTimeline({ dataProviders, result, dispatch }); + if (userIsReArrangingProviders(result)) { + reArrangeProviders({ + dataProviders: activeTimelineDataProviders, + destination: result.destination, + dispatch, + source: result.source, + timelineId: ACTIVE_TIMELINE_REDUX_ID, + }); + } else if (providerWasDroppedOnTimeline(result)) { + addProviderToTimeline({ + activeTimelineDataProviders, + dataProviders, + dispatch, + onAddedToTimeline, + result, + timelineId: ACTIVE_TIMELINE_REDUX_ID, + }); } else if (fieldWasDroppedOnTimelineColumns(result)) { - addFieldToTimelineColumns({ browserFields, dispatch, result }); + addFieldToTimelineColumns({ + browserFields, + dispatch, + result, + timelineId: ACTIVE_TIMELINE_REDUX_ID, + }); } }; +const sensors = [useAddToTimelineSensor]; + /** * DragDropContextWrapperComponent handles all drag end events */ export const DragDropContextWrapperComponent = React.memo<Props & PropsFromRedux>( - ({ browserFields, children, dataProviders, dispatch }) => { + ({ activeTimelineDataProviders, browserFields, children, dataProviders, dispatch }) => { + const [, dispatchToaster] = useStateToaster(); + const onAddedToTimeline = useCallback( + (fieldOrValue: string) => { + displaySuccessToast(ADDED_TO_TIMELINE_MESSAGE(fieldOrValue), dispatchToaster); + }, + [dispatchToaster] + ); + const onDragEnd = useCallback( (result: DropResult) => { - enableScrolling(); - - if (dataProviders != null) { - onDragEndHandler({ - browserFields, - result, - dataProviders, - dispatch, - }); - } - - if (!draggableIsField(result)) { + try { + enableScrolling(); + + if (dataProviders != null) { + onDragEndHandler({ + activeTimelineDataProviders, + browserFields, + dataProviders, + dispatch, + onAddedToTimeline, + result, + }); + } + } finally { document.body.classList.remove(IS_DRAGGING_CLASS_NAME); - } - if (draggableIsField(result)) { - document.body.classList.remove(IS_TIMELINE_FIELD_DRAGGING_CLASS_NAME); + if (draggableIsField(result)) { + document.body.classList.remove(IS_TIMELINE_FIELD_DRAGGING_CLASS_NAME); + } } }, - [browserFields, dataProviders] + [dataProviders, activeTimelineDataProviders, browserFields] ); return ( // @ts-ignore - <DragDropContext onDragEnd={onDragEnd} onBeforeCapture={onBeforeCapture}> + <DragDropContext onDragEnd={onDragEnd} onBeforeCapture={onBeforeCapture} sensors={sensors}> {children} </DragDropContext> ); @@ -96,7 +136,8 @@ export const DragDropContextWrapperComponent = React.memo<Props & PropsFromRedux (prevProps, nextProps) => { return ( prevProps.children === nextProps.children && - prevProps.dataProviders === nextProps.dataProviders + prevProps.dataProviders === nextProps.dataProviders && + prevProps.activeTimelineDataProviders === nextProps.activeTimelineDataProviders ); // prevent re-renders when data providers are added or removed, but all other props are the same } ); @@ -104,11 +145,15 @@ export const DragDropContextWrapperComponent = React.memo<Props & PropsFromRedux DragDropContextWrapperComponent.displayName = 'DragDropContextWrapperComponent'; const emptyDataProviders: dragAndDropModel.IdToDataProvider = {}; // stable reference +const emptyActiveTimelineDataProviders: DataProvider[] = []; // stable reference const mapStateToProps = (state: State) => { + const activeTimelineDataProviders = + timelineSelectors.getTimelineByIdSelector()(state, ACTIVE_TIMELINE_REDUX_ID)?.dataProviders ?? + emptyActiveTimelineDataProviders; const dataProviders = dragAndDropSelectors.dataProvidersSelector(state) ?? emptyDataProviders; - return { dataProviders }; + return { activeTimelineDataProviders, dataProviders }; }; const connector = connect(mapStateToProps); diff --git a/x-pack/plugins/siem/public/components/drag_and_drop/draggable_wrapper.tsx b/x-pack/plugins/siem/public/components/drag_and_drop/draggable_wrapper.tsx index c7da5b5c58951..5676c8fe5c30b 100644 --- a/x-pack/plugins/siem/public/components/drag_and_drop/draggable_wrapper.tsx +++ b/x-pack/plugins/siem/public/components/drag_and_drop/draggable_wrapper.tsx @@ -132,6 +132,7 @@ export const DraggableWrapper = React.memo<Props>( const hoverContent = useMemo( () => ( <DraggableWrapperHoverContent + draggableId={getDraggableId(dataProvider.id)} field={dataProvider.queryMatch.field} onFilterAdded={onFilterAdded} showTopN={showTopN} diff --git a/x-pack/plugins/siem/public/components/drag_and_drop/draggable_wrapper_hover_content.tsx b/x-pack/plugins/siem/public/components/drag_and_drop/draggable_wrapper_hover_content.tsx index 40725bea498f1..6976714cbe324 100644 --- a/x-pack/plugins/siem/public/components/drag_and_drop/draggable_wrapper_hover_content.tsx +++ b/x-pack/plugins/siem/public/components/drag_and_drop/draggable_wrapper_hover_content.tsx @@ -6,8 +6,10 @@ import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import React, { useCallback, useMemo } from 'react'; +import { DraggableId } from 'react-beautiful-dnd'; import { getAllFieldsByName, WithSource } from '../../containers/source'; +import { useAddToTimeline } from '../../hooks/use_add_to_timeline'; import { WithCopyToClipboard } from '../../lib/clipboard/with_copy_to_clipboard'; import { useKibana } from '../../lib/kibana'; import { createFilter } from '../page/add_filter_to_global_search_bar'; @@ -18,6 +20,7 @@ import { allowTopN } from './helpers'; import * as i18n from './translations'; interface Props { + draggableId?: DraggableId; field: string; onFilterAdded?: () => void; showTopN: boolean; @@ -26,12 +29,14 @@ interface Props { } const DraggableWrapperHoverContentComponent: React.FC<Props> = ({ + draggableId, field, onFilterAdded, showTopN, toggleTopN, value, }) => { + const startDragToTimeline = useAddToTimeline({ draggableId, fieldName: field }); const kibana = useKibana(); const { filterManager: timelineFilterManager } = useTimelineContext(); const filterManager = useMemo(() => kibana.services.data.query.filterManager, [ @@ -92,6 +97,18 @@ const DraggableWrapperHoverContentComponent: React.FC<Props> = ({ </EuiToolTip> )} + {!showTopN && value != null && draggableId != null && ( + <EuiToolTip content={i18n.ADD_TO_TIMELINE}> + <EuiButtonIcon + aria-label={i18n.ADD_TO_TIMELINE} + color="text" + data-test-subj="add-to-timeline" + iconType="timeline" + onClick={startDragToTimeline} + /> + </EuiToolTip> + )} + <WithSource sourceId="default"> {({ browserFields }) => ( <> diff --git a/x-pack/plugins/siem/public/components/drag_and_drop/helpers.test.ts b/x-pack/plugins/siem/public/components/drag_and_drop/helpers.test.ts index 753fa5b54eade..333875feae4d1 100644 --- a/x-pack/plugins/siem/public/components/drag_and_drop/helpers.test.ts +++ b/x-pack/plugins/siem/public/components/drag_and_drop/helpers.test.ts @@ -28,7 +28,6 @@ import { getDroppableId, getFieldIdFromDraggable, getProviderIdFromDraggable, - getTimelineIdFromDestination, providerWasDroppedOnTimeline, reasonIsDrop, sourceIsContent, @@ -381,100 +380,6 @@ describe('helpers', () => { }); }); - describe('#getTimelineIdFromDestination', () => { - test('it returns returns the timeline id from the destination when it is a provider', () => { - expect( - getTimelineIdFromDestination({ - destination: { - droppableId: DROPPABLE_ID_TIMELINE_PROVIDERS, - index: 0, - }, - draggableId: getDraggableId('685260508808089'), - reason: 'DROP', - source: { - droppableId: getDroppableId('685260508808089'), - index: 0, - }, - type: 'DEFAULT', - mode: 'FLUID', - }) - ).toEqual('timeline'); - }); - - test('it returns returns the timeline id from the destination when the destination is timeline columns', () => { - expect( - getTimelineIdFromDestination({ - destination: { - droppableId: DROPPABLE_ID_TIMELINE_COLUMNS, - index: 0, - }, - draggableId: getDraggableFieldId({ contextId: 'test', fieldId: 'event.action' }), - reason: 'DROP', - source: { - droppableId: 'fake.source.droppable.id', - index: 0, - }, - type: 'DEFAULT', - mode: 'FLUID', - }) - ).toEqual('timeline-1'); - }); - - test('it returns returns the timeline id from the destination when it is a button', () => { - expect( - getTimelineIdFromDestination({ - destination: { - droppableId: `${droppableTimelineFlyoutButtonPrefix}timeline`, - index: 0, - }, - draggableId: getDraggableId('685260508808089'), - reason: 'DROP', - source: { - droppableId: getDroppableId('685260508808089'), - index: 0, - }, - type: 'DEFAULT', - mode: 'FLUID', - }) - ).toEqual('timeline'); - }); - - test('it returns returns an empty string when the destination is undefined', () => { - expect( - getTimelineIdFromDestination({ - destination: undefined, - draggableId: `${draggableIdPrefix}.timeline.timeline.dataProvider.685260508808089`, - reason: 'DROP', - source: { - droppableId: `${droppableIdPrefix}.timelineProviders.timeline`, - index: 0, - }, - type: 'DEFAULT', - mode: 'FLUID', - }) - ).toEqual(''); - }); - - test('it returns returns an empty string when the destination is not a timeline', () => { - expect( - getTimelineIdFromDestination({ - destination: { - droppableId: `${droppableIdPrefix}.somewhere.else`, - index: 0, - }, - draggableId: getDraggableId('685260508808089'), - reason: 'DROP', - source: { - droppableId: getDroppableId('685260508808089'), - index: 0, - }, - type: 'DEFAULT', - mode: 'FLUID', - }) - ).toEqual(''); - }); - }); - describe('#getProviderIdFromDraggable', () => { test('it returns the expected id', () => { const id = getProviderIdFromDraggable({ diff --git a/x-pack/plugins/siem/public/components/drag_and_drop/helpers.ts b/x-pack/plugins/siem/public/components/drag_and_drop/helpers.ts index cd3d7cc68d537..9b37387ce076b 100644 --- a/x-pack/plugins/siem/public/components/drag_and_drop/helpers.ts +++ b/x-pack/plugins/siem/public/components/drag_and_drop/helpers.ts @@ -10,12 +10,12 @@ import { Dispatch } from 'redux'; import { ActionCreator } from 'typescript-fsa'; import { BrowserField, BrowserFields, getAllFieldsByName } from '../../containers/source'; +import { dragAndDropActions, timelineActions } from '../../store/actions'; import { IdToDataProvider } from '../../store/drag_and_drop/model'; import { ColumnHeaderOptions } from '../../store/timeline/model'; import { DEFAULT_COLUMN_MIN_WIDTH } from '../timeline/body/constants'; - import { DataProvider } from '../timeline/data_providers/data_provider'; -import { dragAndDropActions, timelineActions } from '../../store/actions'; +import { addContentToTimeline } from '../timeline/data_providers/helpers'; export const draggableIdPrefix = 'draggableId'; @@ -23,6 +23,8 @@ export const droppableIdPrefix = 'droppableId'; export const draggableContentPrefix = `${draggableIdPrefix}.content.`; +export const draggableTimelineProvidersPrefix = `${draggableIdPrefix}.timelineProviders.`; + export const draggableFieldPrefix = `${draggableIdPrefix}.field.`; export const droppableContentPrefix = `${droppableIdPrefix}.content.`; @@ -46,12 +48,43 @@ export const getDraggableFieldId = ({ fieldId: string; }): string => `${draggableFieldPrefix}${escapeContextId(contextId)}.${escapeFieldId(fieldId)}`; +export const getTimelineProviderDroppableId = ({ + groupIndex, + timelineId, +}: { + groupIndex: number; + timelineId: string; +}): string => `${droppableTimelineProvidersPrefix}${timelineId}.group.${groupIndex}`; + +export const getTimelineProviderDraggableId = ({ + dataProviderId, + groupIndex, + timelineId, +}: { + dataProviderId: string; + groupIndex: number; + timelineId: string; +}): string => + `${draggableTimelineProvidersPrefix}${timelineId}.group.${groupIndex}.${dataProviderId}`; + export const getDroppableId = (visualizationPlaceholderId: string): string => `${droppableContentPrefix}${visualizationPlaceholderId}`; export const sourceIsContent = (result: DropResult): boolean => result.source.droppableId.startsWith(droppableContentPrefix); +export const sourceAndDestinationAreSameTimelineProviders = (result: DropResult): boolean => { + const regex = /^droppableId\.timelineProviders\.(\S+)\./; + const sourceMatches = result.source.droppableId.match(regex) ?? []; + const destinationMatches = result.destination?.droppableId.match(regex) ?? []; + + return ( + sourceMatches.length >= 2 && + destinationMatches.length >= 2 && + sourceMatches[1] === destinationMatches[1] + ); +}; + export const draggableIsContent = (result: DropResult | { draggableId: string }): boolean => result.draggableId.startsWith(draggableContentPrefix); @@ -72,14 +105,6 @@ export const destinationIsTimelineButton = (result: DropResult): boolean => result.destination != null && result.destination.droppableId.startsWith(droppableTimelineFlyoutButtonPrefix); -export const getTimelineIdFromDestination = (result: DropResult): string => - result.destination != null && - (destinationIsTimelineProviders(result) || - destinationIsTimelineButton(result) || - destinationIsTimelineColumns(result)) - ? result.destination.droppableId.substring(result.destination.droppableId.lastIndexOf('.') + 1) - : ''; - export const getProviderIdFromDraggable = (result: DropResult): string => result.draggableId.substring(result.draggableId.lastIndexOf('.') + 1); @@ -100,26 +125,22 @@ export const providerWasDroppedOnTimeline = (result: DropResult): boolean => sourceIsContent(result) && destinationIsTimelineProviders(result); +export const userIsReArrangingProviders = (result: DropResult): boolean => + reasonIsDrop(result) && sourceAndDestinationAreSameTimelineProviders(result); + export const fieldWasDroppedOnTimelineColumns = (result: DropResult): boolean => reasonIsDrop(result) && draggableIsField(result) && destinationIsTimelineColumns(result); -export const providerWasDroppedOnTimelineButton = (result: DropResult): boolean => - reasonIsDrop(result) && - draggableIsContent(result) && - sourceIsContent(result) && - destinationIsTimelineButton(result); - interface AddProviderToTimelineParams { + activeTimelineDataProviders: DataProvider[]; dataProviders: IdToDataProvider; - result: DropResult; dispatch: Dispatch; - addProvider?: ActionCreator<{ - id: string; - provider: DataProvider; - }>; noProviderFound?: ActionCreator<{ id: string; }>; + onAddedToTimeline: (fieldOrValue: string) => void; + result: DropResult; + timelineId: string; } interface AddFieldToTimelineColumnsParams { @@ -131,21 +152,30 @@ interface AddFieldToTimelineColumnsParams { browserFields: BrowserFields; dispatch: Dispatch; result: DropResult; + timelineId: string; } export const addProviderToTimeline = ({ + activeTimelineDataProviders, dataProviders, - result, dispatch, - addProvider = timelineActions.addProvider, + result, + timelineId, noProviderFound = dragAndDropActions.noProviderFound, + onAddedToTimeline, }: AddProviderToTimelineParams): void => { - const timeline = getTimelineIdFromDestination(result); const providerId = getProviderIdFromDraggable(result); - const provider = dataProviders[providerId]; - - if (provider) { - dispatch(addProvider({ id: timeline, provider })); + const providerToAdd = dataProviders[providerId]; + + if (providerToAdd) { + addContentToTimeline({ + dataProviders: activeTimelineDataProviders, + destination: result.destination, + dispatch, + onAddedToTimeline, + providerToAdd, + timelineId, + }); } else { dispatch(noProviderFound({ id: providerId })); } @@ -156,8 +186,8 @@ export const addFieldToTimelineColumns = ({ browserFields, dispatch, result, + timelineId, }: AddFieldToTimelineColumnsParams): void => { - const timeline = getTimelineIdFromDestination(result); const fieldId = getFieldIdFromDraggable(result); const allColumns = getAllFieldsByName(browserFields); const column = allColumns[fieldId]; @@ -175,7 +205,7 @@ export const addFieldToTimelineColumns = ({ aggregatable: column.aggregatable, width: DEFAULT_COLUMN_MIN_WIDTH, }, - id: timeline, + id: timelineId, index: result.destination != null ? result.destination.index : 0, }) ); @@ -188,34 +218,13 @@ export const addFieldToTimelineColumns = ({ id: fieldId, width: DEFAULT_COLUMN_MIN_WIDTH, }, - id: timeline, + id: timelineId, index: result.destination != null ? result.destination.index : 0, }) ); } }; -interface ShowTimelineParams { - result: DropResult; - show: boolean; - dispatch: Dispatch; - showTimeline?: ActionCreator<{ - id: string; - show: boolean; - }>; -} - -export const updateShowTimeline = ({ - result, - show, - dispatch, - showTimeline = timelineActions.showTimeline, -}: ShowTimelineParams): void => { - const timeline = getTimelineIdFromDestination(result); - - dispatch(showTimeline({ id: timeline, show })); -}; - /** * Prevents fields from being dragged or dropped to any area other than column * header drop zone in the timeline diff --git a/x-pack/plugins/siem/public/components/drag_and_drop/translations.ts b/x-pack/plugins/siem/public/components/drag_and_drop/translations.ts index 61d036635a250..cbcb34bd9f75e 100644 --- a/x-pack/plugins/siem/public/components/drag_and_drop/translations.ts +++ b/x-pack/plugins/siem/public/components/drag_and_drop/translations.ts @@ -6,6 +6,10 @@ import { i18n } from '@kbn/i18n'; +export const ADD_TO_TIMELINE = i18n.translate('xpack.siem.dragAndDrop.addToTimeline', { + defaultMessage: 'Add to timeline investigation', +}); + export const COPY_TO_CLIPBOARD = i18n.translate('xpack.siem.dragAndDrop.copyToClipboardTooltip', { defaultMessage: 'Copy to Clipboard', }); diff --git a/x-pack/plugins/siem/public/components/flyout/button/index.tsx b/x-pack/plugins/siem/public/components/flyout/button/index.tsx index 6ec5912872467..d0debbca4dec3 100644 --- a/x-pack/plugins/siem/public/components/flyout/button/index.tsx +++ b/x-pack/plugins/siem/public/components/flyout/button/index.tsx @@ -4,67 +4,48 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiNotificationBadge, EuiIcon, EuiButton } from '@elastic/eui'; +import { noop } from 'lodash/fp'; +import { EuiButton, EuiNotificationBadge, EuiPanel } from '@elastic/eui'; import { rgba } from 'polished'; -import React from 'react'; +import React, { useMemo } from 'react'; import styled from 'styled-components'; -import { DroppableWrapper } from '../../drag_and_drop/droppable_wrapper'; -import { - droppableTimelineFlyoutButtonPrefix, - IS_DRAGGING_CLASS_NAME, -} from '../../drag_and_drop/helpers'; +import { WithSource } from '../../../containers/source'; +import { IS_DRAGGING_CLASS_NAME } from '../../drag_and_drop/helpers'; +import { DataProviders } from '../../timeline/data_providers'; import { DataProvider } from '../../timeline/data_providers/data_provider'; +import { flattenIntoAndGroups } from '../../timeline/data_providers/helpers'; import * as i18n from './translations'; -export const NOT_READY_TO_DROP_CLASS_NAME = 'not-ready-to-drop'; -export const READY_TO_DROP_CLASS_NAME = 'ready-to-drop'; +export const FLYOUT_BUTTON_CLASS_NAME = 'timeline-flyout-button'; + +export const getBadgeCount = (dataProviders: DataProvider[]): number => + flattenIntoAndGroups(dataProviders).reduce((total, group) => total + group.length, 0); + +const SHOW_HIDE_TRANSLATE_X = 497; // px const Container = styled.div` - overflow-x: auto; - overflow-y: hidden; padding-top: 8px; position: fixed; + right: 0px; top: 40%; - right: -51px; - z-index: ${({ theme }) => theme.eui.euiZLevel9}; - transform: rotate(-90deg); + transform: translateX(${SHOW_HIDE_TRANSLATE_X}px); user-select: none; + width: 500px; + z-index: ${({ theme }) => theme.eui.euiZLevel9}; - button { - border-radius: 4px 4px 0 0; - box-shadow: none; - height: 46px; - margin: 1px 0 1px 1px; - width: 136px; - } - - .euiButton:hover:not(:disabled) { + .${IS_DRAGGING_CLASS_NAME} & { transform: none; } - .euiButton--primary:enabled { - background: ${({ theme }) => theme.eui.euiColorEmptyShade}; - box-shadow: none; - } - - .euiButton--primary:enabled:hover, - .euiButton--primary:enabled:focus { - animation: none; - background: ${({ theme }) => theme.eui.euiColorEmptyShade}; + .${FLYOUT_BUTTON_CLASS_NAME} { + border-radius: 4px 4px 0 0; box-shadow: none; + height: 46px; } - .${IS_DRAGGING_CLASS_NAME} & .${NOT_READY_TO_DROP_CLASS_NAME} { - color: ${({ theme }) => theme.eui.euiColorSuccess}; - background: ${({ theme }) => rgba(theme.eui.euiColorSuccess, 0.1)} !important; - border: 1px solid ${({ theme }) => theme.eui.euiColorSuccess}; - border-bottom: none; - text-decoration: none; - } - - .${READY_TO_DROP_CLASS_NAME} { + .${IS_DRAGGING_CLASS_NAME} & .${FLYOUT_BUTTON_CLASS_NAME} { color: ${({ theme }) => theme.eui.euiColorSuccess}; background: ${({ theme }) => rgba(theme.eui.euiColorSuccess, 0.2)} !important; border: 1px solid ${({ theme }) => theme.eui.euiColorSuccess}; @@ -79,10 +60,21 @@ const BadgeButtonContainer = styled.div` align-items: flex-start; display: flex; flex-direction: row; + left: -87px; + position: absolute; + top: 34px; + transform: rotate(-90deg); `; BadgeButtonContainer.displayName = 'BadgeButtonContainer'; +const DataProvidersPanel = styled(EuiPanel)` + border-radius: 0; + padding: 0 4px 0 4px; + user-select: none; + z-index: ${({ theme }) => theme.eui.euiZLevel9}; +`; + interface FlyoutButtonProps { dataProviders: DataProvider[]; onOpen: () => void; @@ -91,57 +83,63 @@ interface FlyoutButtonProps { } export const FlyoutButton = React.memo<FlyoutButtonProps>( - ({ onOpen, show, dataProviders, timelineId }) => - show ? ( - <Container onClick={onOpen}> - <DroppableWrapper - data-test-subj="flyout-droppable-wrapper" - droppableId={`${droppableTimelineFlyoutButtonPrefix}${timelineId}`} - render={({ isDraggingOver }) => ( - <BadgeButtonContainer - className="flyout-overlay" - data-test-subj="flyoutOverlay" - onClick={onOpen} - > - {!isDraggingOver ? ( - <EuiButton - className={NOT_READY_TO_DROP_CLASS_NAME} - data-test-subj="flyout-button-not-ready-to-drop" - fill={false} - iconSide="right" - iconType="arrowUp" - > - {i18n.FLYOUT_BUTTON} - </EuiButton> - ) : ( - <EuiButton - className={READY_TO_DROP_CLASS_NAME} - data-test-subj="flyout-button-ready-to-drop" - fill={false} - > - <EuiIcon data-test-subj="flyout-button-plus-icon" type="plusInCircleFilled" /> - </EuiButton> - )} - - <EuiNotificationBadge - color="accent" - data-test-subj="badge" - style={{ - left: '-9px', - position: 'relative', - top: '-6px', - transform: 'rotate(90deg)', - visibility: dataProviders.length !== 0 ? 'inherit' : 'hidden', - zIndex: 10, - }} - > - {dataProviders.length} - </EuiNotificationBadge> - </BadgeButtonContainer> - )} - /> + ({ onOpen, show, dataProviders, timelineId }) => { + const badgeCount = useMemo(() => getBadgeCount(dataProviders), [dataProviders]); + + if (!show) { + return null; + } + + return ( + <Container> + <BadgeButtonContainer + className="flyout-overlay" + data-test-subj="flyoutOverlay" + onClick={onOpen} + > + <EuiButton + className={FLYOUT_BUTTON_CLASS_NAME} + data-test-subj="flyout-button-not-ready-to-drop" + fill={false} + iconSide="right" + iconType="arrowUp" + > + {i18n.FLYOUT_BUTTON} + </EuiButton> + <EuiNotificationBadge + color="accent" + data-test-subj="badge" + style={{ + left: '-9px', + position: 'relative', + top: '-6px', + transform: 'rotate(90deg)', + visibility: dataProviders.length !== 0 ? 'inherit' : 'hidden', + zIndex: 10, + }} + > + {badgeCount} + </EuiNotificationBadge> + </BadgeButtonContainer> + <DataProvidersPanel paddingSize="none"> + <WithSource sourceId="default"> + {({ browserFields }) => ( + <DataProviders + browserFields={browserFields} + id={timelineId} + dataProviders={dataProviders} + onDataProviderEdited={noop} + onDataProviderRemoved={noop} + onToggleDataProviderEnabled={noop} + onToggleDataProviderExcluded={noop} + show={show} + /> + )} + </WithSource> + </DataProvidersPanel> </Container> - ) : null, + ); + }, (prevProps, nextProps) => prevProps.show === nextProps.show && prevProps.dataProviders === nextProps.dataProviders && diff --git a/x-pack/plugins/siem/public/components/link_to/index.ts b/x-pack/plugins/siem/public/components/link_to/index.ts index a1c1f78e398e3..c35a60766d7bd 100644 --- a/x-pack/plugins/siem/public/components/link_to/index.ts +++ b/x-pack/plugins/siem/public/components/link_to/index.ts @@ -12,7 +12,11 @@ export { export { getOverviewUrl, RedirectToOverviewPage } from './redirect_to_overview'; export { getHostDetailsUrl, getHostsUrl } from './redirect_to_hosts'; export { getNetworkUrl, getIPDetailsUrl, RedirectToNetworkPage } from './redirect_to_network'; -export { getTimelinesUrl, RedirectToTimelinesPage } from './redirect_to_timelines'; +export { + getTimelinesUrl, + getTimelineTabsUrl, + RedirectToTimelinesPage, +} from './redirect_to_timelines'; export { getCaseDetailsUrl, getCaseUrl, diff --git a/x-pack/plugins/siem/public/components/link_to/link_to.tsx b/x-pack/plugins/siem/public/components/link_to/link_to.tsx index 08e4d1a3494e0..d3bf2e34b435b 100644 --- a/x-pack/plugins/siem/public/components/link_to/link_to.tsx +++ b/x-pack/plugins/siem/public/components/link_to/link_to.tsx @@ -26,6 +26,7 @@ import { RedirectToConfigureCasesPage, } from './redirect_to_case'; import { DetectionEngineTab } from '../../pages/detection_engine/types'; +import { TimelineType } from '../../../common/types/timeline'; interface LinkToPageProps { match: RouteMatch<{}>; @@ -112,8 +113,13 @@ export const LinkToPage = React.memo<LinkToPageProps>(({ match }) => ( /> <Route component={RedirectToTimelinesPage} + exact path={`${match.url}/:pageName(${SiemPageName.timelines})`} /> + <Route + component={RedirectToTimelinesPage} + path={`${match.url}/:pageName(${SiemPageName.timelines})/:tabName(${TimelineType.default}|${TimelineType.template})`} + /> <Redirect to="/" /> </Switch> )); diff --git a/x-pack/plugins/siem/public/components/link_to/redirect_to_timelines.tsx b/x-pack/plugins/siem/public/components/link_to/redirect_to_timelines.tsx index 27765a4125afc..9c704a7f70d29 100644 --- a/x-pack/plugins/siem/public/components/link_to/redirect_to_timelines.tsx +++ b/x-pack/plugins/siem/public/components/link_to/redirect_to_timelines.tsx @@ -11,14 +11,30 @@ import { SiemPageName } from '../../pages/home/types'; import { appendSearch } from './helpers'; import { RedirectWrapper } from './redirect_wrapper'; +import { TimelineTypeLiteral, TimelineType } from '../../../common/types/timeline'; export type TimelineComponentProps = RouteComponentProps<{ + tabName: TimelineTypeLiteral; search: string; }>; -export const RedirectToTimelinesPage = ({ location: { search } }: TimelineComponentProps) => ( - <RedirectWrapper to={`/${SiemPageName.timelines}${search}`} /> +export const RedirectToTimelinesPage = ({ + match: { + params: { tabName }, + }, + location: { search }, +}: TimelineComponentProps) => ( + <RedirectWrapper + to={ + tabName + ? `/${SiemPageName.timelines}/${tabName}${search}` + : `/${SiemPageName.timelines}/${TimelineType.default}${search}` + } + /> ); export const getTimelinesUrl = (search?: string) => `#/link-to/${SiemPageName.timelines}${appendSearch(search)}`; + +export const getTimelineTabsUrl = (tabName: TimelineTypeLiteral, search?: string) => + `#/link-to/${SiemPageName.timelines}/${tabName}${appendSearch(search)}`; diff --git a/x-pack/plugins/siem/public/components/navigation/breadcrumbs/index.test.ts b/x-pack/plugins/siem/public/components/navigation/breadcrumbs/index.test.ts index 7770780fb9613..2acae92c390dd 100644 --- a/x-pack/plugins/siem/public/components/navigation/breadcrumbs/index.test.ts +++ b/x-pack/plugins/siem/public/components/navigation/breadcrumbs/index.test.ts @@ -148,7 +148,7 @@ describe('Navigation Breadcrumbs', () => { ); expect(breadcrumbs).toEqual([ { text: 'SIEM', href: '#/link-to/overview' }, - { text: 'Timelines', href: '' }, + { text: 'Timelines', href: '#/link-to/timelines' }, ]); }); diff --git a/x-pack/plugins/siem/public/components/navigation/breadcrumbs/index.ts b/x-pack/plugins/siem/public/components/navigation/breadcrumbs/index.ts index 85d77485830a5..8abc099ee7f69 100644 --- a/x-pack/plugins/siem/public/components/navigation/breadcrumbs/index.ts +++ b/x-pack/plugins/siem/public/components/navigation/breadcrumbs/index.ts @@ -13,8 +13,14 @@ import { getBreadcrumbs as getHostDetailsBreadcrumbs } from '../../../pages/host import { getBreadcrumbs as getIPDetailsBreadcrumbs } from '../../../pages/network/ip_details'; import { getBreadcrumbs as getCaseDetailsBreadcrumbs } from '../../../pages/case/utils'; import { getBreadcrumbs as getDetectionRulesBreadcrumbs } from '../../../pages/detection_engine/rules/utils'; +import { getBreadcrumbs as getTimelinesBreadcrumbs } from '../../../pages/timelines'; import { SiemPageName } from '../../../pages/home/types'; -import { RouteSpyState, HostRouteSpyState, NetworkRouteSpyState } from '../../../utils/route/types'; +import { + RouteSpyState, + HostRouteSpyState, + NetworkRouteSpyState, + TimelineRouteSpyState, +} from '../../../utils/route/types'; import { getOverviewUrl } from '../../link_to'; import { TabNavigationProps } from '../tab_navigation/types'; @@ -44,6 +50,9 @@ const isNetworkRoutes = (spyState: RouteSpyState): spyState is NetworkRouteSpySt const isHostsRoutes = (spyState: RouteSpyState): spyState is HostRouteSpyState => spyState != null && spyState.pageName === SiemPageName.hosts; +const isTimelinesRoutes = (spyState: RouteSpyState): spyState is TimelineRouteSpyState => + spyState != null && spyState.pageName === SiemPageName.timelines; + const isCaseRoutes = (spyState: RouteSpyState): spyState is RouteSpyState => spyState != null && spyState.pageName === SiemPageName.case; @@ -124,6 +133,24 @@ export const getBreadcrumbsForRoute = ( ), ]; } + if (isTimelinesRoutes(spyState) && object.navTabs) { + const tempNav: SearchNavTab = { urlKey: 'timeline', isDetailPage: false }; + let urlStateKeys = [getOr(tempNav, spyState.pageName, object.navTabs)]; + if (spyState.tabName != null) { + urlStateKeys = [...urlStateKeys, getOr(tempNav, spyState.tabName, object.navTabs)]; + } + + return [ + ...siemRootBreadcrumb, + ...getTimelinesBreadcrumbs( + spyState, + urlStateKeys.reduce( + (acc: string[], item: SearchNavTab) => [...acc, getSearch(item, object)], + [] + ) + ), + ]; + } if ( spyState != null && object.navTabs && diff --git a/x-pack/plugins/siem/public/components/open_timeline/index.test.tsx b/x-pack/plugins/siem/public/components/open_timeline/index.test.tsx index ea28bc06ef915..731c6d1ca9806 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/index.test.tsx +++ b/x-pack/plugins/siem/public/components/open_timeline/index.test.tsx @@ -17,16 +17,28 @@ import { DEFAULT_SEARCH_RESULTS_PER_PAGE } from '../../pages/timelines/timelines import { NotePreviews } from './note_previews'; import { OPEN_TIMELINE_CLASS_NAME } from './helpers'; +import { TimelineTabsStyle } from './types'; + import { StatefulOpenTimeline } from '.'; import { useGetAllTimeline, getAllTimeline } from '../../containers/timeline/all'; jest.mock('../../lib/kibana'); jest.mock('../../containers/timeline/all', () => { const originalModule = jest.requireActual('../../containers/timeline/all'); return { + ...originalModule, useGetAllTimeline: jest.fn(), getAllTimeline: originalModule.getAllTimeline, }; }); +jest.mock('./use_timeline_types', () => { + return { + useTimelineTypes: jest.fn().mockReturnValue({ + timelineType: 'default', + timelineTabs: <div data-test-subj="timeline-tab" />, + timelineFilters: <div data-test-subj="timeline-filter" />, + }), + }; +}); describe('StatefulOpenTimeline', () => { const theme = () => ({ eui: euiDarkVars, darkMode: true }); @@ -489,33 +501,30 @@ describe('StatefulOpenTimeline', () => { .text() ).toEqual('elastic'); }); - }); - test('it renders the title', async () => { - const wrapper = mount( - <ThemeProvider theme={theme}> - <TestProviderWithoutDragAndDrop> - <MockedProvider mocks={mockOpenTimelineQueryResults} addTypename={false}> - <StatefulOpenTimeline - data-test-subj="stateful-timeline" - apolloClient={apolloClient} - isModal={false} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - title={title} - /> - </MockedProvider> - </TestProviderWithoutDragAndDrop> - </ThemeProvider> - ); + test('it renders the title', async () => { + const wrapper = mount( + <ThemeProvider theme={theme}> + <TestProviderWithoutDragAndDrop> + <MockedProvider mocks={mockOpenTimelineQueryResults} addTypename={false}> + <StatefulOpenTimeline + data-test-subj="stateful-timeline" + apolloClient={apolloClient} + isModal={false} + defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} + title={title} + /> + </MockedProvider> + </TestProviderWithoutDragAndDrop> + </ThemeProvider> + ); - await wait(); + await wait(); - expect( - wrapper - .find('[data-test-subj="header-section-title"]') - .first() - .text() - ).toEqual(title); + expect(wrapper.find(`[data-test-subj="timeline-${TimelineTabsStyle.tab}"]`).exists()).toEqual( + true + ); + }); }); describe('#resetSelectionState', () => { diff --git a/x-pack/plugins/siem/public/components/open_timeline/index.tsx b/x-pack/plugins/siem/public/components/open_timeline/index.tsx index d26d02780ffba..ed22673f07a78 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/index.tsx +++ b/x-pack/plugins/siem/public/components/open_timeline/index.tsx @@ -9,6 +9,7 @@ import React, { useEffect, useState, useCallback } from 'react'; import { connect, ConnectedProps } from 'react-redux'; import { Dispatch } from 'redux'; + import { defaultHeaders } from '../../components/timeline/body/column_headers/default_headers'; import { deleteTimelineMutation } from '../../containers/timeline/delete/persist.gql_query'; import { useGetAllTimeline } from '../../containers/timeline/all'; @@ -40,6 +41,7 @@ import { OnDeleteOneTimeline, } from './types'; import { DEFAULT_SORT_FIELD, DEFAULT_SORT_DIRECTION } from './constants'; +import { useTimelineTypes } from './use_timeline_types'; interface OwnProps<TCache = object> { apolloClient: ApolloClient<TCache>; @@ -103,7 +105,21 @@ export const StatefulOpenTimelineComponent = React.memo<OpenTimelineOwnProps>( /** The requested field to sort on */ const [sortField, setSortField] = useState(DEFAULT_SORT_FIELD); - const { fetchAllTimeline, timelines, loading, totalCount, refetch } = useGetAllTimeline(); + const { timelineType, timelineTabs, timelineFilters } = useTimelineTypes(); + const { fetchAllTimeline, timelines, loading, totalCount } = useGetAllTimeline(); + + const refetch = useCallback(() => { + fetchAllTimeline({ + pageInfo: { + pageIndex: pageIndex + 1, + pageSize, + }, + search, + sort: { sortField: sortField as SortFieldTimeline, sortOrder: sortDirection as Direction }, + onlyUserFavorite: onlyFavorites, + timelineType, + }); + }, [pageIndex, pageSize, search, sortField, sortDirection, timelineType, onlyFavorites]); /** Invoked when the user presses enters to submit the text in the search input */ const onQueryChange: OnQueryChange = useCallback((query: EuiSearchBarQuery) => { @@ -139,6 +155,7 @@ export const StatefulOpenTimelineComponent = React.memo<OpenTimelineOwnProps>( if (timelineIds.includes(timeline.savedObjectId || '')) { createNewTimeline({ id: 'timeline-1', columns: defaultHeaders, show: false }); } + await apolloClient.mutate< DeleteTimelineMutation.Mutation, DeleteTimelineMutation.Variables @@ -229,27 +246,8 @@ export const StatefulOpenTimelineComponent = React.memo<OpenTimelineOwnProps>( }, []); useEffect(() => { - fetchAllTimeline({ - pageInfo: { - pageIndex: pageIndex + 1, - pageSize, - }, - search, - sort: { sortField: sortField as SortFieldTimeline, sortOrder: sortDirection as Direction }, - onlyUserFavorite: onlyFavorites, - timelines, - totalCount, - }); - }, [ - pageIndex, - pageSize, - search, - sortField, - sortDirection, - timelines, - totalCount, - onlyFavorites, - ]); + refetch(); + }, [refetch]); return !isModal ? ( <OpenTimeline @@ -277,6 +275,7 @@ export const StatefulOpenTimelineComponent = React.memo<OpenTimelineOwnProps>( selectedItems={selectedItems} sortDirection={sortDirection} sortField={sortField} + tabs={timelineTabs} title={title} totalSearchResultsCount={totalCount} /> @@ -303,6 +302,7 @@ export const StatefulOpenTimelineComponent = React.memo<OpenTimelineOwnProps>( selectedItems={selectedItems} sortDirection={sortDirection} sortField={sortField} + tabs={timelineFilters} title={title} totalSearchResultsCount={totalCount} /> diff --git a/x-pack/plugins/siem/public/components/open_timeline/open_timeline.test.tsx b/x-pack/plugins/siem/public/components/open_timeline/open_timeline.test.tsx index e010d54d711c3..449e1b169cea6 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/open_timeline.test.tsx +++ b/x-pack/plugins/siem/public/components/open_timeline/open_timeline.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { ThemeProvider } from 'styled-components'; import { DEFAULT_SEARCH_RESULTS_PER_PAGE } from '../../pages/timelines/timelines_page'; -import { OpenTimelineResult } from './types'; +import { OpenTimelineResult, OpenTimelineProps } from './types'; import { TimelinesTableProps } from './timelines_table'; import { mockTimelineResults } from '../../mock/timeline_results'; import { OpenTimeline } from './open_timeline'; @@ -25,75 +25,41 @@ describe('OpenTimeline', () => { let mockResults: OpenTimelineResult[]; - beforeEach(() => { - mockResults = cloneDeep(mockTimelineResults); + const getDefaultTestProps = (mockSearchResults: OpenTimelineResult[]): OpenTimelineProps => ({ + deleteTimelines: jest.fn(), + defaultPageSize: DEFAULT_SEARCH_RESULTS_PER_PAGE, + isLoading: false, + itemIdToExpandedNotesRowMap: {}, + onAddTimelinesToFavorites: jest.fn(), + onDeleteSelected: jest.fn(), + onlyFavorites: false, + onOpenTimeline: jest.fn(), + onQueryChange: jest.fn(), + onSelectionChange: jest.fn(), + onTableChange: jest.fn(), + onToggleOnlyFavorites: jest.fn(), + onToggleShowNotes: jest.fn(), + pageIndex: 0, + pageSize: DEFAULT_SEARCH_RESULTS_PER_PAGE, + query: '', + searchResults: mockSearchResults, + selectedItems: [], + sortDirection: DEFAULT_SORT_DIRECTION, + sortField: DEFAULT_SORT_FIELD, + tabs: <div />, + title, + totalSearchResultsCount: mockSearchResults.length, }); - test('it renders the title row', () => { - const wrapper = mountWithIntl( - <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> - </ThemeProvider> - ); - - expect( - wrapper - .find('[data-test-subj="title-row"]') - .first() - .exists() - ).toBe(true); + beforeEach(() => { + mockResults = cloneDeep(mockTimelineResults); }); test('it renders the search row', () => { + const defaultProps = getDefaultTestProps(mockResults); const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -106,32 +72,10 @@ describe('OpenTimeline', () => { }); test('it renders the timelines table', () => { + const defaultProps = getDefaultTestProps(mockResults); const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -144,32 +88,10 @@ describe('OpenTimeline', () => { }); test('it shows the delete action columns when onDeleteSelected and deleteTimelines are specified', () => { + const defaultProps = getDefaultTestProps(mockResults); const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -182,31 +104,14 @@ describe('OpenTimeline', () => { }); test('it does NOT show the delete action columns when is onDeleteSelected undefined and deleteTimelines is specified', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + onDeleteSelected: undefined, + deleteTimelines: undefined, + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -219,31 +124,14 @@ describe('OpenTimeline', () => { }); test('it does NOT show the delete action columns when is onDeleteSelected provided and deleteTimelines is undefined', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + onDeleteSelected: undefined, + deleteTimelines: undefined, + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -256,30 +144,14 @@ describe('OpenTimeline', () => { }); test('it does NOT show the delete action when both onDeleteSelected and deleteTimelines are undefined', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + onDeleteSelected: undefined, + deleteTimelines: undefined, + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -292,32 +164,13 @@ describe('OpenTimeline', () => { }); test('it renders an empty string when the query is an empty string', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + query: '', + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -330,32 +183,13 @@ describe('OpenTimeline', () => { }); test('it renders the expected message when the query just has spaces', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + query: ' ', + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={' '} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -368,32 +202,13 @@ describe('OpenTimeline', () => { }); test('it echos the query when the query has non-whitespace characters', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + query: 'Would you like to go to Denver?', + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query="Would you like to go to Denver?" - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -406,32 +221,13 @@ describe('OpenTimeline', () => { }); test('trims whitespace from the ends of the query', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + query: ' Is it starting to feel cramped in here? ', + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query=" Is it starting to feel cramped in here? " - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -444,32 +240,13 @@ describe('OpenTimeline', () => { }); test('it renders the expected message when the query is an empty string', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + query: '', + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query="" - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -482,32 +259,13 @@ describe('OpenTimeline', () => { }); test('it renders the expected message when the query just has whitespace', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + query: ' ', + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query=" " - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); @@ -520,32 +278,13 @@ describe('OpenTimeline', () => { }); test('it includes the word "with" when the query has non-whitespace characters', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + query: 'How was your day?', + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimeline - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query="How was your day?" - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimeline {...defaultProps} /> </ThemeProvider> ); diff --git a/x-pack/plugins/siem/public/components/open_timeline/open_timeline.tsx b/x-pack/plugins/siem/public/components/open_timeline/open_timeline.tsx index 26aeab87e3510..e172a006abe4b 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/open_timeline.tsx +++ b/x-pack/plugins/siem/public/components/open_timeline/open_timeline.tsx @@ -11,7 +11,6 @@ import { OPEN_TIMELINE_CLASS_NAME } from './helpers'; import { OpenTimelineProps, OpenTimelineResult } from './types'; import { SearchRow } from './search_row'; import { TimelinesTable } from './timelines_table'; -import { TitleRow } from './title_row'; import { ImportDataModal } from '../import_data_modal'; import * as i18n from './translations'; import { importTimelines } from '../../containers/timeline/api'; @@ -52,7 +51,7 @@ export const OpenTimeline = React.memo<OpenTimelineProps>( sortDirection, setImportDataModalToggle, sortField, - title, + tabs, totalSearchResultsCount, }) => { const tableRef = useRef<EuiBasicTable<OpenTimelineResult>>(); @@ -98,9 +97,9 @@ export const OpenTimeline = React.memo<OpenTimelineProps>( const onRefreshBtnClick = useCallback(() => { if (refetch != null) { - refetch(); + refetch(searchResults, totalSearchResultsCount); } - }, [refetch]); + }, [refetch, searchResults, totalSearchResultsCount]); const handleCloseModal = useCallback(() => { if (setImportDataModalToggle != null) { @@ -112,9 +111,9 @@ export const OpenTimeline = React.memo<OpenTimelineProps>( setImportDataModalToggle(false); } if (refetch != null) { - refetch(); + refetch(searchResults, totalSearchResultsCount); } - }, [setImportDataModalToggle, refetch]); + }, [setImportDataModalToggle, refetch, searchResults, totalSearchResultsCount]); return ( <> @@ -143,21 +142,15 @@ export const OpenTimeline = React.memo<OpenTimelineProps>( /> <EuiPanel className={OPEN_TIMELINE_CLASS_NAME}> - <TitleRow - data-test-subj="title-row" - onAddTimelinesToFavorites={onAddTimelinesToFavorites} - selectedTimelinesCount={selectedItems.length} - title={title} - > - <SearchRow - data-test-subj="search-row" - onlyFavorites={onlyFavorites} - onQueryChange={onQueryChange} - onToggleOnlyFavorites={onToggleOnlyFavorites} - query={query} - totalSearchResultsCount={totalSearchResultsCount} - /> - </TitleRow> + {tabs} + <SearchRow + data-test-subj="search-row" + onlyFavorites={onlyFavorites} + onQueryChange={onQueryChange} + onToggleOnlyFavorites={onToggleOnlyFavorites} + query={query} + totalSearchResultsCount={totalSearchResultsCount} + /> <UtilityBar border> <UtilityBarSection> diff --git a/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/index.test.tsx b/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/index.test.tsx index 46a0d46c1e0d1..178c69e6957e1 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/index.test.tsx +++ b/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/index.test.tsx @@ -28,6 +28,15 @@ jest.mock('../../../containers/timeline/all', () => { getAllTimeline: originalModule.getAllTimeline, }; }); +jest.mock('../use_timeline_types', () => { + return { + useTimelineTypes: jest.fn().mockReturnValue({ + timelineType: 'default', + timelineTabs: <div />, + timelineFilters: <div />, + }), + }; +}); describe('OpenTimelineModal', () => { const theme = () => ({ eui: euiDarkVars, darkMode: true }); diff --git a/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx b/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx index 2c3adb138b7ac..a610884d287a6 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx +++ b/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { ThemeProvider } from 'styled-components'; import { DEFAULT_SEARCH_RESULTS_PER_PAGE } from '../../../pages/timelines/timelines_page'; -import { OpenTimelineResult } from '../types'; +import { OpenTimelineResult, OpenTimelineProps } from '../types'; import { TimelinesTableProps } from '../timelines_table'; import { mockTimelineResults } from '../../../mock/timeline_results'; import { OpenTimelineModalBody } from './open_timeline_modal_body'; @@ -22,40 +22,43 @@ jest.mock('../../../lib/kibana'); describe('OpenTimelineModal', () => { const theme = () => ({ eui: euiDarkVars, darkMode: true }); const title = 'All Timelines / Open Timelines'; - let mockResults: OpenTimelineResult[]; + const getDefaultTestProps = (mockSearchResults: OpenTimelineResult[]): OpenTimelineProps => ({ + deleteTimelines: jest.fn(), + defaultPageSize: DEFAULT_SEARCH_RESULTS_PER_PAGE, + isLoading: false, + itemIdToExpandedNotesRowMap: {}, + onAddTimelinesToFavorites: jest.fn(), + onDeleteSelected: jest.fn(), + onlyFavorites: false, + onOpenTimeline: jest.fn(), + onQueryChange: jest.fn(), + onSelectionChange: jest.fn(), + onTableChange: jest.fn(), + onToggleOnlyFavorites: jest.fn(), + onToggleShowNotes: jest.fn(), + pageIndex: 0, + pageSize: DEFAULT_SEARCH_RESULTS_PER_PAGE, + query: '', + searchResults: mockSearchResults, + selectedItems: [], + sortDirection: DEFAULT_SORT_DIRECTION, + sortField: DEFAULT_SORT_FIELD, + tabs: <div />, + title, + totalSearchResultsCount: mockSearchResults.length, + }); + beforeEach(() => { mockResults = cloneDeep(mockTimelineResults); }); test('it renders the title row', () => { + const defaultProps = getDefaultTestProps(mockResults); const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimelineModalBody - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimelineModalBody {...defaultProps} /> </ThemeProvider> ); @@ -68,32 +71,10 @@ describe('OpenTimelineModal', () => { }); test('it renders the search row', () => { + const defaultProps = getDefaultTestProps(mockResults); const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimelineModalBody - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimelineModalBody {...defaultProps} /> </ThemeProvider> ); @@ -106,32 +87,10 @@ describe('OpenTimelineModal', () => { }); test('it renders the timelines table', () => { + const defaultProps = getDefaultTestProps(mockResults); const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimelineModalBody - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimelineModalBody {...defaultProps} /> </ThemeProvider> ); @@ -144,32 +103,14 @@ describe('OpenTimelineModal', () => { }); test('it shows the delete action when onDeleteSelected and deleteTimelines are specified', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + onDeleteSelected: jest.fn(), + deleteTimelines: jest.fn(), + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimelineModalBody - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimelineModalBody {...defaultProps} /> </ThemeProvider> ); @@ -182,31 +123,14 @@ describe('OpenTimelineModal', () => { }); test('it does NOT show the delete when is onDeleteSelected undefined and deleteTimelines is specified', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + onDeleteSelected: undefined, + deleteTimelines: undefined, + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimelineModalBody - deleteTimelines={jest.fn()} - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleShowNotes={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimelineModalBody {...defaultProps} /> </ThemeProvider> ); @@ -219,31 +143,14 @@ describe('OpenTimelineModal', () => { }); test('it does NOT show the delete action when is onDeleteSelected provided and deleteTimelines is undefined', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + onDeleteSelected: undefined, + deleteTimelines: undefined, + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimelineModalBody - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onDeleteSelected={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimelineModalBody {...defaultProps} /> </ThemeProvider> ); @@ -256,30 +163,14 @@ describe('OpenTimelineModal', () => { }); test('it does NOT show extended columns when both onDeleteSelected and deleteTimelines are undefined', () => { + const defaultProps = { + ...getDefaultTestProps(mockResults), + onDeleteSelected: undefined, + deleteTimelines: undefined, + }; const wrapper = mountWithIntl( <ThemeProvider theme={theme}> - <OpenTimelineModalBody - defaultPageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - isLoading={false} - itemIdToExpandedNotesRowMap={{}} - onAddTimelinesToFavorites={jest.fn()} - onlyFavorites={false} - onOpenTimeline={jest.fn()} - onQueryChange={jest.fn()} - onSelectionChange={jest.fn()} - onTableChange={jest.fn()} - onToggleOnlyFavorites={jest.fn()} - onToggleShowNotes={jest.fn()} - pageIndex={0} - pageSize={DEFAULT_SEARCH_RESULTS_PER_PAGE} - query={''} - searchResults={mockResults} - selectedItems={[]} - sortDirection={DEFAULT_SORT_DIRECTION} - sortField={DEFAULT_SORT_FIELD} - title={title} - totalSearchResultsCount={mockResults.length} - /> + <OpenTimelineModalBody {...defaultProps} /> </ThemeProvider> ); diff --git a/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/open_timeline_modal_body.tsx b/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/open_timeline_modal_body.tsx index 60ebf2118d556..ebfd01274ab41 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/open_timeline_modal_body.tsx +++ b/x-pack/plugins/siem/public/components/open_timeline/open_timeline_modal/open_timeline_modal_body.tsx @@ -42,6 +42,7 @@ export const OpenTimelineModalBody = memo<OpenTimelineProps>( selectedItems, sortDirection, sortField, + tabs, title, totalSearchResultsCount, }) => { @@ -52,6 +53,7 @@ export const OpenTimelineModalBody = memo<OpenTimelineProps>( : ['duplicate']; return actions.filter(action => !hideActions.includes(action)); }, [onDeleteSelected, deleteTimelines, hideActions]); + return ( <> <EuiModalHeader> @@ -62,15 +64,17 @@ export const OpenTimelineModalBody = memo<OpenTimelineProps>( selectedTimelinesCount={selectedItems.length} title={title} /> - - <SearchRow - data-test-subj="search-row" - onlyFavorites={onlyFavorites} - onQueryChange={onQueryChange} - onToggleOnlyFavorites={onToggleOnlyFavorites} - query={query} - totalSearchResultsCount={totalSearchResultsCount} - /> + <> + <SearchRow + data-test-subj="search-row" + onlyFavorites={onlyFavorites} + onQueryChange={onQueryChange} + onToggleOnlyFavorites={onToggleOnlyFavorites} + query={query} + tabs={tabs} + totalSearchResultsCount={totalSearchResultsCount} + /> + </> </HeaderContainer> </EuiModalHeader> diff --git a/x-pack/plugins/siem/public/components/open_timeline/search_row/index.tsx b/x-pack/plugins/siem/public/components/open_timeline/search_row/index.tsx index 55fce1f1c1ed0..b05be6b44418a 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/search_row/index.tsx +++ b/x-pack/plugins/siem/public/components/open_timeline/search_row/index.tsx @@ -35,7 +35,7 @@ SearchRowFlexGroup.displayName = 'SearchRowFlexGroup'; type Props = Pick< OpenTimelineProps, 'onlyFavorites' | 'onQueryChange' | 'onToggleOnlyFavorites' | 'query' | 'totalSearchResultsCount' ->; +> & { tabs?: JSX.Element }; const searchBox = { placeholder: i18n.SEARCH_PLACEHOLDER, @@ -46,7 +46,14 @@ const searchBox = { * Renders the row containing the search input and Only Favorites filter */ export const SearchRow = React.memo<Props>( - ({ onlyFavorites, onQueryChange, onToggleOnlyFavorites, query, totalSearchResultsCount }) => { + ({ + onlyFavorites, + onQueryChange, + onToggleOnlyFavorites, + query, + totalSearchResultsCount, + tabs, + }) => { return ( <SearchRowContainer> <SearchRowFlexGroup gutterSize="s"> @@ -55,14 +62,17 @@ export const SearchRow = React.memo<Props>( </EuiFlexItem> <EuiFlexItem grow={false}> - <EuiFilterGroup> - <EuiFilterButton - data-test-subj="only-favorites-toggle" - hasActiveFilters={onlyFavorites} - onClick={onToggleOnlyFavorites} - > - {i18n.ONLY_FAVORITES} - </EuiFilterButton> + <EuiFilterGroup fullWidth={true}> + <> + <EuiFilterButton + data-test-subj="only-favorites-toggle" + hasActiveFilters={onlyFavorites} + onClick={onToggleOnlyFavorites} + > + {i18n.ONLY_FAVORITES} + </EuiFilterButton> + {tabs} + </> </EuiFilterGroup> </EuiFlexItem> </SearchRowFlexGroup> diff --git a/x-pack/plugins/siem/public/components/open_timeline/translations.ts b/x-pack/plugins/siem/public/components/open_timeline/translations.ts index 7914e368166db..80c044c0a1d9f 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/translations.ts +++ b/x-pack/plugins/siem/public/components/open_timeline/translations.ts @@ -146,6 +146,20 @@ export const SUCCESSFULLY_EXPORTED_TIMELINES = (totalTimelines: number) => 'Successfully exported {totalTimelines, plural, =0 {all timelines} =1 {{totalTimelines} timeline} other {{totalTimelines} timelines}}', }); +export const FILTER_TIMELINES = (timelineType: string) => + i18n.translate('xpack.siem.open.timeline.filterByTimelineTypesTitle', { + values: { timelineType }, + defaultMessage: 'Only {timelineType}', + }); + +export const TAB_TIMELINES = i18n.translate('xpack.siem.timelines.components.tabs.timelinesTitle', { + defaultMessage: 'Timelines', +}); + +export const TAB_TEMPLATES = i18n.translate('xpack.siem.timelines.components.tabs.templatesTitle', { + defaultMessage: 'Templates', +}); + export const IMPORT_TIMELINE_BTN_TITLE = i18n.translate( 'xpack.siem.timelines.components.importTimelineModal.importTimelineTitle', { diff --git a/x-pack/plugins/siem/public/components/open_timeline/types.ts b/x-pack/plugins/siem/public/components/open_timeline/types.ts index 41999c6249277..4d953f6fa775e 100644 --- a/x-pack/plugins/siem/public/components/open_timeline/types.ts +++ b/x-pack/plugins/siem/public/components/open_timeline/types.ts @@ -8,8 +8,7 @@ import { SetStateAction, Dispatch } from 'react'; import { AllTimelinesVariables } from '../../containers/timeline/all'; import { TimelineModel } from '../../store/timeline/model'; import { NoteResult } from '../../graphql/types'; -import { Refetch } from '../../store/inputs/model'; -import { TimelineType } from '../../../common/types/timeline'; +import { TimelineType, TimelineTypeLiteral } from '../../../common/types/timeline'; /** The users who added a timeline to favorites */ export interface FavoriteTimelineResult { @@ -150,7 +149,7 @@ export interface OpenTimelineProps { /** The currently applied search criteria */ query: string; /** Refetch table */ - refetch?: Refetch; + refetch?: (existingTimeline?: OpenTimelineResult[], existingCount?: number) => void; /** The results of executing a search */ searchResults: OpenTimelineResult[]; /** the currently-selected timelines in the table */ @@ -161,6 +160,8 @@ export interface OpenTimelineProps { sortDirection: 'asc' | 'desc'; /** the requested field to sort on */ sortField: string; + /** timeline / template timeline */ + tabs: JSX.Element; /** The title of the Open Timeline component */ title: string; /** The total (server-side) count of the search results */ @@ -188,3 +189,15 @@ export type DispatchUpdateTimeline = ({ to, ruleNote, }: UpdateTimeline) => () => void; + +export enum TimelineTabsStyle { + tab = 'tab', + filter = 'filter', +} + +export interface TimelineTab { + id: TimelineTypeLiteral; + name: string; + disabled: boolean; + href: string; +} diff --git a/x-pack/plugins/siem/public/components/open_timeline/use_timeline_types.tsx b/x-pack/plugins/siem/public/components/open_timeline/use_timeline_types.tsx new file mode 100644 index 0000000000000..1e23bc5bdda3c --- /dev/null +++ b/x-pack/plugins/siem/public/components/open_timeline/use_timeline_types.tsx @@ -0,0 +1,106 @@ +/* + * 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. + */ +import React, { useState, useCallback, useMemo } from 'react'; +import { useParams } from 'react-router-dom'; +import { EuiTabs, EuiTab, EuiSpacer, EuiFilterButton } from '@elastic/eui'; + +import { TimelineTypeLiteralWithNull, TimelineType } from '../../../common/types/timeline'; + +import { getTimelineTabsUrl } from '../link_to'; +import { useGetUrlSearch } from '../navigation/use_get_url_search'; +import { navTabs } from '../../pages/home/home_navigations'; + +import * as i18n from './translations'; +import { TimelineTabsStyle, TimelineTab } from './types'; + +export const useTimelineTypes = (): { + timelineType: TimelineTypeLiteralWithNull; + timelineTabs: JSX.Element; + timelineFilters: JSX.Element; +} => { + const urlSearch = useGetUrlSearch(navTabs.timelines); + const { tabName } = useParams<{ pageName: string; tabName: string }>(); + const [timelineType, setTimelineTypes] = useState<TimelineTypeLiteralWithNull>( + tabName === TimelineType.default || tabName === TimelineType.template ? tabName : null + ); + + const getFilterOrTabs: (timelineTabsStyle: TimelineTabsStyle) => TimelineTab[] = ( + timelineTabsStyle: TimelineTabsStyle + ) => [ + { + id: TimelineType.default, + name: + timelineTabsStyle === TimelineTabsStyle.filter + ? i18n.FILTER_TIMELINES(i18n.TAB_TIMELINES) + : i18n.TAB_TIMELINES, + href: getTimelineTabsUrl(TimelineType.default, urlSearch), + disabled: false, + }, + { + id: TimelineType.template, + name: + timelineTabsStyle === TimelineTabsStyle.filter + ? i18n.FILTER_TIMELINES(i18n.TAB_TEMPLATES) + : i18n.TAB_TEMPLATES, + href: getTimelineTabsUrl(TimelineType.template, urlSearch), + disabled: false, + }, + ]; + + const onFilterClicked = useCallback( + (timelineTabsStyle, tabId) => { + if (timelineTabsStyle === TimelineTabsStyle.filter && tabId === timelineType) { + setTimelineTypes(null); + } else { + setTimelineTypes(tabId); + } + }, + [timelineType, setTimelineTypes] + ); + + const timelineTabs = useMemo(() => { + return ( + <> + <EuiTabs> + {getFilterOrTabs(TimelineTabsStyle.tab).map((tab: TimelineTab) => ( + <EuiTab + isSelected={tab.id === tabName} + disabled={tab.disabled} + key={`timeline-${TimelineTabsStyle.tab}-${tab.id}`} + href={tab.href} + onClick={onFilterClicked.bind(null, TimelineTabsStyle.tab, tab.id)} + > + {tab.name} + </EuiTab> + ))} + </EuiTabs> + <EuiSpacer size="m" /> + </> + ); + }, [tabName]); + + const timelineFilters = useMemo(() => { + return ( + <> + {getFilterOrTabs(TimelineTabsStyle.tab).map((tab: TimelineTab) => ( + <EuiFilterButton + hasActiveFilters={tab.id === timelineType} + key={`timeline-${TimelineTabsStyle.filter}-${tab.id}`} + onClick={onFilterClicked.bind(null, TimelineTabsStyle.filter, tab.id)} + > + {tab.name} + </EuiFilterButton> + ))} + </> + ); + }, [timelineType]); + + return { + timelineType, + timelineTabs, + timelineFilters, + }; +}; diff --git a/x-pack/plugins/siem/public/components/recent_timelines/index.tsx b/x-pack/plugins/siem/public/components/recent_timelines/index.tsx index b641038f35ba6..d3532d9fd1025 100644 --- a/x-pack/plugins/siem/public/components/recent_timelines/index.tsx +++ b/x-pack/plugins/siem/public/components/recent_timelines/index.tsx @@ -10,6 +10,8 @@ import React, { useCallback, useMemo, useEffect } from 'react'; import { connect, ConnectedProps } from 'react-redux'; import { Dispatch } from 'redux'; +import { TimelineType } from '../../../common/types/timeline'; + import { useGetAllTimeline } from '../../containers/timeline/all'; import { SortFieldTimeline, Direction } from '../../graphql/types'; import { queryTimelineById, dispatchUpdateTimeline } from '../open_timeline/helpers'; @@ -62,7 +64,7 @@ const StatefulRecentTimelinesComponent = React.memo<Props>( [filterBy] ); - const { fetchAllTimeline, timelines, totalCount, loading } = useGetAllTimeline(); + const { fetchAllTimeline, timelines, loading } = useGetAllTimeline(); useEffect(() => { fetchAllTimeline({ @@ -76,10 +78,9 @@ const StatefulRecentTimelinesComponent = React.memo<Props>( sortOrder: Direction.desc, }, onlyUserFavorite: filterBy === 'favorites', - timelines, - totalCount, + timelineType: TimelineType.default, }); - }, [filterBy, timelines, totalCount]); + }, [filterBy]); return ( <> diff --git a/x-pack/plugins/siem/public/components/timeline/__snapshots__/timeline.test.tsx.snap b/x-pack/plugins/siem/public/components/timeline/__snapshots__/timeline.test.tsx.snap index a8ba787477797..3854fc6b985ac 100644 --- a/x-pack/plugins/siem/public/components/timeline/__snapshots__/timeline.test.tsx.snap +++ b/x-pack/plugins/siem/public/components/timeline/__snapshots__/timeline.test.tsx.snap @@ -722,8 +722,6 @@ exports[`Timeline rendering renders correctly against snapshot 1`] = ` "title": "filebeat-*,auditbeat-*,packetbeat-*", } } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} onDataProviderEdited={[MockFunction]} onDataProviderRemoved={[MockFunction]} onToggleDataProviderEnabled={[MockFunction]} diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/__snapshots__/empty.test.tsx.snap b/x-pack/plugins/siem/public/components/timeline/data_providers/__snapshots__/empty.test.tsx.snap index 5b4405b8d3bc7..dac95c302af27 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/__snapshots__/empty.test.tsx.snap +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/__snapshots__/empty.test.tsx.snap @@ -14,7 +14,9 @@ exports[`Empty rendering renders correctly against snapshot 1`] = ` Drop anything </Text> <HighlightedBackground> - <BadgeHighlighted> + <BadgeHighlighted + className="highlighted-drop-target" + > highlighted </BadgeHighlighted> </HighlightedBackground> diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/__snapshots__/providers.test.tsx.snap b/x-pack/plugins/siem/public/components/timeline/data_providers/__snapshots__/providers.test.tsx.snap index b344381f99d4f..330306b00e7c1 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/__snapshots__/providers.test.tsx.snap +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/__snapshots__/providers.test.tsx.snap @@ -1,514 +1,534 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Providers rendering renders correctly against snapshot 1`] = ` -<PanelProviders - className="timeline-drop-area" - data-test-subj="providers" -> - <Empty - showSmallMsg={true} - /> - <PanelProvidersGroupContainer - alignItems="flexStart" - className="provider-items-container" - direction="column" +<Fragment> + <EuiFlexGroup + alignItems="center" gutterSize="none" + key="droppable-0" > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={true} + > + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.0" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" + > + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-1" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} + > + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.1" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" + > + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-2" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} + > + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.2" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" + > + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-3" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} + > + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.3" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" + > + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-4" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} + > + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.4" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" + > + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-5" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} + > + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> <EuiFlexItem - grow={true} + grow={false} > - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 1" + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.5" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 1" - index={0} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 1", - "kqlQuery": "", - "name": "Provider 1", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 1", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 2" + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-6" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 2" - index={1} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 2", - "kqlQuery": "", - "name": "Provider 2", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 2", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 3" + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.6" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 3" - index={2} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 3", - "kqlQuery": "", - "name": "Provider 3", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 3", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 4" + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-7" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 4" - index={3} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 4", - "kqlQuery": "", - "name": "Provider 4", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 4", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 5" + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.7" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" + > + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-8" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 5" - index={4} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 5", - "kqlQuery": "", - "name": "Provider 5", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 5", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 6" + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.8" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 6" - index={5} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 6", - "kqlQuery": "", - "name": "Provider 6", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 6", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 7" + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-9" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 7" - index={6} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 7", - "kqlQuery": "", - "name": "Provider 7", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 7", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 8" + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.9" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 8" - index={7} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 8", - "kqlQuery": "", - "name": "Provider 8", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 8", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 9" + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> + <EuiFlexGroup + alignItems="center" + gutterSize="none" + key="droppable-10" + > + <Styled(EuiFlexItem) + grow={false} + > + <styled.div + hideBadge={false} > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 9" - index={8} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 9", - "kqlQuery": "", - "name": "Provider 9", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 9", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - <PanelProviderGroupContainer - alignItems="center" - direction="row" - gutterSize="none" - justifyContent="flexStart" - key="id-Provider 10" + <AndOrBadge + type="or" + /> + </styled.div> + </Styled(EuiFlexItem)> + <EuiFlexItem + grow={false} + > + <styled.span> + ( + </styled.span> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <Connect(Droppable) + direction="horizontal" + droppableId="droppableId.timelineProviders.foo.group.10" + getContainerForClone={[Function]} + ignoreContainerClipping={false} + isCombineEnabled={false} + isDropDisabled={false} + mode="standard" + renderClone={null} + type="DEFAULT" > - <PanelProviderItemContainer - className="provider-item-filter-container" - grow={false} - > - <PublicDraggable - draggableId="draggableId.timeline.foo.dataProvider.id-Provider 10" - index={9} - > - <Component /> - </PublicDraggable> - </PanelProviderItemContainer> - <EuiFlexItem - grow={false} - > - <ProviderItemAndDragDrop - browserFields={Object {}} - dataProvider={ - Object { - "and": Array [], - "enabled": true, - "excluded": false, - "id": "id-Provider 10", - "kqlQuery": "", - "name": "Provider 10", - "queryMatch": Object { - "field": "name", - "operator": ":", - "value": "Provider 10", - }, - } - } - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} - onDataProviderEdited={[MockFunction]} - onDataProviderRemoved={[MockFunction]} - onToggleDataProviderEnabled={[MockFunction]} - onToggleDataProviderExcluded={[MockFunction]} - timelineId="foo" - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - </EuiFlexItem> - </PanelProvidersGroupContainer> - <TimelineEuiFormHelpText> - <span> - Drop here - - to build an - - OR - - query - </span> - </TimelineEuiFormHelpText> -</PanelProviders> + <Component /> + </Connect(Droppable)> + </EuiFlexItem> + <EuiFlexItem + grow={false} + > + <styled.span> + ) + </styled.span> + </EuiFlexItem> + </EuiFlexGroup> +</Fragment> `; diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/data_providers.test.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/data_providers.test.tsx index a88062d9093d7..b77d37e8e31ab 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/data_providers.test.tsx +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/data_providers.test.tsx @@ -26,8 +26,6 @@ describe('DataProviders', () => { browserFields={{}} id="foo" dataProviders={mockDataProviders} - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -47,29 +45,6 @@ describe('DataProviders', () => { browserFields={{}} id="foo" dataProviders={dataProviders} - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} - onDataProviderEdited={jest.fn()} - onDataProviderRemoved={jest.fn()} - onToggleDataProviderEnabled={jest.fn()} - onToggleDataProviderExcluded={jest.fn()} - show={true} - /> - </TestProviders> - ); - - dropMessage.forEach(word => expect(wrapper.text()).toContain(word)); - }); - - test('it should STILL render a placeholder given a non-empty collection of data providers', () => { - const wrapper = mount( - <TestProviders> - <DataProviders - browserFields={{}} - id="foo" - dataProviders={mockDataProviders} - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -89,8 +64,6 @@ describe('DataProviders', () => { browserFields={{}} id="foo" dataProviders={mockDataProviders} - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/empty.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/empty.tsx index 60c868f780ff3..1c225eba20b4f 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/empty.tsx +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/empty.tsx @@ -12,6 +12,8 @@ import { AndOrBadge } from '../../and_or_badge'; import * as i18n from './translations'; +export const HIGHLIGHTED_DROP_TARGET_CLASS_NAME = 'highlighted-drop-target'; + const Text = styled(EuiText)` overflow: hidden; margin: 5px 0 5px 0; @@ -88,7 +90,9 @@ export const Empty = React.memo<Props>(({ showSmallMsg = false }) => ( {i18n.DROP_ANYTHING} </Text> <HighlightedBackground> - <BadgeHighlighted>{i18n.HIGHLIGHTED}</BadgeHighlighted> + <BadgeHighlighted className={HIGHLIGHTED_DROP_TARGET_CLASS_NAME}> + {i18n.HIGHLIGHTED} + </BadgeHighlighted> </HighlightedBackground> </NoWrap> diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/helpers.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/helpers.tsx new file mode 100644 index 0000000000000..8b10ee550096f --- /dev/null +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/helpers.tsx @@ -0,0 +1,334 @@ +/* + * 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. + */ + +import { omit } from 'lodash/fp'; +import { DraggableLocation } from 'react-beautiful-dnd'; +import { Dispatch } from 'redux'; + +import { updateProviders } from '../../../store/timeline/actions'; + +import { DataProvider, DataProvidersAnd } from './data_provider'; + +export const omitAnd = (provider: DataProvider): DataProvidersAnd => omit('and', provider); + +export const reorder = ( + group: DataProvidersAnd[], + startIndex: number, + endIndex: number +): DataProvidersAnd[] => { + const groupClone = [...group]; + const [removed] = groupClone.splice(startIndex, 1); // ⚠️ mutation + groupClone.splice(endIndex, 0, removed); // ⚠️ mutation + + return groupClone; +}; + +export const move = ({ + destinationGroup, + moveProviderFromSourceIndex, + moveProviderToDestinationIndex, + sourceGroup, +}: { + destinationGroup: DataProvidersAnd[]; + moveProviderFromSourceIndex: number; + moveProviderToDestinationIndex: number; + sourceGroup: DataProvidersAnd[]; +}): { + updatedDestinationGroup: DataProvidersAnd[]; + updatedSourceGroup: DataProvidersAnd[]; +} => { + const sourceClone = [...sourceGroup]; + const destinationClone = [...destinationGroup]; + + const [removed] = sourceClone.splice(moveProviderFromSourceIndex, 1); // ⚠️ mutation + destinationClone.splice(moveProviderToDestinationIndex, 0, removed); // ⚠️ mutation + + const deDuplicatedDestinationGroup = destinationClone.filter((provider, i) => + provider.id === removed.id && i !== moveProviderToDestinationIndex ? false : true + ); + + return { + updatedDestinationGroup: deDuplicatedDestinationGroup, + updatedSourceGroup: sourceClone, + }; +}; + +export const isValidDestination = ( + destination: DraggableLocation | undefined +): destination is DraggableLocation => destination != null; + +export const sourceAndDestinationAreSameDroppable = ({ + destination, + source, +}: { + destination: DraggableLocation; + source: DraggableLocation; +}): boolean => source.droppableId === destination.droppableId; + +export const flattenIntoAndGroups = (dataProviders: DataProvider[]): DataProvidersAnd[][] => + dataProviders.reduce<DataProvidersAnd[][]>( + (acc, provider) => [...acc, [omitAnd(provider), ...provider.and]], + [] + ); + +export const reArrangeProvidersInSameGroup = ({ + dataProviderGroups, + destination, + dispatch, + source, + timelineId, +}: { + dataProviderGroups: DataProvidersAnd[][]; + destination: DraggableLocation; + dispatch: Dispatch; + source: DraggableLocation; + timelineId: string; +}) => { + const groupIndex = getGroupIndexFromDroppableId(source.droppableId); + + if ( + indexIsValid({ + index: groupIndex, + dataProviderGroups, + }) + ) { + const reorderedGroup = reorder(dataProviderGroups[groupIndex], source.index, destination.index); + + const updatedGroups = dataProviderGroups.reduce<DataProvidersAnd[][]>( + (acc, group, i) => [...acc, i === groupIndex ? [...reorderedGroup] : [...group]], + [] + ); + + dispatch( + updateProviders({ + id: timelineId, + providers: unFlattenGroups(updatedGroups.filter(g => g.length)), + }) + ); + } +}; + +export const getGroupIndexFromDroppableId = (droppableId: string): number => + Number(droppableId.substring(droppableId.lastIndexOf('.') + 1)); + +export const indexIsValid = ({ + index, + dataProviderGroups, +}: { + index: number; + dataProviderGroups: DataProvidersAnd[][]; +}): boolean => index >= 0 && index < dataProviderGroups.length; + +export const convertDataProviderAnd = (dataProvidersAnd: DataProvidersAnd): DataProvider => ({ + ...dataProvidersAnd, + and: [], +}); + +export const unFlattenGroups = (groups: DataProvidersAnd[][]): DataProvider[] => + groups.reduce<DataProvider[]>((acc, group) => [...acc, { ...group[0], and: group.slice(1) }], []); + +export const moveProvidersBetweenGroups = ({ + dataProviderGroups, + destination, + dispatch, + source, + timelineId, +}: { + dataProviderGroups: DataProvidersAnd[][]; + destination: DraggableLocation; + dispatch: Dispatch; + source: DraggableLocation; + timelineId: string; +}) => { + const sourceGroupIndex = getGroupIndexFromDroppableId(source.droppableId); + const destinationGroupIndex = getGroupIndexFromDroppableId(destination.droppableId); + + if ( + indexIsValid({ + index: sourceGroupIndex, + dataProviderGroups, + }) && + indexIsValid({ + index: destinationGroupIndex, + dataProviderGroups, + }) + ) { + const sourceGroup = dataProviderGroups[sourceGroupIndex]; + const destinationGroup = dataProviderGroups[destinationGroupIndex]; + const moveProviderFromSourceIndex = source.index; + const moveProviderToDestinationIndex = destination.index; + + const { updatedDestinationGroup, updatedSourceGroup } = move({ + destinationGroup, + moveProviderFromSourceIndex, + moveProviderToDestinationIndex, + sourceGroup, + }); + + const updatedGroups = dataProviderGroups.reduce<DataProvidersAnd[][]>( + (acc, group, i) => [ + ...acc, + i === sourceGroupIndex + ? [...updatedSourceGroup] + : i === destinationGroupIndex + ? [...updatedDestinationGroup] + : [...group], + ], + [] + ); + + dispatch( + updateProviders({ + id: timelineId, + providers: unFlattenGroups(updatedGroups.filter(g => g.length)), + }) + ); + } +}; + +export const addProviderToEmptyTimeline = ({ + dispatch, + onAddedToTimeline, + providerToAdd, + timelineId, +}: { + dispatch: Dispatch; + onAddedToTimeline: (fieldOrValue: string) => void; + providerToAdd: DataProvider; + timelineId: string; +}) => { + dispatch( + updateProviders({ + id: timelineId, + providers: [providerToAdd], + }) + ); + + onAddedToTimeline(providerToAdd.name); +}; + +/** Rendered as a constant drop target for creating a new OR group */ +export const EMPTY_GROUP: DataProvidersAnd[][] = [[]]; + +export const reArrangeProviders = ({ + dataProviders, + destination, + dispatch, + source, + timelineId, +}: { + dataProviders: DataProvider[]; + destination: DraggableLocation | undefined; + dispatch: Dispatch; + source: DraggableLocation; + timelineId: string; +}) => { + if (!isValidDestination(destination)) { + return; + } + + const dataProviderGroups = [...flattenIntoAndGroups(dataProviders), ...EMPTY_GROUP]; + + if (sourceAndDestinationAreSameDroppable({ source, destination })) { + reArrangeProvidersInSameGroup({ + dataProviderGroups, + destination, + dispatch, + source, + timelineId, + }); + } else { + moveProvidersBetweenGroups({ + dataProviderGroups, + destination, + dispatch, + source, + timelineId, + }); + } +}; + +export const addProviderToGroup = ({ + dataProviders, + destination, + dispatch, + onAddedToTimeline, + providerToAdd, + timelineId, +}: { + dataProviders: DataProvider[]; + destination: DraggableLocation | undefined; + dispatch: Dispatch; + onAddedToTimeline: (fieldOrValue: string) => void; + providerToAdd: DataProvider; + timelineId: string; +}) => { + const dataProviderGroups = [...flattenIntoAndGroups(dataProviders), ...EMPTY_GROUP]; + + if (!isValidDestination(destination)) { + return; + } + + const destinationGroupIndex = getGroupIndexFromDroppableId(destination.droppableId); + if ( + indexIsValid({ + index: destinationGroupIndex, + dataProviderGroups, + }) + ) { + const destinationGroup = dataProviderGroups[destinationGroupIndex]; + const destinationClone = [...destinationGroup]; + destinationClone.splice(destination.index, 0, omitAnd(providerToAdd)); // ⚠️ mutation + const deDuplicatedGroup = destinationClone.filter((provider, i) => + provider.id === providerToAdd.id && i !== destination.index ? false : true + ); + + const updatedGroups = dataProviderGroups.reduce<DataProvidersAnd[][]>( + (acc, group, i) => [ + ...acc, + i === destinationGroupIndex ? [...deDuplicatedGroup] : [...group], + ], + [] + ); + + dispatch( + updateProviders({ + id: timelineId, + providers: unFlattenGroups(updatedGroups.filter(g => g.length)), + }) + ); + onAddedToTimeline(providerToAdd.name); + } +}; + +export const addContentToTimeline = ({ + dataProviders, + destination, + dispatch, + onAddedToTimeline, + providerToAdd, + timelineId, +}: { + dataProviders: DataProvider[]; + destination: DraggableLocation | undefined; + dispatch: Dispatch; + onAddedToTimeline: (fieldOrValue: string) => void; + providerToAdd: DataProvider; + timelineId: string; +}) => { + if (dataProviders.length === 0) { + addProviderToEmptyTimeline({ dispatch, onAddedToTimeline, providerToAdd, timelineId }); + } else { + addProviderToGroup({ + dataProviders, + destination, + dispatch, + onAddedToTimeline, + providerToAdd, + timelineId, + }); + } +}; diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/index.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/index.tsx index f369b961807af..caead394db051 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/index.tsx +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/index.tsx @@ -15,8 +15,6 @@ import { IS_DRAGGING_CLASS_NAME, } from '../../drag_and_drop/helpers'; import { - OnChangeDataProviderKqlQuery, - OnChangeDroppableAndProvider, OnDataProviderEdited, OnDataProviderRemoved, OnToggleDataProviderEnabled, @@ -32,8 +30,6 @@ interface Props { browserFields: BrowserFields; id: string; dataProviders: DataProvider[]; - onChangeDataProviderKqlQuery: OnChangeDataProviderKqlQuery; - onChangeDroppableAndProvider: OnChangeDroppableAndProvider; onDataProviderEdited: OnDataProviderEdited; onDataProviderRemoved: OnDataProviderRemoved; onToggleDataProviderEnabled: OnToggleDataProviderEnabled; @@ -42,6 +38,8 @@ interface Props { } const DropTargetDataProvidersContainer = styled.div` + padding: 2px 0 4px 0; + .${IS_DRAGGING_CLASS_NAME} & .drop-target-data-providers { background: ${({ theme }) => rgba(theme.eui.euiColorSuccess, 0.1)}; border: 0.2rem dashed ${({ theme }) => theme.eui.euiColorSuccess}; @@ -60,9 +58,6 @@ const DropTargetDataProviders = styled.div` position: relative; border: 0.2rem dashed ${props => props.theme.eui.euiColorMediumShade}; border-radius: 5px; - display: flex; - flex-direction: column; - justify-content: center; margin: 5px 0 5px 0; min-height: 100px; overflow-y: auto; @@ -95,43 +90,46 @@ export const DataProviders = React.memo<Props>( browserFields, id, dataProviders, - onChangeDataProviderKqlQuery, - onChangeDroppableAndProvider, onDataProviderEdited, onDataProviderRemoved, onToggleDataProviderEnabled, onToggleDataProviderExcluded, show, - }) => ( - <DropTargetDataProvidersContainer className="drop-target-data-providers-container"> - <DropTargetDataProviders - className="drop-target-data-providers" - data-test-subj="dataProviders" - > - <TimelineContext.Consumer> - {({ isLoading }) => ( - <DroppableWrapper isDropDisabled={!show || isLoading} droppableId={getDroppableId(id)}> - {dataProviders != null && dataProviders.length ? ( - <Providers - browserFields={browserFields} - id={id} - dataProviders={dataProviders} - onChangeDataProviderKqlQuery={onChangeDataProviderKqlQuery} - onChangeDroppableAndProvider={onChangeDroppableAndProvider} - onDataProviderEdited={onDataProviderEdited} - onDataProviderRemoved={onDataProviderRemoved} - onToggleDataProviderEnabled={onToggleDataProviderEnabled} - onToggleDataProviderExcluded={onToggleDataProviderExcluded} - /> - ) : ( - <Empty /> - )} - </DroppableWrapper> - )} - </TimelineContext.Consumer> - </DropTargetDataProviders> - </DropTargetDataProvidersContainer> - ) + }) => { + return ( + <DropTargetDataProvidersContainer className="drop-target-data-providers-container"> + <DropTargetDataProviders + className="drop-target-data-providers" + data-test-subj="dataProviders" + > + <TimelineContext.Consumer> + {({ isLoading }) => ( + <> + {dataProviders != null && dataProviders.length ? ( + <Providers + browserFields={browserFields} + id={id} + dataProviders={dataProviders} + onDataProviderEdited={onDataProviderEdited} + onDataProviderRemoved={onDataProviderRemoved} + onToggleDataProviderEnabled={onToggleDataProviderEnabled} + onToggleDataProviderExcluded={onToggleDataProviderExcluded} + /> + ) : ( + <DroppableWrapper + isDropDisabled={!show || isLoading} + droppableId={getDroppableId(id)} + > + <Empty /> + </DroppableWrapper> + )} + </> + )} + </TimelineContext.Consumer> + </DropTargetDataProviders> + </DropTargetDataProvidersContainer> + ); + } ); DataProviders.displayName = 'DataProviders'; diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/provider_badge.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/provider_badge.tsx index e04aed17c6d67..859ced39ebc4f 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/provider_badge.tsx +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/provider_badge.tsx @@ -10,9 +10,8 @@ import { isString } from 'lodash/fp'; import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; +import { ProviderContainer } from '../../drag_and_drop/provider_container'; import { getEmptyString } from '../../empty_value'; -import { WithCopyToClipboard } from '../../../lib/clipboard/with_copy_to_clipboard'; -import { WithHoverActions } from '../../with_hover_actions'; import { EXISTS_OPERATOR, QueryOperator } from './data_provider'; @@ -94,26 +93,13 @@ export const ProviderBadge = React.memo<ProviderBadgeProps>( const prefix = useMemo(() => (isExcluded ? <span>{i18n.NOT} </span> : null), [isExcluded]); - const title = useMemo(() => `${field}: "${formattedValue}"`, [field, formattedValue]); - - const hoverContent = useMemo( - () => ( - <WithCopyToClipboard - data-test-subj="copy-to-clipboard" - text={`${field} : ${typeof val === 'string' ? `"${val}"` : `${val}`}`} - titleSummary={i18n.FIELD} - /> - ), - [field, val] - ); - - const badge = useCallback( - () => ( + return ( + <ProviderContainer> <ProviderBadgeStyled id={`${providerId}-${field}-${val}`} className={classes} color="hollow" - title={title} + title="" iconOnClick={deleteFilter} iconOnClickAriaLabel={i18n.REMOVE_DATA_PROVIDER} iconType="cross" @@ -135,23 +121,8 @@ export const ProviderBadge = React.memo<ProviderBadgeProps>( </span> )} </ProviderBadgeStyled> - ), - [ - providerId, - field, - val, - classes, - title, - deleteFilter, - togglePopover, - formattedValue, - closeButtonProps, - prefix, - operator, - ] + </ProviderContainer> ); - - return <WithHoverActions hoverContent={hoverContent} render={badge} />; } ); diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_and.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_and.tsx deleted file mode 100644 index badc92d00c174..0000000000000 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_and.tsx +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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. - */ - -import { EuiFlexItem } from '@elastic/eui'; -import React from 'react'; - -import { AndOrBadge } from '../../and_or_badge'; -import { BrowserFields } from '../../../containers/source'; -import { - OnChangeDataProviderKqlQuery, - OnDataProviderEdited, - OnDataProviderRemoved, - OnToggleDataProviderEnabled, - OnToggleDataProviderExcluded, -} from '../events'; - -import { DataProvidersAnd, IS_OPERATOR } from './data_provider'; -import { ProviderItemBadge } from './provider_item_badge'; - -interface ProviderItemAndPopoverProps { - browserFields: BrowserFields; - dataProvidersAnd: DataProvidersAnd[]; - onChangeDataProviderKqlQuery: OnChangeDataProviderKqlQuery; - onDataProviderEdited: OnDataProviderEdited; - onDataProviderRemoved: OnDataProviderRemoved; - onToggleDataProviderEnabled: OnToggleDataProviderEnabled; - onToggleDataProviderExcluded: OnToggleDataProviderExcluded; - providerId: string; - timelineId: string; -} - -export class ProviderItemAnd extends React.PureComponent<ProviderItemAndPopoverProps> { - public render() { - const { - browserFields, - dataProvidersAnd, - onDataProviderEdited, - providerId, - timelineId, - } = this.props; - - return dataProvidersAnd.map((providerAnd: DataProvidersAnd, index: number) => ( - <React.Fragment key={`provider-item-and-${timelineId}-${providerId}-${providerAnd.id}`}> - <EuiFlexItem> - <AndOrBadge type="and" /> - </EuiFlexItem> - <EuiFlexItem> - <ProviderItemBadge - andProviderId={providerAnd.id} - browserFields={browserFields} - deleteProvider={() => this.deleteAndProvider(providerId, providerAnd.id)} - field={providerAnd.queryMatch.displayField || providerAnd.queryMatch.field} - kqlQuery={providerAnd.kqlQuery} - isEnabled={providerAnd.enabled} - isExcluded={providerAnd.excluded} - onDataProviderEdited={onDataProviderEdited} - operator={providerAnd.queryMatch.operator || IS_OPERATOR} - providerId={providerId} - timelineId={timelineId} - toggleEnabledProvider={() => - this.toggleEnabledAndProvider(providerId, !providerAnd.enabled, providerAnd.id) - } - toggleExcludedProvider={() => - this.toggleExcludedAndProvider(providerId, !providerAnd.excluded, providerAnd.id) - } - val={providerAnd.queryMatch.displayValue || providerAnd.queryMatch.value} - /> - </EuiFlexItem> - </React.Fragment> - )); - } - - private deleteAndProvider = (providerId: string, andProviderId: string) => { - this.props.onDataProviderRemoved(providerId, andProviderId); - }; - - private toggleEnabledAndProvider = ( - providerId: string, - enabled: boolean, - andProviderId: string - ) => { - this.props.onToggleDataProviderEnabled({ providerId, enabled, andProviderId }); - }; - - private toggleExcludedAndProvider = ( - providerId: string, - excluded: boolean, - andProviderId: string - ) => { - this.props.onToggleDataProviderExcluded({ providerId, excluded, andProviderId }); - }; -} diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_and_drag_drop.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_and_drag_drop.tsx deleted file mode 100644 index 3a691d2bbc621..0000000000000 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_and_drag_drop.tsx +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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. - */ - -import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { rgba } from 'polished'; -import React, { useCallback } from 'react'; -import styled from 'styled-components'; - -import { AndOrBadge } from '../../and_or_badge'; -import { - OnChangeDataProviderKqlQuery, - OnChangeDroppableAndProvider, - OnDataProviderEdited, - OnDataProviderRemoved, - OnToggleDataProviderEnabled, - OnToggleDataProviderExcluded, -} from '../events'; - -import { BrowserFields } from '../../../containers/source'; - -import { DataProvider } from './data_provider'; -import { ProviderItemAnd } from './provider_item_and'; - -import * as i18n from './translations'; - -const DropAndTargetDataProvidersContainer = styled(EuiFlexItem)` - margin: 0px 8px; -`; - -DropAndTargetDataProvidersContainer.displayName = 'DropAndTargetDataProvidersContainer'; - -const DropAndTargetDataProviders = styled.div<{ hasAndItem: boolean }>` - min-width: 230px; - width: auto; - border: 0.1rem dashed ${props => props.theme.eui.euiColorSuccess}; - border-radius: 5px; - text-align: center; - padding: 3px 10px; - display: flex; - justify-content: center; - align-items: center; - ${props => - props.hasAndItem - ? `&:hover { - transition: background-color 0.7s ease; - background-color: ${() => rgba(props.theme.eui.euiColorSuccess, 0.2)}; - }` - : ''}; - cursor: ${({ hasAndItem }) => (!hasAndItem ? `default` : 'inherit')}; -`; - -DropAndTargetDataProviders.displayName = 'DropAndTargetDataProviders'; - -const NumberProviderAndBadge = (styled(EuiBadge)` - margin: 0px 5px; -` as unknown) as typeof EuiBadge; - -NumberProviderAndBadge.displayName = 'NumberProviderAndBadge'; - -interface ProviderItemDropProps { - browserFields: BrowserFields; - dataProvider: DataProvider; - mousePosition?: { x: number; y: number; boundLeft: number; boundTop: number }; - onChangeDataProviderKqlQuery: OnChangeDataProviderKqlQuery; - onChangeDroppableAndProvider: OnChangeDroppableAndProvider; - onDataProviderEdited: OnDataProviderEdited; - onDataProviderRemoved: OnDataProviderRemoved; - onToggleDataProviderEnabled: OnToggleDataProviderEnabled; - onToggleDataProviderExcluded: OnToggleDataProviderExcluded; - timelineId: string; -} - -export const ProviderItemAndDragDrop = React.memo<ProviderItemDropProps>( - ({ - browserFields, - dataProvider, - onChangeDataProviderKqlQuery, - onChangeDroppableAndProvider, - onDataProviderEdited, - onDataProviderRemoved, - onToggleDataProviderEnabled, - onToggleDataProviderExcluded, - timelineId, - }) => { - const onMouseEnter = useCallback(() => onChangeDroppableAndProvider(dataProvider.id), [ - onChangeDroppableAndProvider, - dataProvider.id, - ]); - const onMouseLeave = useCallback(() => onChangeDroppableAndProvider(''), [ - onChangeDroppableAndProvider, - ]); - const hasAndItem = dataProvider.and.length > 0; - return ( - <EuiFlexGroup - direction="row" - gutterSize="none" - justifyContent="flexStart" - alignItems="center" - > - <DropAndTargetDataProvidersContainer className="drop-and-provider-timeline"> - <DropAndTargetDataProviders - hasAndItem={hasAndItem} - onMouseEnter={onMouseEnter} - onMouseLeave={onMouseLeave} - > - {hasAndItem && ( - <NumberProviderAndBadge color="primary"> - {dataProvider.and.length} - </NumberProviderAndBadge> - )} - <EuiText color="subdued" size="xs"> - {i18n.DROP_HERE_TO_ADD_AN} - </EuiText> - <AndOrBadge type="and" /> - </DropAndTargetDataProviders> - </DropAndTargetDataProvidersContainer> - <ProviderItemAnd - browserFields={browserFields} - dataProvidersAnd={dataProvider.and} - providerId={dataProvider.id} - onChangeDataProviderKqlQuery={onChangeDataProviderKqlQuery} - onDataProviderEdited={onDataProviderEdited} - onDataProviderRemoved={onDataProviderRemoved} - onToggleDataProviderEnabled={onToggleDataProviderEnabled} - onToggleDataProviderExcluded={onToggleDataProviderExcluded} - timelineId={timelineId} - /> - </EuiFlexGroup> - ); - } -); - -ProviderItemAndDragDrop.displayName = 'ProviderItemAndDragDrop'; diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_badge.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_badge.tsx index 2cc19537d6a63..b268315efb919 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_badge.tsx +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/provider_item_badge.tsx @@ -5,14 +5,16 @@ */ import { noop } from 'lodash/fp'; -import React, { useCallback, useState } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; +import { useDispatch } from 'react-redux'; import { BrowserFields } from '../../../containers/source'; import { OnDataProviderEdited } from '../events'; import { ProviderBadge } from './provider_badge'; import { ProviderItemActions } from './provider_item_actions'; -import { QueryOperator } from './data_provider'; +import { DataProvidersAnd, QueryOperator } from './data_provider'; +import { dragAndDropActions } from '../../../store/drag_and_drop'; import { TimelineContext } from '../timeline_context'; interface ProviderItemBadgeProps { @@ -26,6 +28,7 @@ interface ProviderItemBadgeProps { onDataProviderEdited?: OnDataProviderEdited; operator: QueryOperator; providerId: string; + register?: DataProvidersAnd; timelineId?: string; toggleEnabledProvider: () => void; toggleExcludedProvider: () => void; @@ -44,6 +47,7 @@ export const ProviderItemBadge = React.memo<ProviderItemBadgeProps>( onDataProviderEdited, operator, providerId, + register, timelineId, toggleEnabledProvider, toggleExcludedProvider, @@ -69,6 +73,31 @@ export const ProviderItemBadge = React.memo<ProviderItemBadgeProps>( closePopover(); }, [toggleExcludedProvider]); + const [providerRegistered, setProviderRegistered] = useState(false); + + const dispatch = useDispatch(); + + useEffect(() => { + // optionally register the provider if provided + if (!providerRegistered && register != null) { + dispatch(dragAndDropActions.registerProvider({ provider: { ...register, and: [] } })); + setProviderRegistered(true); + } + }, [providerRegistered, dispatch, register, setProviderRegistered]); + + const unRegisterProvider = useCallback(() => { + if (providerRegistered && register != null) { + dispatch(dragAndDropActions.unRegisterProvider({ id: register.id })); + } + }, [providerRegistered, dispatch, register]); + + useEffect( + () => () => { + unRegisterProvider(); + }, + [] + ); + return ( <TimelineContext.Consumer> {({ isLoading }) => ( diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/providers.test.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/providers.test.tsx index 0c8a6932adf91..43e84bac508ea 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/providers.test.tsx +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/providers.test.tsx @@ -14,7 +14,7 @@ import { FilterManager } from '../../../../../../../src/plugins/data/public'; import { TimelineContext } from '../timeline_context'; import { mockDataProviders } from './mock/mock_data_providers'; -import { getDraggableId, Providers } from './providers'; +import { Providers } from './providers'; import { DELETE_CLASS_NAME, ENABLE_CLASS_NAME, EXCLUDE_CLASS_NAME } from './provider_item_actions'; import { useMountAppended } from '../../../utils/use_mount_appended'; @@ -32,8 +32,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -51,8 +49,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -80,8 +76,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={mockOnDataProviderRemoved} onToggleDataProviderEnabled={jest.fn()} @@ -107,8 +101,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={mockOnDataProviderRemoved} onToggleDataProviderEnabled={jest.fn()} @@ -136,8 +128,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={mockOnDataProviderRemoved} onToggleDataProviderEnabled={jest.fn()} @@ -170,8 +160,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={mockOnDataProviderRemoved} onToggleDataProviderEnabled={jest.fn()} @@ -197,14 +185,6 @@ describe('Providers', () => { }); }); - describe('#getDraggableId', () => { - test('it returns the expected id', () => { - expect(getDraggableId({ id: 'timeline1', dataProviderId: 'abcd' })).toEqual( - 'draggableId.timeline.timeline1.dataProvider.abcd' - ); - }); - }); - describe('#onToggleDataProviderEnabled', () => { test('it invokes the onToggleDataProviderEnabled callback when you click on the option "Temporary disable" in the provider menu', () => { const mockOnToggleDataProviderEnabled = jest.fn(); @@ -215,8 +195,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={mockOnToggleDataProviderEnabled} @@ -252,8 +230,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={mockOnToggleDataProviderEnabled} @@ -290,8 +266,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -330,8 +304,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -370,8 +342,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={dataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -403,8 +373,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={mockOnDataProviderRemoved} onToggleDataProviderEnabled={jest.fn()} @@ -439,8 +407,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={mockDataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={mockOnDataProviderRemoved} onToggleDataProviderEnabled={jest.fn()} @@ -475,8 +441,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={dataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={mockOnToggleDataProviderEnabled} @@ -520,8 +484,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={dataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={mockOnToggleDataProviderEnabled} @@ -561,8 +523,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={dataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -606,8 +566,6 @@ describe('Providers', () => { browserFields={{}} dataProviders={dataProviders} id="foo" - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/providers.tsx b/x-pack/plugins/siem/public/components/timeline/data_providers/providers.tsx index bfe99f6920e66..8d9d0c69d53cd 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/providers.tsx +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/providers.tsx @@ -5,32 +5,35 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiFormHelpText } from '@elastic/eui'; -import React from 'react'; -import { Draggable } from 'react-beautiful-dnd'; -import styled from 'styled-components'; +import { rgba } from 'polished'; +import React, { useMemo } from 'react'; +import { Draggable, DraggingStyle, Droppable, NotDraggingStyle } from 'react-beautiful-dnd'; +import styled, { css } from 'styled-components'; +import { AndOrBadge } from '../../and_or_badge'; +import { BrowserFields } from '../../../containers/source'; +import { + getTimelineProviderDroppableId, + IS_DRAGGING_CLASS_NAME, + getTimelineProviderDraggableId, +} from '../../drag_and_drop/helpers'; import { - OnChangeDataProviderKqlQuery, - OnChangeDroppableAndProvider, OnDataProviderEdited, OnDataProviderRemoved, OnToggleDataProviderEnabled, OnToggleDataProviderExcluded, } from '../events'; -import { BrowserFields } from '../../../containers/source'; -import { DataProvider, IS_OPERATOR } from './data_provider'; -import { Empty } from './empty'; -import { ProviderItemAndDragDrop } from './provider_item_and_drag_drop'; +import { DataProvider, DataProvidersAnd, IS_OPERATOR } from './data_provider'; +import { EMPTY_GROUP, flattenIntoAndGroups } from './helpers'; import { ProviderItemBadge } from './provider_item_badge'; -import * as i18n from './translations'; + +export const EMPTY_PROVIDERS_GROUP_CLASS_NAME = 'empty-providers-group'; interface Props { browserFields: BrowserFields; id: string; dataProviders: DataProvider[]; - onChangeDataProviderKqlQuery: OnChangeDataProviderKqlQuery; - onChangeDroppableAndProvider: OnChangeDroppableAndProvider; onDataProviderEdited: OnDataProviderEdited; onDataProviderRemoved: OnDataProviderRemoved; onToggleDataProviderEnabled: OnToggleDataProviderEnabled; @@ -42,68 +45,66 @@ interface Props { * (growth causes layout thrashing) when the AND drop target in a row * of data providers is revealed. */ -const ROW_OF_DATA_PROVIDERS_HEIGHT = 43; // px - -const PanelProviders = styled.div` - position: relative; - display: flex; - flex-direction: row; - min-height: 100px; - padding: 5px 10px 15px 0px; - overflow-y: auto; - align-items: stretch; - justify-content: flex-start; -`; +const ROW_OF_DATA_PROVIDERS_HEIGHT = 36; // px -PanelProviders.displayName = 'PanelProviders'; +const listStyle: React.CSSProperties = { + alignItems: 'center', + display: 'flex', + height: `${ROW_OF_DATA_PROVIDERS_HEIGHT}px`, + minWidth: '125px', +}; -const PanelProvidersGroupContainer = styled(EuiFlexGroup)` - position: relative; - flex-grow: unset; +const getItemStyle = ( + draggableStyle: DraggingStyle | NotDraggingStyle | undefined +): React.CSSProperties => ({ + ...draggableStyle, + userSelect: 'none', +}); - .euiFlexItem { - flex: 1 0 auto; - } +const DroppableContainer = styled.div` + height: ${ROW_OF_DATA_PROVIDERS_HEIGHT}px; - .euiFlexItem--flexGrowZero { - flex: 0 0 auto; + .${IS_DRAGGING_CLASS_NAME} &:hover { + background-color: ${({ theme }) => rgba(theme.eui.euiColorSuccess, 0.2)} !important; } `; -PanelProvidersGroupContainer.displayName = 'PanelProvidersGroupContainer'; +const Parens = styled.span` + ${({ theme }) => css` + color: ${theme.eui.euiColorMediumShade}; + font-size: 32px; + padding: 2px; + user-select: none; + `} +`; -/** A row of data providers in the timeline drop zone */ -const PanelProviderGroupContainer = styled(EuiFlexGroup)` - height: ${ROW_OF_DATA_PROVIDERS_HEIGHT}px; - min-height: ${ROW_OF_DATA_PROVIDERS_HEIGHT}px; - margin: 5px 0px; +const AndOrBadgeContainer = styled.div<{ hideBadge: boolean }>` + span { + visibility: ${({ hideBadge }) => (hideBadge ? 'hidden' : 'inherit')}; + } `; -PanelProviderGroupContainer.displayName = 'PanelProviderGroupContainer'; +const LastAndOrBadgeInGroup = styled.div` + display: none; -const PanelProviderItemContainer = styled(EuiFlexItem)` - position: relative; + .${IS_DRAGGING_CLASS_NAME} & { + display: initial; + } `; -PanelProviderItemContainer.displayName = 'PanelProviderItemContainer'; +const OrFlexItem = styled(EuiFlexItem)` + padding-left: 9px; +`; const TimelineEuiFormHelpText = styled(EuiFormHelpText)` padding-top: 0px; position: absolute; bottom: 0px; - left: 5px; + left: 4px; `; TimelineEuiFormHelpText.displayName = 'TimelineEuiFormHelpText'; -interface GetDraggableIdParams { - id: string; - dataProviderId: string; -} - -export const getDraggableId = ({ id, dataProviderId }: GetDraggableIdParams): string => - `draggableId.timeline.${id}.dataProvider.${dataProviderId}`; - /** * Renders an interactive card representation of the data providers. It also * affords uniform UI controls for the following actions: @@ -116,104 +117,151 @@ export const Providers = React.memo<Props>( browserFields, id, dataProviders, - onChangeDataProviderKqlQuery, - onChangeDroppableAndProvider, onDataProviderEdited, onDataProviderRemoved, onToggleDataProviderEnabled, onToggleDataProviderExcluded, - }) => ( - <PanelProviders className="timeline-drop-area" data-test-subj="providers"> - <Empty showSmallMsg={dataProviders.length > 0} /> - <PanelProvidersGroupContainer - direction="column" - className="provider-items-container" - alignItems="flexStart" - gutterSize="none" - > - <EuiFlexItem grow={true}> - {dataProviders.map((dataProvider, i) => { - const deleteProvider = () => onDataProviderRemoved(dataProvider.id); - const toggleEnabledProvider = () => - onToggleDataProviderEnabled({ - providerId: dataProvider.id, - enabled: !dataProvider.enabled, - }); - const toggleExcludedProvider = () => - onToggleDataProviderExcluded({ - providerId: dataProvider.id, - excluded: !dataProvider.excluded, - }); - return ( - // Providers are a special drop target that can't be drag-and-dropped - // to another destination, so it doesn't use our DraggableWrapper - <PanelProviderGroupContainer - key={dataProvider.id} - direction="row" - gutterSize="none" - justifyContent="flexStart" - alignItems="center" + }) => { + // Transform the dataProviders into flattened groups, and append an empty group + const dataProviderGroups: DataProvidersAnd[][] = useMemo( + () => [...flattenIntoAndGroups(dataProviders), ...EMPTY_GROUP], + [dataProviders] + ); + + return ( + <> + {dataProviderGroups.map((group, groupIndex) => ( + <EuiFlexGroup alignItems="center" gutterSize="none" key={`droppable-${groupIndex}`}> + <OrFlexItem grow={false}> + <AndOrBadgeContainer hideBadge={groupIndex === 0}> + <AndOrBadge type="or" /> + </AndOrBadgeContainer> + </OrFlexItem> + <EuiFlexItem grow={false}> + <Parens>{'('}</Parens> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <Droppable + droppableId={getTimelineProviderDroppableId({ groupIndex, timelineId: id })} + direction="horizontal" > - <PanelProviderItemContainer className="provider-item-filter-container" grow={false}> - <Draggable - draggableId={getDraggableId({ id, dataProviderId: dataProvider.id })} - index={i} + {droppableProvided => ( + <DroppableContainer + className={ + groupIndex === dataProviderGroups.length - 1 + ? EMPTY_PROVIDERS_GROUP_CLASS_NAME + : '' + } + ref={droppableProvided.innerRef} + style={listStyle} + {...droppableProvided.droppableProps} > - {provided => ( - <div - {...provided.draggableProps} - {...provided.dragHandleProps} - ref={provided.innerRef} - data-test-subj="providerContainer" + {group.map((dataProvider, index) => ( + <Draggable + disableInteractiveElementBlocking={true} + draggableId={getTimelineProviderDraggableId({ + dataProviderId: dataProvider.id, + groupIndex, + timelineId: id, + })} + index={index} + key={dataProvider.id} > - <ProviderItemBadge - browserFields={browserFields} - field={ - dataProvider.queryMatch.displayField || dataProvider.queryMatch.field - } - kqlQuery={dataProvider.kqlQuery} - isEnabled={dataProvider.enabled} - isExcluded={dataProvider.excluded} - deleteProvider={deleteProvider} - operator={dataProvider.queryMatch.operator || IS_OPERATOR} - onDataProviderEdited={onDataProviderEdited} - timelineId={id} - toggleEnabledProvider={toggleEnabledProvider} - toggleExcludedProvider={toggleExcludedProvider} - providerId={dataProvider.id} - val={ - dataProvider.queryMatch.displayValue || dataProvider.queryMatch.value - } - /> - </div> - )} - </Draggable> - </PanelProviderItemContainer> - <EuiFlexItem grow={false}> - <ProviderItemAndDragDrop - browserFields={browserFields} - dataProvider={dataProvider} - onChangeDataProviderKqlQuery={onChangeDataProviderKqlQuery} - onChangeDroppableAndProvider={onChangeDroppableAndProvider} - onDataProviderEdited={onDataProviderEdited} - onDataProviderRemoved={onDataProviderRemoved} - onToggleDataProviderEnabled={onToggleDataProviderEnabled} - onToggleDataProviderExcluded={onToggleDataProviderExcluded} - timelineId={id} - /> - </EuiFlexItem> - </PanelProviderGroupContainer> - ); - })} - </EuiFlexItem> - </PanelProvidersGroupContainer> - <TimelineEuiFormHelpText> - <span> - {i18n.DROP_HERE} {i18n.TO_BUILD_AN} {i18n.OR.toLocaleUpperCase()} {i18n.QUERY} - </span> - </TimelineEuiFormHelpText> - </PanelProviders> - ) + {(provided, snapshot) => ( + <div + ref={provided.innerRef} + {...provided.draggableProps} + {...provided.dragHandleProps} + style={getItemStyle(provided.draggableProps.style)} + data-test-subj="providerContainer" + > + <EuiFlexGroup alignItems="center" gutterSize="none"> + <EuiFlexItem grow={false}> + <ProviderItemBadge + andProviderId={index > 0 ? dataProvider.id : undefined} + browserFields={browserFields} + deleteProvider={() => + index > 0 + ? onDataProviderRemoved(group[0].id, dataProvider.id) + : onDataProviderRemoved(dataProvider.id) + } + field={ + index > 0 + ? dataProvider.queryMatch.displayField ?? + dataProvider.queryMatch.field + : group[0].queryMatch.displayField ?? + group[0].queryMatch.field + } + kqlQuery={index > 0 ? dataProvider.kqlQuery : group[0].kqlQuery} + isEnabled={index > 0 ? dataProvider.enabled : group[0].enabled} + isExcluded={index > 0 ? dataProvider.excluded : group[0].excluded} + onDataProviderEdited={onDataProviderEdited} + operator={ + index > 0 + ? dataProvider.queryMatch.operator ?? IS_OPERATOR + : group[0].queryMatch.operator ?? IS_OPERATOR + } + register={dataProvider} + providerId={index > 0 ? group[0].id : dataProvider.id} + timelineId={id} + toggleEnabledProvider={() => + index > 0 + ? onToggleDataProviderEnabled({ + providerId: group[0].id, + enabled: !dataProvider.enabled, + andProviderId: dataProvider.id, + }) + : onToggleDataProviderEnabled({ + providerId: dataProvider.id, + enabled: !dataProvider.enabled, + }) + } + toggleExcludedProvider={() => + index > 0 + ? onToggleDataProviderExcluded({ + providerId: group[0].id, + excluded: !dataProvider.excluded, + andProviderId: dataProvider.id, + }) + : onToggleDataProviderExcluded({ + providerId: dataProvider.id, + excluded: !dataProvider.excluded, + }) + } + val={ + dataProvider.queryMatch.displayValue ?? + dataProvider.queryMatch.value + } + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + {!snapshot.isDragging && + (index < group.length - 1 ? ( + <AndOrBadge type="and" /> + ) : ( + <LastAndOrBadgeInGroup> + <AndOrBadge type="and" /> + </LastAndOrBadgeInGroup> + ))} + </EuiFlexItem> + </EuiFlexGroup> + </div> + )} + </Draggable> + ))} + {droppableProvided.placeholder} + </DroppableContainer> + )} + </Droppable> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <Parens>{')'}</Parens> + </EuiFlexItem> + </EuiFlexGroup> + ))} + </> + ); + } ); Providers.displayName = 'Providers'; diff --git a/x-pack/plugins/siem/public/components/timeline/data_providers/translations.ts b/x-pack/plugins/siem/public/components/timeline/data_providers/translations.ts index eec12177b8b72..56628502f5550 100644 --- a/x-pack/plugins/siem/public/components/timeline/data_providers/translations.ts +++ b/x-pack/plugins/siem/public/components/timeline/data_providers/translations.ts @@ -83,7 +83,7 @@ export const INCLUDE_DATA_PROVIDER = i18n.translate( ); export const NOT = i18n.translate('xpack.siem.dataProviders.not', { - defaultMessage: 'not', + defaultMessage: 'NOT', }); export const OR = i18n.translate('xpack.siem.dataProviders.or', { diff --git a/x-pack/plugins/siem/public/components/timeline/header/__snapshots__/index.test.tsx.snap b/x-pack/plugins/siem/public/components/timeline/header/__snapshots__/index.test.tsx.snap index 42a1d4cd7f0f0..1182cf4f44bc8 100644 --- a/x-pack/plugins/siem/public/components/timeline/header/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/siem/public/components/timeline/header/__snapshots__/index.test.tsx.snap @@ -139,8 +139,6 @@ exports[`Header rendering renders correctly against snapshot 1`] = ` ] } id="foo" - onChangeDataProviderKqlQuery={[MockFunction]} - onChangeDroppableAndProvider={[MockFunction]} onDataProviderEdited={[MockFunction]} onDataProviderRemoved={[MockFunction]} onToggleDataProviderEnabled={[MockFunction]} diff --git a/x-pack/plugins/siem/public/components/timeline/header/index.test.tsx b/x-pack/plugins/siem/public/components/timeline/header/index.test.tsx index 6f2053488f69b..7da76df497768 100644 --- a/x-pack/plugins/siem/public/components/timeline/header/index.test.tsx +++ b/x-pack/plugins/siem/public/components/timeline/header/index.test.tsx @@ -33,8 +33,6 @@ describe('Header', () => { filterManager={new FilterManager(mockUiSettingsForFilterManager)} id="foo" indexPattern={indexPattern} - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -55,8 +53,6 @@ describe('Header', () => { filterManager={new FilterManager(mockUiSettingsForFilterManager)} id="foo" indexPattern={indexPattern} - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} @@ -79,8 +75,6 @@ describe('Header', () => { filterManager={new FilterManager(mockUiSettingsForFilterManager)} id="foo" indexPattern={indexPattern} - onChangeDataProviderKqlQuery={jest.fn()} - onChangeDroppableAndProvider={jest.fn()} onDataProviderEdited={jest.fn()} onDataProviderRemoved={jest.fn()} onToggleDataProviderEnabled={jest.fn()} diff --git a/x-pack/plugins/siem/public/components/timeline/header/index.tsx b/x-pack/plugins/siem/public/components/timeline/header/index.tsx index 99964c955bafe..58e6b6e837249 100644 --- a/x-pack/plugins/siem/public/components/timeline/header/index.tsx +++ b/x-pack/plugins/siem/public/components/timeline/header/index.tsx @@ -12,8 +12,6 @@ import deepEqual from 'fast-deep-equal'; import { DataProviders } from '../data_providers'; import { DataProvider } from '../data_providers/data_provider'; import { - OnChangeDataProviderKqlQuery, - OnChangeDroppableAndProvider, OnDataProviderEdited, OnDataProviderRemoved, OnToggleDataProviderEnabled, @@ -30,8 +28,6 @@ interface Props { filterManager: FilterManager; id: string; indexPattern: IIndexPattern; - onChangeDataProviderKqlQuery: OnChangeDataProviderKqlQuery; - onChangeDroppableAndProvider: OnChangeDroppableAndProvider; onDataProviderEdited: OnDataProviderEdited; onDataProviderRemoved: OnDataProviderRemoved; onToggleDataProviderEnabled: OnToggleDataProviderEnabled; @@ -46,8 +42,6 @@ const TimelineHeaderComponent: React.FC<Props> = ({ indexPattern, dataProviders, filterManager, - onChangeDataProviderKqlQuery, - onChangeDroppableAndProvider, onDataProviderEdited, onDataProviderRemoved, onToggleDataProviderEnabled, @@ -65,18 +59,19 @@ const TimelineHeaderComponent: React.FC<Props> = ({ size="s" /> )} - <DataProviders - browserFields={browserFields} - id={id} - dataProviders={dataProviders} - onChangeDroppableAndProvider={onChangeDroppableAndProvider} - onChangeDataProviderKqlQuery={onChangeDataProviderKqlQuery} - onDataProviderEdited={onDataProviderEdited} - onDataProviderRemoved={onDataProviderRemoved} - onToggleDataProviderEnabled={onToggleDataProviderEnabled} - onToggleDataProviderExcluded={onToggleDataProviderExcluded} - show={show} - /> + {show && ( + <DataProviders + browserFields={browserFields} + id={id} + dataProviders={dataProviders} + onDataProviderEdited={onDataProviderEdited} + onDataProviderRemoved={onDataProviderRemoved} + onToggleDataProviderEnabled={onToggleDataProviderEnabled} + onToggleDataProviderExcluded={onToggleDataProviderExcluded} + show={show} + /> + )} + <StatefulSearchOrFilter browserFields={browserFields} filterManager={filterManager} @@ -94,8 +89,6 @@ export const TimelineHeader = React.memo( deepEqual(prevProps.indexPattern, nextProps.indexPattern) && deepEqual(prevProps.dataProviders, nextProps.dataProviders) && prevProps.filterManager === nextProps.filterManager && - prevProps.onChangeDataProviderKqlQuery === nextProps.onChangeDataProviderKqlQuery && - prevProps.onChangeDroppableAndProvider === nextProps.onChangeDroppableAndProvider && prevProps.onDataProviderEdited === nextProps.onDataProviderEdited && prevProps.onDataProviderRemoved === nextProps.onDataProviderRemoved && prevProps.onToggleDataProviderEnabled === nextProps.onToggleDataProviderEnabled && diff --git a/x-pack/plugins/siem/public/components/timeline/index.tsx b/x-pack/plugins/siem/public/components/timeline/index.tsx index 35099e3836fb4..bebc6f9b654c5 100644 --- a/x-pack/plugins/siem/public/components/timeline/index.tsx +++ b/x-pack/plugins/siem/public/components/timeline/index.tsx @@ -16,8 +16,6 @@ import { ColumnHeaderOptions, TimelineModel } from '../../store/timeline/model'; import { timelineDefaults } from '../../store/timeline/defaults'; import { defaultHeaders } from './body/column_headers/default_headers'; import { - OnChangeDataProviderKqlQuery, - OnChangeDroppableAndProvider, OnChangeItemsPerPage, OnDataProviderRemoved, OnDataProviderEdited, @@ -58,8 +56,6 @@ const StatefulTimelineComponent = React.memo<Props>( start, updateDataProviderEnabled, updateDataProviderExcluded, - updateDataProviderKqlQuery, - updateHighlightedDropAndProviderId, updateItemsPerPage, upsertColumn, usersViewing, @@ -120,21 +116,11 @@ const StatefulTimelineComponent = React.memo<Props>( [id] ); - const onChangeDataProviderKqlQuery: OnChangeDataProviderKqlQuery = useCallback( - ({ providerId, kqlQuery }) => updateDataProviderKqlQuery!({ id, kqlQuery, providerId }), - [id] - ); - const onChangeItemsPerPage: OnChangeItemsPerPage = useCallback( itemsChangedPerPage => updateItemsPerPage!({ id, itemsPerPage: itemsChangedPerPage }), [id] ); - const onChangeDroppableAndProvider: OnChangeDroppableAndProvider = useCallback( - providerId => updateHighlightedDropAndProviderId!({ id, providerId }), - [id] - ); - const toggleColumn = useCallback( (column: ColumnHeaderOptions) => { const exists = columns.findIndex(c => c.id === column.id) !== -1; @@ -182,8 +168,6 @@ const StatefulTimelineComponent = React.memo<Props>( kqlMode={kqlMode} kqlQueryExpression={kqlQueryExpression} loadingIndexName={loading} - onChangeDataProviderKqlQuery={onChangeDataProviderKqlQuery} - onChangeDroppableAndProvider={onChangeDroppableAndProvider} onChangeItemsPerPage={onChangeItemsPerPage} onClose={onClose} onDataProviderEdited={onDataProviderEditedLocal} diff --git a/x-pack/plugins/siem/public/components/timeline/selectable_timeline/index.tsx b/x-pack/plugins/siem/public/components/timeline/selectable_timeline/index.tsx index 4cc89e5bdba73..964bb2061333d 100644 --- a/x-pack/plugins/siem/public/components/timeline/selectable_timeline/index.tsx +++ b/x-pack/plugins/siem/public/components/timeline/selectable_timeline/index.tsx @@ -23,6 +23,8 @@ import styled from 'styled-components'; import { useGetAllTimeline } from '../../../containers/timeline/all'; import { SortFieldTimeline, Direction } from '../../../graphql/types'; +import { TimelineType, TimelineTypeLiteralWithNull } from '../../../../common/types/timeline'; + import { isUntitled } from '../../open_timeline/helpers'; import * as i18nTimeline from '../../open_timeline/translations'; import { OpenTimelineResult } from '../../open_timeline/types'; @@ -71,6 +73,7 @@ const TIMELINE_ITEM_HEIGHT = 50; export interface GetSelectableOptions { timelines: OpenTimelineResult[]; onlyFavorites: boolean; + timelineType?: TimelineTypeLiteralWithNull; searchTimelineValue: string; } @@ -79,6 +82,7 @@ interface SelectableTimelineProps { getSelectableOptions: ({ timelines, onlyFavorites, + timelineType, searchTimelineValue, }: GetSelectableOptions) => EuiSelectableOption[]; onClosePopover: () => void; @@ -228,10 +232,9 @@ const SelectableTimelineComponent: React.FC<SelectableTimelineProps> = ({ sortOrder: Direction.desc, }, onlyUserFavorite: onlyFavorites, - timelines, - totalCount: timelineCount, + timelineType: TimelineType.default, }); - }, [onlyFavorites, pageSize, searchTimelineValue, timelines, timelineCount]); + }, [onlyFavorites, pageSize, searchTimelineValue]); return ( <EuiSelectableContainer isLoading={loading}> @@ -263,7 +266,12 @@ const SelectableTimelineComponent: React.FC<SelectableTimelineProps> = ({ }, }} singleSelection={true} - options={getSelectableOptions({ timelines, onlyFavorites, searchTimelineValue })} + options={getSelectableOptions({ + timelines, + onlyFavorites, + searchTimelineValue, + timelineType: TimelineType.default, + })} > {(list, search) => ( <> diff --git a/x-pack/plugins/siem/public/components/timeline/timeline.test.tsx b/x-pack/plugins/siem/public/components/timeline/timeline.test.tsx index 22f1c525a6c2a..0d0ce79c77be7 100644 --- a/x-pack/plugins/siem/public/components/timeline/timeline.test.tsx +++ b/x-pack/plugins/siem/public/components/timeline/timeline.test.tsx @@ -65,8 +65,6 @@ describe('Timeline', () => { kqlMode: 'search' as TimelineComponentProps['kqlMode'], kqlQueryExpression: '', loadingIndexName: false, - onChangeDataProviderKqlQuery: jest.fn(), - onChangeDroppableAndProvider: jest.fn(), onChangeItemsPerPage: jest.fn(), onClose: jest.fn(), onDataProviderEdited: jest.fn(), diff --git a/x-pack/plugins/siem/public/components/timeline/timeline.tsx b/x-pack/plugins/siem/public/components/timeline/timeline.tsx index 10f10b1a86f1e..cc3116235557f 100644 --- a/x-pack/plugins/siem/public/components/timeline/timeline.tsx +++ b/x-pack/plugins/siem/public/components/timeline/timeline.tsx @@ -20,8 +20,6 @@ import { Sort } from './body/sort'; import { StatefulBody } from './body/stateful_body'; import { DataProvider } from './data_providers/data_provider'; import { - OnChangeDataProviderKqlQuery, - OnChangeDroppableAndProvider, OnChangeItemsPerPage, OnDataProviderRemoved, OnDataProviderEdited, @@ -99,8 +97,6 @@ export interface Props { kqlMode: KqlMode; kqlQueryExpression: string; loadingIndexName: boolean; - onChangeDataProviderKqlQuery: OnChangeDataProviderKqlQuery; - onChangeDroppableAndProvider: OnChangeDroppableAndProvider; onChangeItemsPerPage: OnChangeItemsPerPage; onClose: () => void; onDataProviderEdited: OnDataProviderEdited; @@ -132,8 +128,6 @@ export const TimelineComponent: React.FC<Props> = ({ kqlMode, kqlQueryExpression, loadingIndexName, - onChangeDataProviderKqlQuery, - onChangeDroppableAndProvider, onChangeItemsPerPage, onClose, onDataProviderEdited, @@ -185,8 +179,6 @@ export const TimelineComponent: React.FC<Props> = ({ indexPattern={indexPattern} dataProviders={dataProviders} filterManager={filterManager} - onChangeDataProviderKqlQuery={onChangeDataProviderKqlQuery} - onChangeDroppableAndProvider={onChangeDroppableAndProvider} onDataProviderEdited={onDataProviderEdited} onDataProviderRemoved={onDataProviderRemoved} onToggleDataProviderEnabled={onToggleDataProviderEnabled} diff --git a/x-pack/plugins/siem/public/containers/timeline/all/index.gql_query.ts b/x-pack/plugins/siem/public/containers/timeline/all/index.gql_query.ts index 7d30b6c22a110..76aef8de4ad84 100644 --- a/x-pack/plugins/siem/public/containers/timeline/all/index.gql_query.ts +++ b/x-pack/plugins/siem/public/containers/timeline/all/index.gql_query.ts @@ -12,12 +12,14 @@ export const allTimelinesQuery = gql` $search: String $sort: SortTimeline $onlyUserFavorite: Boolean + $timelineType: String ) { getAllTimeline( pageInfo: $pageInfo search: $search sort: $sort onlyUserFavorite: $onlyUserFavorite + timelineType: $timelineType ) { totalCount timeline { diff --git a/x-pack/plugins/siem/public/containers/timeline/all/index.tsx b/x-pack/plugins/siem/public/containers/timeline/all/index.tsx index 62c8d21a2e944..e1d1edc1a8cec 100644 --- a/x-pack/plugins/siem/public/containers/timeline/all/index.tsx +++ b/x-pack/plugins/siem/public/containers/timeline/all/index.tsx @@ -6,7 +6,7 @@ import { getOr, noop } from 'lodash/fp'; import memoizeOne from 'memoize-one'; -import { useCallback, useState, useRef, useEffect } from 'react'; +import { useCallback, useState, useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { OpenTimelineResult } from '../../../components/open_timeline/types'; @@ -17,18 +17,24 @@ import { SortTimeline, TimelineResult, } from '../../../graphql/types'; -import { inputsModel, inputsActions } from '../../../store/inputs'; +import { inputsActions } from '../../../store/inputs'; import { useApolloClient } from '../../../utils/apollo_context'; import { allTimelinesQuery } from './index.gql_query'; import * as i18n from '../../../pages/timelines/translations'; +import { TimelineTypeLiteralWithNull } from '../../../../common/types/timeline'; export interface AllTimelinesArgs { - fetchAllTimeline: ({ onlyUserFavorite, pageInfo, search, sort }: AllTimelinesVariables) => void; + fetchAllTimeline: ({ + onlyUserFavorite, + pageInfo, + search, + sort, + timelineType, + }: AllTimelinesVariables) => void; timelines: OpenTimelineResult[]; loading: boolean; totalCount: number; - refetch: () => void; } export interface AllTimelinesVariables { @@ -36,8 +42,7 @@ export interface AllTimelinesVariables { pageInfo: PageInfoTimeline; search: string; sort: SortTimeline; - timelines: OpenTimelineResult[]; - totalCount: number; + timelineType: TimelineTypeLiteralWithNull; } export const ALL_TIMELINE_QUERY_ID = 'FETCH_ALL_TIMELINES'; @@ -80,25 +85,16 @@ export const getAllTimeline = memoizeOne( export const useGetAllTimeline = (): AllTimelinesArgs => { const dispatch = useDispatch(); const apolloClient = useApolloClient(); - const refetch = useRef<inputsModel.Refetch>(); const [, dispatchToaster] = useStateToaster(); const [allTimelines, setAllTimelines] = useState<AllTimelinesArgs>({ fetchAllTimeline: noop, loading: false, - refetch: refetch.current ?? noop, totalCount: 0, timelines: [], }); const fetchAllTimeline = useCallback( - async ({ - onlyUserFavorite, - pageInfo, - search, - sort, - timelines, - totalCount, - }: AllTimelinesVariables) => { + async ({ onlyUserFavorite, pageInfo, search, sort, timelineType }: AllTimelinesVariables) => { let didCancel = false; const abortCtrl = new AbortController(); @@ -107,15 +103,15 @@ export const useGetAllTimeline = (): AllTimelinesArgs => { if (apolloClient != null) { setAllTimelines({ ...allTimelines, - timelines: timelines ?? allTimelines.timelines, - totalCount: totalCount ?? allTimelines.totalCount, loading: true, }); + const variables: GetAllTimeline.Variables = { onlyUserFavorite, pageInfo, search, sort, + timelineType, }; const response = await apolloClient.query< GetAllTimeline.Query, @@ -130,25 +126,23 @@ export const useGetAllTimeline = (): AllTimelinesArgs => { }, }, }); + const totalCount = response?.data?.getAllTimeline?.totalCount ?? 0; + const timelines = response?.data?.getAllTimeline?.timeline ?? []; if (!didCancel) { dispatch( inputsActions.setQuery({ inputId: 'global', id: ALL_TIMELINE_QUERY_ID, loading: false, - refetch: refetch.current ?? noop, + refetch: fetchData, inspect: null, }) ); setAllTimelines({ fetchAllTimeline, loading: false, - refetch: refetch.current ?? noop, - totalCount: getOr(0, 'getAllTimeline.totalCount', response.data), - timelines: getAllTimeline( - JSON.stringify(variables), - getOr([], 'getAllTimeline.timeline', response.data) - ), + totalCount, + timelines: getAllTimeline(JSON.stringify(variables), timelines as TimelineResult[]), }); } } @@ -162,14 +156,12 @@ export const useGetAllTimeline = (): AllTimelinesArgs => { setAllTimelines({ fetchAllTimeline, loading: false, - refetch: noop, totalCount: 0, timelines: [], }); } } }; - refetch.current = fetchData; fetchData(); return () => { didCancel = true; @@ -188,6 +180,5 @@ export const useGetAllTimeline = (): AllTimelinesArgs => { return { ...allTimelines, fetchAllTimeline, - refetch: refetch.current ?? noop, }; }; diff --git a/x-pack/plugins/siem/public/graphql/introspection.json b/x-pack/plugins/siem/public/graphql/introspection.json index 4026a043c7778..c2b21957a9056 100644 --- a/x-pack/plugins/siem/public/graphql/introspection.json +++ b/x-pack/plugins/siem/public/graphql/introspection.json @@ -249,6 +249,12 @@ "description": "", "type": { "kind": "SCALAR", "name": "Boolean", "ofType": null }, "defaultValue": null + }, + { + "name": "timelineType", + "description": "", + "type": { "kind": "SCALAR", "name": "String", "ofType": null }, + "defaultValue": null } ], "type": { diff --git a/x-pack/plugins/siem/public/graphql/types.ts b/x-pack/plugins/siem/public/graphql/types.ts index 86890988c06b6..dd4e967b185b9 100644 --- a/x-pack/plugins/siem/public/graphql/types.ts +++ b/x-pack/plugins/siem/public/graphql/types.ts @@ -2235,6 +2235,8 @@ export interface GetAllTimelineQueryArgs { sort?: Maybe<SortTimeline>; onlyUserFavorite?: Maybe<boolean>; + + timelineType?: Maybe<string>; } export interface AuthenticationsSourceArgs { timerange: TimerangeInput; @@ -4012,6 +4014,7 @@ export namespace GetAllTimeline { search?: Maybe<string>; sort?: Maybe<SortTimeline>; onlyUserFavorite?: Maybe<boolean>; + timelineType?: Maybe<string>; }; export type Query = { diff --git a/x-pack/plugins/siem/public/hooks/translations.ts b/x-pack/plugins/siem/public/hooks/translations.ts index ba3ec40df466a..40db748a3e1ac 100644 --- a/x-pack/plugins/siem/public/hooks/translations.ts +++ b/x-pack/plugins/siem/public/hooks/translations.ts @@ -6,6 +6,12 @@ import { i18n } from '@kbn/i18n'; +export const ADDED_TO_TIMELINE_MESSAGE = (fieldOrValue: string) => + i18n.translate('xpack.siem.hooks.useAddToTimeline.addedFieldMessage', { + values: { fieldOrValue }, + defaultMessage: `Added {fieldOrValue} to timeline`, + }); + export const STATUS_CODE = i18n.translate( 'xpack.siem.components.ml.api.errors.statusCodeFailureTitle', { diff --git a/x-pack/plugins/siem/public/hooks/use_add_to_timeline.tsx b/x-pack/plugins/siem/public/hooks/use_add_to_timeline.tsx new file mode 100644 index 0000000000000..be0ddb153457e --- /dev/null +++ b/x-pack/plugins/siem/public/hooks/use_add_to_timeline.tsx @@ -0,0 +1,165 @@ +/* + * 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. + */ + +import d3 from 'd3'; +import { useCallback } from 'react'; +import { DraggableId, FluidDragActions, Position, SensorAPI } from 'react-beautiful-dnd'; + +import { IS_DRAGGING_CLASS_NAME } from '../components/drag_and_drop/helpers'; +import { HIGHLIGHTED_DROP_TARGET_CLASS_NAME } from '../components/timeline/data_providers/empty'; +import { EMPTY_PROVIDERS_GROUP_CLASS_NAME } from '../components/timeline/data_providers/providers'; + +let _sensorApiSingleton: SensorAPI; + +/** + * This hook is passed (in an array) to the `sensors` prop of the + * `react-beautiful-dnd` `DragDropContext` component. Example: + * + * ``` + <DragDropContext onDragEnd={onDragEnd} sensors={[useAddToTimelineSensor]}> + {children} + </DragDropContext>* + * ``` + * + * As a side effect of registering this hook with the `DragDropContext`, + * the `SensorAPI` singleton is initialized. This singleton is used + * by the `useAddToTimeline` hook. + */ +export const useAddToTimelineSensor = (api: SensorAPI) => { + _sensorApiSingleton = api; +}; + +/** + * Returns the position of the specified element + */ +const getPosition = (element: Element): Position => { + const rect = element.getBoundingClientRect(); + + return { x: rect.left, y: rect.top }; +}; + +/** + * Returns the position of one of the following timeline drop targets + * (in the following order of preference): + * 1) The "Drop anything highlighted..." drop target + * 2) The persistent "empty" data provider group drop target + * 3) `null`, because none of the above targets exist (an error state) + */ +export const getDropTargetCoordinate = (): Position | null => { + // The placeholder in the "Drop anything highlighted here to build an OR query": + const highlighted = document.querySelector(`.${HIGHLIGHTED_DROP_TARGET_CLASS_NAME}`); + + if (highlighted != null) { + return getPosition(highlighted); + } + + // If at least one provider has been added to the timeline, the "Drop anything + // highlighted..." drop target won't be visible, so we need to drop into the + // empty group instead: + const emptyGroup = document.querySelector(`.${EMPTY_PROVIDERS_GROUP_CLASS_NAME}`); + + if (emptyGroup != null) { + return getPosition(emptyGroup); + } + + return null; +}; + +/** + * Returns the coordinates of the specified draggable + */ +export const getDraggableCoordinate = (draggableId: DraggableId): Position | null => { + // The placeholder in the "Drop anything highlighted here to build an OR query": + const draggable = document.querySelector(`[data-rbd-draggable-id="${draggableId}"]`); + + if (draggable != null) { + return getPosition(draggable); + } + + return null; +}; + +/** + * Animates a draggable via `requestAnimationFrame` + */ +export const animate = ({ + drag, + fieldName, + values, +}: { + drag: FluidDragActions; + fieldName: string; + values: Position[]; +}) => { + requestAnimationFrame(() => { + if (values.length === 0) { + setTimeout(() => drag.drop(), 0); // schedule the drop the next time around + return; + } + + drag.move(values[0]); + + animate({ + drag, + fieldName, + values: values.slice(1), + }); + }); +}; + +/** + * This hook animates a draggable data provider to the timeline + */ +export const useAddToTimeline = ({ + draggableId, + fieldName, +}: { + draggableId: DraggableId | undefined; + fieldName: string; +}) => { + const startDragToTimeline = useCallback(() => { + if (_sensorApiSingleton == null) { + throw new TypeError( + 'To use this hook, the companion `useAddToTimelineSensor` hook must be registered in the `sensors` prop of the `DragDropContext`.' + ); + } + + if (draggableId == null) { + // A request to start the animation should not have been made, because + // no draggableId was provided + return; + } + + // add the dragging class, which will show the flyout data providers (if the flyout button is being displayed): + document.body.classList.add(IS_DRAGGING_CLASS_NAME); + + // start the animation after the flyout data providers are visible: + setTimeout(() => { + const draggableCoordinate = getDraggableCoordinate(draggableId); + const dropTargetCoordinate = getDropTargetCoordinate(); + const preDrag = _sensorApiSingleton.tryGetLock(draggableId); + + if (draggableCoordinate != null && dropTargetCoordinate != null && preDrag != null) { + const steps = 10; + const points = d3.range(steps + 1).map(i => ({ + x: d3.interpolate(draggableCoordinate.x, dropTargetCoordinate.x)(i * 0.1), + y: d3.interpolate(draggableCoordinate.y, dropTargetCoordinate.y)(i * 0.1), + })); + + const drag = preDrag.fluidLift(draggableCoordinate); + animate({ + drag, + fieldName, + values: points, + }); + } else { + document.body.classList.remove(IS_DRAGGING_CLASS_NAME); // it was not possible to perform a drag and drop + } + }, 0); + }, [_sensorApiSingleton, draggableId]); + + return startDragToTimeline; +}; diff --git a/x-pack/plugins/siem/public/hooks/use_providers_portal.tsx b/x-pack/plugins/siem/public/hooks/use_providers_portal.tsx new file mode 100644 index 0000000000000..1099215f755ee --- /dev/null +++ b/x-pack/plugins/siem/public/hooks/use_providers_portal.tsx @@ -0,0 +1,20 @@ +/* + * 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. + */ + +import { useState } from 'react'; +import { createPortalNode } from 'react-reverse-portal'; + +/** + * A singleton portal for rendering the draggable groups of providers in the + * header of the timeline, or in the animated flyout + */ +const proivdersPortalNodeSingleton = createPortalNode(); + +export const useProvidersPortal = () => { + const [proivdersPortalNode] = useState(proivdersPortalNodeSingleton); + + return proivdersPortalNode; +}; diff --git a/x-pack/plugins/siem/public/pages/case/components/configure_cases/connectors.test.tsx b/x-pack/plugins/siem/public/pages/case/components/configure_cases/connectors.test.tsx index 125a42b126466..b0271f6849ac5 100644 --- a/x-pack/plugins/siem/public/pages/case/components/configure_cases/connectors.test.tsx +++ b/x-pack/plugins/siem/public/pages/case/components/configure_cases/connectors.test.tsx @@ -16,13 +16,17 @@ describe('Connectors', () => { let wrapper: ReactWrapper; const onChangeConnector = jest.fn(); const handleShowAddFlyout = jest.fn(); + const handleShowEditFlyout = jest.fn(); + const props: Props = { disabled: false, + updateConnectorDisabled: false, connectors, selectedConnector: 'none', isLoading: false, onChangeConnector, handleShowAddFlyout, + handleShowEditFlyout, }; beforeAll(() => { @@ -87,4 +91,16 @@ describe('Connectors', () => { expect(onChangeConnector).toHaveBeenCalled(); expect(onChangeConnector).toHaveBeenCalledWith('none'); }); + + test('the text of the update button is shown correctly', () => { + const newWrapper = mount(<Connectors {...props} selectedConnector={'servicenow-1'} />, { + wrappingComponent: TestProviders, + }); + + expect( + newWrapper + .find('button[data-test-subj="case-configure-update-selected-connector-button"]') + .text() + ).toBe('Update My Connector'); + }); }); diff --git a/x-pack/plugins/siem/public/pages/case/components/configure_cases/connectors.tsx b/x-pack/plugins/siem/public/pages/case/components/configure_cases/connectors.tsx index de6d5f76cfad0..1b1439d3bac43 100644 --- a/x-pack/plugins/siem/public/pages/case/components/configure_cases/connectors.tsx +++ b/x-pack/plugins/siem/public/pages/case/components/configure_cases/connectors.tsx @@ -4,13 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; +import React, { useMemo } from 'react'; import { EuiDescribedFormGroup, EuiFormRow, EuiFlexGroup, EuiFlexItem, EuiLink, + EuiButton, } from '@elastic/eui'; import styled from 'styled-components'; @@ -28,35 +29,55 @@ const EuiFormRowExtended = styled(EuiFormRow)` } `; +const AddConnectorEuiFormRow = styled(EuiFormRow)` + width: 100%; + max-width: 100%; + text-align: right; +`; + export interface Props { connectors: Connector[]; disabled: boolean; isLoading: boolean; + updateConnectorDisabled: boolean; onChangeConnector: (id: string) => void; selectedConnector: string; handleShowAddFlyout: () => void; + handleShowEditFlyout: () => void; } const ConnectorsComponent: React.FC<Props> = ({ connectors, - disabled, isLoading, + disabled, + updateConnectorDisabled, onChangeConnector, selectedConnector, handleShowAddFlyout, + handleShowEditFlyout, }) => { - const dropDownLabel = ( - <EuiFlexGroup justifyContent="spaceBetween"> - <EuiFlexItem grow={false}>{i18n.INCIDENT_MANAGEMENT_SYSTEM_LABEL}</EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiLink - disabled={disabled} - onClick={handleShowAddFlyout} - data-test-subj="case-configure-add-connector-button" - > - {i18n.ADD_NEW_CONNECTOR} - </EuiLink> - </EuiFlexItem> - </EuiFlexGroup> + const connectorsName = useMemo( + () => connectors.find(c => c.id === selectedConnector)?.name ?? 'none', + [connectors, selectedConnector] + ); + + const dropDownLabel = useMemo( + () => ( + <EuiFlexGroup justifyContent="spaceBetween"> + <EuiFlexItem grow={false}>{i18n.INCIDENT_MANAGEMENT_SYSTEM_LABEL}</EuiFlexItem> + <EuiFlexItem grow={false}> + {connectorsName !== 'none' && ( + <EuiLink + disabled={updateConnectorDisabled} + onClick={handleShowEditFlyout} + data-test-subj="case-configure-update-selected-connector-button" + > + {i18n.UPDATE_SELECTED_CONNECTOR(connectorsName)} + </EuiLink> + )} + </EuiFlexItem> + </EuiFlexGroup> + ), + [connectorsName] ); return ( @@ -81,6 +102,16 @@ const ConnectorsComponent: React.FC<Props> = ({ data-test-subj="case-connectors-dropdown" /> </EuiFormRowExtended> + <AddConnectorEuiFormRow> + <EuiButton + fill + disabled={disabled} + onClick={handleShowAddFlyout} + data-test-subj="case-configure-add-connector-button" + > + {i18n.ADD_NEW_CONNECTOR} + </EuiButton> + </AddConnectorEuiFormRow> </EuiDescribedFormGroup> </> ); diff --git a/x-pack/plugins/siem/public/pages/case/components/configure_cases/index.test.tsx b/x-pack/plugins/siem/public/pages/case/components/configure_cases/index.test.tsx index 0359c1dbdba67..08975703241c7 100644 --- a/x-pack/plugins/siem/public/pages/case/components/configure_cases/index.test.tsx +++ b/x-pack/plugins/siem/public/pages/case/components/configure_cases/index.test.tsx @@ -11,13 +11,11 @@ import { ConfigureCases } from './'; import { TestProviders } from '../../../../mock'; import { Connectors } from './connectors'; import { ClosureOptions } from './closure_options'; -import { Mapping } from './mapping'; import { ActionsConnectorsContextProvider, ConnectorAddFlyout, ConnectorEditFlyout, } from '../../../../../../triggers_actions_ui/public'; -import { EuiBottomBar } from '@elastic/eui'; import { useKibana } from '../../../../lib/kibana'; import { useConnectors } from '../../../../containers/case/configure/use_connectors'; @@ -55,17 +53,11 @@ describe('ConfigureCases', () => { }); test('it renders the Connectors', () => { - expect(wrapper.find('[data-test-subj="case-connectors-form-group"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="dropdown-connectors"]').exists()).toBeTruthy(); }); test('it renders the ClosureType', () => { - expect( - wrapper.find('[data-test-subj="case-closure-options-form-group"]').exists() - ).toBeTruthy(); - }); - - test('it renders the Mapping', () => { - expect(wrapper.find('[data-test-subj="case-mapping-form-group"]').exists()).toBeTruthy(); + expect(wrapper.find('[data-test-subj="closure-options-radio-group"]').exists()).toBeTruthy(); }); test('it renders the ActionsConnectorsContextProvider', () => { @@ -127,8 +119,12 @@ describe('ConfigureCases', () => { ).toBeTruthy(); }); - test('it disables the update connector button when the connectorId is invalid', () => { - expect(wrapper.find(Mapping).prop('disabled')).toBe(true); + test('it hides the update connector button when the connectorId is invalid', () => { + expect( + wrapper + .find('button[data-test-subj="case-configure-update-selected-connector-button"]') + .exists() + ).toBeFalsy(); }); }); @@ -171,14 +167,6 @@ describe('ConfigureCases', () => { expect(wrapper.find(ClosureOptions).prop('disabled')).toBe(false); expect(wrapper.find(ClosureOptions).prop('closureTypeSelected')).toBe('close-by-user'); - // Mapping - expect(wrapper.find(Mapping).prop('disabled')).toBe(true); - expect(wrapper.find(Mapping).prop('updateConnectorDisabled')).toBe(false); - expect(wrapper.find(Mapping).prop('connectorActionTypeId')).toBe('.servicenow'); - expect(wrapper.find(Mapping).prop('mapping')).toEqual( - connectors[0].config.casesConfiguration.mapping - ); - // Flyouts expect(wrapper.find(ConnectorAddFlyout).prop('addFlyoutVisible')).toBe(false); expect(wrapper.find(ConnectorAddFlyout).prop('actionTypes')).toEqual([ @@ -200,28 +188,41 @@ describe('ConfigureCases', () => { ).toBeFalsy(); }); - test('it disables the mapping permanently', () => { - expect(wrapper.find(Mapping).prop('disabled')).toBe(true); - }); - - test('it sets the mapping of a connector correctly', () => { - expect(wrapper.find(Mapping).prop('mapping')).toEqual( - connectors[0].config.casesConfiguration.mapping - ); - }); - - // TODO: When mapping is enabled the test.todo should be implemented. - test.todo('it disables the update connector button when loading the configuration'); - test('it disables correctly when the user cannot crud', () => { const newWrapper = mount(<ConfigureCases userCanCrud={false} />, { wrappingComponent: TestProviders, }); - expect(newWrapper.find(Connectors).prop('disabled')).toBe(true); - expect(newWrapper.find(ClosureOptions).prop('disabled')).toBe(true); - expect(newWrapper.find(Mapping).prop('disabled')).toBe(true); - expect(newWrapper.find(Mapping).prop('updateConnectorDisabled')).toBe(true); + expect(newWrapper.find('button[data-test-subj="dropdown-connectors"]').prop('disabled')).toBe( + true + ); + + expect( + newWrapper + .find('button[data-test-subj="case-configure-add-connector-button"]') + .prop('disabled') + ).toBe(true); + + expect( + newWrapper + .find('button[data-test-subj="case-configure-update-selected-connector-button"]') + .prop('disabled') + ).toBe(true); + + // Two closure options + expect( + newWrapper + .find('[data-test-subj="closure-options-radio-group"] input') + .first() + .prop('disabled') + ).toBe(true); + + expect( + newWrapper + .find('[data-test-subj="closure-options-radio-group"] input') + .at(1) + .prop('disabled') + ).toBe(true); }); }); @@ -232,7 +233,18 @@ describe('ConfigureCases', () => { jest.resetAllMocks(); jest.restoreAllMocks(); jest.clearAllMocks(); - useCaseConfigureMock.mockImplementation(() => useCaseConfigureResponse); + useCaseConfigureMock.mockImplementation(() => ({ + ...useCaseConfigureResponse, + mapping: connectors[1].config.casesConfiguration.mapping, + closureType: 'close-by-user', + connectorId: 'servicenow-2', + connectorName: 'unchanged', + currentConfiguration: { + connectorName: 'unchanged', + connectorId: 'servicenow-1', + closureType: 'close-by-user', + }, + })); useConnectorsMock.mockImplementation(() => ({ ...useConnectorsResponse, loading: true, @@ -243,7 +255,9 @@ describe('ConfigureCases', () => { }); test('it disables correctly Connector when loading connectors', () => { - expect(wrapper.find(Connectors).prop('disabled')).toBe(true); + expect( + wrapper.find('button[data-test-subj="dropdown-connectors"]').prop('disabled') + ).toBeTruthy(); }); test('it pass the correct value to isLoading attribute on Connector', () => { @@ -254,38 +268,31 @@ describe('ConfigureCases', () => { expect(wrapper.find(ClosureOptions).prop('disabled')).toBe(true); }); - test('it disables the update connector button when loading the connectors', () => { - expect(wrapper.find(Mapping).prop('disabled')).toBe(true); + test('it hides the update connector button when loading the connectors', () => { + expect( + wrapper + .find('button[data-test-subj="case-configure-update-selected-connector-button"]') + .prop('disabled') + ).toBe(true); }); + test('it disables the buttons of action bar when loading connectors', () => { - useCaseConfigureMock.mockImplementation(() => ({ - ...useCaseConfigureResponse, - mapping: connectors[1].config.casesConfiguration.mapping, - closureType: 'close-by-user', - connectorId: 'servicenow-2', - connectorName: 'unchanged', - currentConfiguration: { - connectorName: 'unchanged', - connectorId: 'servicenow-1', - closureType: 'close-by-user', - }, - })); const newWrapper = mount(<ConfigureCases userCanCrud />, { wrappingComponent: TestProviders, }); expect( newWrapper - .find('[data-test-subj="case-configure-action-bottom-bar-cancel-button"]') + .find('button[data-test-subj="case-configure-action-bottom-bar-cancel-button"]') .first() - .prop('isDisabled') + .prop('disabled') ).toBe(true); expect( newWrapper - .find('[data-test-subj="case-configure-action-bottom-bar-save-button"]') + .find('button[data-test-subj="case-configure-action-bottom-bar-save-button"]') .first() - .prop('isDisabled') + .prop('disabled') ).toBe(true); }); }); @@ -297,6 +304,7 @@ describe('ConfigureCases', () => { jest.resetAllMocks(); useCaseConfigureMock.mockImplementation(() => ({ ...useCaseConfigureResponse, + connectorId: 'servicenow-1', persistLoading: true, })); @@ -311,11 +319,27 @@ describe('ConfigureCases', () => { }); test('it disables correctly ClosureOptions when saving configuration', () => { - expect(wrapper.find(ClosureOptions).prop('disabled')).toBe(true); + expect( + wrapper + .find('[data-test-subj="closure-options-radio-group"] input') + .first() + .prop('disabled') + ).toBe(true); + + expect( + wrapper + .find('[data-test-subj="closure-options-radio-group"] input') + .at(1) + .prop('disabled') + ).toBe(true); }); test('it disables the update connector button when saving the configuration', () => { - expect(wrapper.find(Mapping).prop('disabled')).toBe(true); + expect( + wrapper + .find('button[data-test-subj="case-configure-update-selected-connector-button"]') + .prop('disabled') + ).toBe(true); }); test('it disables the buttons of action bar when saving configuration', () => { @@ -387,6 +411,32 @@ describe('ConfigureCases', () => { }); }); + describe('loading configuration', () => { + let wrapper: ReactWrapper; + + beforeEach(() => { + jest.resetAllMocks(); + useCaseConfigureMock.mockImplementation(() => ({ + ...useCaseConfigureResponse, + loading: true, + })); + useConnectorsMock.mockImplementation(() => ({ + ...useConnectorsResponse, + })); + useKibanaMock.mockImplementation(() => kibanaMockImplementationArgs); + useGetUrlSearchMock.mockImplementation(() => searchURL); + wrapper = mount(<ConfigureCases userCanCrud />, { wrappingComponent: TestProviders }); + }); + + test('it hides the update connector button when loading the configuration', () => { + expect( + wrapper + .find('button[data-test-subj="case-configure-update-selected-connector-button"]') + .exists() + ).toBeFalsy(); + }); + }); + describe('update connector', () => { let wrapper: ReactWrapper; const persistCaseConfigure = jest.fn(); @@ -500,18 +550,22 @@ describe('ConfigureCases', () => { wrapper.update(); expect(wrapper.find(ConnectorAddFlyout).prop('addFlyoutVisible')).toBe(true); - expect(wrapper.find(EuiBottomBar).exists()).toBeFalsy(); + expect( + wrapper.find('[data-test-subj="case-configure-action-bottom-bar"]').exists() + ).toBeFalsy(); }); test('it show the edit flyout when pressing the update connector button', () => { const wrapper = mount(<ConfigureCases userCanCrud />, { wrappingComponent: TestProviders }); wrapper - .find('button[data-test-subj="case-mapping-update-connector-button"]') + .find('button[data-test-subj="case-configure-update-selected-connector-button"]') .simulate('click'); wrapper.update(); expect(wrapper.find(ConnectorEditFlyout).prop('editFlyoutVisible')).toBe(true); - expect(wrapper.find(EuiBottomBar).exists()).toBeFalsy(); + expect( + wrapper.find('[data-test-subj="case-configure-action-bottom-bar"]').exists() + ).toBeFalsy(); }); test('it tracks the changes successfully', () => { @@ -681,7 +735,7 @@ describe('ConfigureCases', () => { // Press update connector button wrapper - .find('button[data-test-subj="case-mapping-update-connector-button"]') + .find('button[data-test-subj="case-configure-update-selected-connector-button"]') .simulate('click'); wrapper.update(); @@ -778,29 +832,29 @@ describe('ConfigureCases', () => { ).toBeFalsy(); }); - test('it sets the mapping correctly when changing connector types', () => { - useCaseConfigureMock.mockImplementation(() => ({ - ...useCaseConfigureResponse, - mapping: connectors[2].config.casesConfiguration.mapping, - closureType: 'close-by-user', - connectorId: 'jira-1', - connectorName: 'unchanged', - currentConfiguration: { - connectorName: 'unchanged', + test('the text of the update button is changed successfully', () => { + useCaseConfigureMock + .mockImplementationOnce(() => ({ + ...useCaseConfigureResponse, connectorId: 'servicenow-1', - closureType: 'close-by-user', - }, - persistLoading: false, - })); + })) + .mockImplementation(() => ({ + ...useCaseConfigureResponse, + connectorId: 'servicenow-2', + })); const wrapper = mount(<ConfigureCases userCanCrud />, { wrappingComponent: TestProviders }); + + wrapper.find('button[data-test-subj="dropdown-connectors"]').simulate('click'); + wrapper.update(); + wrapper.find('button[data-test-subj="dropdown-connector-servicenow-2"]').simulate('click'); + wrapper.update(); + expect( - wrapper.find('button[data-test-subj="case-configure-third-party-select-title"]').text() - ).toBe('Summary'); + wrapper + .find('button[data-test-subj="case-configure-update-selected-connector-button"]') + .text() + ).toBe('Update My Connector 2'); }); - - // TODO: When mapping is enabled the test.todo should be implemented. - test.todo('the mapping is changed successfully when changing the third party'); - test.todo('the mapping is changed successfully when changing the action type'); }); }); diff --git a/x-pack/plugins/siem/public/pages/case/components/configure_cases/index.tsx b/x-pack/plugins/siem/public/pages/case/components/configure_cases/index.tsx index 40def5231a304..739083a5009ec 100644 --- a/x-pack/plugins/siem/public/pages/case/components/configure_cases/index.tsx +++ b/x-pack/plugins/siem/public/pages/case/components/configure_cases/index.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useCallback, useEffect, useState, Dispatch, SetStateAction, useMemo } from 'react'; +import React, { useCallback, useEffect, useState, Dispatch, SetStateAction } from 'react'; import styled, { css } from 'styled-components'; import { @@ -16,7 +16,8 @@ import { EuiButtonEmpty, EuiText, } from '@elastic/eui'; -import { isEmpty, difference } from 'lodash/fp'; + +import { difference } from 'lodash/fp'; import { useKibana } from '../../../../lib/kibana'; import { useConnectors } from '../../../../containers/case/configure/use_connectors'; import { useCaseConfigure } from '../../../../containers/case/configure/use_configure'; @@ -31,12 +32,10 @@ import { import { ActionConnectorTableItem } from '../../../../../../triggers_actions_ui/public/types'; import { getCaseUrl } from '../../../../components/link_to'; import { useGetUrlSearch } from '../../../../components/navigation/use_get_url_search'; -import { CCMapsCombinedActionAttributes } from '../../../../containers/case/configure/types'; import { connectorsConfiguration } from '../../../../lib/connectors/config'; import { Connectors } from '../configure_cases/connectors'; import { ClosureOptions } from '../configure_cases/closure_options'; -import { Mapping } from '../configure_cases/mapping'; import { SectionWrapper } from '../wrappers'; import { navTabs } from '../../../../pages/home/home_navigations'; import * as i18n from './translations'; @@ -79,14 +78,12 @@ const ConfigureCasesComponent: React.FC<ConfigureCasesComponentProps> = ({ userC const { connectorId, closureType, - mapping, currentConfiguration, loading: loadingCaseConfigure, persistLoading, persistCaseConfigure, setConnector, setClosureType, - setMapping, } = useCaseConfigure(); const { loading: isLoadingConnectors, connectors, refetchConnectors } = useConnectors(); @@ -107,7 +104,7 @@ const ConfigureCasesComponent: React.FC<ConfigureCasesComponentProps> = ({ userC closureType, }); }, - [connectorId, connectors, closureType, mapping] + [connectorId, connectors, closureType] ); const onClickAddConnector = useCallback(() => { @@ -149,24 +146,6 @@ const ConfigureCasesComponent: React.FC<ConfigureCasesComponentProps> = ({ userC [currentConfiguration, connectorId, closureType] ); - useEffect(() => { - if ( - !isEmpty(connectors) && - connectorId !== 'none' && - connectors.some(c => c.id === connectorId) - ) { - const myConnector = connectors.find(c => c.id === connectorId); - const myMapping = myConnector?.config?.casesConfiguration?.mapping ?? []; - setMapping( - myMapping.map((m: CCMapsCombinedActionAttributes) => ({ - source: m.source, - target: m.target, - actionType: m.action_type ?? m.actionType, - })) - ); - } - }, [connectors, connectorId]); - useEffect(() => { if ( !isLoadingConnectors && @@ -200,11 +179,6 @@ const ConfigureCasesComponent: React.FC<ConfigureCasesComponentProps> = ({ userC currentConfiguration.closureType, ]); - const connectorActionTypeId = useMemo( - () => connectors.find(c => c.id === connectorId)?.actionTypeId ?? '.none', - [connectorId, connectors] - ); - return ( <FormWrapper> {!connectorIsValid && ( @@ -219,16 +193,6 @@ const ConfigureCasesComponent: React.FC<ConfigureCasesComponentProps> = ({ userC </EuiCallOut> </SectionWrapper> )} - <SectionWrapper> - <Connectors - connectors={connectors ?? []} - disabled={persistLoading || isLoadingConnectors || !userCanCrud} - isLoading={isLoadingConnectors} - onChangeConnector={setConnector} - handleShowAddFlyout={onClickAddConnector} - selectedConnector={connectorId} - /> - </SectionWrapper> <SectionWrapper> <ClosureOptions closureTypeSelected={closureType} @@ -237,13 +201,15 @@ const ConfigureCasesComponent: React.FC<ConfigureCasesComponentProps> = ({ userC /> </SectionWrapper> <SectionWrapper> - <Mapping - disabled + <Connectors + connectors={connectors ?? []} + disabled={persistLoading || isLoadingConnectors || !userCanCrud} + isLoading={isLoadingConnectors} + onChangeConnector={setConnector} updateConnectorDisabled={updateConnectorDisabled || !userCanCrud} - mapping={mapping} - connectorActionTypeId={connectorActionTypeId} - onChangeMapping={setMapping} - setEditFlyoutVisibility={onClickUpdateConnector} + handleShowAddFlyout={onClickAddConnector} + handleShowEditFlyout={onClickUpdateConnector} + selectedConnector={connectorId} /> </SectionWrapper> {actionBarVisible && ( diff --git a/x-pack/plugins/siem/public/pages/case/components/configure_cases/translations.ts b/x-pack/plugins/siem/public/pages/case/components/configure_cases/translations.ts index 46d713773a837..58438d5cd666a 100644 --- a/x-pack/plugins/siem/public/pages/case/components/configure_cases/translations.ts +++ b/x-pack/plugins/siem/public/pages/case/components/configure_cases/translations.ts @@ -33,13 +33,13 @@ export const NO_CONNECTOR = i18n.translate('xpack.siem.case.configureCases.noCon }); export const ADD_NEW_CONNECTOR = i18n.translate('xpack.siem.case.configureCases.addNewConnector', { - defaultMessage: 'Add new connector option', + defaultMessage: 'Add new connector', }); export const CASE_CLOSURE_OPTIONS_TITLE = i18n.translate( 'xpack.siem.case.configureCases.caseClosureOptionsTitle', { - defaultMessage: 'Cases Closures', + defaultMessage: 'Case Closures', } ); @@ -170,6 +170,13 @@ export const UPDATE_CONNECTOR = i18n.translate('xpack.siem.case.configureCases.u defaultMessage: 'Update connector', }); +export const UPDATE_SELECTED_CONNECTOR = (connectorName: string): string => { + return i18n.translate('xpack.siem.case.configureCases.updateSelectedConnector', { + values: { connectorName }, + defaultMessage: 'Update { connectorName }', + }); +}; + export const UNSAVED_CHANGES = (unsavedChanges: number): string => { return i18n.translate('xpack.siem.case.configureCases.unsavedChanges', { values: { unsavedChanges }, diff --git a/x-pack/plugins/siem/public/pages/timelines/index.tsx b/x-pack/plugins/siem/public/pages/timelines/index.tsx index aa5c891de3628..343be5cbe3839 100644 --- a/x-pack/plugins/siem/public/pages/timelines/index.tsx +++ b/x-pack/plugins/siem/public/pages/timelines/index.tsx @@ -6,11 +6,66 @@ import React from 'react'; import { ApolloConsumer } from 'react-apollo'; +import { Switch, Route, Redirect } from 'react-router-dom'; + +import { ChromeBreadcrumb } from '../../../../../../src/core/public'; + +import { TimelineType } from '../../../common/types/timeline'; +import { TAB_TIMELINES, TAB_TEMPLATES } from '../../components/open_timeline/translations'; +import { getTimelinesUrl } from '../../components/link_to'; +import { TimelineRouteSpyState } from '../../utils/route/types'; + +import { SiemPageName } from '../home/types'; import { TimelinesPage } from './timelines_page'; +import { PAGE_TITLE } from './translations'; +import { appendSearch } from '../../components/link_to/helpers'; +const timelinesPagePath = `/:pageName(${SiemPageName.timelines})/:tabName(${TimelineType.default}|${TimelineType.template})`; +const timelinesDefaultPath = `/${SiemPageName.timelines}/${TimelineType.default}`; + +const TabNameMappedToI18nKey: Record<TimelineType, string> = { + [TimelineType.default]: TAB_TIMELINES, + [TimelineType.template]: TAB_TEMPLATES, +}; + +export const getBreadcrumbs = ( + params: TimelineRouteSpyState, + search: string[] +): ChromeBreadcrumb[] => { + let breadcrumb = [ + { + text: PAGE_TITLE, + href: `${getTimelinesUrl(appendSearch(search[1]))}`, + }, + ]; + + const tabName = params?.tabName; + if (!tabName) return breadcrumb; + + breadcrumb = [ + ...breadcrumb, + { + text: TabNameMappedToI18nKey[tabName], + href: '', + }, + ]; + return breadcrumb; +}; -export const Timelines = React.memo(() => ( - <ApolloConsumer>{client => <TimelinesPage apolloClient={client} />}</ApolloConsumer> -)); +export const Timelines = React.memo(() => { + return ( + <Switch> + <Route exact path={timelinesPagePath}> + <ApolloConsumer>{client => <TimelinesPage apolloClient={client} />}</ApolloConsumer> + </Route> + <Route + path={`/${SiemPageName.timelines}/`} + render={({ location: { search = '' } }) => ( + <Redirect to={`${timelinesDefaultPath}${appendSearch(search)}`} /> + )} + /> + </Switch> + ); +}); Timelines.displayName = 'Timelines'; diff --git a/x-pack/plugins/siem/public/plugin.tsx b/x-pack/plugins/siem/public/plugin.tsx index 2f2bd70569dcd..f4310e1b073ab 100644 --- a/x-pack/plugins/siem/public/plugin.tsx +++ b/x-pack/plugins/siem/public/plugin.tsx @@ -12,6 +12,7 @@ import { CoreStart, PluginInitializerContext, Plugin as IPlugin, + DEFAULT_APP_CATEGORIES, } from '../../../../src/core/public'; import { HomePublicPluginSetup, @@ -91,6 +92,7 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S title: APP_NAME, order: 9000, euiIconType: APP_ICON, + category: DEFAULT_APP_CATEGORIES.security, async mount(params: AppMountParameters) { const [coreStart, startPlugins] = await core.getStartServices(); const { renderApp } = await import('./app'); diff --git a/x-pack/plugins/siem/public/store/timeline/model.ts b/x-pack/plugins/siem/public/store/timeline/model.ts index 7885064380eff..54e19812634ac 100644 --- a/x-pack/plugins/siem/public/store/timeline/model.ts +++ b/x-pack/plugins/siem/public/store/timeline/model.ts @@ -80,7 +80,7 @@ export interface TimelineModel { }; /** Title */ title: string; - /** timelineTypes: default | template */ + /** timelineType: default | template */ timelineType: TimelineTypeLiteralWithNull; /** an unique id for template timeline */ templateTimelineId: string | null; diff --git a/x-pack/plugins/siem/public/utils/route/types.ts b/x-pack/plugins/siem/public/utils/route/types.ts index d3eca36bd0d96..17b312a427c43 100644 --- a/x-pack/plugins/siem/public/utils/route/types.ts +++ b/x-pack/plugins/siem/public/utils/route/types.ts @@ -8,11 +8,13 @@ import * as H from 'history'; import React from 'react'; import { RouteComponentProps } from 'react-router-dom'; +import { TimelineType } from '../../../common/types/timeline'; + import { HostsTableType } from '../../store/hosts/model'; import { NetworkRouteType } from '../../pages/network/navigation/types'; import { FlowTarget } from '../../graphql/types'; -export type SiemRouteType = HostsTableType | NetworkRouteType; +export type SiemRouteType = HostsTableType | NetworkRouteType | TimelineType; export interface RouteSpyState { pageName: string; detailName: string | undefined; @@ -32,6 +34,10 @@ export interface NetworkRouteSpyState extends RouteSpyState { tabName: NetworkRouteType | undefined; } +export interface TimelineRouteSpyState extends RouteSpyState { + tabName: TimelineType | undefined; +} + export type RouteSpyAction = | { type: 'updateSearch'; diff --git a/x-pack/plugins/siem/scripts/optimize_tsconfig/tsconfig.json b/x-pack/plugins/siem/scripts/optimize_tsconfig/tsconfig.json index fb89c0e0fc3e2..fb838d82f14ed 100644 --- a/x-pack/plugins/siem/scripts/optimize_tsconfig/tsconfig.json +++ b/x-pack/plugins/siem/scripts/optimize_tsconfig/tsconfig.json @@ -3,7 +3,7 @@ "typings/**/*", "plugins/siem/**/*", "plugins/apm/typings/numeral.d.ts", - "legacy/plugins/canvas/types/webpack.d.ts", + "plugins/canvas/types/webpack.d.ts", "plugins/triggers_actions_ui/**/*" ], "exclude": [ diff --git a/x-pack/plugins/siem/server/graphql/timeline/resolvers.ts b/x-pack/plugins/siem/server/graphql/timeline/resolvers.ts index a33751179e93a..a40ef5466c780 100644 --- a/x-pack/plugins/siem/server/graphql/timeline/resolvers.ts +++ b/x-pack/plugins/siem/server/graphql/timeline/resolvers.ts @@ -52,7 +52,8 @@ export const createTimelineResolvers = ( args.onlyUserFavorite || null, args.pageInfo || null, args.search || null, - args.sort || null + args.sort || null, + args.timelineType || null ); }, }, diff --git a/x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts b/x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts index bc2b3a53d85f3..a1c13fd21a88e 100644 --- a/x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts +++ b/x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts @@ -278,7 +278,7 @@ export const timelineSchema = gql` extend type Query { getOneTimeline(id: ID!): TimelineResult! - getAllTimeline(pageInfo: PageInfoTimeline, search: String, sort: SortTimeline, onlyUserFavorite: Boolean): ResponseTimelines! + getAllTimeline(pageInfo: PageInfoTimeline, search: String, sort: SortTimeline, onlyUserFavorite: Boolean, timelineType: String): ResponseTimelines! } extend type Mutation { diff --git a/x-pack/plugins/siem/server/graphql/types.ts b/x-pack/plugins/siem/server/graphql/types.ts index 6a35ba08f8e43..d74086357edbe 100644 --- a/x-pack/plugins/siem/server/graphql/types.ts +++ b/x-pack/plugins/siem/server/graphql/types.ts @@ -2237,6 +2237,8 @@ export interface GetAllTimelineQueryArgs { sort?: Maybe<SortTimeline>; onlyUserFavorite?: Maybe<boolean>; + + timelineType?: Maybe<string>; } export interface AuthenticationsSourceArgs { timerange: TimerangeInput; @@ -2693,6 +2695,8 @@ export namespace QueryResolvers { sort?: Maybe<SortTimeline>; onlyUserFavorite?: Maybe<boolean>; + + timelineType?: Maybe<string>; } } diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts index 99621f1391acb..4a79dada07171 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts @@ -119,35 +119,35 @@ export const importTimelinesRoute = ( return null; } const { - savedObjectId, + savedObjectId = null, pinnedEventIds, globalNotes, eventNotes, templateTimelineId, templateTimelineVersion, timelineType, + version = null, } = parsedTimeline; const parsedTimelineObject = omit( timelineSavedObjectOmittedFields, parsedTimeline ); + let newTimeline = null; try { const templateTimeline = templateTimelineId != null ? await getTemplateTimeline(frameworkRequest, templateTimelineId) : null; + const timeline = - templateTimeline?.savedObjectId != null || savedObjectId != null - ? await getTimeline( - frameworkRequest, - templateTimeline?.savedObjectId ?? savedObjectId - ) - : null; + savedObjectId != null && + (await getTimeline(frameworkRequest, savedObjectId)); const isHandlingTemplateTimeline = timelineType === TimelineType.template; + if ( (timeline == null && !isHandlingTemplateTimeline) || - (templateTimeline == null && isHandlingTemplateTimeline) + (timeline == null && templateTimeline == null && isHandlingTemplateTimeline) ) { // create timeline / template timeline newTimeline = await createTimelines( @@ -156,7 +156,9 @@ export const importTimelinesRoute = ( null, // timelineSavedObjectId null, // timelineVersion pinnedEventIds, - [...globalNotes, ...eventNotes], + isHandlingTemplateTimeline + ? globalNotes + : [...globalNotes, ...eventNotes], [] // existing note ids ); @@ -165,6 +167,7 @@ export const importTimelinesRoute = ( status_code: 200, }); } else if ( + timeline && timeline != null && templateTimeline != null && isHandlingTemplateTimeline @@ -172,8 +175,8 @@ export const importTimelinesRoute = ( // update template timeline const errorObj = checkIsFailureCases( isHandlingTemplateTimeline, - timeline.version, - templateTimeline.templateTimelineVersion ?? null, + version, + templateTimelineVersion ?? null, timeline, templateTimeline ); @@ -198,16 +201,16 @@ export const importTimelinesRoute = ( } else { resolve( createBulkErrorObject({ - id: savedObjectId, + id: savedObjectId ?? 'unknown', statusCode: 409, - message: `timeline_id: "${timeline?.savedObjectId}" already exists`, + message: `timeline_id: "${savedObjectId}" already exists`, }) ); } } catch (err) { resolve( createBulkErrorObject({ - id: savedObjectId, + id: savedObjectId ?? 'unknown', statusCode: 400, message: err.message, }) diff --git a/x-pack/plugins/siem/server/lib/timeline/routes/utils/import_timelines.ts b/x-pack/plugins/siem/server/lib/timeline/routes/utils/import_timelines.ts index a49627d40c8f5..3f46b9ba91dc4 100644 --- a/x-pack/plugins/siem/server/lib/timeline/routes/utils/import_timelines.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/utils/import_timelines.ts @@ -18,7 +18,8 @@ export interface ImportTimelinesSchema { } export type ImportedTimeline = SavedTimeline & { - savedObjectId: string; + savedObjectId: string | null; + version: string | null; pinnedEventIds: string[]; globalNotes: NoteResult[]; eventNotes: NoteResult[]; @@ -86,16 +87,18 @@ export const isBulkError = ( return has('error', importRuleResponse); }; +/** + * This fields do not exists in savedObject mapping, but exist in Users' import, + * exclude them here to avoid creating savedObject failure + */ export const timelineSavedObjectOmittedFields = [ 'globalNotes', 'eventNotes', 'pinnedEventIds', - 'version', 'savedObjectId', 'created', 'createdBy', 'updated', 'updatedBy', - 'templateTimelineId', - 'templateTimelineVersion', + 'version', ]; diff --git a/x-pack/plugins/siem/server/lib/timeline/saved_object.ts b/x-pack/plugins/siem/server/lib/timeline/saved_object.ts index d2df7589f3c4a..6d022ab42fa7b 100644 --- a/x-pack/plugins/siem/server/lib/timeline/saved_object.ts +++ b/x-pack/plugins/siem/server/lib/timeline/saved_object.ts @@ -47,7 +47,8 @@ export interface Timeline { onlyUserFavorite: boolean | null, pageInfo: PageInfoTimeline | null, search: string | null, - sort: SortTimeline | null + sort: SortTimeline | null, + timelineType: string | null ) => Promise<ResponseTimelines>; persistFavorite: ( @@ -94,12 +95,24 @@ export const getTimelineByTemplateTimelineId = async ( return getAllSavedTimeline(request, options); }; +/** The filter here is able to handle the legacy data, + * which has no timelineType exists in the savedObject */ +const getTimelineTypeFilter = (timelineType: string | null) => { + return timelineType === TimelineType.template + ? `siem-ui-timeline.attributes.timelineType: ${TimelineType.template}` /** Show only whose timelineType exists and equals to "template" */ + : /** Show me every timeline whose timelineType is not "template". + * which includes timelineType === 'default' and + * those timelineType doesn't exists */ + `not siem-ui-timeline.attributes.timelineType: ${TimelineType.template}`; +}; + export const getAllTimeline = async ( request: FrameworkRequest, onlyUserFavorite: boolean | null, pageInfo: PageInfoTimeline | null, search: string | null, - sort: SortTimeline | null + sort: SortTimeline | null, + timelineType: string | null ): Promise<ResponseTimelines> => { const options: SavedObjectsFindOptions = { type: timelineSavedObjectType, @@ -109,6 +122,7 @@ export const getAllTimeline = async ( searchFields: onlyUserFavorite ? ['title', 'description', 'favorite.keySearch'] : ['title', 'description'], + filter: getTimelineTypeFilter(timelineType), sortField: sort != null ? sort.sortField : undefined, sortOrder: sort != null ? sort.sortOrder : undefined, }; diff --git a/x-pack/plugins/spaces/public/nav_control/__snapshots__/nav_control_popover.test.tsx.snap b/x-pack/plugins/spaces/public/nav_control/__snapshots__/nav_control_popover.test.tsx.snap index 22d65f4600e05..10c3eed388ff7 100644 --- a/x-pack/plugins/spaces/public/nav_control/__snapshots__/nav_control_popover.test.tsx.snap +++ b/x-pack/plugins/spaces/public/nav_control/__snapshots__/nav_control_popover.test.tsx.snap @@ -4,7 +4,7 @@ exports[`NavControlPopover renders without crashing 1`] = ` <EuiPopover anchorPosition="downRight" button={ - <EuiHeaderSectionItemButton + <ForwardRef aria-controls="headerSpacesMenuContent" aria-expanded={false} aria-haspopup="true" @@ -15,7 +15,7 @@ exports[`NavControlPopover renders without crashing 1`] = ` <EuiLoadingSpinner size="m" /> - </EuiHeaderSectionItemButton> + </ForwardRef> } closePopover={[Function]} data-test-subj="spacesNavSelector" diff --git a/x-pack/plugins/spaces/server/saved_objects/mappings.ts b/x-pack/plugins/spaces/server/saved_objects/mappings.ts index 00e1ab732a8a5..3afa7c389927c 100644 --- a/x-pack/plugins/spaces/server/saved_objects/mappings.ts +++ b/x-pack/plugins/spaces/server/saved_objects/mappings.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { deepFreeze } from '../../../../../src/core/utils'; +import { deepFreeze } from '../../../../../src/core/server'; export const SpacesSavedObjectMappings = deepFreeze({ properties: { diff --git a/x-pack/plugins/task_manager/server/create_task_manager.test.ts b/x-pack/plugins/task_manager/server/create_task_manager.test.ts deleted file mode 100644 index 133cfcac4c046..0000000000000 --- a/x-pack/plugins/task_manager/server/create_task_manager.test.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ - -import { createTaskManager, LegacyDeps } from './create_task_manager'; -import { mockLogger } from './test_utils'; -import { CoreSetup, SavedObjectsSerializer, UuidServiceSetup } from '../../../../src/core/server'; -import { - savedObjectsRepositoryMock, - savedObjectsTypeRegistryMock, -} from '../../../../src/core/server/mocks'; - -jest.mock('./task_manager'); - -describe('createTaskManager', () => { - const uuid: UuidServiceSetup = { - getInstanceUuid() { - return 'some-uuid'; - }, - }; - const mockCoreSetup = { - uuid, - } as CoreSetup; - - const getMockLegacyDeps = (): LegacyDeps => ({ - config: {}, - savedObjectsSerializer: new SavedObjectsSerializer(savedObjectsTypeRegistryMock.create()), - elasticsearch: { - callAsInternalUser: jest.fn(), - }, - savedObjectsRepository: savedObjectsRepositoryMock.create(), - logger: mockLogger(), - }); - - beforeEach(() => { - jest.resetAllMocks(); - }); - - test('exposes the underlying TaskManager', async () => { - const mockLegacyDeps = getMockLegacyDeps(); - const setupResult = createTaskManager(mockCoreSetup, mockLegacyDeps); - expect(setupResult).toMatchInlineSnapshot(` - TaskManager { - "addMiddleware": [MockFunction], - "assertUninitialized": [MockFunction], - "attemptToRun": [MockFunction], - "ensureScheduled": [MockFunction], - "fetch": [MockFunction], - "get": [MockFunction], - "registerTaskDefinitions": [MockFunction], - "remove": [MockFunction], - "runNow": [MockFunction], - "schedule": [MockFunction], - "start": [MockFunction], - "stop": [MockFunction], - "waitUntilStarted": [MockFunction], - } - `); - }); -}); diff --git a/x-pack/plugins/task_manager/server/create_task_manager.ts b/x-pack/plugins/task_manager/server/create_task_manager.ts deleted file mode 100644 index 7ab6acba7976d..0000000000000 --- a/x-pack/plugins/task_manager/server/create_task_manager.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -import { - IClusterClient, - SavedObjectsSerializer, - CoreSetup, - ISavedObjectsRepository, -} from '../../../../src/core/server'; -import { TaskManager } from './task_manager'; -import { Logger } from './types'; -import { TaskManagerConfig } from './config'; - -export interface LegacyDeps { - config: unknown; - elasticsearch: Pick<IClusterClient, 'callAsInternalUser'>; - savedObjectsRepository: ISavedObjectsRepository; - savedObjectsSerializer: SavedObjectsSerializer; - logger: Logger; -} - -export function createTaskManager( - core: CoreSetup, - { - logger, - config, - elasticsearch: { callAsInternalUser }, - savedObjectsRepository, - savedObjectsSerializer, - }: LegacyDeps -) { - return new TaskManager({ - taskManagerId: core.uuid.getInstanceUuid(), - config: config as TaskManagerConfig, - savedObjectsRepository, - serializer: savedObjectsSerializer, - callAsInternalUser, - logger, - }); -} diff --git a/x-pack/plugins/task_manager/server/mocks.ts b/x-pack/plugins/task_manager/server/mocks.ts index 8ec05dd1bd401..4a78a0b49001b 100644 --- a/x-pack/plugins/task_manager/server/mocks.ts +++ b/x-pack/plugins/task_manager/server/mocks.ts @@ -8,7 +8,6 @@ import { TaskManagerSetupContract, TaskManagerStartContract } from './plugin'; const createSetupMock = () => { const mock: jest.Mocked<TaskManagerSetupContract> = { - registerLegacyAPI: jest.fn(), addMiddleware: jest.fn(), registerTaskDefinitions: jest.fn(), }; diff --git a/x-pack/plugins/task_manager/server/plugin.ts b/x-pack/plugins/task_manager/server/plugin.ts index 0f6e3fc31d96d..4295dbf912c4c 100644 --- a/x-pack/plugins/task_manager/server/plugin.ts +++ b/x-pack/plugins/task_manager/server/plugin.ts @@ -3,20 +3,19 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { PluginInitializerContext, Plugin, CoreSetup } from 'src/core/server'; +import { PluginInitializerContext, Plugin, CoreSetup, CoreStart } from 'src/core/server'; import { Subject } from 'rxjs'; import { first } from 'rxjs/operators'; -import { once } from 'lodash'; import { TaskDictionary, TaskDefinition } from './task'; import { TaskManager } from './task_manager'; -import { createTaskManager } from './create_task_manager'; import { TaskManagerConfig } from './config'; import { Middleware } from './lib/middleware'; import { setupSavedObjects } from './saved_objects'; -export type TaskManagerSetupContract = { - registerLegacyAPI: () => Promise<TaskManager>; -} & Pick<TaskManager, 'addMiddleware' | 'registerTaskDefinitions'>; +export type TaskManagerSetupContract = Pick< + TaskManager, + 'addMiddleware' | 'registerTaskDefinitions' +>; export type TaskManagerStartContract = Pick< TaskManager, @@ -28,39 +27,24 @@ export class TaskManagerPlugin legacyTaskManager$: Subject<TaskManager> = new Subject<TaskManager>(); taskManager: Promise<TaskManager> = this.legacyTaskManager$.pipe(first()).toPromise(); currentConfig: TaskManagerConfig; + taskManagerId?: string; + config?: TaskManagerConfig; constructor(private readonly initContext: PluginInitializerContext) { this.initContext = initContext; this.currentConfig = {} as TaskManagerConfig; } - public async setup(core: CoreSetup, plugins: unknown): Promise<TaskManagerSetupContract> { - const logger = this.initContext.logger.get('taskManager'); - const config = await this.initContext.config + public async setup(core: CoreSetup): Promise<TaskManagerSetupContract> { + this.config = await this.initContext.config .create<TaskManagerConfig>() .pipe(first()) .toPromise(); - setupSavedObjects(core.savedObjects, config); + setupSavedObjects(core.savedObjects, this.config); + this.taskManagerId = core.uuid.getInstanceUuid(); return { - registerLegacyAPI: once(() => { - (async () => { - const [{ savedObjects, elasticsearch }] = await core.getStartServices(); - const savedObjectsRepository = savedObjects.createInternalRepository(['task']); - this.legacyTaskManager$.next( - createTaskManager(core, { - logger, - config, - elasticsearch: elasticsearch.legacy.client, - savedObjectsRepository, - savedObjectsSerializer: savedObjects.createSerializer(), - }) - ); - this.legacyTaskManager$.complete(); - })(); - return this.taskManager; - }), addMiddleware: (middleware: Middleware) => { this.taskManager.then(tm => tm.addMiddleware(middleware)); }, @@ -70,7 +54,29 @@ export class TaskManagerPlugin }; } - public start(): TaskManagerStartContract { + public start({ savedObjects, elasticsearch }: CoreStart): TaskManagerStartContract { + const logger = this.initContext.logger.get('taskManager'); + const savedObjectsRepository = savedObjects.createInternalRepository(['task']); + + this.legacyTaskManager$.next( + new TaskManager({ + taskManagerId: this.taskManagerId!, + config: this.config!, + savedObjectsRepository, + serializer: savedObjects.createSerializer(), + callAsInternalUser: elasticsearch.legacy.client.callAsInternalUser, + logger, + }) + ); + this.legacyTaskManager$.complete(); + + // we need to "drain" any calls made to the seup API + // before `starting` TaskManager. This is a legacy relic + // of the old API that should be resolved once we split + // Task manager into two services, setup and start, instead + // of the single instance of TaskManager + this.taskManager.then(tm => tm.start()); + return { fetch: (...args) => this.taskManager.then(tm => tm.fetch(...args)), get: (...args) => this.taskManager.then(tm => tm.get(...args)), diff --git a/x-pack/plugins/task_manager/server/task_manager.mock.ts b/x-pack/plugins/task_manager/server/task_manager.mock.ts index 1be1a81cdeb68..1fc626e7d58d6 100644 --- a/x-pack/plugins/task_manager/server/task_manager.mock.ts +++ b/x-pack/plugins/task_manager/server/task_manager.mock.ts @@ -11,7 +11,6 @@ export const taskManagerMock = { const mocked: jest.Mocked<TaskManagerSetupContract> = { registerTaskDefinitions: jest.fn(), addMiddleware: jest.fn(), - registerLegacyAPI: jest.fn(), ...overrides, }; return mocked; diff --git a/x-pack/plugins/transform/public/app/common/transform.ts b/x-pack/plugins/transform/public/app/common/transform.ts index 41e18ca9d1589..18c53dda0e8a2 100644 --- a/x-pack/plugins/transform/public/app/common/transform.ts +++ b/x-pack/plugins/transform/public/app/common/transform.ts @@ -40,6 +40,10 @@ export interface CreateRequestBody extends PreviewRequestBody { index: IndexName; }; frequency?: string; + settings?: { + max_page_search_size?: number; + docs_per_second?: number; + }; sync?: { time: { field: string; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form.tsx index 3ea009a9bb6b4..2de8239813b4d 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/edit_transform_flyout_form.tsx @@ -32,14 +32,21 @@ export const EditTransformFlyoutForm: FC<EditTransformFlyoutFormProps> = ({ onChange={value => dispatch({ field: 'description', value })} value={formFields.description.value} /> - {/* <EditTransformFlyoutFormTextInput - defaultValue={config.dest.index} - label={i18n.translate('xpack.transform.transformList.editFlyoutFormDestinationIndexLabel', { - defaultMessage: 'Destination Index', + errorMessages={formFields.docsPerSecond.errorMessages} + helpText={i18n.translate( + 'xpack.transform.transformList.editFlyoutFormDocsPerSecondHelptext', + { + defaultMessage: + 'To enable throttling, set a limit of documents per second of input documents.', + } + )} + label={i18n.translate('xpack.transform.transformList.editFlyoutFormdocsPerSecondLabel', { + defaultMessage: 'Documents per second', })} - onChange={onChangeDestinationIndexHandler} - />*/} + onChange={value => dispatch({ field: 'docsPerSecond', value })} + value={formFields.docsPerSecond.value} + /> <EditTransformFlyoutFormTextInput errorMessages={formFields.frequency.errorMessages} helpText={i18n.translate('xpack.transform.transformList.editFlyoutFormFrequencyHelptext', { diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.test.ts b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.test.ts index 04a512cab5f1a..4a8b26b601ae2 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.test.ts +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.test.ts @@ -11,6 +11,8 @@ import { formReducerFactory, frequencyValidator, getDefaultState, + numberAboveZeroValidator, + FormField, } from './use_edit_transform_flyout'; const getTransformConfigMock = (): TransformPivotConfig => ({ @@ -43,14 +45,21 @@ const getTransformConfigMock = (): TransformPivotConfig => ({ description: 'the-description', }); -const getDescriptionFieldMock = (value = '') => ({ +const getDescriptionFieldMock = (value = ''): FormField => ({ isOptional: true, value, errorMessages: [], validator: 'string', }); -const getFrequencyFieldMock = (value = '') => ({ +const getDocsPerSecondFieldMock = (value = ''): FormField => ({ + isOptional: true, + value, + errorMessages: [], + validator: 'numberAboveZero', +}); + +const getFrequencyFieldMock = (value = ''): FormField => ({ isOptional: true, value, errorMessages: [], @@ -63,6 +72,7 @@ describe('Transform: applyFormFieldsToTransformConfig()', () => { const updateConfig = applyFormFieldsToTransformConfig(transformConfigMock, { description: getDescriptionFieldMock(transformConfigMock.description), + docsPerSecond: getDocsPerSecondFieldMock(), frequency: getFrequencyFieldMock(), }); @@ -70,6 +80,8 @@ describe('Transform: applyFormFieldsToTransformConfig()', () => { // because the Update-Button will be disabled when no form field was changed. expect(Object.keys(updateConfig)).toHaveLength(0); expect(updateConfig.description).toBe(undefined); + // `docs_per_second` is nested under `settings` so we're just checking against that. + expect(updateConfig.settings).toBe(undefined); expect(updateConfig.frequency).toBe(undefined); }); @@ -80,23 +92,28 @@ describe('Transform: applyFormFieldsToTransformConfig()', () => { const updateConfig = applyFormFieldsToTransformConfig(transformConfigMock, { description: getDescriptionFieldMock('the-new-description'), - frequency: getFrequencyFieldMock(undefined), + docsPerSecond: getDocsPerSecondFieldMock('10'), + frequency: getFrequencyFieldMock('1m'), }); - expect(Object.keys(updateConfig)).toHaveLength(1); + expect(Object.keys(updateConfig)).toHaveLength(3); expect(updateConfig.description).toBe('the-new-description'); - expect(updateConfig.frequency).toBe(undefined); + expect(updateConfig.settings?.docs_per_second).toBe(10); + expect(updateConfig.frequency).toBe('1m'); }); test('should only include changed form fields', () => { const transformConfigMock = getTransformConfigMock(); const updateConfig = applyFormFieldsToTransformConfig(transformConfigMock, { description: getDescriptionFieldMock('the-updated-description'), + docsPerSecond: getDocsPerSecondFieldMock(), frequency: getFrequencyFieldMock(), }); expect(Object.keys(updateConfig)).toHaveLength(1); expect(updateConfig.description).toBe('the-updated-description'); + // `docs_per_second` is nested under `settings` so we're just checking against that. + expect(updateConfig.settings).toBe(undefined); expect(updateConfig.frequency).toBe(undefined); }); }); @@ -166,3 +183,21 @@ describe('Transform: frequencyValidator()', () => { expect(frequencyValidator('59m')).toHaveLength(0); }); }); + +describe('Transform: numberValidator()', () => { + test('it should only allow numbers', () => { + // numberValidator() returns an array of error messages so + // an array with a length of 0 means a successful validation. + + // invalid + expect(numberAboveZeroValidator('a-string')).toHaveLength(1); + expect(numberAboveZeroValidator('0s')).toHaveLength(1); + expect(numberAboveZeroValidator('1m')).toHaveLength(1); + expect(numberAboveZeroValidator(-1)).toHaveLength(1); + expect(numberAboveZeroValidator(0)).toHaveLength(1); + + // valid + expect(numberAboveZeroValidator(1)).toHaveLength(0); + expect(numberAboveZeroValidator('1')).toHaveLength(0); + }); +}); diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.ts b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.ts index 8c4af7ac252f7..38d91115d212e 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.ts +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/edit_transform_flyout/use_edit_transform_flyout.ts @@ -11,29 +11,43 @@ import { i18n } from '@kbn/i18n'; import { TransformPivotConfig } from '../../../../common'; +// A Validator function takes in a value to check and returns an array of error messages. +// If no messages (empty array) get returned, the value is valid. +type Validator = (arg: any) => string[]; + +// Note on the form validation and input components used: +// All inputs use `EuiFieldText` which means all form values will be treated as strings. +// This means we cast other formats like numbers coming from the transform config to strings, +// then revalidate them and cast them again to number before submitting a transform update. +// We do this so we have fine grained control over field validation and the option to +// cast to special values like `null` for disabling `docs_per_second`. +const numberAboveZeroNotValidErrorMessage = i18n.translate( + 'xpack.transform.transformList.editFlyoutFormNumberNotValidErrorMessage', + { + defaultMessage: 'Value needs to be a number above zero.', + } +); +export const numberAboveZeroValidator: Validator = arg => + !isNaN(arg) && parseInt(arg, 10) > 0 ? [] : [numberAboveZeroNotValidErrorMessage]; + +// The way the current form is set up, this validator is just a sanity check, +// it should never trigger an error, because `EuiFieldText` always returns a string. const stringNotValidErrorMessage = i18n.translate( 'xpack.transform.transformList.editFlyoutFormStringNotValidErrorMessage', { defaultMessage: 'Value needs to be of type string.', } ); - -type Validator = (arg: any) => string[]; - -// The way the current form is set up, -// this validator is just a sanity check, -// it should never trigger an error. const stringValidator: Validator = arg => typeof arg === 'string' ? [] : [stringNotValidErrorMessage]; +// Only allow frequencies in the form of 1s/1h etc. const frequencyNotValidErrorMessage = i18n.translate( 'xpack.transform.transformList.editFlyoutFormFrequencyNotValidErrorMessage', { defaultMessage: 'The frequency value is not valid.', } ); - -// Only allow frequencies in the form of 1s/1h etc. export const frequencyValidator: Validator = arg => { if (typeof arg !== 'string' || arg === null) { return [stringNotValidErrorMessage]; @@ -58,23 +72,26 @@ export const frequencyValidator: Validator = arg => { ); }; -interface Validate { - [key: string]: Validator; -} +type Validators = 'string' | 'frequency' | 'numberAboveZero'; + +type Validate = { + [key in Validators]: Validator; +}; const validate: Validate = { string: stringValidator, frequency: frequencyValidator, + numberAboveZero: numberAboveZeroValidator, }; -interface Field { +export interface FormField { errorMessages: string[]; isOptional: boolean; - validator: keyof typeof validate; + validator: keyof Validate; value: string; } -const defaultField: Field = { +const defaultField: FormField = { errorMessages: [], isOptional: true, validator: 'string', @@ -82,9 +99,10 @@ const defaultField: Field = { }; interface EditTransformFlyoutFieldsState { - [key: string]: Field; - description: Field; - frequency: Field; + [key: string]: FormField; + description: FormField; + frequency: FormField; + docsPerSecond: FormField; } export interface EditTransformFlyoutState { @@ -101,10 +119,14 @@ interface Action { } // Some attributes can have a value of `null` to trigger -// a reset to the default value. +// a reset to the default value, or in the case of `docs_per_second` +// `null` is used to disable throttling. interface UpdateTransformPivotConfig { description: string; frequency: string; + settings: { + docs_per_second: number | null; + }; } // Takes in the form configuration and returns a @@ -112,7 +134,7 @@ interface UpdateTransformPivotConfig { // transform update API endpoint. export const applyFormFieldsToTransformConfig = ( config: TransformPivotConfig, - { description, frequency }: EditTransformFlyoutFieldsState + { description, docsPerSecond, frequency }: EditTransformFlyoutFieldsState ): Partial<UpdateTransformPivotConfig> => { const updateConfig: Partial<UpdateTransformPivotConfig> = {}; @@ -132,6 +154,16 @@ export const applyFormFieldsToTransformConfig = ( updateConfig.description = description.value; } + // if the input field was left empty, + // fall back to the default value of `null` + // which will disable throttling. + const docsPerSecondFormValue = + docsPerSecond.value !== '' ? parseInt(docsPerSecond.value, 10) : null; + const docsPerSecondConfigValue = config.settings?.docs_per_second ?? null; + if (docsPerSecondFormValue !== docsPerSecondConfigValue) { + updateConfig.settings = { docs_per_second: docsPerSecondFormValue }; + } + return updateConfig; }; @@ -141,6 +173,11 @@ export const getDefaultState = (config: TransformPivotConfig): EditTransformFlyo formFields: { description: { ...defaultField, value: config?.description ?? '' }, frequency: { ...defaultField, value: config?.frequency ?? '', validator: 'frequency' }, + docsPerSecond: { + ...defaultField, + value: config?.settings?.docs_per_second?.toString() ?? '', + validator: 'numberAboveZero', + }, }, isFormTouched: false, isFormValid: true, @@ -154,10 +191,13 @@ const isFormValid = (fieldsState: EditTransformFlyoutFieldsState) => // Updates a form field with its new value, // runs validation and populates // `errorMessages` if any errors occur. -const formFieldReducer = (state: Field, value: string): Field => { +const formFieldReducer = (state: FormField, value: string): FormField => { return { ...state, - errorMessages: state.isOptional && value.length === 0 ? [] : validate[state.validator](value), + errorMessages: + state.isOptional && typeof value === 'string' && value.length === 0 + ? [] + : validate[state.validator](value), value, }; }; diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 85b4c7f7eb032..67eec939701c3 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -302,7 +302,6 @@ "common.ui.flotCharts.tueLabel": "火", "common.ui.flotCharts.wedLabel": "水", "common.ui.scriptingLanguages.errorFetchingToastDescription": "Elasticsearch から利用可能なスクリプト言語の取得中にエラーが発生しました", - "common.ui.stackManagement.breadcrumb": "管理", "common.ui.stateManagement.unableToParseUrlErrorMessage": "URL をパースできません", "common.ui.stateManagement.unableToRestoreUrlErrorMessage": "URL を完全に復元できません。共有機能を使用していることを確認してください。", "common.ui.stateManagement.unableToStoreHistoryInSessionErrorMessage": "セッションがいっぱいで安全に削除できるアイテムが見つからないため、Kibana は履歴アイテムを保存できません。\n\nこれは大抵新規タブに移動することで解決されますが、より大きな問題が原因である可能性もあります。このメッセージが定期的に表示される場合は、{gitHubIssuesUrl} で問題を報告してください。", @@ -503,7 +502,6 @@ "core.notifications.errorToast.closeModal": "閉じる", "core.notifications.unableUpdateUISettingNotificationMessageTitle": "UI 設定を更新できません", "core.toasts.errorToast.seeFullError": "完全なエラーを表示", - "core.ui.analyzeNavList.label": "分析", "core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel": "ホームページに移動", "core.ui.chrome.headerGlobalNav.helpMenuAskElasticTitle": "Elasticに確認する", "core.ui.chrome.headerGlobalNav.helpMenuButtonAriaLabel": "ヘルプメニュー", @@ -1865,7 +1863,6 @@ "home.tutorials.zookeeperMetrics.longDescription": "「{moduleName}」Metricbeat モジュールは、Zookeeper サーバーから内部メトリックを取得します。 [詳細]({learnMoreLink})。", "home.tutorials.zookeeperMetrics.nameTitle": "Zookeeper メトリック", "home.tutorials.zookeeperMetrics.shortDescription": "Zookeeper サーバーから内部メトリックを取得します。", - "home.welcomeDescription": "Elastic Stack への入口", "home.welcomeHomePageHeader": "Kibana ホーム", "home.welcomeTitle": "Elastic Kibana へようこそ", "inputControl.control.noIndexPatternTooltip": "index-pattern id が見つかりませんでした: {indexPatternId}.", @@ -2278,11 +2275,8 @@ "kbn.management.indexPatterns.listBreadcrumb": "インデックスパターン", "kbn.management.indexPatternTable.createBtn": "インデックスパターンの作成", "kbn.management.indexPatternTable.title": "インデックスパターン", - "kbn.management.landing.header": "Kibana {version} 管理", "kbn.management.landing.subhead": "インデックス、インデックスパターン、保存されたオブジェクト、Kibana の設定、その他を管理します。", "kbn.management.landing.text": "すべてのツールの一覧は、左のメニューにあります。", - "kbn.managementTitle": "管理", - "kbn.visualizeTitle": "可視化", "savedObjectsManagement.indexPattern.confirmOverwriteButton": "上書き", "savedObjectsManagement.indexPattern.confirmOverwriteLabel": "「{title}」に上書きしてよろしいですか?", "savedObjectsManagement.indexPattern.confirmOverwriteTitle": "{type} を上書きしますか?", @@ -2424,7 +2418,6 @@ "kibana-react.dualRangeControl.upperValidErrorMessage": "上の値は下の値以上でなければなりません", "kibana-react.exitFullScreenButton.exitFullScreenModeButtonAriaLabel": "全画面モードを終了", "kibana-react.exitFullScreenButton.exitFullScreenModeButtonText": "全画面を終了", - "kibana-react.exitFullScreenButton.exitFullScreenModeButtonTitle": "Elastic Kibana", "kibana-react.exitFullScreenButton.fullScreenModeDescription": "ESC キーで全画面モードを終了します。", "kibana-react.splitPanel.adjustPanelSizeAriaLabel": "左右のキーを押してパネルサイズを調整します", "kibana-react.tableListView.listing.createNewItemButtonLabel": "Create {entityName}", @@ -2443,12 +2436,7 @@ "kibana-react.tableListView.listing.table.editActionDescription": "編集", "kibana-react.tableListView.listing.table.editActionName": "編集", "kibana-react.tableListView.listing.unableToDeleteDangerMessage": "{entityName} を削除できません", - "management.breadcrumb": "管理", "management.connectDataDisplayName": "データに接続", - "management.displayName": "管理", - "management.nav.label": "管理", - "management.nav.menu": "管理メニュー", - "management.stackManagement.managementDescription": "Elastic Stack の管理を行うセンターコンソールです。", "indexPatternManagement.editIndexPattern.createIndex.defaultButtonDescription": "すべてのデータに完全集約を実行", "indexPatternManagement.editIndexPattern.createIndex.defaultButtonText": "標準インデックスパターン", "indexPatternManagement.editIndexPattern.createIndex.defaultTypeName": "インデックスパターン", @@ -3956,7 +3944,6 @@ "visualize.linkedToSearch.unlinkSuccessNotificationText": "保存された検索「{searchTitle}」からリンクが解除されました", "visualize.listing.betaTitle": "ベータ", "visualize.listing.betaTooltip": "このビジュアライゼーションはベータ段階で、変更される可能性があります。デザインとコードはオフィシャル GA 機能よりも完成度が低く、現状のまま保証なしで提供されています。ベータ機能にはオフィシャル GA 機能の SLA が適用されません", - "visualize.listing.breadcrumb": "可視化", "visualize.listing.createNew.createButtonLabel": "新規ビジュアライゼーションを追加", "visualize.listing.createNew.description": "データに基づき異なるビジュアライゼーションを作成できます。", "visualize.listing.createNew.title": "最初のビジュアライゼーションの作成", @@ -3969,7 +3956,6 @@ "visualize.listing.table.titleColumnName": "タイトル", "visualize.listing.table.typeColumnName": "タイプ", "visualize.pageHeading": "{chartName} {chartType} ビジュアライゼーション", - "visualize.saveDialog.saveAndAddToDashboardButtonLabel": "保存してダッシュボードに追加", "visualize.topNavMenu.openInspectorButtonAriaLabel": "ビジュアライゼーションのインスペクターを開く", "visualize.topNavMenu.openInspectorDisabledButtonTooltip": "このビジュアライゼーションはインスペクターをサポートしていません。", "visualize.topNavMenu.saveVisualization.failureNotificationText": "「{visTitle}」の保存中にエラーが発生しました", @@ -3979,7 +3965,6 @@ "visualize.topNavMenu.shareVisualizationButtonAriaLabel": "ビジュアライゼーションを共有", "visualize.visualizationTypeInvalidNotificationMessage": "無効なビジュアライゼーションタイプ", "visualize.visualizeDescription": "ビジュアライゼーションを作成して Elasticsearch インデックスに保存されたデータを集約します。", - "visualize.visualizeListingBreadcrumbsTitle": "可視化", "visualize.visualizeListingDeleteErrorTitle": "ビジュアライゼーションの削除中にエラーが発生", "visualize.wizard.step1Breadcrumb": "作成", "visualize.wizard.step2Breadcrumb": "作成", @@ -8363,7 +8348,6 @@ "xpack.lens.app.docSavingError": "ドキュメントの保存中にエラーが発生", "xpack.lens.app.indexPatternLoadingError": "インデックスパターンの読み込み中にエラーが発生", "xpack.lens.app.save": "保存", - "xpack.lens.app.saveAddToDashboard": "保存してダッシュボードに追加", "xpack.lens.app.saveModalType": "レンズビジュアライゼーション", "xpack.lens.app404": "404 Not Found", "xpack.lens.breadcrumbsCreate": "作成", @@ -12542,7 +12526,6 @@ "xpack.security.loginPage.requiresSecureConnectionTitle": "ログインにはセキュアな接続が必要です", "xpack.security.loginPage.unknownLayoutMessage": "詳細は Kibana ログを確認し、このページを再度読み込んでみてください。", "xpack.security.loginPage.unknownLayoutTitle": "サポートされていないログインフォームレイアウト。", - "xpack.security.loginPage.welcomeDescription": "Elastic Stack への入口", "xpack.security.loginPage.welcomeTitle": "Elastic Kibana へようこそ", "xpack.security.loginPage.xpackUnavailableMessage": "この Kibana ディストリビューションの無料の機能をすべて使用するには、デフォルトの Elasticsearch をアップデートしてください。", "xpack.security.loginPage.xpackUnavailableTitle": "現在 Kibana に構成されている Elasticsearch クラスターへの接続をキャンセルします。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 2f2b2b7f37481..486bb747a15e0 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -302,7 +302,6 @@ "common.ui.flotCharts.tueLabel": "周二", "common.ui.flotCharts.wedLabel": "周三", "common.ui.scriptingLanguages.errorFetchingToastDescription": "从 Elasticsearch 获取可用的脚本语言时出错", - "common.ui.stackManagement.breadcrumb": "管理", "common.ui.stateManagement.unableToParseUrlErrorMessage": "无法解析 URL", "common.ui.stateManagement.unableToRestoreUrlErrorMessage": "无法完整还原 URL,确保使用共享功能。", "common.ui.stateManagement.unableToStoreHistoryInSessionErrorMessage": "Kibana 无法将历史记录项存储在您的会话中,因为其已满,并且似乎没有任何可安全删除的项。\n\n通常可通过移至新的标签页来解决此问题,但这会导致更大的问题。如果您有规律地看到此消息,请在 {gitHubIssuesUrl} 提交问题。", @@ -503,7 +502,6 @@ "core.notifications.errorToast.closeModal": "关闭", "core.notifications.unableUpdateUISettingNotificationMessageTitle": "无法更新 UI 设置", "core.toasts.errorToast.seeFullError": "请参阅完整的错误信息", - "core.ui.analyzeNavList.label": "分析", "core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel": "前往主页", "core.ui.chrome.headerGlobalNav.helpMenuAskElasticTitle": "问询 Elastic", "core.ui.chrome.headerGlobalNav.helpMenuButtonAriaLabel": "帮助菜单", @@ -1866,7 +1864,6 @@ "home.tutorials.zookeeperMetrics.longDescription": "Metricbeat 模块 `{moduleName}` 从 Zookeeper 服务器提取内部指标。[了解详情]({learnMoreLink})。", "home.tutorials.zookeeperMetrics.nameTitle": "Zookeeper 指标", "home.tutorials.zookeeperMetrics.shortDescription": "从 Zookeeper 服务器提取内部指标。", - "home.welcomeDescription": "您了解 Elastic Stack 的窗口", "home.welcomeHomePageHeader": "Kibana 主页", "home.welcomeTitle": "欢迎使用 Elastic Kibana", "inputControl.control.noIndexPatternTooltip": "找不到索引模式 ID:{indexPatternId}。", @@ -2279,11 +2276,8 @@ "kbn.management.indexPatterns.listBreadcrumb": "索引模式", "kbn.management.indexPatternTable.createBtn": "创建索引模式", "kbn.management.indexPatternTable.title": "索引模式", - "kbn.management.landing.header": "Kibana {version} 管理", "kbn.management.landing.subhead": "管理您的索引、索引模式、已保存对象、Kibana 设置等等。", "kbn.management.landing.text": "应用的完整列表位于左侧菜单中。", - "kbn.managementTitle": "管理", - "kbn.visualizeTitle": "可视化", "savedObjectsManagement.indexPattern.confirmOverwriteButton": "覆盖", "savedObjectsManagement.indexPattern.confirmOverwriteLabel": "确定要覆盖 “{title}”?", "savedObjectsManagement.indexPattern.confirmOverwriteTitle": "覆盖“{type}”?", @@ -2425,7 +2419,6 @@ "kibana-react.dualRangeControl.upperValidErrorMessage": "上限值必须大于或等于下限值", "kibana-react.exitFullScreenButton.exitFullScreenModeButtonAriaLabel": "退出全屏模式", "kibana-react.exitFullScreenButton.exitFullScreenModeButtonText": "退出全屏", - "kibana-react.exitFullScreenButton.exitFullScreenModeButtonTitle": "Elastic Kibana", "kibana-react.exitFullScreenButton.fullScreenModeDescription": "在全屏模式下,按 ESC 键可退出。", "kibana-react.splitPanel.adjustPanelSizeAriaLabel": "按左/右箭头键调整面板大小", "kibana-react.tableListView.listing.createNewItemButtonLabel": "创建 {entityName}", @@ -2444,12 +2437,7 @@ "kibana-react.tableListView.listing.table.editActionDescription": "编辑", "kibana-react.tableListView.listing.table.editActionName": "编辑", "kibana-react.tableListView.listing.unableToDeleteDangerMessage": "无法删除{entityName}", - "management.breadcrumb": "管理", "management.connectDataDisplayName": "连接数据", - "management.displayName": "管理", - "management.nav.label": "管理", - "management.nav.menu": "管理菜单", - "management.stackManagement.managementDescription": "您用于管理 Elastic Stack 的中心控制台。", "indexPatternManagement.editIndexPattern.createIndex.defaultButtonDescription": "对任何数据执行完全聚合", "indexPatternManagement.editIndexPattern.createIndex.defaultButtonText": "标准索引模式", "indexPatternManagement.editIndexPattern.createIndex.defaultTypeName": "索引模式", @@ -3957,7 +3945,6 @@ "visualize.linkedToSearch.unlinkSuccessNotificationText": "取消与已保存搜索 “{searchTitle}” 的链接", "visualize.listing.betaTitle": "公测版", "visualize.listing.betaTooltip": "此可视化为公测版,可能会进行更改。设计和代码相对于正式发行版功能还不够成熟,将按原样提供,且不提供任何保证。公测版功能不受正式发行版功能支持 SLA 的约束", - "visualize.listing.breadcrumb": "可视化", "visualize.listing.createNew.createButtonLabel": "新建可视化", "visualize.listing.createNew.description": "可以根据您的数据创建不同的可视化。", "visualize.listing.createNew.title": "创建首个可视化", @@ -3970,7 +3957,6 @@ "visualize.listing.table.titleColumnName": "标题", "visualize.listing.table.typeColumnName": "类型", "visualize.pageHeading": "{chartName} {chartType}可视化", - "visualize.saveDialog.saveAndAddToDashboardButtonLabel": "保存并添加到仪表板", "visualize.topNavMenu.openInspectorButtonAriaLabel": "打开检查器查看可视化", "visualize.topNavMenu.openInspectorDisabledButtonTooltip": "此可视化不支持任何检查器。", "visualize.topNavMenu.saveVisualization.failureNotificationText": "保存 “{visTitle}” 时出错", @@ -3980,7 +3966,6 @@ "visualize.topNavMenu.shareVisualizationButtonAriaLabel": "共享可视化", "visualize.visualizationTypeInvalidNotificationMessage": "无效的可视化类型", "visualize.visualizeDescription": "创建可视化并聚合存储在 Elasticsearch 索引中的数据。", - "visualize.visualizeListingBreadcrumbsTitle": "可视化", "visualize.visualizeListingDeleteErrorTitle": "删除可视化时出错", "visualize.wizard.step1Breadcrumb": "创建", "visualize.wizard.step2Breadcrumb": "创建", @@ -8369,7 +8354,6 @@ "xpack.lens.app.docSavingError": "保存文档时出错", "xpack.lens.app.indexPatternLoadingError": "加载索引模式时出错", "xpack.lens.app.save": "保存", - "xpack.lens.app.saveAddToDashboard": "保存并添加到仪表板", "xpack.lens.app.saveModalType": "Lens 可视化", "xpack.lens.app404": "404 找不到", "xpack.lens.breadcrumbsCreate": "创建", @@ -12549,7 +12533,6 @@ "xpack.security.loginPage.requiresSecureConnectionTitle": "登录需要安全连接", "xpack.security.loginPage.unknownLayoutMessage": "请参阅 Kibana 日志了解详情,然后尝试重新加载页面。", "xpack.security.loginPage.unknownLayoutTitle": "登录窗体布局不支持。", - "xpack.security.loginPage.welcomeDescription": "您了解 Elastic Stack 的窗口", "xpack.security.loginPage.welcomeTitle": "欢迎使用 Elastic Kibana", "xpack.security.loginPage.xpackUnavailableMessage": "要使用此 Kibana 发行版中全部免费功能,请将 Elasticsearch 更新为默认发行版。", "xpack.security.loginPage.xpackUnavailableTitle": "当前无法连接到为 Kibana 配置的 Elasticsearch 集群。", diff --git a/x-pack/plugins/uptime/public/apps/plugin.ts b/x-pack/plugins/uptime/public/apps/plugin.ts index 719dac022dada..c64ca7c3d4843 100644 --- a/x-pack/plugins/uptime/public/apps/plugin.ts +++ b/x-pack/plugins/uptime/public/apps/plugin.ts @@ -3,8 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { LegacyCoreStart, AppMountParameters } from 'src/core/public'; import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'kibana/public'; +import { + LegacyCoreStart, + AppMountParameters, + DEFAULT_APP_CATEGORIES, +} from '../../../../../src/core/public'; import { UMFrontendLibs } from '../lib/lib'; import { PLUGIN } from '../../common/constants'; import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; @@ -54,6 +58,7 @@ export class UptimePlugin implements Plugin<void, void, ClientPluginsSetup, Clie euiIconType: 'uptimeApp', order: 8900, title: PLUGIN.TITLE, + category: DEFAULT_APP_CATEGORIES.observability, async mount(params: AppMountParameters) { const [coreStart, corePlugins] = await core.getStartServices(); const { element } = params; diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap index a83a1d99d7bb0..3ee949b9712bd 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap @@ -2,12 +2,8 @@ exports[`ML Flyout component renders without errors 1`] = ` <EuiFlyout - closeButtonAriaLabel="Closes this dialog" data-test-subj="uptimeMLFlyout" - hideCloseButton={false} - maxWidth={false} onClose={[Function]} - ownFocus={false} size="s" > <EuiFlyoutHeader> @@ -106,7 +102,7 @@ exports[`ML Flyout component shows license info if no ml available 1`] = ` tabindex="0" > <button - aria-label="Closes this dialog" + aria-label="Close this dialog" class="euiButtonIcon euiButtonIcon--text euiFlyout__closeButton" data-test-subj="euiFlyoutCloseButton" type="button" diff --git a/x-pack/tasks/build.ts b/x-pack/tasks/build.ts index ca03e1c9fd283..38ebb0bad4bdc 100644 --- a/x-pack/tasks/build.ts +++ b/x-pack/tasks/build.ts @@ -30,7 +30,7 @@ async function cleanBuildTask() { await del(BUILD_DIR); fancyLog('[canvas] Deleting Shareable Runtime'); - await del(resolve(XPACK_DIR, 'legacy/plugins/canvas/shareable_runtime/build')); + await del(resolve(XPACK_DIR, 'plugins/canvas/shareable_runtime/build')); } async function reportTask() { @@ -50,7 +50,7 @@ async function pluginHelpersBuild() { } async function buildCanvasShareableRuntime() { - await execa(process.execPath, ['legacy/plugins/canvas/scripts/shareable_runtime'], { + await execa(process.execPath, ['plugins/canvas/scripts/shareable_runtime'], { cwd: XPACK_DIR, stdio: ['ignore', 'inherit', 'inherit'], // @ts-ignore Incorrect @types - execa supports `buffer` diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/servicenow.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/servicenow.ts index 1244657ed9988..0bb98a540c4e8 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/servicenow.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/servicenow.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators'; +} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; // node ../scripts/functional_test_runner.js --grep "Actions.servicenddd" --config=test/alerting_api_integration/security_and_spaces/config.ts diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/slack.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/slack.ts index 4151deab45213..15b7f4f8b3386 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/slack.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/slack.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators'; +} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function slackTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/webhook.ts b/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/webhook.ts index bae6dada48fb7..e3ba075d27de2 100644 --- a/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/webhook.ts +++ b/x-pack/test/alerting_api_integration/basic/tests/actions/builtin_action_types/webhook.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators'; +} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function webhookTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/common/config.ts b/x-pack/test/alerting_api_integration/common/config.ts index 72a2774e672f1..d6b5b40d99d99 100644 --- a/x-pack/test/alerting_api_integration/common/config.ts +++ b/x-pack/test/alerting_api_integration/common/config.ts @@ -5,10 +5,11 @@ */ import path from 'path'; +import fs from 'fs'; import { CA_CERT_PATH } from '@kbn/dev-utils'; import { FtrConfigProviderContext } from '@kbn/test/types/ftr'; import { services } from './services'; -import { getAllExternalServiceSimulatorPaths } from './fixtures/plugins/actions_simulators'; +import { getAllExternalServiceSimulatorPaths } from './fixtures/plugins/actions_simulators/server/plugin'; interface CreateTestConfigOptions { license: string; @@ -48,6 +49,11 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) protocol: ssl ? 'https' : 'http', }, }; + // Find all folders in ./plugins since we treat all them as plugin folder + const allFiles = fs.readdirSync(path.resolve(__dirname, 'fixtures', 'plugins')); + const plugins = allFiles.filter(file => + fs.statSync(path.resolve(__dirname, 'fixtures', 'plugins', file)).isDirectory() + ); return { testFiles: [require.resolve(`../${name}/tests/`)], @@ -123,10 +129,10 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) }, ])}`, ...disabledPlugins.map(key => `--xpack.${key}.enabled=false`), - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'alerts')}`, - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'actions_simulators')}`, - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'task_manager')}`, - `--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'aad')}`, + ...plugins.map( + pluginDir => + `--plugin-path=${path.resolve(__dirname, 'fixtures', 'plugins', pluginDir)}` + ), `--server.xsrf.whitelist=${JSON.stringify(getAllExternalServiceSimulatorPaths())}`, ...(ssl ? [ diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/index.ts deleted file mode 100644 index 400aec7e11c8d..0000000000000 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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. - */ - -import Joi from 'joi'; -import Hapi from 'hapi'; -import { Legacy } from 'kibana'; -import KbnServer from '../../../../../../../src/legacy/server/kbn_server'; -import { EncryptedSavedObjectsPluginStart } from '../../../../../../plugins/encrypted_saved_objects/server'; - -interface CheckAADRequest extends Hapi.Request { - payload: { - spaceId?: string; - type: string; - id: string; - }; -} - -// eslint-disable-next-line import/no-default-export -export default function(kibana: any) { - return new kibana.Plugin({ - require: ['encryptedSavedObjects'], - name: 'aad-fixtures', - init(server: Legacy.Server) { - const newPlatform = ((server as unknown) as KbnServer).newPlatform; - const esoPlugin = newPlatform.start.plugins - .encryptedSavedObjects as EncryptedSavedObjectsPluginStart; - - server.route({ - method: 'POST', - path: '/api/check_aad', - options: { - validate: { - payload: Joi.object() - .keys({ - spaceId: Joi.string().optional(), - type: Joi.string().required(), - id: Joi.string().required(), - }) - .required(), - }, - }, - handler: (async (request: CheckAADRequest) => { - let namespace: string | undefined; - const spacesPlugin = server.plugins.spaces; - if (spacesPlugin && request.payload.spaceId) { - namespace = spacesPlugin.spaceIdToNamespace(request.payload.spaceId); - } - await esoPlugin.getDecryptedAsInternalUser(request.payload.type, request.payload.id, { - namespace, - }); - return { success: true }; - }) as Hapi.Lifecycle.Method, - }); - }, - }); -} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json new file mode 100644 index 0000000000000..9a7bedbb5c6d5 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json @@ -0,0 +1,10 @@ +{ + "id": "aad-fixtures", + "version": "1.0.0", + "kibanaVersion": "kibana", + "configPath": ["xpack"], + "requiredPlugins": ["taskManager", "encryptedSavedObjects"], + "optionalPlugins": ["spaces"], + "server": true, + "ui": false +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json index f5d174c18a209..128b75aaa0509 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json @@ -1,7 +1,20 @@ { "name": "aad-fixtures", - "version": "0.0.0", + "version": "1.0.0", "kibana": { - "version": "kibana" + "version": "kibana", + "templateVersion": "1.0.0" + }, + "main": "target/test/plugin_api_integration/plugins/aad", + "scripts": { + "kbn": "node ../../../../../scripts/kbn.js", + "build": "rm -rf './target' && tsc" + }, + "devDependencies": { + "typescript": "3.7.2" + }, + "license": "Apache-2.0", + "dependencies": { + "joi": "^13.5.2" } } diff --git a/x-pack/legacy/plugins/task_manager/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/index.ts similarity index 72% rename from x-pack/legacy/plugins/task_manager/index.ts rename to x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/index.ts index 276d1ea3accea..54d6de50cff4d 100644 --- a/x-pack/legacy/plugins/task_manager/index.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/index.ts @@ -4,4 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -export * from './server/'; +import { FixturePlugin } from './plugin'; + +export const plugin = () => new FixturePlugin(); diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/plugin.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/plugin.ts new file mode 100644 index 0000000000000..0e9c71d8c20c8 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/plugin.ts @@ -0,0 +1,64 @@ +/* + * 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. + */ + +import { + Plugin, + CoreSetup, + RequestHandlerContext, + KibanaRequest, + KibanaResponseFactory, + IKibanaResponse, +} from 'kibana/server'; +import { schema } from '@kbn/config-schema'; +import { EncryptedSavedObjectsPluginStart } from '../../../../../../../plugins/encrypted_saved_objects/server'; +import { SpacesPluginSetup } from '../../../../../../../plugins/spaces/server'; + +interface FixtureSetupDeps { + spaces?: SpacesPluginSetup; +} + +interface FixtureStartDeps { + encryptedSavedObjects: EncryptedSavedObjectsPluginStart; +} + +export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, FixtureStartDeps> { + public setup(core: CoreSetup<FixtureStartDeps>, { spaces }: FixtureSetupDeps) { + core.http.createRouter().post( + { + path: '/api/check_aad', + validate: { + body: schema.object({ + spaceId: schema.maybe(schema.string()), + type: schema.string(), + id: schema.string(), + }), + }, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + try { + let namespace: string | undefined; + const [, { encryptedSavedObjects }] = await core.getStartServices(); + if (spaces && req.body.spaceId) { + namespace = spaces.spacesService.spaceIdToNamespace(req.body.spaceId); + } + await encryptedSavedObjects.getDecryptedAsInternalUser(req.body.type, req.body.id, { + namespace, + }); + return res.ok({ body: { success: true } }); + } catch (err) { + return res.internalError({ body: err }); + } + } + ); + } + + public start() {} + public stop() {} +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/index.ts deleted file mode 100644 index 6e7e9e3793778..0000000000000 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/index.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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. - */ -import Hapi from 'hapi'; -import { PluginSetupContract as ActionsPluginSetupContract } from '../../../../../../plugins/actions/server/plugin'; -import { ActionType } from '../../../../../../plugins/actions/server'; - -import { initPlugin as initPagerduty } from './pagerduty_simulation'; -import { initPlugin as initSlack } from './slack_simulation'; -import { initPlugin as initWebhook } from './webhook_simulation'; -import { initPlugin as initServiceNow } from './servicenow_simulation'; -import { initPlugin as initJira } from './jira_simulation'; - -const NAME = 'actions-FTS-external-service-simulators'; - -export enum ExternalServiceSimulator { - PAGERDUTY = 'pagerduty', - SERVICENOW = 'servicenow', - JIRA = 'jira', - SLACK = 'slack', - WEBHOOK = 'webhook', -} - -export function getExternalServiceSimulatorPath(service: ExternalServiceSimulator): string { - return `/api/_${NAME}/${service}`; -} - -export function getAllExternalServiceSimulatorPaths(): string[] { - const allPaths = Object.values(ExternalServiceSimulator).map(service => - getExternalServiceSimulatorPath(service) - ); - - allPaths.push(`/api/_${NAME}/${ExternalServiceSimulator.SERVICENOW}/api/now/v2/table/incident`); - allPaths.push(`/api/_${NAME}/${ExternalServiceSimulator.JIRA}/rest/api/2/issue`); - return allPaths; -} - -// eslint-disable-next-line import/no-default-export -export default function(kibana: any) { - return new kibana.Plugin({ - require: ['xpack_main'], - name: NAME, - init: (server: Hapi.Server) => { - // this action is specifically NOT enabled in ../../config.ts - const notEnabledActionType: ActionType = { - id: 'test.not-enabled', - name: 'Test: Not Enabled', - minimumLicenseRequired: 'gold', - async executor() { - return { status: 'ok', actionId: '' }; - }, - }; - (server.newPlatform.setup.plugins.actions as ActionsPluginSetupContract).registerType( - notEnabledActionType - ); - server.plugins.xpack_main.registerFeature({ - id: 'actions', - name: 'Actions', - app: ['actions', 'kibana'], - privileges: { - all: { - app: ['actions', 'kibana'], - savedObject: { - all: ['action', 'action_task_params'], - read: [], - }, - ui: [], - api: ['actions-read', 'actions-all'], - }, - read: { - app: ['actions', 'kibana'], - savedObject: { - all: ['action_task_params'], - read: ['action'], - }, - ui: [], - api: ['actions-read'], - }, - }, - }); - - initPagerduty(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.PAGERDUTY)); - initSlack(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.SLACK)); - initWebhook(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.WEBHOOK)); - initServiceNow(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.SERVICENOW)); - initJira(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.JIRA)); - }, - }); -} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/jira_simulation.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/jira_simulation.ts deleted file mode 100644 index 629d0197b2292..0000000000000 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/jira_simulation.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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. - */ - -import Hapi from 'hapi'; - -interface JiraRequest extends Hapi.Request { - payload: { - summary: string; - description?: string; - comments?: string; - }; -} -export function initPlugin(server: Hapi.Server, path: string) { - server.route({ - method: 'POST', - path: `${path}/rest/api/2/issue`, - options: { - auth: false, - }, - handler: createHandler as Hapi.Lifecycle.Method, - }); - - server.route({ - method: 'PUT', - path: `${path}/rest/api/2/issue/{id}`, - options: { - auth: false, - }, - handler: updateHandler as Hapi.Lifecycle.Method, - }); - - server.route({ - method: 'GET', - path: `${path}/rest/api/2/issue/{id}`, - options: { - auth: false, - }, - handler: getHandler as Hapi.Lifecycle.Method, - }); - - server.route({ - method: 'POST', - path: `${path}/rest/api/2/issue/{id}/comment`, - options: { - auth: false, - }, - handler: createCommentHanlder as Hapi.Lifecycle.Method, - }); -} - -// ServiceNow simulator: create a servicenow action pointing here, and you can get -// different responses based on the message posted. See the README.md for -// more info. -function createHandler(request: JiraRequest, h: any) { - return jsonResponse(h, 200, { - id: '123', - key: 'CK-1', - created: '2020-04-27T14:17:45.490Z', - }); -} - -function updateHandler(request: JiraRequest, h: any) { - return jsonResponse(h, 200, { - id: '123', - key: 'CK-1', - created: '2020-04-27T14:17:45.490Z', - updated: '2020-04-27T14:17:45.490Z', - }); -} - -function getHandler(request: JiraRequest, h: any) { - return jsonResponse(h, 200, { - id: '123', - key: 'CK-1', - created: '2020-04-27T14:17:45.490Z', - updated: '2020-04-27T14:17:45.490Z', - summary: 'title', - description: 'description', - }); -} - -function createCommentHanlder(request: JiraRequest, h: any) { - return jsonResponse(h, 200, { - id: '123', - created: '2020-04-27T14:17:45.490Z', - }); -} - -function jsonResponse(h: any, code: number, object?: any) { - if (object == null) { - return h.response('').code(code); - } - - return h - .response(JSON.stringify(object)) - .type('application/json') - .code(code); -} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json new file mode 100644 index 0000000000000..5f92b9e5479e8 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json @@ -0,0 +1,9 @@ +{ + "id": "actions_simulators", + "version": "1.0.0", + "kibanaVersion": "kibana", + "configPath": ["xpack"], + "requiredPlugins": ["actions", "features", "encryptedSavedObjects"], + "server": true, + "ui": false +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json index 7f319f52dee2d..b1076437ef37f 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json @@ -1,7 +1,20 @@ { - "name": "actions-fixtures", - "version": "0.0.0", + "name": "actions_simulators", + "version": "1.0.0", "kibana": { - "version": "kibana" + "version": "kibana", + "templateVersion": "1.0.0" + }, + "main": "target/test/plugin_api_integration/plugins/actions_simulators", + "scripts": { + "kbn": "node ../../../../../scripts/kbn.js", + "build": "rm -rf './target' && tsc" + }, + "devDependencies": { + "typescript": "3.7.2" + }, + "license": "Apache-2.0", + "dependencies": { + "joi": "^13.5.2" } } diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/pagerduty_simulation.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/pagerduty_simulation.ts deleted file mode 100644 index 1de1476fc4ff2..0000000000000 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/pagerduty_simulation.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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. - */ - -import Joi from 'joi'; -import Hapi from 'hapi'; - -interface PagerdutyRequest extends Hapi.Request { - payload: { - dedup_key: string; - payload: { - summary: string; - }; - }; -} - -export function initPlugin(server: Hapi.Server, path: string) { - server.route({ - method: 'POST', - path, - options: { - auth: false, - validate: { - options: { abortEarly: false }, - payload: Joi.object() - .unknown(true) - .keys({ - dedup_key: Joi.string(), - payload: Joi.object() - .unknown(true) - .keys({ - summary: Joi.string(), - }), - }), - }, - }, - handler: pagerdutyHandler as Hapi.Lifecycle.Method, - }); -} -// Pagerduty simulator: create an action pointing here, and you can get -// different responses based on the message posted. See the README.md for -// more info. -function pagerdutyHandler(request: PagerdutyRequest, h: any) { - const body = request.payload; - let dedupKey = body && body.dedup_key; - const summary = body && body.payload && body.payload.summary; - - if (dedupKey == null) { - dedupKey = `kibana-ft-simulator-dedup-key-${new Date().toISOString()}`; - } - - switch (summary) { - case 'respond-with-429': - return jsonResponse(h, 429); - case 'respond-with-502': - return jsonResponse(h, 502); - case 'respond-with-418': - return jsonResponse(h, 418); - } - - return jsonResponse(h, 202, { - status: 'success', - message: 'Event processed', - dedup_key: dedupKey, - }); -} - -function jsonResponse(h: any, code: number, object?: any) { - if (object == null) { - return h.response('').code(code); - } - - return h - .response(JSON.stringify(object)) - .type('application/json') - .code(code); -} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/README.md b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/README.md similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/README.md rename to x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/README.md diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/index.ts new file mode 100644 index 0000000000000..54d6de50cff4d --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/index.ts @@ -0,0 +1,9 @@ +/* + * 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. + */ + +import { FixturePlugin } from './plugin'; + +export const plugin = () => new FixturePlugin(); diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/jira_simulation.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/jira_simulation.ts new file mode 100644 index 0000000000000..8a55cf6b35652 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/jira_simulation.ts @@ -0,0 +1,116 @@ +/* + * 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. + */ + +/* + * 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. + */ + +import { + RequestHandlerContext, + KibanaRequest, + KibanaResponseFactory, + IKibanaResponse, + IRouter, +} from 'kibana/server'; + +export function initPlugin(router: IRouter, path: string) { + router.post( + { + path: `${path}/rest/api/2/issue`, + options: { + authRequired: false, + }, + validate: {}, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + return jsonResponse(res, 200, { + id: '123', + key: 'CK-1', + created: '2020-04-27T14:17:45.490Z', + }); + } + ); + + router.put( + { + path: `${path}/rest/api/2/issue/{id}`, + options: { + authRequired: false, + }, + validate: {}, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + return jsonResponse(res, 200, { + id: '123', + key: 'CK-1', + created: '2020-04-27T14:17:45.490Z', + updated: '2020-04-27T14:17:45.490Z', + }); + } + ); + + router.get( + { + path: `${path}/rest/api/2/issue/{id}`, + options: { + authRequired: false, + }, + validate: {}, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + return jsonResponse(res, 200, { + id: '123', + key: 'CK-1', + created: '2020-04-27T14:17:45.490Z', + updated: '2020-04-27T14:17:45.490Z', + summary: 'title', + description: 'description', + }); + } + ); + + router.post( + { + path: `${path}/rest/api/2/issue/{id}/comment`, + options: { + authRequired: false, + }, + validate: {}, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + return jsonResponse(res, 200, { + id: '123', + created: '2020-04-27T14:17:45.490Z', + }); + } + ); +} + +function jsonResponse( + res: KibanaResponseFactory, + code: number, + object: Record<string, unknown> = {} +) { + return res.custom<Record<string, unknown>>({ body: object, statusCode: code }); +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/pagerduty_simulation.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/pagerduty_simulation.ts new file mode 100644 index 0000000000000..83022ec0e3260 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/pagerduty_simulation.ts @@ -0,0 +1,86 @@ +/* + * 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. + */ + +import { schema } from '@kbn/config-schema'; +import { + RequestHandlerContext, + KibanaRequest, + KibanaResponseFactory, + IKibanaResponse, + IRouter, +} from 'kibana/server'; + +export function initPlugin(router: IRouter, path: string) { + router.post( + { + path, + options: { + authRequired: false, + }, + validate: { + body: schema.object( + { + dedup_key: schema.string(), + payload: schema.object( + { + summary: schema.string(), + }, + { + unknowns: 'allow', + } + ), + }, + { + unknowns: 'allow', + } + ), + }, + }, + // Pagerduty simulator: create an action pointing here, and you can get + // different responses based on the message posted. See the README.md for + // more info. + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + const { body } = req; + let dedupKey = body && body.dedup_key; + const summary = body && body.payload && body.payload.summary; + + if (dedupKey == null) { + dedupKey = `kibana-ft-simulator-dedup-key-${new Date().toISOString()}`; + } + + switch (summary) { + case 'respond-with-429': + return jsonErrorResponse(res, 429, new Error(summary)); + case 'respond-with-502': + return jsonErrorResponse(res, 502, new Error(summary)); + case 'respond-with-418': + return jsonErrorResponse(res, 418, new Error(summary)); + } + + return jsonResponse(res, 202, { + status: 'success', + message: 'Event processed', + dedup_key: dedupKey, + }); + } + ); +} + +function jsonResponse( + res: KibanaResponseFactory, + code: number, + object: Record<string, unknown> = {} +) { + return res.custom<Record<string, unknown>>({ body: object, statusCode: code }); +} + +function jsonErrorResponse(res: KibanaResponseFactory, code: number, object: Error) { + return res.custom<Error>({ body: object, statusCode: code }); +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin.ts new file mode 100644 index 0000000000000..efb219fc8e717 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/plugin.ts @@ -0,0 +1,95 @@ +/* + * 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. + */ + +import { Plugin, CoreSetup, IRouter } from 'kibana/server'; +import { EncryptedSavedObjectsPluginStart } from '../../../../../../../plugins/encrypted_saved_objects/server'; +import { PluginSetupContract as FeaturesPluginSetup } from '../../../../../../../plugins/features/server'; +import { PluginSetupContract as ActionsPluginSetupContract } from '../../../../../../../plugins/actions/server/plugin'; +import { ActionType } from '../../../../../../../plugins/actions/server'; +import { initPlugin as initPagerduty } from './pagerduty_simulation'; +import { initPlugin as initServiceNow } from './servicenow_simulation'; +import { initPlugin as initJira } from './jira_simulation'; + +export const NAME = 'actions-FTS-external-service-simulators'; + +export enum ExternalServiceSimulator { + PAGERDUTY = 'pagerduty', + SERVICENOW = 'servicenow', + SLACK = 'slack', + JIRA = 'jira', + WEBHOOK = 'webhook', +} + +export function getExternalServiceSimulatorPath(service: ExternalServiceSimulator): string { + return `/api/_${NAME}/${service}`; +} + +export function getAllExternalServiceSimulatorPaths(): string[] { + const allPaths = Object.values(ExternalServiceSimulator).map(service => + getExternalServiceSimulatorPath(service) + ); + allPaths.push(`/api/_${NAME}/${ExternalServiceSimulator.SERVICENOW}/api/now/v2/table/incident`); + allPaths.push(`/api/_${NAME}/${ExternalServiceSimulator.JIRA}/rest/api/2/issue`); + return allPaths; +} + +interface FixtureSetupDeps { + actions: ActionsPluginSetupContract; + features: FeaturesPluginSetup; +} + +interface FixtureStartDeps { + encryptedSavedObjects: EncryptedSavedObjectsPluginStart; +} + +export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, FixtureStartDeps> { + public setup(core: CoreSetup<FixtureStartDeps>, { features, actions }: FixtureSetupDeps) { + // this action is specifically NOT enabled in ../../config.ts + const notEnabledActionType: ActionType = { + id: 'test.not-enabled', + name: 'Test: Not Enabled', + minimumLicenseRequired: 'gold', + async executor() { + return { status: 'ok', actionId: '' }; + }, + }; + actions.registerType(notEnabledActionType); + features.registerFeature({ + id: 'actions', + name: 'Actions', + app: ['actions', 'kibana'], + privileges: { + all: { + app: ['actions', 'kibana'], + savedObject: { + all: ['action', 'action_task_params'], + read: [], + }, + ui: [], + api: ['actions-read', 'actions-all'], + }, + read: { + app: ['actions', 'kibana'], + savedObject: { + all: ['action_task_params'], + read: ['action'], + }, + ui: [], + api: ['actions-read'], + }, + }, + }); + + const router: IRouter = core.http.createRouter(); + + initPagerduty(router, getExternalServiceSimulatorPath(ExternalServiceSimulator.PAGERDUTY)); + initServiceNow(router, getExternalServiceSimulatorPath(ExternalServiceSimulator.SERVICENOW)); + initJira(router, getExternalServiceSimulatorPath(ExternalServiceSimulator.JIRA)); + } + + public start() {} + public stop() {} +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_simulation.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_simulation.ts new file mode 100644 index 0000000000000..4bf8216aed26f --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/server/servicenow_simulation.ts @@ -0,0 +1,99 @@ +/* + * 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. + */ + +import { schema } from '@kbn/config-schema'; +import { + RequestHandlerContext, + KibanaRequest, + KibanaResponseFactory, + IKibanaResponse, + IRouter, +} from 'kibana/server'; + +export function initPlugin(router: IRouter, path: string) { + router.post( + { + path: `${path}/api/now/v2/table/incident`, + options: { + authRequired: false, + }, + validate: { + body: schema.object({ + short_description: schema.string(), + description: schema.maybe(schema.string()), + comments: schema.maybe(schema.string()), + }), + }, + }, + // ServiceNow simulator: create a servicenow action pointing here, and you can get + // different responses based on the message posted. See the README.md for + // more info. + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + return jsonResponse(res, 200, { + result: { sys_id: '123', number: 'INC01', sys_created_on: '2020-03-10 12:24:20' }, + }); + } + ); + + router.patch( + { + path: `${path}/api/now/v2/table/incident/{id}`, + options: { + authRequired: false, + }, + validate: {}, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + return jsonResponse(res, 200, { + result: { sys_id: '123', number: 'INC01', sys_updated_on: '2020-03-10 12:24:20' }, + }); + } + ); + + router.get( + { + path: `${path}/api/now/v2/table/incident/{id}`, + options: { + authRequired: false, + }, + validate: {}, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + return jsonResponse(res, 200, { + result: { + sys_id: '123', + number: 'INC01', + sys_created_on: '2020-03-10 12:24:20', + short_description: 'title', + description: 'description', + }, + }); + } + ); +} + +function jsonResponse(res: KibanaResponseFactory, code: number, object?: Record<string, unknown>) { + if (object == null) { + return res.custom({ + statusCode: code, + body: '', + }); + } + + return res.custom<Record<string, unknown>>({ body: object, statusCode: code }); +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/servicenow_simulation.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/servicenow_simulation.ts deleted file mode 100644 index cc9521369a47d..0000000000000 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/servicenow_simulation.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - */ - -import Hapi from 'hapi'; - -interface ServiceNowRequest extends Hapi.Request { - payload: { - short_description: string; - description?: string; - comments?: string; - }; -} -export function initPlugin(server: Hapi.Server, path: string) { - server.route({ - method: 'POST', - path: `${path}/api/now/v2/table/incident`, - options: { - auth: false, - }, - handler: createHandler as Hapi.Lifecycle.Method, - }); - - server.route({ - method: 'PATCH', - path: `${path}/api/now/v2/table/incident/{id}`, - options: { - auth: false, - }, - handler: updateHandler as Hapi.Lifecycle.Method, - }); - - server.route({ - method: 'GET', - path: `${path}/api/now/v2/table/incident/{id}`, - options: { - auth: false, - }, - handler: getHandler as Hapi.Lifecycle.Method, - }); -} - -// ServiceNow simulator: create a servicenow action pointing here, and you can get -// different responses based on the message posted. See the README.md for -// more info. -function createHandler(request: ServiceNowRequest, h: any) { - return jsonResponse(h, 200, { - result: { sys_id: '123', number: 'INC01', sys_created_on: '2020-03-10 12:24:20' }, - }); -} - -function updateHandler(request: ServiceNowRequest, h: any) { - return jsonResponse(h, 200, { - result: { sys_id: '123', number: 'INC01', sys_updated_on: '2020-03-10 12:24:20' }, - }); -} - -function getHandler(request: ServiceNowRequest, h: any) { - return jsonResponse(h, 200, { - result: { - sys_id: '123', - number: 'INC01', - sys_created_on: '2020-03-10 12:24:20', - short_description: 'title', - description: 'description', - }, - }); -} - -function jsonResponse(h: any, code: number, object?: any) { - if (object == null) { - return h.response('').code(code); - } - - return h - .response(JSON.stringify(object)) - .type('application/json') - .code(code); -} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/index.ts new file mode 100644 index 0000000000000..4219d99b6c43b --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/index.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ +import Hapi from 'hapi'; +import { + getExternalServiceSimulatorPath, + NAME, + ExternalServiceSimulator, +} from '../actions_simulators/server/plugin'; + +import { initPlugin as initWebhook } from './webhook_simulation'; +import { initPlugin as initSlack } from './slack_simulation'; + +// eslint-disable-next-line import/no-default-export +export default function(kibana: any) { + return new kibana.Plugin({ + require: ['xpack_main'], + name: `${NAME}-legacy`, + init: (server: Hapi.Server) => { + initWebhook(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.WEBHOOK)); + initSlack(server, getExternalServiceSimulatorPath(ExternalServiceSimulator.SLACK)); + }, + }); +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/package.json new file mode 100644 index 0000000000000..644cd77d3be75 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/package.json @@ -0,0 +1,7 @@ +{ + "name": "actions-fixtures-legacy", + "version": "0.0.0", + "kibana": { + "version": "kibana" + } +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/slack_simulation.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/slack_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/slack_simulation.ts rename to x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/slack_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/webhook_simulation.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/webhook_simulation.ts similarity index 100% rename from x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/webhook_simulation.ts rename to x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators_legacy/webhook_simulation.ts diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/index.ts deleted file mode 100644 index 1a47addf36ab3..0000000000000 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/index.ts +++ /dev/null @@ -1,501 +0,0 @@ -/* - * 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. - */ -import { times } from 'lodash'; -import { schema } from '@kbn/config-schema'; -import { AlertExecutorOptions, AlertType } from '../../../../../../plugins/alerting/server'; -import { ActionTypeExecutorOptions, ActionType } from '../../../../../../plugins/actions/server'; - -// eslint-disable-next-line import/no-default-export -export default function(kibana: any) { - return new kibana.Plugin({ - require: ['xpack_main', 'elasticsearch'], - name: 'alerts-fixture', - init(server: any) { - const clusterClient = server.newPlatform.start.core.elasticsearch.legacy.client; - server.plugins.xpack_main.registerFeature({ - id: 'alerting', - name: 'Alerting', - app: ['alerting', 'kibana'], - privileges: { - all: { - app: ['alerting', 'kibana'], - savedObject: { - all: ['alert'], - read: [], - }, - ui: [], - api: ['alerting-read', 'alerting-all'], - }, - read: { - app: ['alerting', 'kibana'], - savedObject: { - all: [], - read: ['alert'], - }, - ui: [], - api: ['alerting-read'], - }, - }, - }); - - // Action types - const noopActionType: ActionType = { - id: 'test.noop', - name: 'Test: Noop', - minimumLicenseRequired: 'gold', - async executor() { - return { status: 'ok', actionId: '' }; - }, - }; - const indexRecordActionType: ActionType = { - id: 'test.index-record', - name: 'Test: Index Record', - minimumLicenseRequired: 'gold', - validate: { - params: schema.object({ - index: schema.string(), - reference: schema.string(), - message: schema.string(), - }), - config: schema.object({ - unencrypted: schema.string(), - }), - secrets: schema.object({ - encrypted: schema.string(), - }), - }, - async executor({ config, secrets, params, services, actionId }: ActionTypeExecutorOptions) { - await services.callCluster('index', { - index: params.index, - refresh: 'wait_for', - body: { - params, - config, - secrets, - reference: params.reference, - source: 'action:test.index-record', - }, - }); - return { status: 'ok', actionId }; - }, - }; - const failingActionType: ActionType = { - id: 'test.failing', - name: 'Test: Failing', - minimumLicenseRequired: 'gold', - validate: { - params: schema.object({ - index: schema.string(), - reference: schema.string(), - }), - }, - async executor({ config, secrets, params, services }: ActionTypeExecutorOptions) { - await services.callCluster('index', { - index: params.index, - refresh: 'wait_for', - body: { - params, - config, - secrets, - reference: params.reference, - source: 'action:test.failing', - }, - }); - throw new Error(`expected failure for ${params.index} ${params.reference}`); - }, - }; - const rateLimitedActionType: ActionType = { - id: 'test.rate-limit', - name: 'Test: Rate Limit', - minimumLicenseRequired: 'gold', - maxAttempts: 2, - validate: { - params: schema.object({ - index: schema.string(), - reference: schema.string(), - retryAt: schema.number(), - }), - }, - async executor({ config, params, services }: ActionTypeExecutorOptions) { - await services.callCluster('index', { - index: params.index, - refresh: 'wait_for', - body: { - params, - config, - reference: params.reference, - source: 'action:test.rate-limit', - }, - }); - return { - status: 'error', - retry: new Date(params.retryAt), - actionId: '', - }; - }, - }; - const authorizationActionType: ActionType = { - id: 'test.authorization', - name: 'Test: Authorization', - minimumLicenseRequired: 'gold', - validate: { - params: schema.object({ - callClusterAuthorizationIndex: schema.string(), - savedObjectsClientType: schema.string(), - savedObjectsClientId: schema.string(), - index: schema.string(), - reference: schema.string(), - }), - }, - async executor({ params, services, actionId }: ActionTypeExecutorOptions) { - // Call cluster - let callClusterSuccess = false; - let callClusterError; - try { - await services.callCluster('index', { - index: params.callClusterAuthorizationIndex, - refresh: 'wait_for', - body: { - param1: 'test', - }, - }); - callClusterSuccess = true; - } catch (e) { - callClusterError = e; - } - // Call scoped cluster - const callScopedCluster = services.getScopedCallCluster(clusterClient); - let callScopedClusterSuccess = false; - let callScopedClusterError; - try { - await callScopedCluster('index', { - index: params.callClusterAuthorizationIndex, - refresh: 'wait_for', - body: { - param1: 'test', - }, - }); - callScopedClusterSuccess = true; - } catch (e) { - callScopedClusterError = e; - } - // Saved objects client - let savedObjectsClientSuccess = false; - let savedObjectsClientError; - try { - await services.savedObjectsClient.get( - params.savedObjectsClientType, - params.savedObjectsClientId - ); - savedObjectsClientSuccess = true; - } catch (e) { - savedObjectsClientError = e; - } - // Save the result - await services.callCluster('index', { - index: params.index, - refresh: 'wait_for', - body: { - state: { - callClusterSuccess, - callClusterError, - callScopedClusterSuccess, - callScopedClusterError, - savedObjectsClientSuccess, - savedObjectsClientError, - }, - params, - reference: params.reference, - source: 'action:test.authorization', - }, - }); - return { - actionId, - status: 'ok', - }; - }, - }; - server.newPlatform.setup.plugins.actions.registerType(noopActionType); - server.newPlatform.setup.plugins.actions.registerType(indexRecordActionType); - server.newPlatform.setup.plugins.actions.registerType(failingActionType); - server.newPlatform.setup.plugins.actions.registerType(rateLimitedActionType); - server.newPlatform.setup.plugins.actions.registerType(authorizationActionType); - - // Alert types - const alwaysFiringAlertType: AlertType = { - id: 'test.always-firing', - name: 'Test: Always Firing', - actionGroups: [ - { id: 'default', name: 'Default' }, - { id: 'other', name: 'Other' }, - ], - defaultActionGroupId: 'default', - actionVariables: { - state: [{ name: 'instanceStateValue', description: 'the instance state value' }], - context: [{ name: 'instanceContextValue', description: 'the instance context value' }], - }, - async executor(alertExecutorOptions: AlertExecutorOptions) { - const { - services, - params, - state, - alertId, - spaceId, - namespace, - name, - tags, - createdBy, - updatedBy, - } = alertExecutorOptions; - let group = 'default'; - const alertInfo = { alertId, spaceId, namespace, name, tags, createdBy, updatedBy }; - - if (params.groupsToScheduleActionsInSeries) { - const index = state.groupInSeriesIndex || 0; - group = params.groupsToScheduleActionsInSeries[index]; - } - - if (group) { - services - .alertInstanceFactory('1') - .replaceState({ instanceStateValue: true }) - .scheduleActions(group, { - instanceContextValue: true, - }); - } - await services.callCluster('index', { - index: params.index, - refresh: 'wait_for', - body: { - state, - params, - reference: params.reference, - source: 'alert:test.always-firing', - alertInfo, - }, - }); - return { - globalStateValue: true, - groupInSeriesIndex: (state.groupInSeriesIndex || 0) + 1, - }; - }, - }; - // Alert types - const cumulativeFiringAlertType: AlertType = { - id: 'test.cumulative-firing', - name: 'Test: Cumulative Firing', - actionGroups: [ - { id: 'default', name: 'Default' }, - { id: 'other', name: 'Other' }, - ], - defaultActionGroupId: 'default', - async executor(alertExecutorOptions: AlertExecutorOptions) { - const { services, state } = alertExecutorOptions; - const group = 'default'; - - const runCount = (state.runCount || 0) + 1; - - times(runCount, index => { - services - .alertInstanceFactory(`instance-${index}`) - .replaceState({ instanceStateValue: true }) - .scheduleActions(group); - }); - - return { - runCount, - }; - }, - }; - const neverFiringAlertType: AlertType = { - id: 'test.never-firing', - name: 'Test: Never firing', - actionGroups: [ - { - id: 'default', - name: 'Default', - }, - ], - defaultActionGroupId: 'default', - async executor({ services, params, state }: AlertExecutorOptions) { - await services.callCluster('index', { - index: params.index, - refresh: 'wait_for', - body: { - state, - params, - reference: params.reference, - source: 'alert:test.never-firing', - }, - }); - return { - globalStateValue: true, - }; - }, - }; - const failingAlertType: AlertType = { - id: 'test.failing', - name: 'Test: Failing', - actionGroups: [ - { - id: 'default', - name: 'Default', - }, - ], - defaultActionGroupId: 'default', - async executor({ services, params, state }: AlertExecutorOptions) { - await services.callCluster('index', { - index: params.index, - refresh: 'wait_for', - body: { - state, - params, - reference: params.reference, - source: 'alert:test.failing', - }, - }); - throw new Error('Failed to execute alert type'); - }, - }; - const authorizationAlertType: AlertType = { - id: 'test.authorization', - name: 'Test: Authorization', - actionGroups: [ - { - id: 'default', - name: 'Default', - }, - ], - defaultActionGroupId: 'default', - validate: { - params: schema.object({ - callClusterAuthorizationIndex: schema.string(), - savedObjectsClientType: schema.string(), - savedObjectsClientId: schema.string(), - index: schema.string(), - reference: schema.string(), - }), - }, - async executor({ services, params, state }: AlertExecutorOptions) { - // Call cluster - let callClusterSuccess = false; - let callClusterError; - try { - await services.callCluster('index', { - index: params.callClusterAuthorizationIndex, - refresh: 'wait_for', - body: { - param1: 'test', - }, - }); - callClusterSuccess = true; - } catch (e) { - callClusterError = e; - } - // Call scoped cluster - const callScopedCluster = services.getScopedCallCluster(clusterClient); - let callScopedClusterSuccess = false; - let callScopedClusterError; - try { - await callScopedCluster('index', { - index: params.callClusterAuthorizationIndex, - refresh: 'wait_for', - body: { - param1: 'test', - }, - }); - callScopedClusterSuccess = true; - } catch (e) { - callScopedClusterError = e; - } - // Saved objects client - let savedObjectsClientSuccess = false; - let savedObjectsClientError; - try { - await services.savedObjectsClient.get( - params.savedObjectsClientType, - params.savedObjectsClientId - ); - savedObjectsClientSuccess = true; - } catch (e) { - savedObjectsClientError = e; - } - // Save the result - await services.callCluster('index', { - index: params.index, - refresh: 'wait_for', - body: { - state: { - callClusterSuccess, - callClusterError, - callScopedClusterSuccess, - callScopedClusterError, - savedObjectsClientSuccess, - savedObjectsClientError, - }, - params, - reference: params.reference, - source: 'alert:test.authorization', - }, - }); - }, - }; - const validationAlertType: AlertType = { - id: 'test.validation', - name: 'Test: Validation', - actionGroups: [ - { - id: 'default', - name: 'Default', - }, - ], - defaultActionGroupId: 'default', - validate: { - params: schema.object({ - param1: schema.string(), - }), - }, - async executor({ services, params, state }: AlertExecutorOptions) {}, - }; - const noopAlertType: AlertType = { - id: 'test.noop', - name: 'Test: Noop', - actionGroups: [{ id: 'default', name: 'Default' }], - defaultActionGroupId: 'default', - async executor({ services, params, state }: AlertExecutorOptions) {}, - }; - const onlyContextVariablesAlertType: AlertType = { - id: 'test.onlyContextVariables', - name: 'Test: Only Context Variables', - actionGroups: [{ id: 'default', name: 'Default' }], - defaultActionGroupId: 'default', - actionVariables: { - context: [{ name: 'aContextVariable', description: 'this is a context variable' }], - }, - async executor(opts: AlertExecutorOptions) {}, - }; - const onlyStateVariablesAlertType: AlertType = { - id: 'test.onlyStateVariables', - name: 'Test: Only State Variables', - actionGroups: [{ id: 'default', name: 'Default' }], - defaultActionGroupId: 'default', - actionVariables: { - state: [{ name: 'aStateVariable', description: 'this is a state variable' }], - }, - async executor(opts: AlertExecutorOptions) {}, - }; - server.newPlatform.setup.plugins.alerting.registerType(alwaysFiringAlertType); - server.newPlatform.setup.plugins.alerting.registerType(cumulativeFiringAlertType); - server.newPlatform.setup.plugins.alerting.registerType(neverFiringAlertType); - server.newPlatform.setup.plugins.alerting.registerType(failingAlertType); - server.newPlatform.setup.plugins.alerting.registerType(validationAlertType); - server.newPlatform.setup.plugins.alerting.registerType(authorizationAlertType); - server.newPlatform.setup.plugins.alerting.registerType(noopAlertType); - server.newPlatform.setup.plugins.alerting.registerType(onlyContextVariablesAlertType); - server.newPlatform.setup.plugins.alerting.registerType(onlyStateVariablesAlertType); - }, - }); -} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json new file mode 100644 index 0000000000000..98c57db16c914 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json @@ -0,0 +1,10 @@ +{ + "id": "alerts-fixtures", + "version": "1.0.0", + "kibanaVersion": "kibana", + "configPath": ["xpack"], + "requiredPlugins": ["taskManager", "features", "actions", "alerting"], + "optionalPlugins": ["spaces"], + "server": true, + "ui": false +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json index 836fa09855d8f..53abf490ad376 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json @@ -1,7 +1,20 @@ { - "name": "alerts", - "version": "0.0.0", + "name": "alerts-fixtures", + "version": "1.0.0", "kibana": { - "version": "kibana" + "version": "kibana", + "templateVersion": "1.0.0" + }, + "main": "target/test/plugin_api_integration/plugins/alerts", + "scripts": { + "kbn": "node ../../../../../scripts/kbn.js", + "build": "rm -rf './target' && tsc" + }, + "devDependencies": { + "typescript": "3.7.2" + }, + "license": "Apache-2.0", + "dependencies": { + "joi": "^13.5.2" } } diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/index.ts new file mode 100644 index 0000000000000..54d6de50cff4d --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/index.ts @@ -0,0 +1,9 @@ +/* + * 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. + */ + +import { FixturePlugin } from './plugin'; + +export const plugin = () => new FixturePlugin(); diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/plugin.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/plugin.ts new file mode 100644 index 0000000000000..347695dd12beb --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/server/plugin.ts @@ -0,0 +1,516 @@ +/* + * 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. + */ + +import { Plugin, CoreSetup } from 'kibana/server'; +import { schema } from '@kbn/config-schema'; +import { times } from 'lodash'; +import { PluginSetupContract as ActionsPluginSetup } from '../../../../../../../plugins/actions/server/plugin'; +import { PluginSetupContract as AlertingPluginSetup } from '../../../../../../../plugins/alerting/server/plugin'; +import { EncryptedSavedObjectsPluginStart } from '../../../../../../../plugins/encrypted_saved_objects/server'; +import { PluginSetupContract as FeaturesPluginSetup } from '../../../../../../../plugins/features/server'; +import { ActionType, ActionTypeExecutorOptions } from '../../../../../../../plugins/actions/server'; +import { AlertType, AlertExecutorOptions } from '../../../../../../../plugins/alerting/server'; + +interface FixtureSetupDeps { + features: FeaturesPluginSetup; + actions: ActionsPluginSetup; + alerting: AlertingPluginSetup; +} + +interface FixtureStartDeps { + encryptedSavedObjects: EncryptedSavedObjectsPluginStart; +} + +export class FixturePlugin implements Plugin<void, void, FixtureSetupDeps, FixtureStartDeps> { + public setup( + core: CoreSetup<FixtureStartDeps>, + { features, actions, alerting }: FixtureSetupDeps + ) { + const clusterClient = core.elasticsearch.adminClient; + features.registerFeature({ + id: 'alerting', + name: 'Alerting', + app: ['alerting', 'kibana'], + privileges: { + all: { + app: ['alerting', 'kibana'], + savedObject: { + all: ['alert'], + read: [], + }, + ui: [], + api: ['alerting-read', 'alerting-all'], + }, + read: { + app: ['alerting', 'kibana'], + savedObject: { + all: [], + read: ['alert'], + }, + ui: [], + api: ['alerting-read'], + }, + }, + }); + // Action types + const noopActionType: ActionType = { + id: 'test.noop', + name: 'Test: Noop', + minimumLicenseRequired: 'gold', + async executor() { + return { status: 'ok', actionId: '' }; + }, + }; + const indexRecordActionType: ActionType = { + id: 'test.index-record', + name: 'Test: Index Record', + minimumLicenseRequired: 'gold', + validate: { + params: schema.object({ + index: schema.string(), + reference: schema.string(), + message: schema.string(), + }), + config: schema.object({ + unencrypted: schema.string(), + }), + secrets: schema.object({ + encrypted: schema.string(), + }), + }, + async executor({ config, secrets, params, services, actionId }: ActionTypeExecutorOptions) { + await services.callCluster('index', { + index: params.index, + refresh: 'wait_for', + body: { + params, + config, + secrets, + reference: params.reference, + source: 'action:test.index-record', + }, + }); + return { status: 'ok', actionId }; + }, + }; + const failingActionType: ActionType = { + id: 'test.failing', + name: 'Test: Failing', + minimumLicenseRequired: 'gold', + validate: { + params: schema.object({ + index: schema.string(), + reference: schema.string(), + }), + }, + async executor({ config, secrets, params, services }: ActionTypeExecutorOptions) { + await services.callCluster('index', { + index: params.index, + refresh: 'wait_for', + body: { + params, + config, + secrets, + reference: params.reference, + source: 'action:test.failing', + }, + }); + throw new Error(`expected failure for ${params.index} ${params.reference}`); + }, + }; + const rateLimitedActionType: ActionType = { + id: 'test.rate-limit', + name: 'Test: Rate Limit', + minimumLicenseRequired: 'gold', + maxAttempts: 2, + validate: { + params: schema.object({ + index: schema.string(), + reference: schema.string(), + retryAt: schema.number(), + }), + }, + async executor({ config, params, services }: ActionTypeExecutorOptions) { + await services.callCluster('index', { + index: params.index, + refresh: 'wait_for', + body: { + params, + config, + reference: params.reference, + source: 'action:test.rate-limit', + }, + }); + return { + status: 'error', + retry: new Date(params.retryAt), + actionId: '', + }; + }, + }; + const authorizationActionType: ActionType = { + id: 'test.authorization', + name: 'Test: Authorization', + minimumLicenseRequired: 'gold', + validate: { + params: schema.object({ + callClusterAuthorizationIndex: schema.string(), + savedObjectsClientType: schema.string(), + savedObjectsClientId: schema.string(), + index: schema.string(), + reference: schema.string(), + }), + }, + async executor({ params, services, actionId }: ActionTypeExecutorOptions) { + // Call cluster + let callClusterSuccess = false; + let callClusterError; + try { + await services.callCluster('index', { + index: params.callClusterAuthorizationIndex, + refresh: 'wait_for', + body: { + param1: 'test', + }, + }); + callClusterSuccess = true; + } catch (e) { + callClusterError = e; + } + // Call scoped cluster + const callScopedCluster = services.getScopedCallCluster(clusterClient); + let callScopedClusterSuccess = false; + let callScopedClusterError; + try { + await callScopedCluster('index', { + index: params.callClusterAuthorizationIndex, + refresh: 'wait_for', + body: { + param1: 'test', + }, + }); + callScopedClusterSuccess = true; + } catch (e) { + callScopedClusterError = e; + } + // Saved objects client + let savedObjectsClientSuccess = false; + let savedObjectsClientError; + try { + await services.savedObjectsClient.get( + params.savedObjectsClientType, + params.savedObjectsClientId + ); + savedObjectsClientSuccess = true; + } catch (e) { + savedObjectsClientError = e; + } + // Save the result + await services.callCluster('index', { + index: params.index, + refresh: 'wait_for', + body: { + state: { + callClusterSuccess, + callClusterError, + callScopedClusterSuccess, + callScopedClusterError, + savedObjectsClientSuccess, + savedObjectsClientError, + }, + params, + reference: params.reference, + source: 'action:test.authorization', + }, + }); + return { + actionId, + status: 'ok', + }; + }, + }; + actions.registerType(noopActionType); + actions.registerType(indexRecordActionType); + actions.registerType(failingActionType); + actions.registerType(rateLimitedActionType); + actions.registerType(authorizationActionType); + + const alwaysFiringAlertType: AlertType = { + id: 'test.always-firing', + name: 'Test: Always Firing', + actionGroups: [ + { id: 'default', name: 'Default' }, + { id: 'other', name: 'Other' }, + ], + defaultActionGroupId: 'default', + actionVariables: { + state: [{ name: 'instanceStateValue', description: 'the instance state value' }], + context: [{ name: 'instanceContextValue', description: 'the instance context value' }], + }, + async executor(alertExecutorOptions: AlertExecutorOptions) { + const { + services, + params, + state, + alertId, + spaceId, + namespace, + name, + tags, + createdBy, + updatedBy, + } = alertExecutorOptions; + let group = 'default'; + const alertInfo = { alertId, spaceId, namespace, name, tags, createdBy, updatedBy }; + + if (params.groupsToScheduleActionsInSeries) { + const index = state.groupInSeriesIndex || 0; + group = params.groupsToScheduleActionsInSeries[index]; + } + + if (group) { + services + .alertInstanceFactory('1') + .replaceState({ instanceStateValue: true }) + .scheduleActions(group, { + instanceContextValue: true, + }); + } + await services.callCluster('index', { + index: params.index, + refresh: 'wait_for', + body: { + state, + params, + reference: params.reference, + source: 'alert:test.always-firing', + alertInfo, + }, + }); + return { + globalStateValue: true, + groupInSeriesIndex: (state.groupInSeriesIndex || 0) + 1, + }; + }, + }; + // Alert types + const cumulativeFiringAlertType: AlertType = { + id: 'test.cumulative-firing', + name: 'Test: Cumulative Firing', + actionGroups: [ + { id: 'default', name: 'Default' }, + { id: 'other', name: 'Other' }, + ], + defaultActionGroupId: 'default', + async executor(alertExecutorOptions: AlertExecutorOptions) { + const { services, state } = alertExecutorOptions; + const group = 'default'; + + const runCount = (state.runCount || 0) + 1; + + times(runCount, index => { + services + .alertInstanceFactory(`instance-${index}`) + .replaceState({ instanceStateValue: true }) + .scheduleActions(group); + }); + + return { + runCount, + }; + }, + }; + const neverFiringAlertType: AlertType = { + id: 'test.never-firing', + name: 'Test: Never firing', + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + ], + defaultActionGroupId: 'default', + async executor({ services, params, state }: AlertExecutorOptions) { + await services.callCluster('index', { + index: params.index, + refresh: 'wait_for', + body: { + state, + params, + reference: params.reference, + source: 'alert:test.never-firing', + }, + }); + return { + globalStateValue: true, + }; + }, + }; + const failingAlertType: AlertType = { + id: 'test.failing', + name: 'Test: Failing', + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + ], + defaultActionGroupId: 'default', + async executor({ services, params, state }: AlertExecutorOptions) { + await services.callCluster('index', { + index: params.index, + refresh: 'wait_for', + body: { + state, + params, + reference: params.reference, + source: 'alert:test.failing', + }, + }); + throw new Error('Failed to execute alert type'); + }, + }; + const authorizationAlertType: AlertType = { + id: 'test.authorization', + name: 'Test: Authorization', + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + ], + defaultActionGroupId: 'default', + validate: { + params: schema.object({ + callClusterAuthorizationIndex: schema.string(), + savedObjectsClientType: schema.string(), + savedObjectsClientId: schema.string(), + index: schema.string(), + reference: schema.string(), + }), + }, + async executor({ services, params, state }: AlertExecutorOptions) { + // Call cluster + let callClusterSuccess = false; + let callClusterError; + try { + await services.callCluster('index', { + index: params.callClusterAuthorizationIndex, + refresh: 'wait_for', + body: { + param1: 'test', + }, + }); + callClusterSuccess = true; + } catch (e) { + callClusterError = e; + } + // Call scoped cluster + const callScopedCluster = services.getScopedCallCluster(clusterClient); + let callScopedClusterSuccess = false; + let callScopedClusterError; + try { + await callScopedCluster('index', { + index: params.callClusterAuthorizationIndex, + refresh: 'wait_for', + body: { + param1: 'test', + }, + }); + callScopedClusterSuccess = true; + } catch (e) { + callScopedClusterError = e; + } + // Saved objects client + let savedObjectsClientSuccess = false; + let savedObjectsClientError; + try { + await services.savedObjectsClient.get( + params.savedObjectsClientType, + params.savedObjectsClientId + ); + savedObjectsClientSuccess = true; + } catch (e) { + savedObjectsClientError = e; + } + // Save the result + await services.callCluster('index', { + index: params.index, + refresh: 'wait_for', + body: { + state: { + callClusterSuccess, + callClusterError, + callScopedClusterSuccess, + callScopedClusterError, + savedObjectsClientSuccess, + savedObjectsClientError, + }, + params, + reference: params.reference, + source: 'alert:test.authorization', + }, + }); + }, + }; + const validationAlertType: AlertType = { + id: 'test.validation', + name: 'Test: Validation', + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + ], + defaultActionGroupId: 'default', + validate: { + params: schema.object({ + param1: schema.string(), + }), + }, + async executor({ services, params, state }: AlertExecutorOptions) {}, + }; + const noopAlertType: AlertType = { + id: 'test.noop', + name: 'Test: Noop', + actionGroups: [{ id: 'default', name: 'Default' }], + defaultActionGroupId: 'default', + async executor({ services, params, state }: AlertExecutorOptions) {}, + }; + const onlyContextVariablesAlertType: AlertType = { + id: 'test.onlyContextVariables', + name: 'Test: Only Context Variables', + actionGroups: [{ id: 'default', name: 'Default' }], + defaultActionGroupId: 'default', + actionVariables: { + context: [{ name: 'aContextVariable', description: 'this is a context variable' }], + }, + async executor(opts: AlertExecutorOptions) {}, + }; + const onlyStateVariablesAlertType: AlertType = { + id: 'test.onlyStateVariables', + name: 'Test: Only State Variables', + actionGroups: [{ id: 'default', name: 'Default' }], + defaultActionGroupId: 'default', + actionVariables: { + state: [{ name: 'aStateVariable', description: 'this is a state variable' }], + }, + async executor(opts: AlertExecutorOptions) {}, + }; + alerting.registerType(alwaysFiringAlertType); + alerting.registerType(cumulativeFiringAlertType); + alerting.registerType(neverFiringAlertType); + alerting.registerType(failingAlertType); + alerting.registerType(validationAlertType); + alerting.registerType(authorizationAlertType); + alerting.registerType(noopAlertType); + alerting.registerType(onlyContextVariablesAlertType); + alerting.registerType(onlyStateVariablesAlertType); + } + + public start() {} + public stop() {} +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager/index.ts deleted file mode 100644 index ac32f05805e4a..0000000000000 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager/index.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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. - */ - -import { TaskManagerStartContract } from '../../../../../../plugins/task_manager/server'; - -const taskManagerQuery = (...filters: any[]) => ({ - bool: { - filter: { - bool: { - must: filters, - }, - }, - }, -}); - -const tasksForAlerting = { - term: { - 'task.scope': 'alerting', - }, -}; -const taskByIdQuery = (id: string) => ({ - ids: { - values: [`task:${id}`], - }, -}); - -// eslint-disable-next-line import/no-default-export -export default function(kibana: any) { - return new kibana.Plugin({ - name: 'taskManagerHelpers', - require: ['elasticsearch'], - - config(Joi: any) { - return Joi.object({ - enabled: Joi.boolean().default(true), - }).default(); - }, - - init(server: any) { - const taskManager = server.newPlatform.start.plugins.taskManager as TaskManagerStartContract; - - server.route({ - path: '/api/alerting_tasks/{taskId}', - method: 'GET', - async handler(request: any) { - try { - return taskManager.fetch({ - query: taskManagerQuery(tasksForAlerting, taskByIdQuery(request.params.taskId)), - }); - } catch (err) { - return err; - } - }, - }); - }, - }); -} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager/package.json deleted file mode 100644 index 532b597829561..0000000000000 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "alerting_task_plugin", - "version": "1.0.0", - "kibana": { - "version": "kibana", - "templateVersion": "1.0.0" - }, - "license": "Apache-2.0", - "dependencies": { - "joi": "^13.5.2" - } -} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json new file mode 100644 index 0000000000000..8f606276998f5 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json @@ -0,0 +1,9 @@ +{ + "id": "task_manager_fixture", + "version": "1.0.0", + "kibanaVersion": "kibana", + "configPath": ["xpack"], + "requiredPlugins": ["taskManager"], + "server": true, + "ui": false +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json new file mode 100644 index 0000000000000..be3b542ed7b52 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json @@ -0,0 +1,20 @@ +{ + "name": "task_manager_fixture", + "version": "1.0.0", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "main": "target/test/plugin_api_integration/plugins/task_manager_fixture", + "scripts": { + "kbn": "node ../../../../../scripts/kbn.js", + "build": "rm -rf './target' && tsc" + }, + "devDependencies": { + "typescript": "3.7.2" + }, + "license": "Apache-2.0", + "dependencies": { + "joi": "^13.5.2" + } +} diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/index.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/index.ts new file mode 100644 index 0000000000000..77233f463734a --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/index.ts @@ -0,0 +1,9 @@ +/* + * 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. + */ + +import { SampleTaskManagerFixturePlugin } from './plugin'; + +export const plugin = () => new SampleTaskManagerFixturePlugin(); diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/plugin.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/plugin.ts new file mode 100644 index 0000000000000..18fdd5f9c3ac3 --- /dev/null +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/server/plugin.ts @@ -0,0 +1,87 @@ +/* + * 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. + */ + +import { + Plugin, + CoreSetup, + CoreStart, + RequestHandlerContext, + KibanaRequest, + KibanaResponseFactory, + IKibanaResponse, +} from 'kibana/server'; +import { Subject } from 'rxjs'; +import { first } from 'rxjs/operators'; +import { schema } from '@kbn/config-schema'; +import { TaskManagerStartContract } from '../../../../../../../plugins/task_manager/server'; + +export interface SampleTaskManagerFixtureStartDeps { + taskManager: TaskManagerStartContract; +} + +const taskManagerQuery = (...filters: any[]) => ({ + bool: { + filter: { + bool: { + must: filters, + }, + }, + }, +}); + +const tasksForAlerting = { + term: { + 'task.scope': 'alerting', + }, +}; +const taskByIdQuery = (id: string) => ({ + ids: { + values: [`task:${id}`], + }, +}); + +export class SampleTaskManagerFixturePlugin + implements Plugin<void, void, {}, SampleTaskManagerFixtureStartDeps> { + taskManagerStart$: Subject<TaskManagerStartContract> = new Subject<TaskManagerStartContract>(); + taskManagerStart: Promise<TaskManagerStartContract> = this.taskManagerStart$ + .pipe(first()) + .toPromise(); + + public setup(core: CoreSetup) { + core.http.createRouter().get( + { + path: '/api/alerting_tasks/{taskId}', + validate: { + params: schema.object({ + taskId: schema.string(), + }), + }, + }, + async ( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> => { + try { + const taskManager = await this.taskManagerStart; + return res.ok({ + body: await taskManager.fetch({ + query: taskManagerQuery(tasksForAlerting, taskByIdQuery(req.params.taskId)), + }), + }); + } catch (err) { + return res.badRequest({ body: err }); + } + } + ); + } + + public start(core: CoreStart, { taskManager }: SampleTaskManagerFixtureStartDeps) { + this.taskManagerStart$.next(taskManager); + this.taskManagerStart$.complete(); + } + public stop() {} +} diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/jira.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/jira.ts index ed63d25d86aca..c67f7868f7ff0 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/jira.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/jira.ts @@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators'; +} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; const mapping = [ { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/pagerduty.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/pagerduty.ts index 4c76ebfb93b0b..443d3acb7ba1c 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/pagerduty.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/pagerduty.ts @@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators'; +} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function pagerdutyTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow.ts index 04cd06999f432..c69eead75e278 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/servicenow.ts @@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators'; +} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; const mapping = [ { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/slack.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/slack.ts index 386254e49c19c..e522b8c7b898d 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/slack.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/slack.ts @@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators'; +} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function slackTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/webhook.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/webhook.ts index 9b66326fa6157..9c769897d35ee 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/webhook.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/actions/builtin_action_types/webhook.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators'; +} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; const defaultValues: Record<string, any> = { headers: null, diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/builtin_action_types/webhook.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/builtin_action_types/webhook.ts index 112149a32649a..22e1284f55aa8 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/actions/builtin_action_types/webhook.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/actions/builtin_action_types/webhook.ts @@ -10,7 +10,7 @@ import { FtrProviderContext } from '../../../../common/ftr_provider_context'; import { getExternalServiceSimulatorPath, ExternalServiceSimulator, -} from '../../../../common/fixtures/plugins/actions_simulators'; +} from '../../../../common/fixtures/plugins/actions_simulators/server/plugin'; // eslint-disable-next-line import/no-default-export export default function webhookTest({ getService }: FtrProviderContext) { diff --git a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts index 1a01cf8929c05..838a1d1c9461c 100644 --- a/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts +++ b/x-pack/test/encrypted_saved_objects_api_integration/fixtures/api_consumer_plugin/server/index.ts @@ -5,7 +5,7 @@ */ import { CoreSetup, PluginInitializer } from '../../../../../../src/core/server'; -import { deepFreeze } from '../../../../../../src/core/utils'; +import { deepFreeze } from '../../../../../../src/core/server'; import { EncryptedSavedObjectsPluginSetup, EncryptedSavedObjectsPluginStart, diff --git a/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts b/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts index 7e15ff436d12c..b5946dcf22610 100644 --- a/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts +++ b/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_security.ts @@ -69,7 +69,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows management navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Management']); + expect(navLinks).to.eql(['Stack Management']); }); it(`allows settings to be changed`, async () => { @@ -125,7 +125,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows Management navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Management']); + expect(navLinks).to.eql(['Stack Management']); }); it(`does not allow settings to be changed`, async () => { @@ -178,7 +178,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows Management navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Discover', 'Management']); + expect(navLinks).to.eql(['Discover', 'Stack Management']); }); it(`does not allow navigation to advanced settings; redirects to management home`, async () => { diff --git a/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_spaces.ts b/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_spaces.ts index 4b105263f3ba5..f27e1386d5adc 100644 --- a/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_spaces.ts +++ b/x-pack/test/functional/apps/advanced_settings/feature_controls/advanced_settings_spaces.ts @@ -43,7 +43,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { basePath: '/s/custom_space', }); const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.contain('Management'); + expect(navLinks).to.contain('Stack Management'); }); it(`allows settings to be changed`, async () => { diff --git a/x-pack/test/functional/apps/apm/feature_controls/apm_security.ts b/x-pack/test/functional/apps/apm/feature_controls/apm_security.ts index e2d5efac4644c..7c9c9f9c8c155 100644 --- a/x-pack/test/functional/apps/apm/feature_controls/apm_security.ts +++ b/x-pack/test/functional/apps/apm/feature_controls/apm_security.ts @@ -60,7 +60,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows apm navlink', async () => { const navLinks = await appsMenu.readLinks(); - expect(navLinks.map(link => link.text)).to.eql(['APM', 'Management']); + expect(navLinks.map(link => link.text)).to.eql(['APM', 'Stack Management']); }); it('can navigate to APM app', async () => { @@ -109,7 +109,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows apm navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['APM', 'Management']); + expect(navLinks).to.eql(['APM', 'Stack Management']); }); it('can navigate to APM app', async () => { diff --git a/x-pack/test/functional/apps/canvas/feature_controls/canvas_security.ts b/x-pack/test/functional/apps/canvas/feature_controls/canvas_security.ts index d0e37ec8e3f35..71c10bd8248be 100644 --- a/x-pack/test/functional/apps/canvas/feature_controls/canvas_security.ts +++ b/x-pack/test/functional/apps/canvas/feature_controls/canvas_security.ts @@ -66,7 +66,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows canvas navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Canvas', 'Management']); + expect(navLinks).to.eql(['Canvas', 'Stack Management']); }); it(`landing page shows "Create new workpad" button`, async () => { @@ -142,7 +142,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows canvas navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Canvas', 'Management']); + expect(navLinks).to.eql(['Canvas', 'Stack Management']); }); it(`landing page shows disabled "Create new workpad" button`, async () => { diff --git a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts index b6889f21bb1ab..959e5b109ca55 100644 --- a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts +++ b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts @@ -77,7 +77,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows dashboard navlink', async () => { const navLinks = await appsMenu.readLinks(); - expect(navLinks.map(link => link.text)).to.eql(['Dashboard', 'Management']); + expect(navLinks.map(link => link.text)).to.eql(['Dashboard', 'Stack Management']); }); it(`landing page shows "Create new Dashboard" button`, async () => { @@ -261,7 +261,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows dashboard navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Dashboard', 'Management']); + expect(navLinks).to.eql(['Dashboard', 'Stack Management']); }); it(`landing page doesn't show "Create new Dashboard" button`, async () => { @@ -376,7 +376,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows dashboard navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Dashboard', 'Management']); + expect(navLinks).to.eql(['Dashboard', 'Stack Management']); }); it(`landing page doesn't show "Create new Dashboard" button`, async () => { diff --git a/x-pack/test/functional/apps/dashboard_mode/dashboard_empty_screen.js b/x-pack/test/functional/apps/dashboard_mode/dashboard_empty_screen.js index 19eebb3ba501c..c8ff3117506c3 100644 --- a/x-pack/test/functional/apps/dashboard_mode/dashboard_empty_screen.js +++ b/x-pack/test/functional/apps/dashboard_mode/dashboard_empty_screen.js @@ -4,11 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ +import expect from '@kbn/expect'; + export default function({ getPageObjects, getService }) { const log = getService('log'); const testSubjects = getService('testSubjects'); const esArchiver = getService('esArchiver'); const dashboardVisualizations = getService('dashboardVisualizations'); + const dashboardPanelActions = getService('dashboardPanelActions'); const PageObjects = getPageObjects(['common', 'dashboard', 'visualize', 'lens']); describe('empty dashboard', function() { @@ -52,7 +55,7 @@ export default function({ getPageObjects, getService }) { operation: 'terms', field: 'ip', }); - await PageObjects.lens.save(title); + await PageObjects.lens.save(title, false, true); } it('adds Lens visualization to empty dashboard', async () => { @@ -64,5 +67,39 @@ export default function({ getPageObjects, getService }) { await PageObjects.dashboard.waitForRenderComplete(); await testSubjects.exists(`embeddablePanelHeading-${title}`); }); + + it('redirects via save and return button after edit', async () => { + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.clickEdit(); + await PageObjects.lens.saveAndReturn(); + }); + + it('redirects via save as button after edit, renaming itself', async () => { + const newTitle = 'wowee, looks like I have a new title'; + const originalPanelCount = await PageObjects.dashboard.getPanelCount(); + await PageObjects.dashboard.waitForRenderComplete(); + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.clickEdit(); + await PageObjects.lens.save(newTitle, false, true); + await PageObjects.dashboard.waitForRenderComplete(); + const newPanelCount = await PageObjects.dashboard.getPanelCount(); + expect(newPanelCount).to.eql(originalPanelCount); + const titles = await PageObjects.dashboard.getPanelTitles(); + expect(titles.indexOf(newTitle)).to.not.be(-1); + }); + + it('redirects via save as button after edit, adding a new panel', async () => { + const newTitle = 'wowee, my title just got cooler'; + const originalPanelCount = await PageObjects.dashboard.getPanelCount(); + await PageObjects.dashboard.waitForRenderComplete(); + await dashboardPanelActions.openContextMenu(); + await dashboardPanelActions.clickEdit(); + await PageObjects.lens.save(newTitle, true, true); + await PageObjects.dashboard.waitForRenderComplete(); + const newPanelCount = await PageObjects.dashboard.getPanelCount(); + expect(newPanelCount).to.eql(originalPanelCount + 1); + const titles = await PageObjects.dashboard.getPanelTitles(); + expect(titles.indexOf(newTitle)).to.not.be(-1); + }); }); } diff --git a/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js b/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js index 78cef80c7ca87..1e734cb59579b 100644 --- a/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js +++ b/x-pack/test/functional/apps/dashboard_mode/dashboard_view_mode.js @@ -204,7 +204,7 @@ export default function({ getService, getPageObjects }) { ]); await PageObjects.header.waitUntilLoadingHasFinished(); - if (await appsMenu.linkExists('Management')) { + if (await appsMenu.linkExists('Stack Management')) { throw new Error('Expected management nav link to not be shown'); } }); @@ -213,7 +213,7 @@ export default function({ getService, getPageObjects }) { await security.testUser.setRoles(['kibana_dashboard_only_user', 'superuser']); await PageObjects.header.waitUntilLoadingHasFinished(); - if (!(await appsMenu.linkExists('Management'))) { + if (!(await appsMenu.linkExists('Stack Management'))) { throw new Error('Expected management nav link to be shown'); } }); diff --git a/x-pack/test/functional/apps/dev_tools/feature_controls/dev_tools_security.ts b/x-pack/test/functional/apps/dev_tools/feature_controls/dev_tools_security.ts index 3d17d235b7f4f..162bf23c29490 100644 --- a/x-pack/test/functional/apps/dev_tools/feature_controls/dev_tools_security.ts +++ b/x-pack/test/functional/apps/dev_tools/feature_controls/dev_tools_security.ts @@ -64,7 +64,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows Dev Tools navlink', async () => { const navLinks = await appsMenu.readLinks(); - expect(navLinks.map(link => link.text)).to.eql(['Dev Tools', 'Management']); + expect(navLinks.map(link => link.text)).to.eql(['Dev Tools', 'Stack Management']); }); describe('console', () => { @@ -145,7 +145,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it(`shows 'Dev Tools' navlink`, async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Dev Tools', 'Management']); + expect(navLinks).to.eql(['Dev Tools', 'Stack Management']); }); describe('console', () => { diff --git a/x-pack/test/functional/apps/discover/feature_controls/discover_security.ts b/x-pack/test/functional/apps/discover/feature_controls/discover_security.ts index 76ca613af4b55..cf915eaefecca 100644 --- a/x-pack/test/functional/apps/discover/feature_controls/discover_security.ts +++ b/x-pack/test/functional/apps/discover/feature_controls/discover_security.ts @@ -82,7 +82,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows discover navlink', async () => { const navLinks = await appsMenu.readLinks(); - expect(navLinks.map(link => link.text)).to.eql(['Discover', 'Management']); + expect(navLinks.map(link => link.text)).to.eql(['Discover', 'Stack Management']); }); it('shows save button', async () => { @@ -169,7 +169,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows discover navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Discover', 'Management']); + expect(navLinks).to.eql(['Discover', 'Stack Management']); }); it(`doesn't show save button`, async () => { @@ -258,7 +258,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows discover navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Discover', 'Management']); + expect(navLinks).to.eql(['Discover', 'Stack Management']); }); it(`doesn't show save button`, async () => { diff --git a/x-pack/test/functional/apps/graph/feature_controls/graph_security.ts b/x-pack/test/functional/apps/graph/feature_controls/graph_security.ts index a2b062e6ef84f..37de93a0a7e91 100644 --- a/x-pack/test/functional/apps/graph/feature_controls/graph_security.ts +++ b/x-pack/test/functional/apps/graph/feature_controls/graph_security.ts @@ -64,7 +64,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows graph navlink', async () => { const navLinks = await appsMenu.readLinks(); - expect(navLinks.map(link => link.text)).to.eql(['Graph', 'Management']); + expect(navLinks.map(link => link.text)).to.eql(['Graph', 'Stack Management']); }); it('landing page shows "Create new graph" button', async () => { @@ -127,7 +127,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows graph navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Graph', 'Management']); + expect(navLinks).to.eql(['Graph', 'Stack Management']); }); it('does not show a "Create new Workspace" button', async () => { diff --git a/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_security.ts b/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_security.ts index d72c9b970204a..25ef24f6bfd39 100644 --- a/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_security.ts +++ b/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_security.ts @@ -71,7 +71,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows management navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Management']); + expect(navLinks).to.eql(['Stack Management']); }); it(`index pattern listing shows create button`, async () => { @@ -125,7 +125,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows management navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Management']); + expect(navLinks).to.eql(['Stack Management']); }); it(`index pattern listing doesn't show create button`, async () => { @@ -177,7 +177,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows Management navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Discover', 'Management']); + expect(navLinks).to.eql(['Discover', 'Stack Management']); }); it(`doesn't show Index Patterns in management side-nav`, async () => { diff --git a/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_spaces.ts b/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_spaces.ts index 7d9bee37bbbc4..6513c0be44683 100644 --- a/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_spaces.ts +++ b/x-pack/test/functional/apps/index_patterns/feature_controls/index_patterns_spaces.ts @@ -42,7 +42,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { basePath: '/s/custom_space', }); const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.contain('Management'); + expect(navLinks).to.contain('Stack Management'); }); it(`index pattern listing shows create button`, async () => { diff --git a/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts b/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts index bf35d4dc06aa2..ede77b7d9afa7 100644 --- a/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts +++ b/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts @@ -61,7 +61,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows metrics navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Metrics', 'Management']); + expect(navLinks).to.eql(['Metrics', 'Stack Management']); }); describe('infrastructure landing page without data', () => { @@ -177,7 +177,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows metrics navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Metrics', 'Management']); + expect(navLinks).to.eql(['Metrics', 'Stack Management']); }); describe('infrastructure landing page without data', () => { diff --git a/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts b/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts index e5a6e27a0fadb..48ad4e90fd413 100644 --- a/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts +++ b/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts @@ -58,7 +58,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows logs navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Logs', 'Management']); + expect(navLinks).to.eql(['Logs', 'Stack Management']); }); describe('logs landing page without data', () => { @@ -121,7 +121,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows logs navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Logs', 'Management']); + expect(navLinks).to.eql(['Logs', 'Stack Management']); }); describe('logs landing page without data', () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts index 0f8655e3c6bbc..30327e8a422c1 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts @@ -71,7 +71,8 @@ export default function({ getService }: FtrProviderContext) { const calendarId = `wizard-test-calendar_${Date.now()}`; - describe('single metric', function() { + // Breaking latest ES snapshots: https://github.com/elastic/kibana/issues/65377 + describe.skip('single metric', function() { this.tags(['mlqa']); before(async () => { await esArchiver.loadIfNeeded('ml/farequote'); diff --git a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/cloning.ts b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/cloning.ts index 93f225989592e..d87d7d654f5c4 100644 --- a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/cloning.ts +++ b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/cloning.ts @@ -13,7 +13,8 @@ export default function({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const ml = getService('ml'); - describe('jobs cloning supported by UI form', function() { + // TODO add fix for https://github.com/elastic/elasticsearch/pull/56118 + describe.skip('jobs cloning supported by UI form', function() { const testDataList: Array<{ suiteTitle: string; archive: string; diff --git a/x-pack/test/functional/apps/maps/feature_controls/maps_security.ts b/x-pack/test/functional/apps/maps/feature_controls/maps_security.ts index 804ad5725edfd..ece162cbd96cc 100644 --- a/x-pack/test/functional/apps/maps/feature_controls/maps_security.ts +++ b/x-pack/test/functional/apps/maps/feature_controls/maps_security.ts @@ -66,7 +66,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows maps navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Maps', 'Management']); + expect(navLinks).to.eql(['Maps', 'Stack Management']); }); it(`allows a map to be created`, async () => { @@ -153,7 +153,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows Maps navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Maps', 'Management']); + expect(navLinks).to.eql(['Maps', 'Stack Management']); }); it(`does not show create new button`, async () => { @@ -248,7 +248,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('does not show Maps navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Discover', 'Management']); + expect(navLinks).to.eql(['Discover', 'Stack Management']); }); it(`returns a 404`, async () => { diff --git a/x-pack/test/functional/apps/security/security.ts b/x-pack/test/functional/apps/security/security.ts index 37516acec7c4b..3447f77aa7fd6 100644 --- a/x-pack/test/functional/apps/security/security.ts +++ b/x-pack/test/functional/apps/security/security.ts @@ -48,7 +48,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.security.logout(); const logoutMessage = await testSubjects.getVisibleText('loginInfoMessage'); - expect(logoutMessage).to.eql('You have logged out of Kibana.'); + expect(logoutMessage).to.eql('You have logged out of Elastic.'); }); describe('within a non-default space', async () => { diff --git a/x-pack/test/functional/apps/spaces/feature_controls/spaces_security.ts b/x-pack/test/functional/apps/spaces/feature_controls/spaces_security.ts index 49b684a37079e..47feb0384ebea 100644 --- a/x-pack/test/functional/apps/spaces/feature_controls/spaces_security.ts +++ b/x-pack/test/functional/apps/spaces/feature_controls/spaces_security.ts @@ -56,7 +56,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows management navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.contain('Management'); + expect(navLinks).to.contain('Stack Management'); }); it(`displays Spaces management section`, async () => { @@ -134,7 +134,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows management navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.contain('Management'); + expect(navLinks).to.contain('Stack Management'); }); it(`doesn't display Spaces management section`, async () => { diff --git a/x-pack/test/functional/apps/timelion/feature_controls/timelion_security.ts b/x-pack/test/functional/apps/timelion/feature_controls/timelion_security.ts index dea45f161e451..62483a10552e3 100644 --- a/x-pack/test/functional/apps/timelion/feature_controls/timelion_security.ts +++ b/x-pack/test/functional/apps/timelion/feature_controls/timelion_security.ts @@ -60,7 +60,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows timelion navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Timelion', 'Management']); + expect(navLinks).to.eql(['Timelion', 'Stack Management']); }); it(`allows a timelion sheet to be created`, async () => { @@ -112,7 +112,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows timelion navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Timelion', 'Management']); + expect(navLinks).to.eql(['Timelion', 'Stack Management']); }); it(`does not allow a timelion sheet to be created`, async () => { diff --git a/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts b/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts index a004f8db66823..4ff82484db91c 100644 --- a/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts +++ b/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts @@ -64,7 +64,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows uptime navlink', async () => { const navLinks = await appsMenu.readLinks(); - expect(navLinks.map(link => link.text)).to.eql(['Uptime', 'Management']); + expect(navLinks.map(link => link.text)).to.eql(['Uptime', 'Stack Management']); }); it('can navigate to Uptime app', async () => { @@ -115,7 +115,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows uptime navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Uptime', 'Management']); + expect(navLinks).to.eql(['Uptime', 'Stack Management']); }); it('can navigate to Uptime app', async () => { diff --git a/x-pack/test/functional/apps/visualize/feature_controls/visualize_security.ts b/x-pack/test/functional/apps/visualize/feature_controls/visualize_security.ts index 9f080a056e91f..8b2a0e0d6517d 100644 --- a/x-pack/test/functional/apps/visualize/feature_controls/visualize_security.ts +++ b/x-pack/test/functional/apps/visualize/feature_controls/visualize_security.ts @@ -76,7 +76,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows visualize navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Visualize', 'Management']); + expect(navLinks).to.eql(['Visualize', 'Stack Management']); }); it(`landing page shows "Create new Visualization" button`, async () => { @@ -200,7 +200,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows visualize navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Visualize', 'Management']); + expect(navLinks).to.eql(['Visualize', 'Stack Management']); }); it(`landing page shows "Create new Visualization" button`, async () => { @@ -315,7 +315,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { it('shows visualize navlink', async () => { const navLinks = (await appsMenu.readLinks()).map(link => link.text); - expect(navLinks).to.eql(['Visualize', 'Management']); + expect(navLinks).to.eql(['Visualize', 'Stack Management']); }); it(`landing page shows "Create new Visualization" button`, async () => { diff --git a/x-pack/test/functional/es_archives/endpoint/resolver_tree/api_feature/data.json.gz b/x-pack/test/functional/es_archives/endpoint/resolver_tree/api_feature/data.json.gz new file mode 100644 index 0000000000000..7974eaf35041d Binary files /dev/null and b/x-pack/test/functional/es_archives/endpoint/resolver_tree/api_feature/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/endpoint/resolver_tree/api_feature/mappings.json b/x-pack/test/functional/es_archives/endpoint/resolver_tree/api_feature/mappings.json new file mode 100644 index 0000000000000..13a16ee4e646d --- /dev/null +++ b/x-pack/test/functional/es_archives/endpoint/resolver_tree/api_feature/mappings.json @@ -0,0 +1,2906 @@ +{ + "type": "index", + "value": { + "aliases": { + }, + "index": "events-endpoint-1", + "mappings": { + "_meta": { + "version": "1.5.0-dev" + }, + "date_detection": false, + "dynamic": "false", + "dynamic_templates": [ + { + "strings_as_keyword": { + "mapping": { + "ignore_above": 1024, + "type": "keyword" + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "ephemeral_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "destination": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "registered_domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "top_level_domain": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "dll": { + "properties": { + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "compile_time": { + "type": "date" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "malware_classification": { + "properties": { + "features": { + "properties": { + "data": { + "properties": { + "buffer": { + "ignore_above": 1024, + "type": "keyword" + }, + "decompressed_size": { + "type": "integer" + }, + "encoding": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "identifier": { + "ignore_above": 1024, + "type": "keyword" + }, + "score": { + "type": "double" + }, + "threshold": { + "type": "double" + }, + "upx_packed": { + "type": "boolean" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "mapped_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "mapped_size": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "path": { + "ignore_above": 1024, + "type": "keyword" + }, + "pe": { + "properties": { + "company": { + "ignore_above": 1024, + "type": "keyword" + }, + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "file_version": { + "ignore_above": 1024, + "type": "keyword" + }, + "original_file_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "product": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "dns": { + "properties": { + "question": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "registered_domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "subdomain": { + "ignore_above": 1024, + "type": "keyword" + }, + "top_level_domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "resolved_ip": { + "type": "ip" + } + } + }, + "ecs": { + "properties": { + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "endpoint": { + "properties": { + "artifact": { + "properties": { + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "file": { + "type": "object" + }, + "group": { + "type": "object" + }, + "policy": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "process": { + "type": "object" + }, + "user": { + "type": "object" + } + } + }, + "event": { + "properties": { + "action": { + "ignore_above": 1024, + "type": "keyword" + }, + "category": { + "ignore_above": 1024, + "type": "keyword" + }, + "created": { + "type": "date" + }, + "dataset": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "ingested": { + "type": "date" + }, + "kind": { + "ignore_above": 1024, + "type": "keyword" + }, + "module": { + "ignore_above": 1024, + "type": "keyword" + }, + "outcome": { + "ignore_above": 1024, + "type": "keyword" + }, + "sequence": { + "type": "long" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "file": { + "properties": { + "accessed": { + "type": "date" + }, + "attributes": { + "ignore_above": 1024, + "type": "keyword" + }, + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "created": { + "type": "date" + }, + "ctime": { + "type": "date" + }, + "device": { + "ignore_above": 1024, + "type": "keyword" + }, + "directory": { + "ignore_above": 1024, + "type": "keyword" + }, + "drive_letter": { + "ignore_above": 1, + "type": "keyword" + }, + "entry_modified": { + "type": "double" + }, + "extension": { + "ignore_above": 1024, + "type": "keyword" + }, + "gid": { + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "ignore_above": 1024, + "type": "keyword" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "inode": { + "ignore_above": 1024, + "type": "keyword" + }, + "macro": { + "properties": { + "code_page": { + "type": "long" + }, + "collection": { + "properties": { + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "errors": { + "properties": { + "count": { + "type": "long" + }, + "error_type": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + }, + "file_extension": { + "ignore_above": 1024, + "type": "keyword" + }, + "project_file": { + "properties": { + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "stream": { + "properties": { + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "raw_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "raw_code_size": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + } + } + }, + "malware_classification": { + "properties": { + "features": { + "properties": { + "data": { + "properties": { + "buffer": { + "ignore_above": 1024, + "type": "keyword" + }, + "decompressed_size": { + "type": "integer" + }, + "encoding": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "identifier": { + "ignore_above": 1024, + "type": "keyword" + }, + "score": { + "type": "double" + }, + "threshold": { + "type": "double" + }, + "upx_packed": { + "type": "boolean" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "mode": { + "ignore_above": 1024, + "type": "keyword" + }, + "mtime": { + "type": "date" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "owner": { + "ignore_above": 1024, + "type": "keyword" + }, + "path": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "pe": { + "properties": { + "company": { + "ignore_above": 1024, + "type": "keyword" + }, + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "file_version": { + "ignore_above": 1024, + "type": "keyword" + }, + "original_file_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "product": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "size": { + "type": "long" + }, + "target_path": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "temp_file_path": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "uid": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "group": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "host": { + "properties": { + "architecture": { + "ignore_above": 1024, + "type": "keyword" + }, + "containerized": { + "type": "boolean" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "geo": { + "properties": { + "city_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "continent_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "country_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "location": { + "type": "geo_point" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_iso_code": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "os": { + "properties": { + "build": { + "ignore_above": 1024, + "type": "keyword" + }, + "codename": { + "ignore_above": 1024, + "type": "keyword" + }, + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "variant": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "uptime": { + "type": "long" + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "http": { + "properties": { + "request": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "fields": { + "text": { + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "bytes": { + "type": "long" + } + } + }, + "response": { + "properties": { + "body": { + "properties": { + "bytes": { + "type": "long" + }, + "content": { + "fields": { + "text": { + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "bytes": { + "type": "long" + }, + "status_code": { + "type": "long" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "message": { + "type": "text" + }, + "network": { + "properties": { + "bytes": { + "type": "long" + }, + "community_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "direction": { + "ignore_above": 1024, + "type": "keyword" + }, + "iana_number": { + "ignore_above": 1024, + "type": "keyword" + }, + "packets": { + "type": "long" + }, + "protocol": { + "ignore_above": 1024, + "type": "keyword" + }, + "transport": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "package": { + "properties": { + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "process": { + "properties": { + "args": { + "ignore_above": 1024, + "type": "keyword" + }, + "args_count": { + "type": "long" + }, + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "command_line": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "cpu_percent": { + "type": "double" + }, + "cwd": { + "ignore_above": 1024, + "type": "keyword" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "entity_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "env_variables": { + "ignore_above": 1024, + "type": "keyword" + }, + "executable": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "exit_code": { + "type": "long" + }, + "group": { + "ignore_above": 1024, + "type": "keyword" + }, + "handles": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "malware_classification": { + "properties": { + "features": { + "properties": { + "data": { + "properties": { + "buffer": { + "ignore_above": 1024, + "type": "keyword" + }, + "decompressed_size": { + "type": "integer" + }, + "encoding": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "identifier": { + "ignore_above": 1024, + "type": "keyword" + }, + "score": { + "type": "double" + }, + "threshold": { + "type": "double" + }, + "upx_packed": { + "type": "boolean" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "memory_percent": { + "type": "double" + }, + "memory_region": { + "properties": { + "allocation_base": { + "ignore_above": 1024, + "type": "keyword" + }, + "allocation_protection": { + "ignore_above": 1024, + "type": "keyword" + }, + "bytes": { + "ignore_above": 1024, + "type": "keyword" + }, + "histogram": { + "properties": { + "histogram_array": { + "ignore_above": 1024, + "type": "keyword" + }, + "histogram_flavor": { + "ignore_above": 1024, + "type": "keyword" + }, + "histogram_resolution": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + }, + "length": { + "ignore_above": 1024, + "type": "keyword" + }, + "memory": { + "ignore_above": 1024, + "type": "keyword" + }, + "memory_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "module_path": { + "ignore_above": 1024, + "type": "keyword" + }, + "permission": { + "ignore_above": 1024, + "type": "keyword" + }, + "protection": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_base": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_size": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_tag": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "unbacked_on_disk": { + "type": "boolean" + } + }, + "type": "nested" + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "num_threads": { + "type": "long" + }, + "parent": { + "properties": { + "args": { + "ignore_above": 1024, + "type": "keyword" + }, + "args_count": { + "type": "long" + }, + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "command_line": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "entity_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "executable": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "exit_code": { + "type": "long" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "pgid": { + "type": "long" + }, + "pid": { + "type": "long" + }, + "ppid": { + "type": "long" + }, + "start": { + "type": "date" + }, + "thread": { + "properties": { + "entrypoint": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "service": { + "ignore_above": 1024, + "type": "keyword" + }, + "start": { + "type": "date" + }, + "start_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "start_address_module": { + "ignore_above": 1024, + "type": "keyword" + }, + "uptime": { + "type": "long" + } + } + }, + "title": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "uptime": { + "type": "long" + }, + "working_directory": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "pe": { + "properties": { + "company": { + "ignore_above": 1024, + "type": "keyword" + }, + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "file_version": { + "ignore_above": 1024, + "type": "keyword" + }, + "original_file_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "product": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "pgid": { + "type": "long" + }, + "phys_memory_bytes": { + "ignore_above": 1024, + "type": "keyword" + }, + "pid": { + "type": "long" + }, + "ppid": { + "type": "long" + }, + "services": { + "ignore_above": 1024, + "type": "keyword" + }, + "session_id": { + "type": "long" + }, + "short_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "sid": { + "ignore_above": 1024, + "type": "keyword" + }, + "start": { + "type": "date" + }, + "thread": { + "properties": { + "call_stack": { + "properties": { + "instruction_pointer": { + "ignore_above": 1024, + "type": "keyword" + }, + "memory_section": { + "properties": { + "memory_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "memory_size": { + "ignore_above": 1024, + "type": "keyword" + }, + "protection": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "module_path": { + "ignore_above": 1024, + "type": "keyword" + }, + "rva": { + "ignore_above": 1024, + "type": "keyword" + }, + "symbol_info": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "entrypoint": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "service": { + "ignore_above": 1024, + "type": "keyword" + }, + "start": { + "type": "date" + }, + "start_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "start_address_module": { + "ignore_above": 1024, + "type": "keyword" + }, + "token": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "impersonation_level": { + "ignore_above": 1024, + "type": "keyword" + }, + "integrity_level": { + "type": "long" + }, + "integrity_level_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "is_appcontainer": { + "type": "boolean" + }, + "privileges": { + "properties": { + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + }, + "sid": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "user": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "uptime": { + "type": "long" + } + } + }, + "title": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "token": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "elevation": { + "type": "boolean" + }, + "elevation_type": { + "ignore_above": 1024, + "type": "keyword" + }, + "impersonation_level": { + "ignore_above": 1024, + "type": "keyword" + }, + "integrity_level": { + "type": "long" + }, + "integrity_level_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "is_appcontainer": { + "type": "boolean" + }, + "privileges": { + "properties": { + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + }, + "sid": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "user": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "tty_device": { + "properties": { + "major_number": { + "type": "integer" + }, + "minor_number": { + "type": "integer" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "uptime": { + "type": "long" + }, + "user": { + "ignore_above": 1024, + "type": "keyword" + }, + "virt_memory_bytes": { + "ignore_above": 1024, + "type": "keyword" + }, + "working_directory": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "registry": { + "properties": { + "data": { + "properties": { + "bytes": { + "ignore_above": 1024, + "type": "keyword" + }, + "strings": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hive": { + "ignore_above": 1024, + "type": "keyword" + }, + "key": { + "ignore_above": 1024, + "type": "keyword" + }, + "path": { + "ignore_above": 1024, + "type": "keyword" + }, + "value": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "rule": { + "properties": { + "category": { + "ignore_above": 1024, + "type": "keyword" + }, + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "reference": { + "ignore_above": 1024, + "type": "keyword" + }, + "ruleset": { + "ignore_above": 1024, + "type": "keyword" + }, + "uuid": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "source": { + "properties": { + "address": { + "ignore_above": 1024, + "type": "keyword" + }, + "bytes": { + "type": "long" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "packets": { + "type": "long" + }, + "port": { + "type": "long" + }, + "registered_domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "top_level_domain": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "stream": { + "properties": { + "dataset": { + "type": "constant_keyword" + }, + "namespace": { + "type": "constant_keyword" + }, + "type": { + "type": "constant_keyword" + } + } + }, + "target": { + "properties": { + "dll": { + "properties": { + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "compile_time": { + "type": "date" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "malware_classification": { + "properties": { + "features": { + "properties": { + "data": { + "properties": { + "buffer": { + "ignore_above": 1024, + "type": "keyword" + }, + "decompressed_size": { + "type": "integer" + }, + "encoding": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "identifier": { + "ignore_above": 1024, + "type": "keyword" + }, + "score": { + "type": "double" + }, + "threshold": { + "type": "double" + }, + "upx_packed": { + "type": "boolean" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "mapped_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "mapped_size": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "path": { + "ignore_above": 1024, + "type": "keyword" + }, + "pe": { + "properties": { + "company": { + "ignore_above": 1024, + "type": "keyword" + }, + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "file_version": { + "ignore_above": 1024, + "type": "keyword" + }, + "original_file_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "product": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "process": { + "properties": { + "args": { + "ignore_above": 1024, + "type": "keyword" + }, + "args_count": { + "type": "long" + }, + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "command_line": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "cpu_percent": { + "type": "double" + }, + "cwd": { + "ignore_above": 1024, + "type": "keyword" + }, + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "entity_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "env_variables": { + "ignore_above": 1024, + "type": "keyword" + }, + "executable": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "exit_code": { + "type": "long" + }, + "group": { + "ignore_above": 1024, + "type": "keyword" + }, + "handles": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "malware_classification": { + "properties": { + "features": { + "properties": { + "data": { + "properties": { + "buffer": { + "ignore_above": 1024, + "type": "keyword" + }, + "decompressed_size": { + "type": "integer" + }, + "encoding": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "identifier": { + "ignore_above": 1024, + "type": "keyword" + }, + "score": { + "type": "double" + }, + "threshold": { + "type": "double" + }, + "upx_packed": { + "type": "boolean" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "memory_percent": { + "type": "double" + }, + "memory_region": { + "properties": { + "allocation_base": { + "ignore_above": 1024, + "type": "keyword" + }, + "allocation_protection": { + "ignore_above": 1024, + "type": "keyword" + }, + "bytes": { + "ignore_above": 1024, + "type": "keyword" + }, + "histogram": { + "properties": { + "histogram_array": { + "ignore_above": 1024, + "type": "keyword" + }, + "histogram_flavor": { + "ignore_above": 1024, + "type": "keyword" + }, + "histogram_resolution": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + }, + "length": { + "ignore_above": 1024, + "type": "keyword" + }, + "memory": { + "ignore_above": 1024, + "type": "keyword" + }, + "memory_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "module_path": { + "ignore_above": 1024, + "type": "keyword" + }, + "permission": { + "ignore_above": 1024, + "type": "keyword" + }, + "protection": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_base": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_size": { + "ignore_above": 1024, + "type": "keyword" + }, + "region_tag": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "unbacked_on_disk": { + "type": "boolean" + } + }, + "type": "nested" + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "num_threads": { + "type": "long" + }, + "parent": { + "properties": { + "args": { + "ignore_above": 1024, + "type": "keyword" + }, + "args_count": { + "type": "long" + }, + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "ignore_above": 1024, + "type": "keyword" + }, + "subject_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "command_line": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "entity_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "executable": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "exit_code": { + "type": "long" + }, + "hash": { + "properties": { + "md5": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha1": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha256": { + "ignore_above": 1024, + "type": "keyword" + }, + "sha512": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "pgid": { + "type": "long" + }, + "pid": { + "type": "long" + }, + "ppid": { + "type": "long" + }, + "start": { + "type": "date" + }, + "thread": { + "properties": { + "entrypoint": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "service": { + "ignore_above": 1024, + "type": "keyword" + }, + "start": { + "type": "date" + }, + "start_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "start_address_module": { + "ignore_above": 1024, + "type": "keyword" + }, + "uptime": { + "type": "long" + } + } + }, + "title": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "uptime": { + "type": "long" + }, + "working_directory": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "pe": { + "properties": { + "company": { + "ignore_above": 1024, + "type": "keyword" + }, + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "file_version": { + "ignore_above": 1024, + "type": "keyword" + }, + "original_file_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "product": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "pgid": { + "type": "long" + }, + "phys_memory_bytes": { + "ignore_above": 1024, + "type": "keyword" + }, + "pid": { + "type": "long" + }, + "ppid": { + "type": "long" + }, + "services": { + "ignore_above": 1024, + "type": "keyword" + }, + "session_id": { + "type": "long" + }, + "short_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "sid": { + "ignore_above": 1024, + "type": "keyword" + }, + "start": { + "type": "date" + }, + "thread": { + "properties": { + "call_stack": { + "properties": { + "instruction_pointer": { + "ignore_above": 1024, + "type": "keyword" + }, + "memory_section": { + "properties": { + "memory_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "memory_size": { + "ignore_above": 1024, + "type": "keyword" + }, + "protection": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "module_path": { + "ignore_above": 1024, + "type": "keyword" + }, + "rva": { + "ignore_above": 1024, + "type": "keyword" + }, + "symbol_info": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "entrypoint": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "type": "long" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "service": { + "ignore_above": 1024, + "type": "keyword" + }, + "start": { + "type": "date" + }, + "start_address": { + "ignore_above": 1024, + "type": "keyword" + }, + "start_address_module": { + "ignore_above": 1024, + "type": "keyword" + }, + "token": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "impersonation_level": { + "ignore_above": 1024, + "type": "keyword" + }, + "integrity_level": { + "type": "long" + }, + "integrity_level_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "is_appcontainer": { + "type": "boolean" + }, + "privileges": { + "properties": { + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + }, + "sid": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "user": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "uptime": { + "type": "long" + } + } + }, + "title": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "token": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "elevation": { + "type": "boolean" + }, + "elevation_type": { + "ignore_above": 1024, + "type": "keyword" + }, + "impersonation_level": { + "ignore_above": 1024, + "type": "keyword" + }, + "integrity_level": { + "type": "long" + }, + "integrity_level_name": { + "ignore_above": 1024, + "type": "keyword" + }, + "is_appcontainer": { + "type": "boolean" + }, + "privileges": { + "properties": { + "description": { + "ignore_above": 1024, + "type": "keyword" + }, + "enabled": { + "type": "boolean" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + }, + "type": "nested" + }, + "sid": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "user": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "tty_device": { + "properties": { + "major_number": { + "type": "integer" + }, + "minor_number": { + "type": "integer" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "uptime": { + "type": "long" + }, + "user": { + "ignore_above": 1024, + "type": "keyword" + }, + "virt_memory_bytes": { + "ignore_above": 1024, + "type": "keyword" + }, + "working_directory": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "threat": { + "properties": { + "framework": { + "ignore_above": 1024, + "type": "keyword" + }, + "tactic": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "reference": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "technique": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "reference": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "user": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "email": { + "ignore_above": 1024, + "type": "keyword" + }, + "full_name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "group": { + "properties": { + "domain": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "hash": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "settings": { + "index": { + "codec": "best_compression", + "lifecycle": { + "name": "events-default" + }, + "mapping": { + "total_fields": { + "limit": "10000" + } + }, + "number_of_replicas": "1", + "number_of_shards": "1", + "prefer_v2_templates": "true", + "query": { + "default_field": [ + "message" + ] + }, + "refresh_interval": "5s" + } + } + } +} + +{ + "type": "index", + "value": { + "aliases": { + }, + "index": "metrics-endpoint-default-1", + "mappings": { + "_meta": { + "version": "1.5.0-dev" + }, + "date_detection": false, + "dynamic_templates": [ + { + "strings_as_keyword": { + "mapping": { + "ignore_above": 1024, + "type": "keyword" + }, + "match_mapping_type": "string" + } + } + ], + "properties": { + "@timestamp": { + "type": "date" + }, + "agent": { + "properties": { + "ephemeral_id": { + "ignore_above": 1024, + "type": "keyword" + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "ecs": { + "properties": { + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "elastic": { + "properties": { + "agent": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "endpoint": { + "properties": { + "policy": { + "properties": { + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + } + } + } + } + }, + "event": { + "properties": { + "created": { + "type": "date" + } + } + }, + "host": { + "properties": { + "architecture": { + "ignore_above": 1024, + "type": "keyword" + }, + "containerized": { + "type": "boolean" + }, + "hostname": { + "ignore_above": 1024, + "type": "keyword" + }, + "id": { + "ignore_above": 1024, + "type": "keyword" + }, + "ip": { + "type": "ip" + }, + "mac": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "ignore_above": 1024, + "type": "keyword" + }, + "os": { + "properties": { + "build": { + "ignore_above": 1024, + "type": "keyword" + }, + "codename": { + "ignore_above": 1024, + "type": "keyword" + }, + "family": { + "ignore_above": 1024, + "type": "keyword" + }, + "full": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "kernel": { + "ignore_above": 1024, + "type": "keyword" + }, + "name": { + "fields": { + "text": { + "norms": false, + "type": "text" + } + }, + "ignore_above": 1024, + "type": "keyword" + }, + "platform": { + "ignore_above": 1024, + "type": "keyword" + }, + "variant": { + "ignore_above": 1024, + "type": "keyword" + }, + "version": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "type": { + "ignore_above": 1024, + "type": "keyword" + } + } + }, + "stream": { + "properties": { + "dataset": { + "type": "constant_keyword" + }, + "namespace": { + "type": "constant_keyword" + }, + "type": { + "type": "constant_keyword" + } + } + } + } + }, + "settings": { + "index": { + "codec": "best_compression", + "lifecycle": { + "name": "metrics-default" + }, + "mapping": { + "total_fields": { + "limit": "10000" + } + }, + "number_of_replicas": "1", + "number_of_shards": "1", + "prefer_v2_templates": "true", + "query": { + "default_field": [ + "message" + ] + }, + "refresh_interval": "5s" + } + } + } +} \ No newline at end of file diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts index 57b2847cc2e50..c4dcf63941cd5 100644 --- a/x-pack/test/functional/page_objects/lens_page.ts +++ b/x-pack/test/functional/page_objects/lens_page.ts @@ -133,9 +133,22 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont /** * Save the current Lens visualization. */ - async save(title: string) { + async save(title: string, saveAsNew?: boolean, redirectToOrigin?: boolean) { await testSubjects.click('lnsApp_saveButton'); await testSubjects.setValue('savedObjectTitle', title); + + const saveAsNewCheckboxExists = await testSubjects.exists('saveAsNewCheckbox'); + if (saveAsNewCheckboxExists) { + const state = saveAsNew ? 'check' : 'uncheck'; + await testSubjects.setEuiSwitch('saveAsNewCheckbox', state); + } + + const redirectToOriginCheckboxExists = await testSubjects.exists('returnToOriginModeSwitch'); + if (redirectToOriginCheckboxExists) { + const state = redirectToOrigin ? 'check' : 'uncheck'; + await testSubjects.setEuiSwitch('returnToOriginModeSwitch', state); + } + await testSubjects.click('confirmSaveSavedObjectButton'); retry.waitForWithTimeout('Save modal to disappear', 1000, () => testSubjects @@ -145,6 +158,10 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont ); }, + async saveAndReturn() { + await testSubjects.click('lnsApp_saveAndReturnButton'); + }, + getTitle() { return testSubjects.getVisibleText('lns_ChartTitle'); }, diff --git a/x-pack/test/functional_endpoint/apps/endpoint/index.ts b/x-pack/test/functional_endpoint/apps/endpoint/index.ts index 3e70a1cc67670..05fed43d1272b 100644 --- a/x-pack/test/functional_endpoint/apps/endpoint/index.ts +++ b/x-pack/test/functional_endpoint/apps/endpoint/index.ts @@ -15,5 +15,6 @@ export default function({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./host_list')); loadTestFile(require.resolve('./policy_list')); loadTestFile(require.resolve('./alerts')); + loadTestFile(require.resolve('./resolver')); }); } diff --git a/x-pack/test/functional_endpoint/apps/endpoint/resolver.ts b/x-pack/test/functional_endpoint/apps/endpoint/resolver.ts new file mode 100644 index 0000000000000..417073865df7b --- /dev/null +++ b/x-pack/test/functional_endpoint/apps/endpoint/resolver.ts @@ -0,0 +1,259 @@ +/* + * 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. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function({ getPageObjects, getService }: FtrProviderContext) { + const pageObjects = getPageObjects(['common', 'timePicker', 'endpointAlerts']); + const testSubjects = getService('testSubjects'); + const esArchiver = getService('esArchiver'); + const retry = getService('retry'); + const browser = getService('browser'); + + describe('Endpoint Alert Resolver', function() { + this.tags(['ciGroup7']); + before(async () => { + const fromTime = 'Sep 22, 2019 @ 20:31:44.000'; + const toTime = 'Now'; + await esArchiver.load('endpoint/resolver_tree/api_feature'); + await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/alerts'); + await testSubjects.existOrFail('superDatePickerShowDatesButton', { timeout: 20000 }); + await pageObjects.timePicker.setAbsoluteRange(fromTime, toTime); + await testSubjects.existOrFail('alertListPage'); + await testSubjects.click('alertTypeCellLink'); + await testSubjects.existOrFail('alertDetailFlyout'); + await testSubjects.click('overviewResolverTab'); + await testSubjects.existOrFail('resolverEmbeddable', { timeout: 20000 }); + await browser.setWindowSize(2400, 1800); + }); + + it('resolver column Process Name exits', async () => { + await testSubjects.existOrFail('tableHeaderCell_name_0'); + }); + + it('resolver column Timestamp exits', async () => { + await testSubjects.existOrFail('tableHeaderCell_timestamp_1'); + }); + + it('resolver Table and Node data same length', async () => { + let count = 1; + const tableData = await pageObjects.endpointAlerts.getEndpointAlertResolverTableData( + 'resolverEmbeddable', + 'tr' + ); + await retry.try(async function() { + await testSubjects.click('zoom-out'); + const Nodes = await testSubjects.findAll('resolverNode'); + expect(tableData.length - 1).to.eql(Nodes.length); + count++; + }); + for (let i = 0; i < count; i++) { + await testSubjects.click('zoom-in'); + } + }); + + it('compare resolver Nodes and Table data', async () => { + const $: string[] = []; + const tableData = await pageObjects.endpointAlerts.getEndpointAlertResolverTableData( + 'resolverEmbeddable', + 'tr' + ); + await testSubjects.click('zoom-out'); + const Nodes = await testSubjects.findAll('euiButton__text'); + for (const value of Nodes) { + $.push(await value._webElement.getText()); + } + for (let i = 0; i < $.length; i++) { + expect(tableData[i + 1][0]).to.eql($[i]); + } + await testSubjects.click('zoom-in'); + }); + + it('resolver Nodes navigation Up', async () => { + const OriginalNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + await testSubjects.click('north-button'); + const NewNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + for (let i = 0; i < OriginalNodeDataStyle.length; i++) { + expect(parseFloat(OriginalNodeDataStyle[i].top)).to.lessThan( + parseFloat(NewNodeDataStyle[i].top) + ); + expect(parseFloat(OriginalNodeDataStyle[i].left)).to.equal( + parseFloat(NewNodeDataStyle[i].left) + ); + } + await testSubjects.click('center-button'); + }); + + it('resolver Nodes navigation Down', async () => { + const OriginalNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + await testSubjects.click('south-button'); + + const NewNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + for (let i = 0; i < NewNodeDataStyle.length; i++) { + expect(parseFloat(NewNodeDataStyle[i].top)).to.lessThan( + parseFloat(OriginalNodeDataStyle[i].top) + ); + expect(parseFloat(OriginalNodeDataStyle[i].left)).to.equal( + parseFloat(NewNodeDataStyle[i].left) + ); + } + await testSubjects.click('center-button'); + }); + + it('resolver Nodes navigation Right', async () => { + const OriginalNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + await testSubjects.click('west-button'); + const NewNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + for (let i = 0; i < NewNodeDataStyle.length; i++) { + expect(parseFloat(OriginalNodeDataStyle[i].left)).to.lessThan( + parseFloat(NewNodeDataStyle[i].left) + ); + expect(parseFloat(NewNodeDataStyle[i].top)).to.equal( + parseFloat(OriginalNodeDataStyle[i].top) + ); + } + await testSubjects.click('center-button'); + }); + + it('resolver Nodes navigation Left', async () => { + const OriginalNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + await testSubjects.click('east-button'); + + const NewNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + for (let i = 0; i < OriginalNodeDataStyle.length; i++) { + expect(parseFloat(NewNodeDataStyle[i].left)).to.lessThan( + parseFloat(OriginalNodeDataStyle[i].left) + ); + expect(parseFloat(NewNodeDataStyle[i].top)).to.equal( + parseFloat(OriginalNodeDataStyle[i].top) + ); + } + await testSubjects.click('center-button'); + }); + + it('resolver Nodes navigation Center', async () => { + const OriginalNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + await testSubjects.click('east-button'); + await testSubjects.click('south-button'); + + const NewNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + for (let i = 0; i < NewNodeDataStyle.length; i++) { + expect(parseFloat(NewNodeDataStyle[i].left)).to.lessThan( + parseFloat(OriginalNodeDataStyle[i].left) + ); + expect(parseFloat(NewNodeDataStyle[i].top)).to.lessThan( + parseFloat(OriginalNodeDataStyle[i].top) + ); + } + await (await testSubjects.find('center-button')).click(); + const CenterNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + + for (let i = 0; i < CenterNodeDataStyle.length; i++) { + expect(parseFloat(CenterNodeDataStyle[i].left)).to.equal( + parseFloat(OriginalNodeDataStyle[i].left) + ); + expect(parseFloat(CenterNodeDataStyle[i].top)).to.equal( + parseFloat(OriginalNodeDataStyle[i].top) + ); + } + }); + + it('resolver Nodes navigation zoom in', async () => { + const OriginalNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + await testSubjects.click('zoom-in'); + const NewNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + for (let i = 1; i < NewNodeDataStyle.length; i++) { + expect(parseFloat(OriginalNodeDataStyle[i].left)).to.lessThan( + parseFloat(NewNodeDataStyle[i].left) + ); + expect(parseFloat(OriginalNodeDataStyle[i].top)).to.lessThan( + parseFloat(NewNodeDataStyle[i].top) + ); + expect(parseFloat(OriginalNodeDataStyle[i].width)).to.lessThan( + parseFloat(NewNodeDataStyle[i].width) + ); + expect(parseFloat(OriginalNodeDataStyle[i].height)).to.lessThan( + parseFloat(NewNodeDataStyle[i].height) + ); + await testSubjects.click('zoom-out'); + } + }); + + it('resolver Nodes navigation zoom out', async () => { + const OriginalNodeDataStyle = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + await testSubjects.click('zoom-out'); + const NewNodeDataStyle1 = await pageObjects.endpointAlerts.parseStyles( + 'resolverNode', + 'style' + ); + for (let i = 1; i < OriginalNodeDataStyle.length; i++) { + expect(parseFloat(NewNodeDataStyle1[i].left)).to.lessThan( + parseFloat(OriginalNodeDataStyle[i].left) + ); + expect(parseFloat(NewNodeDataStyle1[i].top)).to.lessThan( + parseFloat(OriginalNodeDataStyle[i].top) + ); + expect(parseFloat(NewNodeDataStyle1[i].width)).to.lessThan( + parseFloat(OriginalNodeDataStyle[i].width) + ); + expect(parseFloat(NewNodeDataStyle1[i].height)).to.lessThan( + parseFloat(OriginalNodeDataStyle[i].height) + ); + } + await testSubjects.click('zoom-in'); + }); + + after(async () => { + await browser.setWindowSize(1600, 1000); + await testSubjects.click('euiFlyoutCloseButton'); + await pageObjects.common.sleep(2000); + await esArchiver.unload('endpoint/resolver_tree/api_feature'); + }); + }); +} diff --git a/x-pack/test/functional_endpoint/page_objects/endpoint_alerts_page.ts b/x-pack/test/functional_endpoint/page_objects/endpoint_alerts_page.ts index a5ad45536de89..ff675f151c087 100644 --- a/x-pack/test/functional_endpoint/page_objects/endpoint_alerts_page.ts +++ b/x-pack/test/functional_endpoint/page_objects/endpoint_alerts_page.ts @@ -5,16 +5,48 @@ */ import { FtrProviderContext } from '../ftr_provider_context'; +import { WebElementWrapper } from '../../../../test/functional/services/lib/web_element_wrapper'; export function EndpointAlertsPageProvider({ getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); + const retry = getService('retry'); + + /** + * @function parseStyles + * Parses a string of inline styles into a javascript object with casing for react + * + * @param {string} styles + * @returns {Object} + */ + const parseStyle = (styles: any) => + styles + .split(';') + .filter((style: any) => style.split(':')[0] && style.split(':')[1]) + .map((style: any) => [ + style + .split(':')[0] + .trim() + .replace(/-./g, (c: any) => c.substr(1).toUpperCase()), + style + .split(':') + .slice(1) + .join(':') + .trim(), + ]) + .reduce( + (styleObj: any, style: any) => ({ + ...styleObj, + [style[0]]: style[1], + }), + {} + ); return { async enterSearchBarQuery(query: string) { return await testSubjects.setValue('alertsSearchBar', query, { clearWithKeyboard: true }); }, async submitSearchBarFilter() { - return await testSubjects.click('querySubmitButton'); + return testSubjects.click('querySubmitButton'); }, async setSearchBarDate(timestamp: string) { await testSubjects.click('superDatePickerShowDatesButton'); @@ -23,5 +55,70 @@ export function EndpointAlertsPageProvider({ getService }: FtrProviderContext) { await testSubjects.setValue('superDatePickerAbsoluteDateInput', timestamp); await this.submitSearchBarFilter(); }, + /** + * Finds a table and returns the data in a nested array with row 0 is the headers if they exist. + * It uses euiTableCellContent to avoid poluting the array data with the euiTableRowCell__mobileHeader data. + * @param dataTestSubj + * @param element + * @returns Promise<string[][]> + */ + async getEndpointAlertResolverTableData(dataTestSubj: string, element: string) { + await testSubjects.exists(dataTestSubj); + const hostTable: WebElementWrapper = await testSubjects.find(dataTestSubj); + const $ = await hostTable.parseDomContent(); + return $(element) + .toArray() + .map(row => + $(row) + .find('.euiTableCellContent') + .toArray() + .map(cell => + $(cell) + .text() + .replace(/ /g, '') + .trim() + ) + ); + }, + /** + * Finds a nodes and returns the data in a nested array of nodes. + * @param dataTestSubj + * @param element + * @returns Promise<string[][]> + */ + async getEndpointAlertResolverNodeData(dataTestSubj: string, element: string) { + await testSubjects.exists(dataTestSubj); + const Elements = await testSubjects.findAll(dataTestSubj); + const $ = []; + for (const value of Elements) { + $.push(await value.getAttribute(element)); + } + return $; + }, + /** + * Gets a array of not parsed styles and returns the Array of parsed styles. + * @returns Promise<string[][]> + * @param dataTestSubj + * @param element + */ + async parseStyles(dataTestSubj: string, element: string) { + const tableData = await this.getEndpointAlertResolverNodeData(dataTestSubj, element); + const $ = []; + for (let i = 1; i < tableData.length; i++) { + const eachStyle = parseStyle(tableData[i]); + $.push(eachStyle); + } + return $; + }, + + async waitForTableToHaveData(dataTestSubj: string) { + await retry.waitForWithTimeout('table to have data', 2000, async () => { + const tableData = await this.getEndpointAlertResolverTableData(dataTestSubj, 'tr'); + if (tableData[1][0] === 'No items found') { + return false; + } + return true; + }); + }, }; } diff --git a/x-pack/test/kerberos_api_integration/anonymous_access.config.ts b/x-pack/test/kerberos_api_integration/anonymous_access.config.ts index 90d47ec61a4dc..8b712afe6c4d6 100644 --- a/x-pack/test/kerberos_api_integration/anonymous_access.config.ts +++ b/x-pack/test/kerberos_api_integration/anonymous_access.config.ts @@ -21,7 +21,7 @@ export default async function({ readConfigFile }: FtrConfigProviderContext) { serverArgs: [ ...kerberosAPITestsConfig.get('esTestCluster.serverArgs'), 'xpack.security.authc.anonymous.username=anonymous_user', - 'xpack.security.authc.anonymous.roles=superuser', + 'xpack.security.authc.anonymous.roles=superuser_anonymous', ], }, }; diff --git a/x-pack/test/kerberos_api_integration/apis/security/kerberos_login.ts b/x-pack/test/kerberos_api_integration/apis/security/kerberos_login.ts index fbf9a977e8b1f..e81db7e2b02f3 100644 --- a/x-pack/test/kerberos_api_integration/apis/security/kerberos_login.ts +++ b/x-pack/test/kerberos_api_integration/apis/security/kerberos_login.ts @@ -100,9 +100,7 @@ export default function({ getService }: FtrProviderContext) { }); }); - // Preventing ES Snapshot to be promoted - // https://github.com/elastic/kibana/issues/65114 - describe.skip('finishing SPNEGO', () => { + describe('finishing SPNEGO', () => { it('should properly set cookie and authenticate user', async () => { const response = await supertest .get('/internal/security/me') @@ -120,13 +118,22 @@ export default function({ getService }: FtrProviderContext) { const sessionCookie = request.cookie(cookies[0])!; checkCookieIsSet(sessionCookie); + const isAnonymousAccessEnabled = (config.get( + 'esTestCluster.serverArgs' + ) as string[]).some(setting => setting.startsWith('xpack.security.authc.anonymous')); + + // `superuser_anonymous` role is derived from the enabled anonymous access. + const expectedUserRoles = isAnonymousAccessEnabled + ? ['kibana_admin', 'superuser_anonymous'] + : ['kibana_admin']; + await supertest .get('/internal/security/me') .set('kbn-xsrf', 'xxx') .set('Cookie', sessionCookie.cookieString()) .expect(200, { username: 'tester@TEST.ELASTIC.CO', - roles: ['kibana_admin'], + roles: expectedUserRoles, full_name: null, email: null, metadata: { diff --git a/x-pack/test/plugin_api_integration/test_suites/event_log/public_api_integration.ts b/x-pack/test/plugin_api_integration/test_suites/event_log/public_api_integration.ts index a2ae165986340..f5cc1cc166ee8 100644 --- a/x-pack/test/plugin_api_integration/test_suites/event_log/public_api_integration.ts +++ b/x-pack/test/plugin_api_integration/test_suites/event_log/public_api_integration.ts @@ -19,7 +19,9 @@ export default function({ getService }: FtrProviderContext) { const log = getService('log'); const retry = getService('retry'); - describe('Event Log public API', () => { + // FLAKY: https://github.com/elastic/kibana/issues/64723 + // FLAKY: https://github.com/elastic/kibana/issues/64812 + describe.skip('Event Log public API', () => { it('should allow querying for events by Saved Object', async () => { const id = uuid.v4(); diff --git a/x-pack/test/plugin_api_perf/config.js b/x-pack/test/plugin_api_perf/config.js index 9a7d0071afcc4..9c6d8873b8c84 100644 --- a/x-pack/test/plugin_api_perf/config.js +++ b/x-pack/test/plugin_api_perf/config.js @@ -39,7 +39,7 @@ export default async function({ readConfigFile }) { '..', 'plugin_api_integration', 'plugins', - 'task_manager' + 'sample_task_plugin' )}`, ...plugins.map( pluginDir => `--plugin-path=${path.resolve(__dirname, 'plugins', pluginDir)}` diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/index.js b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/index.js deleted file mode 100644 index 87e3b3b66a201..0000000000000 --- a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/index.js +++ /dev/null @@ -1,378 +0,0 @@ -/* - * 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. - */ - -import uuid from 'uuid'; -import _ from 'lodash'; -import stats from 'stats-lite'; -import prettyMilliseconds from 'pretty-ms'; -import { performance, PerformanceObserver } from 'perf_hooks'; -import { initRoutes } from './init_routes'; - -export default function TaskManagerPerformanceAPI(kibana) { - return new kibana.Plugin({ - name: 'perfTask', - require: ['elasticsearch', 'task_manager'], - - config(Joi) { - return Joi.object({ - enabled: Joi.boolean().default(true), - }).default(); - }, - - init(server) { - const taskManager = { - ...server.newPlatform.setup.plugins.taskManager, - ...server.newPlatform.start.plugins.taskManager, - }; - const performanceState = resetPerfState({}); - - let lastFlush = new Date(); - function flushPerfStats() { - setTimeout(flushPerfStats, 5000); - const prevFlush = lastFlush; - lastFlush = new Date(); - - const tasks = performanceState.leadTimeQueue.length; - const title = `[Perf${performanceState.capturing ? ' (capturing)' : ''}]`; - const seconds = parseInt((lastFlush - prevFlush) / 1000); - console.log( - `${title} I have processed ${tasks} tasks in the past ${seconds}s (${tasks / - seconds} per second)` - ); - if (tasks > 0) { - const latestAverage = avg(performanceState.leadTimeQueue.splice(0, tasks)).mean; - - performanceState.averagesTakenLeadTime.push(latestAverage); - performanceState.averagesTaken.push(tasks); - if (performanceState.averagesTakenLeadTime.length > 1) { - performanceState.runningAverageLeadTime = avg( - performanceState.averagesTakenLeadTime - ).mean; - performanceState.runningAverageTasksPerSecond = - avg(performanceState.averagesTaken).mean / 5; - } else { - performanceState.runningAverageLeadTime = latestAverage; - performanceState.runningAverageTasksPerSecond = tasks / 5; - } - } - } - - setTimeout(flushPerfStats, 5000); - - const title = 'Perf Test Task'; - - taskManager.registerTaskDefinitions({ - performanceTestTask: { - title, - description: 'A task for stress testing task_manager.', - timeout: '1m', - - createTaskRunner: ({ taskInstance }) => { - return { - async run() { - const { params, state } = taskInstance; - - const counter = state.counter ? state.counter : 1; - - const now = Date.now(); - const leadTime = now - taskInstance.runAt; - performanceState.leadTimeQueue.push(leadTime); - - // schedule to run next cycle as soon as possible - const runAt = calRunAt(params, counter); - - const stateUpdated = { - ...state, - counter: counter + 1, - }; - - if (params.trackExecutionTimeline && state.perf && state.perf.id) { - performance.mark(`perfTask_run_${state.perf.id}_${counter}`); - performance.measure( - 'perfTask.markUntilRun', - `perfTask_markAsRunning_${state.perf.id}_${counter}`, - `perfTask_run_${state.perf.id}_${counter}` - ); - if (counter === 1) { - performance.measure( - 'perfTask.firstRun', - `perfTask_schedule_${state.perf.id}`, - `perfTask_run_${state.perf.id}_${counter}` - ); - performance.measure( - 'perfTask.firstMarkAsRunningTillRan', - `perfTask_markAsRunning_${state.perf.id}_${counter}`, - `perfTask_run_${state.perf.id}_${counter}` - ); - } - } - - return { - state: stateUpdated, - runAt, - }; - }, - }; - }, - }, - }); - - taskManager.addMiddleware({ - async beforeSave({ taskInstance, ...opts }) { - const modifiedInstance = { - ...taskInstance, - }; - - if (taskInstance.params && taskInstance.params.trackExecutionTimeline) { - modifiedInstance.state = modifiedInstance.state || {}; - modifiedInstance.state.perf = modifiedInstance.state.perf || {}; - modifiedInstance.state.perf.id = uuid.v4().replace(/-/gi, '_'); - performance.mark(`perfTask_schedule_${modifiedInstance.state.perf.id}`); - } - - return { - ...opts, - taskInstance: modifiedInstance, - }; - }, - - async beforeMarkRunning({ taskInstance, ...opts }) { - const modifiedInstance = { - ...taskInstance, - }; - - if ( - modifiedInstance.state && - modifiedInstance.state.perf && - modifiedInstance.state.perf.id - ) { - const { counter = 1 } = modifiedInstance.state; - performance.mark(`perfTask_markAsRunning_${modifiedInstance.state.perf.id}_${counter}`); - if (counter === 1) { - performance.measure( - 'perfTask.firstMarkAsRunning', - `perfTask_schedule_${modifiedInstance.state.perf.id}`, - `perfTask_markAsRunning_${modifiedInstance.state.perf.id}_${counter}` - ); - } else if (counter > 1) { - performance.measure( - 'perfTask.runUntilNextMarkAsRunning', - `perfTask_run_${modifiedInstance.state.perf.id}_${counter - 1}`, - `perfTask_markAsRunning_${modifiedInstance.state.perf.id}_${counter}` - ); - } - } - - return { - ...opts, - taskInstance: modifiedInstance, - }; - }, - }); - - const perfApi = { - capture() { - resetPerfState(performanceState); - performanceState.capturing = true; - performance.mark('perfTest.start'); - }, - endCapture() { - return new Promise(resolve => { - performanceState.performance.summarize.push([resolve, perfApi.summarize]); - - performance.mark('perfTest.end'); - performance.measure('perfTest.duration', 'perfTest.start', 'perfTest.end'); - }); - }, - summarize(perfTestDuration) { - const { - runningAverageTasksPerSecond, - runningAverageLeadTime, - performance, - } = performanceState; - - const { - numberOfTasksRanOverall, - elasticsearchApiCalls, - activityDuration, - sleepDuration, - cycles, - claimAvailableTasksNoTasks, - claimAvailableTasksNoAvailableWorkers, - taskPoolAttemptToRun, - taskRunnerMarkTaskAsRunning, - } = performance; - - const perfRes = { - perfTestDuration: prettyMilliseconds(perfTestDuration), - runningAverageTasksPerSecond, - runningAverageLeadTime, - numberOfTasksRanOverall, - claimAvailableTasksNoTasks, - claimAvailableTasksNoAvailableWorkers, - elasticsearchApiCalls: _.mapValues(elasticsearchApiCalls, avg), - sleepDuration: prettyMilliseconds(stats.sum(sleepDuration)), - activityDuration: prettyMilliseconds(stats.sum(activityDuration)), - cycles, - taskPoolAttemptToRun: avg(taskPoolAttemptToRun), - taskRunnerMarkTaskAsRunning: avg(taskRunnerMarkTaskAsRunning), - }; - - resetPerfState(performanceState); - - return perfRes; - }, - }; - - initRoutes(server, perfApi); - }, - }); -} - -function calRunAt(params, counter) { - const runAt = counter === 1 ? new Date(params.startAt) : new Date(); - return runAt.getTime() < params.runUntil ? runAt : undefined; -} - -function avg(items) { - const mode = stats.mode(items); - return { - mean: parseInt(stats.mean(items)), - range: { - min: parseInt(typeof mode === 'number' ? mode : _.min([...mode])), - max: parseInt(typeof mode === 'number' ? mode : _.max([...mode])), - }, - }; -} - -function resetPerfState(target) { - if (target.performanceObserver) { - target.performanceObserver.disconnect(); - } - - const performanceState = Object.assign(target, { - capturing: false, - runningAverageTasksPerSecond: 0, - averagesTaken: [], - runningAverageLeadTime: -1, - averagesTakenLeadTime: [], - leadTimeQueue: [], - performance: { - numberOfTasksRanOverall: 0, - cycles: { - fillPoolStarts: 0, - fillPoolCycles: 0, - fillPoolBail: 0, - claimedOnRerunCycle: 0, - fillPoolBailNoTasks: 0, - }, - claimAvailableTasksNoTasks: 0, - claimAvailableTasksNoAvailableWorkers: 0, - elasticsearchApiCalls: { - timeUntilFirstRun: [], - timeUntilFirstMarkAsRun: [], - firstMarkAsRunningTillRan: [], - timeFromMarkAsRunTillRun: [], - timeFromRunTillNextMarkAsRun: [], - claimAvailableTasks: [], - }, - activityDuration: [], - sleepDuration: [], - taskPollerActivityDurationPreScheduleComplete: [], - taskPoolAttemptToRun: [], - taskRunnerMarkTaskAsRunning: [], - - summarize: [], - }, - }); - - performanceState.performanceObserver = new PerformanceObserver((list, observer) => { - list.getEntries().forEach(entry => { - const { name, duration } = entry; - switch (name) { - // Elasticsearch Api Calls - case 'perfTask.firstRun': - performanceState.performance.elasticsearchApiCalls.timeUntilFirstRun.push(duration); - break; - case 'perfTask.firstMarkAsRunning': - performanceState.performance.elasticsearchApiCalls.timeUntilFirstMarkAsRun.push(duration); - break; - case 'perfTask.firstMarkAsRunningTillRan': - performanceState.performance.elasticsearchApiCalls.firstMarkAsRunningTillRan.push( - duration - ); - break; - case 'perfTask.markUntilRun': - performanceState.performance.elasticsearchApiCalls.timeFromMarkAsRunTillRun.push( - duration - ); - break; - case 'perfTask.runUntilNextMarkAsRunning': - performanceState.performance.elasticsearchApiCalls.timeFromRunTillNextMarkAsRun.push( - duration - ); - break; - case 'claimAvailableTasks': - performanceState.performance.elasticsearchApiCalls.claimAvailableTasks.push(duration); - break; - case 'TaskPoller.sleepDuration': - performanceState.performance.sleepDuration.push(duration); - break; - case 'fillPool.activityDurationUntilNoTasks': - performanceState.performance.activityDuration.push(duration); - break; - case 'fillPool.activityDurationUntilExhaustedCapacity': - performanceState.performance.activityDuration.push(duration); - break; - case 'fillPool.bailExhaustedCapacity': - performanceState.performance.cycles.fillPoolBail++; - break; - case 'fillPool.claimedOnRerunCycle': - performanceState.performance.cycles.claimedOnRerunCycle++; - break; - case 'fillPool.bailNoTasks': - performanceState.performance.cycles.fillPoolBail++; - performanceState.performance.cycles.fillPoolBailNoTasks++; - break; - case 'fillPool.start': - performanceState.performance.cycles.fillPoolStarts++; - break; - case 'fillPool.cycle': - performanceState.performance.cycles.fillPoolCycles++; - break; - break; - case 'claimAvailableTasks.noTasks': - performanceState.performance.claimAvailableTasksNoTasks++; - break; - case 'claimAvailableTasks.noAvailableWorkers': - performanceState.performance.claimAvailableTasksNoAvailableWorkers++; - break; - case 'taskPool.attemptToRun': - performanceState.performance.taskPoolAttemptToRun.push(duration); - break; - case 'taskRunner.markTaskAsRunning': - performanceState.performance.taskRunnerMarkTaskAsRunning.push(duration); - break; - case 'perfTest.duration': - observer.disconnect(); - const { summarize } = performanceState.performance; - if (summarize && summarize.length) { - summarize.splice(0, summarize.length).forEach(([resolve, summarize]) => { - resolve(summarize(duration)); - }); - } - break; - default: - if (name.startsWith('perfTask_run_')) { - performanceState.performance.numberOfTasksRanOverall++; - } - } - }); - }); - performanceState.performanceObserver.observe({ entryTypes: ['measure', 'mark'] }); - - return performanceState; -} diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/init_routes.js b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/init_routes.js deleted file mode 100644 index 6cd706a6ebecd..0000000000000 --- a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/init_routes.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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. - */ - -import Joi from 'joi'; -import { range, chunk } from 'lodash'; - -const scope = 'perf-testing'; -export function initRoutes(server, performanceState) { - const taskManager = { - ...server.newPlatform.setup.plugins.taskManager, - ...server.newPlatform.start.plugins.taskManager, - }; - - server.route({ - path: '/api/perf_tasks', - method: 'POST', - config: { - validate: { - payload: Joi.object({ - tasksToSpawn: Joi.number().required(), - durationInSeconds: Joi.number().required(), - trackExecutionTimeline: Joi.boolean() - .default(false) - .required(), - }), - }, - }, - async handler(request) { - performanceState.capture(); - - const { tasksToSpawn, durationInSeconds, trackExecutionTimeline } = request.payload; - const startAt = millisecondsFromNow(5000).getTime(); - await chunk(range(tasksToSpawn), 200) - .map(chunkOfTasksToSpawn => () => - Promise.all( - chunkOfTasksToSpawn.map(taskIndex => - taskManager.schedule( - { - taskType: 'performanceTestTask', - params: { - startAt, - taskIndex, - trackExecutionTimeline, - runUntil: millisecondsFromNow(durationInSeconds * 1000).getTime(), - }, - scope: [scope], - }, - { request } - ) - ) - ) - ) - .reduce((chain, nextExecutor) => { - return chain.then(() => nextExecutor()); - }, Promise.resolve()); - - return new Promise(resolve => { - setTimeout(() => { - performanceState.endCapture().then(resolve); - }, durationInSeconds * 1000 + 10000 /* wait extra 10s to drain queue */); - }); - }, - }); -} - -function millisecondsFromNow(ms) { - if (!ms) { - return; - } - - const dt = new Date(); - dt.setTime(dt.getTime() + ms); - return dt; -} diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json new file mode 100644 index 0000000000000..1fa480cd53c48 --- /dev/null +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json @@ -0,0 +1,9 @@ +{ + "id": "task_manager_performance", + "version": "1.0.0", + "kibanaVersion": "kibana", + "configPath": ["xpack"], + "requiredPlugins": ["taskManager"], + "server": true, + "ui": false +} diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json index 7d46d6b0f3cca..9cb3859271d81 100644 --- a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json @@ -1,16 +1,23 @@ { - "name": "perf_task_plugin", + "name": "task_manager_performance", "version": "1.0.0", "kibana": { "version": "kibana", "templateVersion": "1.0.0" }, - "license": "Apache-2.0", + "main": "target/test/plugin_api_perf/plugins/task_manager_performance", + "scripts": { + "kbn": "node ../../../../../scripts/kbn.js", + "build": "rm -rf './target' && tsc" + }, "dependencies": { "lodash": "^4.17.15", "uuid": "3.3.2", - "joi": "^13.5.2", "stats-lite": "2.2.0", "pretty-ms": "5.0.0" - } + }, + "devDependencies": { + "typescript": "3.7.2" + }, + "license": "Apache-2.0" } diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/index.ts b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/index.ts new file mode 100644 index 0000000000000..77233f463734a --- /dev/null +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/index.ts @@ -0,0 +1,9 @@ +/* + * 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. + */ + +import { SampleTaskManagerFixturePlugin } from './plugin'; + +export const plugin = () => new SampleTaskManagerFixturePlugin(); diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/init_routes.ts b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/init_routes.ts new file mode 100644 index 0000000000000..947cc0743e2f8 --- /dev/null +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/init_routes.ts @@ -0,0 +1,92 @@ +/* + * 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. + */ +import { schema } from '@kbn/config-schema'; +import { + RequestHandlerContext, + KibanaRequest, + KibanaResponseFactory, + IKibanaResponse, + IRouter, + CoreSetup, +} from 'kibana/server'; +import { range, chunk } from 'lodash'; +import { + TaskManagerStartContract, + ConcreteTaskInstance, +} from '../../../../../plugins/task_manager/server'; +import { PerfApi, PerfResult } from './types'; + +const scope = 'perf-testing'; + +export function initRoutes( + router: IRouter, + core: CoreSetup, + taskManagerStart: Promise<TaskManagerStartContract>, + performanceApi: PerfApi +) { + router.post( + { + path: '/api/perf_tasks', + validate: { + body: schema.object({ + tasksToSpawn: schema.number(), + durationInSeconds: schema.number(), + trackExecutionTimeline: schema.boolean({ defaultValue: false }), + }), + }, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest<any, any, any, any>, + res: KibanaResponseFactory + ): Promise<IKibanaResponse<any>> { + performanceApi.capture(); + + const taskManager = await taskManagerStart; + + const { tasksToSpawn, durationInSeconds, trackExecutionTimeline } = req.body; + const startAt = millisecondsFromNow(5000).getTime(); + await chunk(range(tasksToSpawn), 200) + .map(chunkOfTasksToSpawn => () => + Promise.all( + chunkOfTasksToSpawn.map(async taskIndex => + taskManager.schedule( + { + taskType: 'performanceTestTask', + params: { + startAt, + taskIndex, + trackExecutionTimeline, + runUntil: millisecondsFromNow(durationInSeconds * 1000).getTime(), + }, + state: {}, + scope: [scope], + }, + { request: req } + ) + ) + ) + ) + .reduce((chain, nextExecutor) => { + return chain.then(() => nextExecutor()); + }, Promise.resolve<ConcreteTaskInstance[] | undefined>(undefined)); + + return res.ok({ + body: await new Promise(resolve => { + setTimeout(() => { + performanceApi.endCapture().then((perf: PerfResult) => resolve(perf)); + }, durationInSeconds * 1000 + 10000 /* wait extra 10s to drain queue */); + }), + }); + } + ); +} + +function millisecondsFromNow(ms: number): Date { + const dt = new Date(); + dt.setTime(dt.getTime() + ms); + return dt; +} diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/plugin.ts b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/plugin.ts new file mode 100644 index 0000000000000..dad17b32b33f4 --- /dev/null +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/plugin.ts @@ -0,0 +1,404 @@ +/* + * 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. + */ + +import { Plugin, CoreSetup, CoreStart } from 'kibana/server'; +import { Subject } from 'rxjs'; +import { first } from 'rxjs/operators'; + +import uuid from 'uuid'; +import _ from 'lodash'; +import stats from 'stats-lite'; +import prettyMilliseconds from 'pretty-ms'; +import { performance, PerformanceObserver } from 'perf_hooks'; +import { + TaskManagerSetupContract, + TaskManagerStartContract, + ConcreteTaskInstance, +} from '../../../../../plugins/task_manager/server'; +import { PerfState, PerfApi, PerfResult } from './types'; +import { initRoutes } from './init_routes'; + +// this plugin's dependendencies +export interface SampleTaskManagerFixtureSetupDeps { + taskManager: TaskManagerSetupContract; +} +export interface SampleTaskManagerFixtureStartDeps { + taskManager: TaskManagerStartContract; +} + +export class SampleTaskManagerFixturePlugin + implements + Plugin<void, void, SampleTaskManagerFixtureSetupDeps, SampleTaskManagerFixtureStartDeps> { + taskManagerStart$: Subject<TaskManagerStartContract> = new Subject<TaskManagerStartContract>(); + taskManagerStart: Promise<TaskManagerStartContract> = this.taskManagerStart$ + .pipe(first()) + .toPromise(); + + public setup(core: CoreSetup, { taskManager }: SampleTaskManagerFixtureSetupDeps) { + const performanceState = resetPerfState({}); + + let lastFlush = new Date(); + function flushPerfStats() { + setTimeout(flushPerfStats, 5000); + const prevFlush = lastFlush; + lastFlush = new Date(); + + const tasks = performanceState.leadTimeQueue.length; + const title = `[Perf${performanceState.capturing ? ' (capturing)' : ''}]`; + const seconds = Math.round((lastFlush.getTime() - prevFlush.getTime()) / 1000); + // eslint-disable-next-line no-console + console.log( + `${title} I have processed ${tasks} tasks in the past ${seconds}s (${tasks / + seconds} per second)` + ); + if (tasks > 0) { + const latestAverage = avg(performanceState.leadTimeQueue.splice(0, tasks)).mean; + + performanceState.averagesTakenLeadTime.push(latestAverage); + performanceState.averagesTaken.push(tasks); + if (performanceState.averagesTakenLeadTime.length > 1) { + performanceState.runningAverageLeadTime = avg( + performanceState.averagesTakenLeadTime + ).mean; + performanceState.runningAverageTasksPerSecond = + avg(performanceState.averagesTaken).mean / 5; + } else { + performanceState.runningAverageLeadTime = latestAverage; + performanceState.runningAverageTasksPerSecond = tasks / 5; + } + } + } + + setTimeout(flushPerfStats, 5000); + + const title = 'Perf Test Task'; + + taskManager.registerTaskDefinitions({ + performanceTestTask: { + type: 'performanceTestTask', + title, + description: 'A task for stress testing task_manager.', + timeout: '1m', + + createTaskRunner: ({ taskInstance }: { taskInstance: ConcreteTaskInstance }) => { + return { + async run() { + const { params, state } = taskInstance; + + const counter = state.counter ? state.counter : 1; + + const now = Date.now(); + const leadTime = now - taskInstance.runAt.getTime(); + performanceState.leadTimeQueue.push(leadTime); + + // schedule to run next cycle as soon as possible + const runAt = calRunAt(params, counter); + + const stateUpdated = { + ...state, + counter: counter + 1, + }; + + if (params.trackExecutionTimeline && state.perf && state.perf.id) { + performance.mark(`perfTask_run_${state.perf.id}_${counter}`); + performance.measure( + 'perfTask.markUntilRun', + `perfTask_markAsRunning_${state.perf.id}_${counter}`, + `perfTask_run_${state.perf.id}_${counter}` + ); + if (counter === 1) { + performance.measure( + 'perfTask.firstRun', + `perfTask_schedule_${state.perf.id}`, + `perfTask_run_${state.perf.id}_${counter}` + ); + performance.measure( + 'perfTask.firstMarkAsRunningTillRan', + `perfTask_markAsRunning_${state.perf.id}_${counter}`, + `perfTask_run_${state.perf.id}_${counter}` + ); + } + } + + return { + state: stateUpdated, + runAt, + }; + }, + }; + }, + }, + }); + + taskManager.addMiddleware({ + async beforeSave({ taskInstance, ...opts }) { + const modifiedInstance = { + ...taskInstance, + }; + + if (taskInstance.params && taskInstance.params.trackExecutionTimeline) { + modifiedInstance.state = modifiedInstance.state || {}; + modifiedInstance.state.perf = modifiedInstance.state.perf || {}; + modifiedInstance.state.perf.id = uuid.v4().replace(/-/gi, '_'); + performance.mark(`perfTask_schedule_${modifiedInstance.state.perf.id}`); + } + + return { + ...opts, + taskInstance: modifiedInstance, + }; + }, + + async beforeRun(opts) { + return opts; + }, + + async beforeMarkRunning({ taskInstance, ...opts }) { + const modifiedInstance = { + ...taskInstance, + }; + + if ( + modifiedInstance.state && + modifiedInstance.state.perf && + modifiedInstance.state.perf.id + ) { + const { counter = 1 } = modifiedInstance.state; + performance.mark(`perfTask_markAsRunning_${modifiedInstance.state.perf.id}_${counter}`); + if (counter === 1) { + performance.measure( + 'perfTask.firstMarkAsRunning', + `perfTask_schedule_${modifiedInstance.state.perf.id}`, + `perfTask_markAsRunning_${modifiedInstance.state.perf.id}_${counter}` + ); + } else if (counter > 1) { + performance.measure( + 'perfTask.runUntilNextMarkAsRunning', + `perfTask_run_${modifiedInstance.state.perf.id}_${counter - 1}`, + `perfTask_markAsRunning_${modifiedInstance.state.perf.id}_${counter}` + ); + } + } + + return { + ...opts, + taskInstance: modifiedInstance, + }; + }, + }); + + const perfApi: PerfApi = { + capture() { + resetPerfState(performanceState); + performanceState.capturing = true; + performance.mark('perfTest.start'); + }, + endCapture() { + return new Promise<PerfResult>(resolve => { + performanceState.performance.summarize.push([resolve, perfApi.summarize]); + + performance.mark('perfTest.end'); + performance.measure('perfTest.duration', 'perfTest.start', 'perfTest.end'); + }); + }, + summarize(perfTestDuration: number) { + const { + runningAverageTasksPerSecond, + runningAverageLeadTime, + performance: { + numberOfTasksRanOverall, + elasticsearchApiCalls, + activityDuration, + sleepDuration, + cycles, + claimAvailableTasksNoTasks, + claimAvailableTasksNoAvailableWorkers, + taskPoolAttemptToRun, + taskRunnerMarkTaskAsRunning, + }, + } = performanceState; + + const perfRes: PerfResult = { + perfTestDuration: prettyMilliseconds(perfTestDuration), + runningAverageTasksPerSecond, + runningAverageLeadTime, + numberOfTasksRanOverall, + claimAvailableTasksNoTasks, + claimAvailableTasksNoAvailableWorkers, + elasticsearchApiCalls: (_.mapValues( + elasticsearchApiCalls, + avg + ) as unknown) as PerfResult['elasticsearchApiCalls'], + sleepDuration: prettyMilliseconds(stats.sum(sleepDuration)), + activityDuration: prettyMilliseconds(stats.sum(activityDuration)), + cycles, + taskPoolAttemptToRun: avg(taskPoolAttemptToRun), + taskRunnerMarkTaskAsRunning: avg(taskRunnerMarkTaskAsRunning), + }; + + resetPerfState(performanceState); + + return perfRes; + }, + }; + initRoutes(core.http.createRouter(), core, this.taskManagerStart, perfApi); + } + + public start(core: CoreStart, { taskManager }: SampleTaskManagerFixtureStartDeps) { + this.taskManagerStart$.next(taskManager); + this.taskManagerStart$.complete(); + } + public stop() {} +} + +function calRunAt(params: ConcreteTaskInstance['params'], counter: number) { + const runAt = counter === 1 ? new Date(params.startAt) : new Date(); + return runAt.getTime() < params.runUntil ? runAt : undefined; +} + +function avg(items: number[]) { + const mode = stats.mode(items); + return { + mean: Math.round(stats.mean(items)), + range: { + min: Math.round(isNumericArray(mode) ? _.min([...mode]) : mode), + max: Math.round(isNumericArray(mode) ? _.max([...mode]) : mode), + }, + }; +} + +function isNumericArray(mode: unknown): mode is number[] { + return Array.isArray(mode); +} + +function resetPerfState(target: Partial<PerfState>): PerfState { + if (target.performanceObserver) { + target.performanceObserver.disconnect(); + } + + const performanceState = Object.assign(target, { + capturing: false, + runningAverageTasksPerSecond: 0, + averagesTaken: [], + runningAverageLeadTime: -1, + averagesTakenLeadTime: [], + leadTimeQueue: [], + performance: { + numberOfTasksRanOverall: 0, + cycles: { + fillPoolStarts: 0, + fillPoolCycles: 0, + fillPoolBail: 0, + claimedOnRerunCycle: 0, + fillPoolBailNoTasks: 0, + }, + claimAvailableTasksNoTasks: 0, + claimAvailableTasksNoAvailableWorkers: 0, + elasticsearchApiCalls: { + timeUntilFirstRun: [], + timeUntilFirstMarkAsRun: [], + firstMarkAsRunningTillRan: [], + timeFromMarkAsRunTillRun: [], + timeFromRunTillNextMarkAsRun: [], + claimAvailableTasks: [], + }, + activityDuration: [], + sleepDuration: [], + taskPollerActivityDurationPreScheduleComplete: [], + taskPoolAttemptToRun: [], + taskRunnerMarkTaskAsRunning: [], + + summarize: [], + }, + }); + + performanceState.performanceObserver = new PerformanceObserver((list, observer) => { + list.getEntries().forEach(entry => { + const { name, duration } = entry; + switch (name) { + // Elasticsearch Api Calls + case 'perfTask.firstRun': + performanceState.performance.elasticsearchApiCalls.timeUntilFirstRun.push(duration); + break; + case 'perfTask.firstMarkAsRunning': + performanceState.performance.elasticsearchApiCalls.timeUntilFirstMarkAsRun.push(duration); + break; + case 'perfTask.firstMarkAsRunningTillRan': + performanceState.performance.elasticsearchApiCalls.firstMarkAsRunningTillRan.push( + duration + ); + break; + case 'perfTask.markUntilRun': + performanceState.performance.elasticsearchApiCalls.timeFromMarkAsRunTillRun.push( + duration + ); + break; + case 'perfTask.runUntilNextMarkAsRunning': + performanceState.performance.elasticsearchApiCalls.timeFromRunTillNextMarkAsRun.push( + duration + ); + break; + case 'claimAvailableTasks': + performanceState.performance.elasticsearchApiCalls.claimAvailableTasks.push(duration); + break; + case 'TaskPoller.sleepDuration': + performanceState.performance.sleepDuration.push(duration); + break; + case 'fillPool.activityDurationUntilNoTasks': + performanceState.performance.activityDuration.push(duration); + break; + case 'fillPool.activityDurationUntilExhaustedCapacity': + performanceState.performance.activityDuration.push(duration); + break; + case 'fillPool.bailExhaustedCapacity': + performanceState.performance.cycles.fillPoolBail++; + break; + case 'fillPool.claimedOnRerunCycle': + performanceState.performance.cycles.claimedOnRerunCycle++; + break; + case 'fillPool.bailNoTasks': + performanceState.performance.cycles.fillPoolBail++; + performanceState.performance.cycles.fillPoolBailNoTasks++; + break; + case 'fillPool.start': + performanceState.performance.cycles.fillPoolStarts++; + break; + case 'fillPool.cycle': + performanceState.performance.cycles.fillPoolCycles++; + break; + break; + case 'claimAvailableTasks.noTasks': + performanceState.performance.claimAvailableTasksNoTasks++; + break; + case 'claimAvailableTasks.noAvailableWorkers': + performanceState.performance.claimAvailableTasksNoAvailableWorkers++; + break; + case 'taskPool.attemptToRun': + performanceState.performance.taskPoolAttemptToRun.push(duration); + break; + case 'taskRunner.markTaskAsRunning': + performanceState.performance.taskRunnerMarkTaskAsRunning.push(duration); + break; + case 'perfTest.duration': + observer.disconnect(); + const { summarize } = performanceState.performance; + if (summarize && summarize.length) { + summarize.splice(0, summarize.length).forEach(([resolve, callSummarize]) => { + resolve(callSummarize(duration)); + }); + } + break; + default: + if (name.startsWith('perfTask_run_')) { + performanceState.performance.numberOfTasksRanOverall++; + } + } + }); + }); + performanceState.performanceObserver.observe({ entryTypes: ['measure', 'mark'] }); + + return performanceState; +} diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/types.ts b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/types.ts new file mode 100644 index 0000000000000..ac5e8cdaba936 --- /dev/null +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/server/types.ts @@ -0,0 +1,82 @@ +/* + * 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. + */ + +import { PerformanceObserver } from 'perf_hooks'; + +export interface Perf { + numberOfTasksRanOverall: number; + cycles: { + fillPoolStarts: number; + fillPoolCycles: number; + fillPoolBail: number; + claimedOnRerunCycle: number; + fillPoolBailNoTasks: number; + }; + claimAvailableTasksNoTasks: number; + claimAvailableTasksNoAvailableWorkers: number; + elasticsearchApiCalls: { + timeUntilFirstRun: number[]; + timeUntilFirstMarkAsRun: number[]; + firstMarkAsRunningTillRan: number[]; + timeFromMarkAsRunTillRun: number[]; + timeFromRunTillNextMarkAsRun: number[]; + claimAvailableTasks: number[]; + }; + activityDuration: number[]; + sleepDuration: number[]; + taskPollerActivityDurationPreScheduleComplete: number[]; + taskPoolAttemptToRun: number[]; + taskRunnerMarkTaskAsRunning: number[]; + + summarize: Array<[(perf: PerfResult) => void, (perfTestDuration: number) => PerfResult]>; +} + +export interface PerfState { + performanceObserver?: PerformanceObserver; + runningAverageTasksPerSecond: number; + averagesTaken: number[]; + runningAverageLeadTime: number; + averagesTakenLeadTime: number[]; + leadTimeQueue: number[]; + performance: Perf; + capturing: boolean; +} + +export interface PerfResult { + perfTestDuration: string; + runningAverageTasksPerSecond: number; + runningAverageLeadTime: number; + numberOfTasksRanOverall: number; + claimAvailableTasksNoTasks: number; + claimAvailableTasksNoAvailableWorkers: number; + elasticsearchApiCalls: { + timeUntilFirstRun: PerfAvg; + timeUntilFirstMarkAsRun: PerfAvg; + firstMarkAsRunningTillRan: PerfAvg; + timeFromMarkAsRunTillRun: PerfAvg; + timeFromRunTillNextMarkAsRun: PerfAvg; + claimAvailableTasks: PerfAvg; + }; + sleepDuration: string; + activityDuration: string; + cycles: Perf['cycles']; + taskPoolAttemptToRun: PerfAvg; + taskRunnerMarkTaskAsRunning: PerfAvg; +} + +export interface PerfApi { + capture: () => void; + endCapture: () => Promise<PerfResult>; + summarize: (perfTestDuration: number) => PerfResult; +} + +export interface PerfAvg { + mean: number; + range: { + min: number; + max: number; + }; +} diff --git a/x-pack/test/saml_api_integration/apis/security/saml_login.ts b/x-pack/test/saml_api_integration/apis/security/saml_login.ts index 0b127288e7958..0684a5e572f55 100644 --- a/x-pack/test/saml_api_integration/apis/security/saml_login.ts +++ b/x-pack/test/saml_api_integration/apis/security/saml_login.ts @@ -515,7 +515,9 @@ export default function({ getService }: FtrProviderContext) { describe('API access with expired access token.', () => { let sessionCookie: Cookie; - beforeEach(async () => { + beforeEach(async function() { + this.timeout(40000); + const captureURLResponse = await supertest .get('/abc/xyz/handshake?one=two three') .expect(302); @@ -539,6 +541,10 @@ export default function({ getService }: FtrProviderContext) { .expect(302); sessionCookie = request.cookie(samlAuthenticationResponse.headers['set-cookie'][0])!; + + // Access token expiration is set to 15s for API integration tests. + // Let's wait for 20s to make sure token expires. + await delay(20000); }); const expectNewSessionCookie = (cookie: Cookie) => { @@ -549,13 +555,7 @@ export default function({ getService }: FtrProviderContext) { expect(cookie.value).to.not.be(sessionCookie.value); }; - it('expired access token should be automatically refreshed', async function() { - this.timeout(40000); - - // Access token expiration is set to 15s for API integration tests. - // Let's wait for 20s to make sure token expires. - await delay(20000); - + it('expired access token should be automatically refreshed', async () => { // This api call should succeed and automatically refresh token. Returned cookie will contain // the new access and refresh token pair. const firstResponse = await supertest @@ -600,6 +600,19 @@ export default function({ getService }: FtrProviderContext) { .set('Cookie', secondNewCookie.cookieString()) .expect(200); }); + + it('should refresh access token even if multiple concurrent requests try to refresh it', async () => { + // Send 5 concurrent requests with a cookie that contains an expired access token. + await Promise.all( + Array.from({ length: 5 }).map((value, index) => + supertest + .get(`/internal/security/me?a=${index}`) + .set('kbn-xsrf', 'xxx') + .set('Cookie', sessionCookie.cookieString()) + .expect(200) + ) + ); + }); }); describe('API access with missing access token document.', () => { @@ -629,9 +642,7 @@ export default function({ getService }: FtrProviderContext) { .expect(302); sessionCookie = request.cookie(samlAuthenticationResponse.headers['set-cookie'][0])!; - }); - it('should properly set cookie and start new SAML handshake', async function() { // Let's delete tokens from `.security` index directly to simulate the case when // Elasticsearch automatically removes access/refresh token document from the index // after some period of time. @@ -643,7 +654,9 @@ export default function({ getService }: FtrProviderContext) { expect(esResponse) .to.have.property('deleted') .greaterThan(0); + }); + it('should properly set cookie and start new SAML handshake', async () => { const handshakeResponse = await supertest .get('/abc/xyz/handshake?one=two three') .set('Cookie', sessionCookie.cookieString()) @@ -662,6 +675,19 @@ export default function({ getService }: FtrProviderContext) { '/internal/security/saml/capture-url-fragment' ); }); + + it('should start new SAML handshake even if multiple concurrent requests try to refresh access token', async () => { + // Issue 5 concurrent requests with a cookie that contains access/refresh token pair without + // a corresponding document in Elasticsearch. + await Promise.all( + Array.from({ length: 5 }).map((value, index) => + supertest + .get(`/abc/xyz/handshake?one=two three&a=${index}`) + .set('Cookie', sessionCookie.cookieString()) + .expect(302) + ) + ); + }); }); describe('IdP initiated login with active session', () => { diff --git a/x-pack/typings/hapi.d.ts b/x-pack/typings/hapi.d.ts index 872e042eb1cdb..ed86a961cd1db 100644 --- a/x-pack/typings/hapi.d.ts +++ b/x-pack/typings/hapi.d.ts @@ -10,7 +10,7 @@ import { XPackMainPlugin } from '../legacy/plugins/xpack_main/server/xpack_main' import { SecurityPlugin } from '../legacy/plugins/security'; import { ActionsPlugin, ActionsClient } from '../plugins/actions/server'; import { AlertingPlugin, AlertsClient } from '../plugins/alerting/server'; -import { LegacyTaskManagerApi } from '../legacy/plugins/task_manager/server'; +import { TaskManager } from '../plugins/task_manager/server'; declare module 'hapi' { interface Request { @@ -22,6 +22,6 @@ declare module 'hapi' { security?: SecurityPlugin; actions?: ActionsPlugin; alerting?: AlertingPlugin; - task_manager?: LegacyTaskManagerApi; + task_manager?: TaskManager; } } diff --git a/yarn.lock b/yarn.lock index ea58497a3b342..1ce919e210e66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1332,10 +1332,10 @@ tabbable "^1.1.0" uuid "^3.1.0" -"@elastic/eui@22.3.0": - version "22.3.0" - resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-22.3.0.tgz#31a7a0aaf69b329acff2791fca677a824b63539d" - integrity sha512-LoQd11RoD6cbDuVQhwTr3lR4Jga8D5cBGaKFPzaS8MoxW5vCu0gcosjI6O5SqmCwifyfU4JP5zeOjy8TawJFxw== +"@elastic/eui@22.3.1": + version "22.3.1" + resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-22.3.1.tgz#d824835774476f1aaca006a466324256a56c1df6" + integrity sha512-psGMIsNhI0LApvmR19Y0DvtmV3BvvzXkd8dVXORjBiPW4Z7N2sGgsMmqpvxlZ1rfP59PyIKpQOTReJZFLSmKQQ== dependencies: "@types/chroma-js" "^2.0.0" "@types/enzyme" "^3.1.13" @@ -4577,6 +4577,13 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.16.1.tgz#328d1c9b54402e44119398bcb6a31b7bbd606d59" integrity sha512-db6pZL5QY3JrlCHBhYQzYDci0xnoDuxfseUuguLRr3JNk+bnCfpkK6p8quiUDyO8A0vbpBKkk59Fw125etrNeA== +"@types/pretty-ms@^5.0.0": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@types/pretty-ms/-/pretty-ms-5.0.1.tgz#f2f0d7be58caf8613d149053d446e0282ae11ff3" + integrity sha512-FFR4uj0p47Yq6JCrOt7DCaiUJIw7t9Vh7wwt3bF6qq99QRqjSH/doEGZsIIgZqhDmwjBObVBkrn0ICm1pY+mPg== + dependencies: + pretty-ms "*" + "@types/prop-types@*": version "15.7.1" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6" @@ -4875,6 +4882,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== +"@types/stats-lite@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@types/stats-lite/-/stats-lite-2.2.0.tgz#bc8190bf9dfa1e16b89eaa2b433c99dff0804de9" + integrity sha512-YV6SS4QC+pbzqjMIV8qVSTDOOazgKBLTVaN+7PfuxELjz/eyzc20KwDVGPrbHt2OcYMA7K2ezLB45Cp6DpNOSQ== + "@types/strip-ansi@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/strip-ansi/-/strip-ansi-3.0.0.tgz#9b63d453a6b54aa849182207711a08be8eea48ae" @@ -22734,7 +22746,7 @@ parse-link-header@^1.0.1: dependencies: xtend "~4.0.1" -parse-ms@^2.0.0: +parse-ms@^2.0.0, parse-ms@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-2.1.0.tgz#348565a753d4391fa524029956b172cb7753097d" integrity sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA== @@ -23495,6 +23507,13 @@ pretty-hrtime@^1.0.0, pretty-hrtime@^1.0.3: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= +pretty-ms@*: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-7.0.0.tgz#45781273110caf35f55cab21a8a9bd403a233dc0" + integrity sha512-J3aPWiC5e9ZeZFuSeBraGxSkGMOvulSWsxDByOcbD1Pr75YL3LSNIKIb52WXbCLE1sS5s4inBBbryjF4Y05Ceg== + dependencies: + parse-ms "^2.1.0" + pretty-ms@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-4.0.0.tgz#31baf41b94fd02227098aaa03bd62608eb0d6e92"