diff --git a/docs/api/saved-objects/import.asciidoc b/docs/api/saved-objects/import.asciidoc index 923482954aa2..a214598af31a 100644 --- a/docs/api/saved-objects/import.asciidoc +++ b/docs/api/saved-objects/import.asciidoc @@ -11,11 +11,13 @@ Saved objects can only be imported into the same version, a newer minor on the s |======= | Exporting version | Importing version | Compatible? -| 6.7.0 | 6.8.1 | Yes -| 6.8.1 | 7.3.0 | Yes -| 7.3.0 | 7.11.1 | Yes -| 7.11.1 | 7.6.0 | No -| 6.8.1 | 8.0.0 | No +| 6.7.x | 6.8.x | Yes +| 6.x.x | 7.x.x | Yes +| 7.x.x | 8.x.x | Yes +| 7.1.x | 7.15.x | Yes +| 7.x.x | 6.x.x | No +| 7.15.x | 7.1.x | No +| 6.x.x | 8.x.x | No |======= [[saved-objects-api-import-request]] diff --git a/docs/concepts/data-views.asciidoc b/docs/concepts/data-views.asciidoc index 7eb95405db6b..954581faa246 100644 --- a/docs/concepts/data-views.asciidoc +++ b/docs/concepts/data-views.asciidoc @@ -1,7 +1,7 @@ [[data-views]] === Create a data view -{kib} requires a data view to access the {es} data that you want to explore. +{kib} requires a data view to access the {es} data that you want to explore. A data view selects the data to use and allows you to define properties of the fields. A data view can point to one or more indices, {ref}/data-streams.html[data stream], or {ref}/alias.html[index aliases]. @@ -37,7 +37,7 @@ If you loaded your own data, follow these steps to create a data view. . Click *Create data view*. [role="screenshot"] -image:management/index-patterns/images/create-index-pattern.png["Create data view"] +image:management/index-patterns/images/create-data-view.png["Create data view"] . Start typing in the *name* field, and {kib} looks for the names of indices, data streams, and aliases that match your input. @@ -87,11 +87,11 @@ For an example, refer to <: +: ``` To query {ls} indices across two {es} clusters diff --git a/docs/concepts/index.asciidoc b/docs/concepts/index.asciidoc index eac26beee1f9..457251e62ae8 100644 --- a/docs/concepts/index.asciidoc +++ b/docs/concepts/index.asciidoc @@ -40,8 +40,6 @@ image:concepts/images/global-search.png["Global search showing matches to apps a {kib} requires a data view to tell it which {es} data you want to access, and whether the data is time-based. A data view can point to one or more {es} data streams, indices, or index aliases by name. -For example, `logs-elasticsearch-prod-*` is an index pattern, -and it is time-based with a time field of `@timestamp`. The time field is not editable. Data views are typically created by an administrator when sending data to {es}. You can <> in *Stack Management*, or by using a script @@ -129,8 +127,7 @@ Previously, {kib} used the {ref}/search-aggregations-bucket-terms-aggregation.ht Structured filters are a more interactive way to create {es} queries, and are commonly used when building dashboards that are shared by multiple analysts. Each filter can be disabled, inverted, or pinned across all apps. -The structured filters are the only way to use the {es} Query DSL in JSON form, -or to target a specific index pattern for filtering. Each of the structured +Each of the structured filters is combined with AND logic on the rest of the query. [role="screenshot"] diff --git a/docs/concepts/save-query.asciidoc b/docs/concepts/save-query.asciidoc index 61113b5491c2..54137d1f9f2c 100644 --- a/docs/concepts/save-query.asciidoc +++ b/docs/concepts/save-query.asciidoc @@ -17,7 +17,7 @@ image:concepts/images/saved-query.png["Example of the saved query management pop Saved queries are different than <>, which include the *Discover* configuration—selected columns in the document table, sort order, and -index pattern—in addition to the query. +{data-source}—in addition to the query. Saved searches are primarily used for adding search results to a dashboard. [role="xpack"] diff --git a/docs/concepts/set-time-filter.asciidoc b/docs/concepts/set-time-filter.asciidoc index 116bcd6f91f7..b379c0ac279e 100644 --- a/docs/concepts/set-time-filter.asciidoc +++ b/docs/concepts/set-time-filter.asciidoc @@ -2,7 +2,7 @@ === Set the time range Display data within a specified time range when your index contains time-based events, and a time-field is configured for the -selected <>. +selected <>. The default time range is 15 minutes, but you can customize it in <>. diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md index 5c2c1d531754..7669b9b64491 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md @@ -24,6 +24,9 @@ readonly links: { readonly canvas: { readonly guide: string; }; + readonly cloud: { + readonly indexManagement: string; + }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; @@ -55,10 +58,64 @@ readonly links: { readonly install: string; readonly start: string; }; + readonly appSearch: { + readonly apiRef: string; + readonly apiClients: string; + readonly apiKeys: string; + readonly authentication: string; + readonly crawlRules: string; + readonly curations: string; + readonly duplicateDocuments: string; + readonly entryPoints: string; + readonly guide: string; + readonly indexingDocuments: string; + readonly indexingDocumentsSchema: string; + readonly logSettings: string; + readonly metaEngines: string; + readonly nativeAuth: string; + readonly precisionTuning: string; + readonly relevanceTuning: string; + readonly resultSettings: string; + readonly searchUI: string; + readonly security: string; + readonly standardAuth: string; + readonly synonyms: string; + readonly webCrawler: string; + readonly webCrawlerEventLogs: string; + }; readonly enterpriseSearch: { - readonly base: string; - readonly appSearchBase: string; - readonly workplaceSearchBase: string; + readonly configuration: string; + readonly licenseManagement: string; + readonly mailService: string; + readonly usersAccess: string; + }; + readonly workplaceSearch: { + readonly box: string; + readonly confluenceCloud: string; + readonly confluenceServer: string; + readonly customSources: string; + readonly customSourcePermissions: string; + readonly documentPermissions: string; + readonly dropbox: string; + readonly externalIdentities: string; + readonly gitHub: string; + readonly gettingStarted: string; + readonly gmail: string; + readonly googleDrive: string; + readonly indexingSchedule: string; + readonly jiraCloud: string; + readonly jiraServer: string; + readonly nativeAuth: string; + readonly oneDrive: string; + readonly permissions: string; + readonly salesforce: string; + readonly security: string; + readonly serviceNow: string; + readonly sharePoint: string; + readonly slack: string; + readonly standardAuth: string; + readonly synch: string; + readonly zendesk: string; }; readonly heartbeat: { readonly base: string; diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md index cbfe53d3eaea..6aa528d4f04d 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md @@ -17,5 +17,5 @@ export interface DocLinksStart | --- | --- | --- | | [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string | | | [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string | | -| [links](./kibana-plugin-core-public.doclinksstart.links.md) | { readonly settings: string; readonly elasticStackGetStarted: string; readonly upgrade: { readonly upgradingElasticStack: string; }; readonly apm: { readonly kibanaSettings: string; readonly supportedServiceMaps: string; readonly customLinks: string; readonly droppedTransactionSpans: string; readonly upgrading: string; readonly metaData: string; }; readonly canvas: { readonly guide: string; }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record<string, string>; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; readonly suricataModule: string; readonly zeekModule: string; }; readonly auditbeat: { readonly base: string; readonly auditdModule: string; readonly systemModule: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly libbeat: { readonly getStarted: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite\_missing\_bucket: string; readonly date\_histogram: string; readonly date\_range: string; readonly date\_format\_pattern: string; readonly filter: string; readonly filters: string; readonly geohash\_grid: string; readonly histogram: string; readonly ip\_range: string; readonly range: string; readonly significant\_terms: string; readonly terms: string; readonly terms\_doc\_count\_error: string; readonly avg: string; readonly avg\_bucket: string; readonly max\_bucket: string; readonly min\_bucket: string; readonly sum\_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative\_sum: string; readonly derivative: string; readonly geo\_bounds: string; readonly geo\_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving\_avg: string; readonly percentile\_ranks: string; readonly serial\_diff: string; readonly std\_dev: string; readonly sum: string; readonly top\_hits: string; }; readonly runtimeFields: { readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly search: { readonly sessions: string; readonly sessionLimits: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; readonly runtimeFields: string; }; readonly addData: string; readonly kibana: string; readonly upgradeAssistant: { readonly overview: string; readonly batchReindex: string; readonly remoteReindex: string; }; readonly rollupJobs: string; readonly elasticsearch: Record<string, string>; readonly siem: { readonly privileges: string; readonly guide: string; readonly gettingStarted: string; readonly ml: string; readonly ruleChangeLog: string; readonly detectionsReq: string; readonly networkMap: string; readonly troubleshootGaps: string; }; readonly securitySolution: { readonly trustedApps: string; }; readonly query: { readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record<string, string>; readonly ml: Record<string, string>; readonly transforms: Record<string, string>; readonly visualize: Record<string, string>; readonly apis: Readonly<{ bulkIndexAlias: string; byteSizeUnits: string; createAutoFollowPattern: string; createFollower: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createRollupJobsRequest: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; timeUnits: string; updateTransform: string; }>; readonly observability: Readonly<{ guide: string; infrastructureThreshold: string; logsThreshold: string; metricsThreshold: string; monitorStatus: string; monitorUptime: string; tlsCertificate: string; uptimeDurationAnomaly: string; }>; readonly alerting: Record<string, string>; readonly maps: Readonly<{ guide: string; importGeospatialPrivileges: string; gdalTutorial: string; }>; readonly monitoring: Record<string, string>; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; elasticsearchEnableApiKeys: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly spaces: Readonly<{ kibanaLegacyUrlAliases: string; kibanaDisableLegacyUrlAliasesApi: string; }>; readonly watcher: Record<string, string>; readonly ccs: Record<string, string>; readonly plugins: Record<string, string>; readonly snapshotRestore: Record<string, string>; readonly ingest: Record<string, string>; readonly fleet: Readonly<{ beatsAgentComparison: string; guide: string; fleetServer: string; fleetServerAddFleetServer: string; settings: string; settingsFleetServerHostSettings: string; settingsFleetServerProxySettings: string; troubleshooting: string; elasticAgent: string; datastreams: string; datastreamsNamingScheme: string; installElasticAgent: string; installElasticAgentStandalone: string; upgradeElasticAgent: string; upgradeElasticAgent712lower: string; learnMoreBlog: string; apiKeysLearnMore: string; onPremRegistry: string; }>; readonly ecs: { readonly guide: string; }; readonly clients: { readonly guide: string; readonly goOverview: string; readonly javaIndex: string; readonly jsIntro: string; readonly netGuide: string; readonly perlGuide: string; readonly phpGuide: string; readonly pythonGuide: string; readonly rubyOverview: string; readonly rustGuide: string; }; readonly endpoints: { readonly troubleshooting: string; }; } | | +| [links](./kibana-plugin-core-public.doclinksstart.links.md) | { readonly settings: string; readonly elasticStackGetStarted: string; readonly upgrade: { readonly upgradingElasticStack: string; }; readonly apm: { readonly kibanaSettings: string; readonly supportedServiceMaps: string; readonly customLinks: string; readonly droppedTransactionSpans: string; readonly upgrading: string; readonly metaData: string; }; readonly canvas: { readonly guide: string; }; readonly cloud: { readonly indexManagement: string; }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record<string, string>; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; readonly suricataModule: string; readonly zeekModule: string; }; readonly auditbeat: { readonly base: string; readonly auditdModule: string; readonly systemModule: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly appSearch: { readonly apiRef: string; readonly apiClients: string; readonly apiKeys: string; readonly authentication: string; readonly crawlRules: string; readonly curations: string; readonly duplicateDocuments: string; readonly entryPoints: string; readonly guide: string; readonly indexingDocuments: string; readonly indexingDocumentsSchema: string; readonly logSettings: string; readonly metaEngines: string; readonly nativeAuth: string; readonly precisionTuning: string; readonly relevanceTuning: string; readonly resultSettings: string; readonly searchUI: string; readonly security: string; readonly standardAuth: string; readonly synonyms: string; readonly webCrawler: string; readonly webCrawlerEventLogs: string; }; readonly enterpriseSearch: { readonly configuration: string; readonly licenseManagement: string; readonly mailService: string; readonly usersAccess: string; }; readonly workplaceSearch: { readonly box: string; readonly confluenceCloud: string; readonly confluenceServer: string; readonly customSources: string; readonly customSourcePermissions: string; readonly documentPermissions: string; readonly dropbox: string; readonly externalIdentities: string; readonly gitHub: string; readonly gettingStarted: string; readonly gmail: string; readonly googleDrive: string; readonly indexingSchedule: string; readonly jiraCloud: string; readonly jiraServer: string; readonly nativeAuth: string; readonly oneDrive: string; readonly permissions: string; readonly salesforce: string; readonly security: string; readonly serviceNow: string; readonly sharePoint: string; readonly slack: string; readonly standardAuth: string; readonly synch: string; readonly zendesk: string; }; readonly heartbeat: { readonly base: string; }; readonly libbeat: { readonly getStarted: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite\_missing\_bucket: string; readonly date\_histogram: string; readonly date\_range: string; readonly date\_format\_pattern: string; readonly filter: string; readonly filters: string; readonly geohash\_grid: string; readonly histogram: string; readonly ip\_range: string; readonly range: string; readonly significant\_terms: string; readonly terms: string; readonly terms\_doc\_count\_error: string; readonly avg: string; readonly avg\_bucket: string; readonly max\_bucket: string; readonly min\_bucket: string; readonly sum\_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative\_sum: string; readonly derivative: string; readonly geo\_bounds: string; readonly geo\_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving\_avg: string; readonly percentile\_ranks: string; readonly serial\_diff: string; readonly std\_dev: string; readonly sum: string; readonly top\_hits: string; }; readonly runtimeFields: { readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly search: { readonly sessions: string; readonly sessionLimits: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; readonly runtimeFields: string; }; readonly addData: string; readonly kibana: string; readonly upgradeAssistant: { readonly overview: string; readonly batchReindex: string; readonly remoteReindex: string; }; readonly rollupJobs: string; readonly elasticsearch: Record<string, string>; readonly siem: { readonly privileges: string; readonly guide: string; readonly gettingStarted: string; readonly ml: string; readonly ruleChangeLog: string; readonly detectionsReq: string; readonly networkMap: string; readonly troubleshootGaps: string; }; readonly securitySolution: { readonly trustedApps: string; }; readonly query: { readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record<string, string>; readonly ml: Record<string, string>; readonly transforms: Record<string, string>; readonly visualize: Record<string, string>; readonly apis: Readonly<{ bulkIndexAlias: string; byteSizeUnits: string; createAutoFollowPattern: string; createFollower: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createRollupJobsRequest: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; timeUnits: string; updateTransform: string; }>; readonly observability: Readonly<{ guide: string; infrastructureThreshold: string; logsThreshold: string; metricsThreshold: string; monitorStatus: string; monitorUptime: string; tlsCertificate: string; uptimeDurationAnomaly: string; }>; readonly alerting: Record<string, string>; readonly maps: Readonly<{ guide: string; importGeospatialPrivileges: string; gdalTutorial: string; }>; readonly monitoring: Record<string, string>; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; elasticsearchEnableApiKeys: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly spaces: Readonly<{ kibanaLegacyUrlAliases: string; kibanaDisableLegacyUrlAliasesApi: string; }>; readonly watcher: Record<string, string>; readonly ccs: Record<string, string>; readonly plugins: Record<string, string>; readonly snapshotRestore: Record<string, string>; readonly ingest: Record<string, string>; readonly fleet: Readonly<{ beatsAgentComparison: string; guide: string; fleetServer: string; fleetServerAddFleetServer: string; settings: string; settingsFleetServerHostSettings: string; settingsFleetServerProxySettings: string; troubleshooting: string; elasticAgent: string; datastreams: string; datastreamsNamingScheme: string; installElasticAgent: string; installElasticAgentStandalone: string; upgradeElasticAgent: string; upgradeElasticAgent712lower: string; learnMoreBlog: string; apiKeysLearnMore: string; onPremRegistry: string; }>; readonly ecs: { readonly guide: string; }; readonly clients: { readonly guide: string; readonly goOverview: string; readonly javaIndex: string; readonly jsIntro: string; readonly netGuide: string; readonly perlGuide: string; readonly phpGuide: string; readonly pythonGuide: string; readonly rubyOverview: string; readonly rustGuide: string; }; readonly endpoints: { readonly troubleshooting: string; }; } | | diff --git a/docs/getting-started/quick-start-guide.asciidoc b/docs/getting-started/quick-start-guide.asciidoc index 03e40c7cc6ce..2667729f4b85 100644 --- a/docs/getting-started/quick-start-guide.asciidoc +++ b/docs/getting-started/quick-start-guide.asciidoc @@ -11,7 +11,7 @@ When you've finished, you'll know how to: [float] === Required privileges -You must have `read`, `write`, and `manage` privileges on the `kibana_sample_data_*` indices. +You must have `read`, `write`, and `manage` privileges on the `kibana_sample_data_*` indices. Learn how to <>, or refer to {ref}/security-privileges.html[Security privileges] for more information. [float] @@ -37,7 +37,7 @@ image::images/addData_sampleDataCards_7.15.0.png[Add data UI for the sample data [[explore-the-data]] == Explore the data -*Discover* displays the data in an interactive histogram that shows the distribution of data, or documents, over time, and a table that lists the fields for each document that matches the index pattern. To view a subset of the documents, you can apply filters to the data, and customize the table to display only the fields you want to explore. +*Discover* displays the data in an interactive histogram that shows the distribution of data, or documents, over time, and a table that lists the fields for each document that matches the {data-source}. To view a subset of the documents, you can apply filters to the data, and customize the table to display only the fields you want to explore. . Open the main menu, then click *Discover*. @@ -65,7 +65,7 @@ image::images/tutorial-discover-3.png[Discover table that displays only the prod A dashboard is a collection of panels that you can use to view and analyze the data. Panels contain visualizations, interactive controls, text, and more. -. Open the main menu, then click *Dashboard*. +. Open the main menu, then click *Dashboard*. . Click *[eCommerce] Revenue Dashboard*. + @@ -104,7 +104,7 @@ The treemap appears as the last visualization panel on the dashboard. [[interact-with-the-data]] === Interact with the data -You can interact with the dashboard data using controls that allow you to apply dashboard-level filters. Interact with the *[eCommerce] Controls* panel to view the women's clothing data from the Gnomehouse manufacturer. +You can interact with the dashboard data using controls that allow you to apply dashboard-level filters. Interact with the *[eCommerce] Controls* panel to view the women's clothing data from the Gnomehouse manufacturer. . From the *Manufacturer* dropdown, select *Gnomehouse*. diff --git a/docs/management/index-patterns/images/create-data-view.png b/docs/management/index-patterns/images/create-data-view.png new file mode 100644 index 000000000000..229ed0f490b4 Binary files /dev/null and b/docs/management/index-patterns/images/create-data-view.png differ diff --git a/docs/management/index-patterns/images/create-index-pattern.png b/docs/management/index-patterns/images/create-index-pattern.png deleted file mode 100644 index c1b673f1ab88..000000000000 Binary files a/docs/management/index-patterns/images/create-index-pattern.png and /dev/null differ diff --git a/docs/migration/migrate_8_0.asciidoc b/docs/migration/migrate_8_0.asciidoc index 59dd36a4fa5e..8936e41762c6 100644 --- a/docs/migration/migrate_8_0.asciidoc +++ b/docs/migration/migrate_8_0.asciidoc @@ -65,7 +65,7 @@ If you are currently using one of these settings in your Kibana config, please r ==== Default logging timezone is now the system's timezone *Details:* In prior releases the timezone used in logs defaulted to UTC. We now use the host machine's timezone by default. -*Impact:* To restore the previous behavior, in kibana.yml use the pattern layout, with a date modifier: +*Impact:* To restore the previous behavior, in kibana.yml use the pattern layout, with a {kibana-ref}/logging-configuration.html#date-format[date modifier]: [source,yaml] ------------------- logging: @@ -100,7 +100,7 @@ See https://github.com/elastic/kibana/pull/87939 for more details. [float] ==== Logging destination is specified by the appender -*Details:* Previously log destination would be `stdout` and could be changed to `file` using `logging.dest`. With the new logging configuration, you can specify the destination using appenders. +*Details:* Previously log destination would be `stdout` and could be changed to `file` using `logging.dest`. With the new logging configuration, you can specify the destination using {kibana-ref}/logging-configuration.html#logging-appenders[appenders]. *Impact:* To restore the previous behavior and log records to *stdout*, in `kibana.yml` use an appender with `type: console`. [source,yaml] @@ -131,7 +131,7 @@ logging: [float] ==== Set log verbosity with root -*Details:* Previously logging output would be specified by `logging.silent` (none), `logging.quiet` (error messages only) and `logging.verbose` (all). With the new logging configuration, set the minimum required log level. +*Details:* Previously logging output would be specified by `logging.silent` (none), `logging.quiet` (error messages only) and `logging.verbose` (all). With the new logging configuration, set the minimum required {kibana-ref}/logging-configuration.html#log-level[log level]. *Impact:* To restore the previous behavior, in `kibana.yml` specify `logging.root.level`: [source,yaml] @@ -188,7 +188,7 @@ logging: ==== Configure log rotation with the rolling-file appender *Details:* Previously log rotation would be enabled when `logging.rotate.enabled` was true. -*Impact:* To restore the previous behavior, in `kibana.yml` use the `rolling-file` appender. +*Impact:* To restore the previous behavior, in `kibana.yml` use the {kibana-ref}/logging-configuration.html#rolling-file-appender[`rolling-file`] appender. [source,yaml] ------------------- diff --git a/docs/settings/logging-settings.asciidoc b/docs/settings/logging-settings.asciidoc index cb8237c5aa38..a9053b90ce72 100644 --- a/docs/settings/logging-settings.asciidoc +++ b/docs/settings/logging-settings.asciidoc @@ -30,7 +30,7 @@ The following table serves as a quick reference for different logging configurat | Allows you to specify a fileName to write log records to disk. To write <>, add the file appender to `root.appenders`. If configured, you also need to specify <>. | `logging.appenders[].rolling-file:` -| Similar to Log4j's `RollingFileAppender`, this appender will log to a file and rotate if following a rolling strategy when the configured policy triggers. There are currently two policies supported: `size-limit` and `time-interval`. +| Similar to https://logging.apache.org/log4j/2.x/[Log4j's] `RollingFileAppender`, this appender will log to a file and rotate if following a rolling strategy when the configured policy triggers. There are currently two policies supported: <> and <>. | `logging.appenders[]..type` | The appender type determines where the log messages are sent. Options are `console`, `file`, `rewrite`, `rolling-file`. Required. diff --git a/docs/user/dashboard/lens.asciidoc b/docs/user/dashboard/lens.asciidoc index 23a6d1fbcfd3..1b0bbf866b85 100644 --- a/docs/user/dashboard/lens.asciidoc +++ b/docs/user/dashboard/lens.asciidoc @@ -249,7 +249,7 @@ In the legend, click the field, then choose one of the following options: [[configure-the-visualization-components]] ==== Configure the visualization components -Each visualiztion type comes with a set of components that you access from the editor toolbar. +Each visualization type comes with a set of components that you access from the editor toolbar. The following component menus are available: diff --git a/package.json b/package.json index 983dddda5d4f..b0c7e4659a55 100644 --- a/package.json +++ b/package.json @@ -397,12 +397,12 @@ "usng.js": "^0.4.5", "utility-types": "^3.10.0", "uuid": "3.3.2", - "vega": "^5.19.1", + "vega": "^5.21.0", "vega-interpreter": "^1.0.4", - "vega-lite": "^5.0.0", - "vega-schema-url-parser": "^2.1.0", + "vega-lite": "^5.2.0", + "vega-schema-url-parser": "^2.2.0", "vega-spec-injector": "^0.0.2", - "vega-tooltip": "^0.25.1", + "vega-tooltip": "^0.27.0", "venn.js": "0.2.20", "vinyl": "^2.2.0", "vt-pbf": "^3.1.1", @@ -556,6 +556,7 @@ "@types/json-stable-stringify": "^1.0.32", "@types/json5": "^0.0.30", "@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/npm_module_types", + "@types/kbn__alerts": "link:bazel-bin/packages/kbn-alerts/npm_module_types", "@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types", "@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types", "@types/license-checker": "15.0.0", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 07513ac94c85..c9a0f6a759b2 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -78,6 +78,7 @@ filegroup( "//packages/elastic-apm-synthtrace:build_types", "//packages/elastic-datemath:build_types", "//packages/kbn-ace:build_types", + "//packages/kbn-alerts:build_types", "//packages/kbn-i18n:build_types", "//packages/kbn-i18n-react:build_types", ], diff --git a/packages/kbn-alerts/BUILD.bazel b/packages/kbn-alerts/BUILD.bazel index e567c18807df..15dbc163cd28 100644 --- a/packages/kbn-alerts/BUILD.bazel +++ b/packages/kbn-alerts/BUILD.bazel @@ -1,10 +1,10 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") -load("//src/dev/bazel:index.bzl", "jsts_transpiler") +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") PKG_BASE_NAME = "kbn-alerts" - PKG_REQUIRE_NAME = "@kbn/alerts" +TYPES_PKG_REQUIRE_NAME = "@types/kbn__alerts" SOURCE_FILES = glob( [ @@ -87,7 +87,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) @@ -106,3 +106,20 @@ filegroup( ], visibility = ["//visibility:public"], ) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = TYPES_PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [ + ":npm_module_types", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-alerts/package.json b/packages/kbn-alerts/package.json index b52a6efc3513..13b60ad9fa07 100644 --- a/packages/kbn-alerts/package.json +++ b/packages/kbn-alerts/package.json @@ -5,6 +5,5 @@ "license": "SSPL-1.0 OR Elastic License 2.0", "browser": "./target_web/index.js", "main": "./target_node/index.js", - "types": "./target_types/index.d.ts", "private": true } diff --git a/packages/kbn-babel-preset/common_preset.js b/packages/kbn-babel-preset/common_preset.js index 3a3763693db9..824a73f9b261 100644 --- a/packages/kbn-babel-preset/common_preset.js +++ b/packages/kbn-babel-preset/common_preset.js @@ -6,46 +6,57 @@ * Side Public License, v 1. */ -const plugins = [ - require.resolve('babel-plugin-add-module-exports'), - - // The class properties proposal was merged with the private fields proposal - // into the "class fields" proposal. Babel doesn't support this combined - // proposal yet, which includes private field, so this transform is - // TECHNICALLY stage 2, but for all intents and purposes it's stage 3 - // - // See https://github.com/babel/proposals/issues/12 for progress - require.resolve('@babel/plugin-proposal-class-properties'), - - // Optional Chaining proposal is stage 4 (https://github.com/tc39/proposal-optional-chaining) - // Need this since we are using TypeScript 3.7+ - require.resolve('@babel/plugin-proposal-optional-chaining'), - - // Nullish coalescing proposal is stage 4 (https://github.com/tc39/proposal-nullish-coalescing) - // Need this since we are using TypeScript 3.7+ - require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), - - // Proposal is on stage 4, and included in ECMA-262 (https://github.com/tc39/proposal-export-ns-from) - // Need this since we are using TypeScript 3.8+ - require.resolve('@babel/plugin-proposal-export-namespace-from'), - - // Proposal is on stage 4, and included in ECMA-262 (https://github.com/tc39/proposal-export-ns-from) - // Need this since we are using TypeScript 3.9+ - require.resolve('@babel/plugin-proposal-private-methods'), - - // It enables the @babel/runtime so we can decrease the bundle sizes of the produced outputs - [ - require.resolve('@babel/plugin-transform-runtime'), +module.exports = { + presets: [ + // plugins always run before presets, but in this case we need the + // @babel/preset-typescript preset to run first so we have to move + // our explicit plugin configs to a sub-preset { - version: '^7.12.5', + plugins: [ + require.resolve('babel-plugin-add-module-exports'), + + // The class properties proposal was merged with the private fields proposal + // into the "class fields" proposal. Babel doesn't support this combined + // proposal yet, which includes private field, so this transform is + // TECHNICALLY stage 2, but for all intents and purposes it's stage 3 + // + // See https://github.com/babel/proposals/issues/12 for progress + require.resolve('@babel/plugin-proposal-class-properties'), + + // Optional Chaining proposal is stage 4 (https://github.com/tc39/proposal-optional-chaining) + // Need this since we are using TypeScript 3.7+ + require.resolve('@babel/plugin-proposal-optional-chaining'), + + // Nullish coalescing proposal is stage 4 (https://github.com/tc39/proposal-nullish-coalescing) + // Need this since we are using TypeScript 3.7+ + require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'), + + // Proposal is on stage 4, and included in ECMA-262 (https://github.com/tc39/proposal-export-ns-from) + // Need this since we are using TypeScript 3.8+ + require.resolve('@babel/plugin-proposal-export-namespace-from'), + + // Proposal is on stage 4, and included in ECMA-262 (https://github.com/tc39/proposal-export-ns-from) + // Need this since we are using TypeScript 3.9+ + require.resolve('@babel/plugin-proposal-private-methods'), + + // It enables the @babel/runtime so we can decrease the bundle sizes of the produced outputs + [ + require.resolve('@babel/plugin-transform-runtime'), + { + version: '^7.12.5', + }, + ], + ], }, - ], -]; -module.exports = { - presets: [ - [require.resolve('@babel/preset-typescript'), { allowNamespaces: true }], require.resolve('@babel/preset-react'), + + [ + require.resolve('@babel/preset-typescript'), + { + allowNamespaces: true, + allowDeclareFields: true, + }, + ], ], - plugins, }; diff --git a/packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts b/packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts index 87a7812165a6..7c7f7dd28f6c 100644 --- a/packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts +++ b/packages/kbn-es-query/src/filters/build_filters/phrase_filter.test.ts @@ -5,16 +5,19 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ - +import { set } from 'lodash'; import { buildInlineScriptForPhraseFilter, buildPhraseFilter, getPhraseFilterField, PhraseFilter, + isPhraseFilter, + isScriptedPhraseFilter, } from './phrase_filter'; import { fields, getField } from '../stubs'; import { DataViewBase } from '../../es_query'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { Filter } from './types'; describe('Phrase filter builder', () => { let indexPattern: DataViewBase; @@ -164,3 +167,23 @@ describe('getPhraseFilterField', function () { expect(result).toBe('extension'); }); }); + +describe('isPhraseFilter', () => { + it('should return true if the filter is a phrases filter false otherwise', () => { + const filter: Filter = set({ meta: {} }, 'query.match_phrase', {}) as Filter; + const unknownFilter = {} as Filter; + + expect(isPhraseFilter(filter)).toBe(true); + expect(isPhraseFilter(unknownFilter)).toBe(false); + }); +}); + +describe('isScriptedPhraseFilter', () => { + it('should return true if the filter is a phrases filter false otherwise', () => { + const filter: Filter = set({ meta: {} }, 'query.script.script.params.value', {}) as Filter; + const unknownFilter = {} as Filter; + + expect(isScriptedPhraseFilter(filter)).toBe(true); + expect(isPhraseFilter(unknownFilter)).toBe(false); + }); +}); diff --git a/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts b/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts index 4c1827dc58c0..525463c9de24 100644 --- a/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts +++ b/packages/kbn-es-query/src/filters/build_filters/phrase_filter.ts @@ -31,8 +31,10 @@ export type PhraseFilter = Filter & { export type ScriptedPhraseFilter = Filter & { meta: PhraseFilterMeta; - script: { - script: estypes.InlineScript; + query: { + script: { + script: estypes.InlineScript; + }; }; }; @@ -58,7 +60,7 @@ export const isPhraseFilter = (filter: Filter): filter is PhraseFilter => { * @public */ export const isScriptedPhraseFilter = (filter: Filter): filter is ScriptedPhraseFilter => - has(filter, 'script.script.params.value'); + has(filter, 'query.script.script.params.value'); /** @internal */ export const getPhraseFilterField = (filter: PhraseFilter) => { @@ -77,7 +79,7 @@ export const getPhraseFilterValue = ( const queryValue = Object.values(queryConfig)[0]; return isPlainObject(queryValue) ? queryValue.query : queryValue; } else { - return filter.script.script.params?.value; + return filter.query?.script?.script?.params?.value; } }; diff --git a/packages/kbn-optimizer/src/babel_runtime_helpers/find_babel_runtime_helpers_in_entry_bundles.ts b/packages/kbn-optimizer/src/babel_runtime_helpers/find_babel_runtime_helpers_in_entry_bundles.ts index beff36023343..f00905f3f492 100644 --- a/packages/kbn-optimizer/src/babel_runtime_helpers/find_babel_runtime_helpers_in_entry_bundles.ts +++ b/packages/kbn-optimizer/src/babel_runtime_helpers/find_babel_runtime_helpers_in_entry_bundles.ts @@ -35,14 +35,14 @@ export async function runFindBabelHelpersInEntryBundlesCli() { } for (const { userRequest } of module.reasons) { - if (userRequest.startsWith('@babel/runtime/')) { + if (userRequest.startsWith('@babel/runtime')) { imports.add(userRequest); } } } } - log.success('found', imports.size, '@babel/register imports in entry bundles'); + log.success('found', imports.size, '@babel/runtime* imports in entry bundles'); log.write( Array.from(imports, (i) => `'${i}',`) .sort() diff --git a/packages/kbn-optimizer/src/worker/emit_stats_plugin.ts b/packages/kbn-optimizer/src/worker/emit_stats_plugin.ts index c964219e1fed..5cb60344037f 100644 --- a/packages/kbn-optimizer/src/worker/emit_stats_plugin.ts +++ b/packages/kbn-optimizer/src/worker/emit_stats_plugin.ts @@ -26,7 +26,7 @@ export class EmitStatsPlugin { (stats) => { Fs.writeFileSync( Path.resolve(this.bundle.outputDir, 'stats.json'), - JSON.stringify(stats.toJson()) + JSON.stringify(stats.toJson(), null, 2) ); } ); diff --git a/packages/kbn-storybook/src/webpack.config.ts b/packages/kbn-storybook/src/webpack.config.ts index 27e887eda65c..53f9c82b8681 100644 --- a/packages/kbn-storybook/src/webpack.config.ts +++ b/packages/kbn-storybook/src/webpack.config.ts @@ -9,11 +9,13 @@ import { externals } from '@kbn/ui-shared-deps-src'; import { stringifyRequest } from 'loader-utils'; import { resolve } from 'path'; -import { Configuration, Stats } from 'webpack'; +import webpack, { Configuration, Stats } from 'webpack'; import webpackMerge from 'webpack-merge'; import { REPO_ROOT } from './lib/constants'; import { IgnoreNotFoundExportPlugin } from './ignore_not_found_export_plugin'; +type Preset = string | [string, Record] | Record; + const stats = { ...Stats.presetToOptions('minimal'), colors: true, @@ -22,6 +24,46 @@ const stats = { moduleTrace: true, }; +function isProgressPlugin(plugin: any) { + return 'handler' in plugin && plugin.showActiveModules && plugin.showModules; +} + +function isHtmlPlugin(plugin: any): plugin is { options: { template: string } } { + return !!(typeof plugin.options?.template === 'string'); +} + +function isBabelLoaderRule(rule: webpack.RuleSetRule): rule is webpack.RuleSetRule & { + use: webpack.RuleSetLoader[]; +} { + return !!( + rule.use && + Array.isArray(rule.use) && + rule.use.some( + (l) => + typeof l === 'object' && typeof l.loader === 'string' && l.loader.includes('babel-loader') + ) + ); +} + +function getPresetPath(preset: Preset) { + if (typeof preset === 'string') return preset; + if (Array.isArray(preset)) return preset[0]; + return undefined; +} + +function getTsPreset(preset: Preset) { + if (getPresetPath(preset)?.includes('preset-typescript')) { + if (typeof preset === 'string') return [preset, {}]; + if (Array.isArray(preset)) return preset; + + throw new Error('unsupported preset-typescript format'); + } +} + +function isDesiredPreset(preset: Preset) { + return !getPresetPath(preset)?.includes('preset-flow'); +} + // Extend the Storybook Webpack config with some customizations /* eslint-disable import/no-default-export */ export default function ({ config: storybookConfig }: { config: Configuration }) { @@ -83,21 +125,72 @@ export default function ({ config: storybookConfig }: { config: Configuration }) stats, }; - // Disable the progress plugin - const progressPlugin: any = (storybookConfig.plugins || []).find((plugin: any) => { - return 'handler' in plugin && plugin.showActiveModules && plugin.showModules; - }); - progressPlugin.handler = () => {}; - - // This is the hacky part. We find something that looks like the - // HtmlWebpackPlugin and mutate its `options.template` to point at our - // revised template. - const htmlWebpackPlugin: any = (storybookConfig.plugins || []).find((plugin: any) => { - return plugin.options && typeof plugin.options.template === 'string'; - }); - if (htmlWebpackPlugin) { - htmlWebpackPlugin.options.template = require.resolve('../templates/index.ejs'); + const updatedModuleRules = []; + // clone and modify the module.rules config provided by storybook so that the default babel plugins run after the typescript preset + for (const originalRule of storybookConfig.module?.rules ?? []) { + const rule = { ...originalRule }; + updatedModuleRules.push(rule); + + if (isBabelLoaderRule(rule)) { + rule.use = [...rule.use]; + const loader = (rule.use[0] = { ...rule.use[0] }); + const options = (loader.options = { ...(loader.options as Record) }); + + // capture the plugins defined at the root level + const plugins: string[] = options.plugins; + options.plugins = []; + + // move the plugins to the top of the preset array so they will run after the typescript preset + options.presets = [ + { + plugins, + }, + ...(options.presets as Preset[]).filter(isDesiredPreset).map((preset) => { + const tsPreset = getTsPreset(preset); + if (!tsPreset) { + return preset; + } + + return [ + tsPreset[0], + { + ...tsPreset[1], + allowNamespaces: true, + allowDeclareFields: true, + }, + ]; + }), + ]; + } } - return webpackMerge(storybookConfig, config); + // copy and modify the webpack plugins added by storybook + const filteredStorybookPlugins = []; + for (const plugin of storybookConfig.plugins ?? []) { + // Remove the progress plugin + if (isProgressPlugin(plugin)) { + continue; + } + + // This is the hacky part. We find something that looks like the + // HtmlWebpackPlugin and mutate its `options.template` to point at our + // revised template. + if (isHtmlPlugin(plugin)) { + plugin.options.template = require.resolve('../templates/index.ejs'); + } + + filteredStorybookPlugins.push(plugin); + } + + return webpackMerge( + { + ...storybookConfig, + plugins: filteredStorybookPlugins, + module: { + ...storybookConfig.module, + rules: updatedModuleRules, + }, + }, + config + ); } diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index 92b4c815f224..5bc7691d6a40 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -30,6 +30,9 @@ export class DocLinksService { const APM_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/apm/`; const SECURITY_SOLUTION_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/`; const STACK_GETTING_STARTED = `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack-get-started/${DOC_LINK_VERSION}/`; + const APP_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/app-search/${DOC_LINK_VERSION}/`; + const ENTERPRISE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/enterprise-search/${DOC_LINK_VERSION}/`; + const WORKPLACE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/workplace-search/${DOC_LINK_VERSION}/`; return deepFreeze({ DOC_LINK_VERSION, @@ -51,6 +54,9 @@ export class DocLinksService { canvas: { guide: `${KIBANA_DOCS}canvas.html`, }, + cloud: { + indexManagement: `${ELASTIC_WEBSITE_URL}/guide/en/cloud/current/ec-configure-index-management.html`, + }, dashboard: { guide: `${KIBANA_DOCS}dashboard.html`, drilldowns: `${KIBANA_DOCS}drilldowns.html`, @@ -77,10 +83,64 @@ export class DocLinksService { auditdModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}/auditbeat-module-auditd.html`, systemModule: `${ELASTIC_WEBSITE_URL}guide/en/beats/auditbeat/${DOC_LINK_VERSION}/auditbeat-module-system.html`, }, + appSearch: { + apiRef: `${APP_SEARCH_DOCS}api-reference.html`, + apiClients: `${APP_SEARCH_DOCS}api-clients.html`, + apiKeys: `${APP_SEARCH_DOCS}authentication.html#authentication-api-keys`, + authentication: `${APP_SEARCH_DOCS}authentication.html`, + crawlRules: `${APP_SEARCH_DOCS}crawl-web-content.html#crawl-web-content-manage-crawl-rules`, + curations: `${APP_SEARCH_DOCS}curations-guide.html`, + duplicateDocuments: `${APP_SEARCH_DOCS}web-crawler-reference.html#web-crawler-reference-content-deduplication`, + entryPoints: `${APP_SEARCH_DOCS}crawl-web-content.html#crawl-web-content-manage-entry-points`, + guide: `${APP_SEARCH_DOCS}index.html`, + indexingDocuments: `${APP_SEARCH_DOCS}indexing-documents-guide.html`, + indexingDocumentsSchema: `${APP_SEARCH_DOCS}indexing-documents-guide.html#indexing-documents-guide-schema`, + logSettings: `${APP_SEARCH_DOCS}logs.html`, + metaEngines: `${APP_SEARCH_DOCS}meta-engines-guide.html`, + nativeAuth: `${APP_SEARCH_DOCS}security-and-users.html#app-search-self-managed-security-and-user-management-elasticsearch-native-realm`, + precisionTuning: `${APP_SEARCH_DOCS}precision-tuning.html`, + relevanceTuning: `${APP_SEARCH_DOCS}relevance-tuning-guide.html`, + resultSettings: `${APP_SEARCH_DOCS}result-settings-guide.html`, + searchUI: `${APP_SEARCH_DOCS}reference-ui-guide.html`, + security: `${APP_SEARCH_DOCS}security-and-users.html`, + standardAuth: `${APP_SEARCH_DOCS}security-and-users.html#app-search-self-managed-security-and-user-management-standard`, + synonyms: `${APP_SEARCH_DOCS}synonyms-guide.html`, + webCrawler: `${APP_SEARCH_DOCS}web-crawler.html`, + webCrawlerEventLogs: `${APP_SEARCH_DOCS}view-web-crawler-events-logs.html`, + }, enterpriseSearch: { - base: `${ELASTIC_WEBSITE_URL}guide/en/enterprise-search/${DOC_LINK_VERSION}`, - appSearchBase: `${ELASTIC_WEBSITE_URL}guide/en/app-search/${DOC_LINK_VERSION}`, - workplaceSearchBase: `${ELASTIC_WEBSITE_URL}guide/en/workplace-search/${DOC_LINK_VERSION}`, + configuration: `${ENTERPRISE_SEARCH_DOCS}configuration.html`, + licenseManagement: `${ENTERPRISE_SEARCH_DOCS}license-management.html`, + mailService: `${ENTERPRISE_SEARCH_DOCS}mailer-configuration.html`, + usersAccess: `${ENTERPRISE_SEARCH_DOCS}users-access.html`, + }, + workplaceSearch: { + box: `${WORKPLACE_SEARCH_DOCS}workplace-search-box-connector.html`, + confluenceCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-cloud-connector.html`, + confluenceServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-confluence-server-connector.html`, + customSources: `${WORKPLACE_SEARCH_DOCS}workplace-search-custom-api-sources.html`, + customSourcePermissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-custom-api-sources.html#custom-api-source-document-level-access-control`, + documentPermissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-sources-document-permissions.html`, + dropbox: `${WORKPLACE_SEARCH_DOCS}workplace-search-dropbox-connector.html`, + externalIdentities: `${WORKPLACE_SEARCH_DOCS}workplace-search-external-identities-api.html`, + gettingStarted: `${WORKPLACE_SEARCH_DOCS}workplace-search-getting-started.html`, + gitHub: `${WORKPLACE_SEARCH_DOCS}workplace-search-github-connector.html`, + gmail: `${WORKPLACE_SEARCH_DOCS}workplace-search-gmail-connector.html`, + googleDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-google-drive-connector.html`, + indexingSchedule: `${WORKPLACE_SEARCH_DOCS}workplace-search-customizing-indexing-rules.html#_indexing_schedule`, + jiraCloud: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-cloud-connector.html`, + jiraServer: `${WORKPLACE_SEARCH_DOCS}workplace-search-jira-server-connector.html`, + nativeAuth: `${WORKPLACE_SEARCH_DOCS}workplace-search-security.html#elasticsearch-native-realm`, + oneDrive: `${WORKPLACE_SEARCH_DOCS}workplace-search-onedrive-connector.html`, + permissions: `${WORKPLACE_SEARCH_DOCS}workplace-search-permissions.html#organizational-sources-private-sources`, + salesforce: `${WORKPLACE_SEARCH_DOCS}workplace-search-salesforce-connector.html`, + security: `${WORKPLACE_SEARCH_DOCS}workplace-search-security.html`, + serviceNow: `${WORKPLACE_SEARCH_DOCS}workplace-search-servicenow-connector.html`, + sharePoint: `${WORKPLACE_SEARCH_DOCS}workplace-search-sharepoint-online-connector.html`, + slack: `${WORKPLACE_SEARCH_DOCS}workplace-search-slack-connector.html`, + standardAuth: `${WORKPLACE_SEARCH_DOCS}workplace-search-security.html#standard`, + synch: `${WORKPLACE_SEARCH_DOCS}workplace-search-customizing-indexing-rules.html`, + zendesk: `${WORKPLACE_SEARCH_DOCS}workplace-search-zendesk-connector.html`, }, metricbeat: { base: `${ELASTIC_WEBSITE_URL}guide/en/beats/metricbeat/${DOC_LINK_VERSION}`, @@ -550,6 +610,9 @@ export interface DocLinksStart { readonly canvas: { readonly guide: string; }; + readonly cloud: { + readonly indexManagement: string; + }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; @@ -581,10 +644,64 @@ export interface DocLinksStart { readonly install: string; readonly start: string; }; + readonly appSearch: { + readonly apiRef: string; + readonly apiClients: string; + readonly apiKeys: string; + readonly authentication: string; + readonly crawlRules: string; + readonly curations: string; + readonly duplicateDocuments: string; + readonly entryPoints: string; + readonly guide: string; + readonly indexingDocuments: string; + readonly indexingDocumentsSchema: string; + readonly logSettings: string; + readonly metaEngines: string; + readonly nativeAuth: string; + readonly precisionTuning: string; + readonly relevanceTuning: string; + readonly resultSettings: string; + readonly searchUI: string; + readonly security: string; + readonly standardAuth: string; + readonly synonyms: string; + readonly webCrawler: string; + readonly webCrawlerEventLogs: string; + }; readonly enterpriseSearch: { - readonly base: string; - readonly appSearchBase: string; - readonly workplaceSearchBase: string; + readonly configuration: string; + readonly licenseManagement: string; + readonly mailService: string; + readonly usersAccess: string; + }; + readonly workplaceSearch: { + readonly box: string; + readonly confluenceCloud: string; + readonly confluenceServer: string; + readonly customSources: string; + readonly customSourcePermissions: string; + readonly documentPermissions: string; + readonly dropbox: string; + readonly externalIdentities: string; + readonly gitHub: string; + readonly gettingStarted: string; + readonly gmail: string; + readonly googleDrive: string; + readonly indexingSchedule: string; + readonly jiraCloud: string; + readonly jiraServer: string; + readonly nativeAuth: string; + readonly oneDrive: string; + readonly permissions: string; + readonly salesforce: string; + readonly security: string; + readonly serviceNow: string; + readonly sharePoint: string; + readonly slack: string; + readonly standardAuth: string; + readonly synch: string; + readonly zendesk: string; }; readonly heartbeat: { readonly base: string; diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 772faa5321d9..cec80af843c4 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -506,6 +506,9 @@ export interface DocLinksStart { readonly canvas: { readonly guide: string; }; + readonly cloud: { + readonly indexManagement: string; + }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; @@ -537,10 +540,64 @@ export interface DocLinksStart { readonly install: string; readonly start: string; }; + readonly appSearch: { + readonly apiRef: string; + readonly apiClients: string; + readonly apiKeys: string; + readonly authentication: string; + readonly crawlRules: string; + readonly curations: string; + readonly duplicateDocuments: string; + readonly entryPoints: string; + readonly guide: string; + readonly indexingDocuments: string; + readonly indexingDocumentsSchema: string; + readonly logSettings: string; + readonly metaEngines: string; + readonly nativeAuth: string; + readonly precisionTuning: string; + readonly relevanceTuning: string; + readonly resultSettings: string; + readonly searchUI: string; + readonly security: string; + readonly standardAuth: string; + readonly synonyms: string; + readonly webCrawler: string; + readonly webCrawlerEventLogs: string; + }; readonly enterpriseSearch: { - readonly base: string; - readonly appSearchBase: string; - readonly workplaceSearchBase: string; + readonly configuration: string; + readonly licenseManagement: string; + readonly mailService: string; + readonly usersAccess: string; + }; + readonly workplaceSearch: { + readonly box: string; + readonly confluenceCloud: string; + readonly confluenceServer: string; + readonly customSources: string; + readonly customSourcePermissions: string; + readonly documentPermissions: string; + readonly dropbox: string; + readonly externalIdentities: string; + readonly gitHub: string; + readonly gettingStarted: string; + readonly gmail: string; + readonly googleDrive: string; + readonly indexingSchedule: string; + readonly jiraCloud: string; + readonly jiraServer: string; + readonly nativeAuth: string; + readonly oneDrive: string; + readonly permissions: string; + readonly salesforce: string; + readonly security: string; + readonly serviceNow: string; + readonly sharePoint: string; + readonly slack: string; + readonly standardAuth: string; + readonly synch: string; + readonly zendesk: string; }; readonly heartbeat: { readonly base: string; diff --git a/src/plugins/console/public/services/history.ts b/src/plugins/console/public/services/history.ts index ee1e97ceb386..972e5283274d 100644 --- a/src/plugins/console/public/services/history.ts +++ b/src/plugins/console/public/services/history.ts @@ -14,9 +14,11 @@ const MAX_NUMBER_OF_HISTORY_ITEMS = 100; export const isQuotaExceededError = (e: Error): boolean => e.name === 'QuotaExceededError'; export class History { - constructor(private readonly storage: Storage) {} + private changeEmitter: BehaviorSubject; - private changeEmitter = new BehaviorSubject(this.getHistory() || []); + constructor(private readonly storage: Storage) { + this.changeEmitter = new BehaviorSubject(this.getHistory() || []); + } getHistoryKeys() { return this.storage diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx index 611a426dd4d7..1e19e495585f 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx @@ -32,7 +32,7 @@ interface State { export class DashboardViewport extends React.Component { static contextType = context; - public readonly context!: DashboardReactContextValue; + public declare readonly context: DashboardReactContextValue; private controlsRoot: React.RefObject; diff --git a/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts b/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts index cfc3ddabe075..58f5cf8e52c9 100644 --- a/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts +++ b/src/plugins/data/public/query/filter_manager/lib/generate_filters.ts @@ -40,7 +40,9 @@ function getExistingFilter( } if (isScriptedPhraseFilter(filter)) { - return filter.meta.field === fieldName && filter.script.script.params?.value === value; + return ( + filter.meta.field === fieldName && filter.query?.script?.script?.params?.value === value + ); } }) as any; } diff --git a/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrase.ts b/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrase.ts index 64576d4978c9..23cae0ee852c 100644 --- a/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrase.ts +++ b/src/plugins/data/public/query/filter_manager/lib/mappers/map_phrase.ts @@ -20,7 +20,7 @@ import { import { FilterValueFormatter } from '../../../../../common'; const getScriptedPhraseValue = (filter: PhraseFilter) => - get(filter, ['script', 'script', 'params', 'value']); + get(filter, ['query', 'script', 'script', 'params', 'value']); const getFormattedValueFn = (value: any) => { return (formatter?: FilterValueFormatter) => { diff --git a/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts b/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts index 8ffeefefd0cc..98ba8b4fbcda 100644 --- a/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts +++ b/src/plugins/input_control_vis/public/control/filter_manager/phrase_filter_manager.ts @@ -97,8 +97,8 @@ export class PhraseFilterManager extends FilterManager { } // scripted field filter - if (_.has(kbnFilter, 'script')) { - return _.get(kbnFilter, 'script.script.params.value'); + if (_.has(kbnFilter, 'query.script')) { + return _.get(kbnFilter, 'query.script.script.params.value'); } // single phrase filter diff --git a/src/plugins/vis_types/vega/public/vega_inspector/vega_adapter.ts b/src/plugins/vis_types/vega/public/vega_inspector/vega_adapter.ts index bc90fe35199b..def7fefd5517 100644 --- a/src/plugins/vis_types/vega/public/vega_inspector/vega_adapter.ts +++ b/src/plugins/vis_types/vega/public/vega_inspector/vega_adapter.ts @@ -6,14 +6,35 @@ * Side Public License, v 1. */ +import { i18n } from '@kbn/i18n'; + import { Observable, ReplaySubject, fromEventPattern, merge, timer } from 'rxjs'; import { map, switchMap, filter, debounce } from 'rxjs/operators'; -import { View, Runtime, Spec } from 'vega'; -import { i18n } from '@kbn/i18n'; -import { Assign } from '@kbn/utility-types'; +import type { View, Spec } from 'vega'; +import type { Assign } from '@kbn/utility-types'; interface DebugValues { - view: View; + view: Assign< + { + _runtime: { + data: Record< + string, + { + values: { + value: Array>; + }; + } + >; + signals: Record< + string, + { + value: unknown; + } + >; + }; + }, + View + >; spec: Spec; } @@ -38,8 +59,11 @@ const vegaAdapterValueLabel = i18n.translate('visTypeVega.inspector.vegaAdapter. /** Get Runtime Scope for Vega View * @link https://vega.github.io/vega/docs/api/debugging/#scope **/ -const getVegaRuntimeScope = (debugValues: DebugValues) => - (debugValues.view as any)._runtime as Runtime; +const getVegaRuntimeScope = (debugValues: DebugValues) => { + const { data, signals } = debugValues.view._runtime ?? {}; + + return { data, signals }; +}; const serializeColumns = (item: Record, columns: string[]) => { const nonSerializableFieldLabel = '(..)'; @@ -69,7 +93,7 @@ export class VegaAdapter { const runtimeScope = getVegaRuntimeScope(debugValues); return Object.keys(runtimeScope.data || []).reduce((acc: InspectDataSets[], key) => { - const value = runtimeScope.data[key].values.value; + const { value } = runtimeScope.data[key].values; if (value && value[0]) { const columns = Object.keys(value[0]); diff --git a/x-pack/plugins/apm/ftr_e2e/apis/fixtures/package_registry_config.yml b/x-pack/plugins/apm/ftr_e2e/apis/fixtures/package_registry_config.yml new file mode 100644 index 000000000000..9f2300dedc82 --- /dev/null +++ b/x-pack/plugins/apm/ftr_e2e/apis/fixtures/package_registry_config.yml @@ -0,0 +1,4 @@ +package_paths: + - /packages/production + - /packages/snapshot + - /packages/test-packages diff --git a/x-pack/plugins/apm/ftr_e2e/ftr_config.ts b/x-pack/plugins/apm/ftr_e2e/ftr_config.ts index 12cc8845264c..84d1c40930c7 100644 --- a/x-pack/plugins/apm/ftr_e2e/ftr_config.ts +++ b/x-pack/plugins/apm/ftr_e2e/ftr_config.ts @@ -6,8 +6,11 @@ */ import { FtrConfigProviderContext } from '@kbn/test'; - import { CA_CERT_PATH } from '@kbn/dev-utils'; + +// Used to spin up a docker container with package registry service that will be used by fleet +export const packageRegistryPort = 1234; + async function config({ readConfigFile }: FtrConfigProviderContext) { const kibanaCommonTestsConfig = await readConfigFile( require.resolve('../../../../test/common/config.js') @@ -38,6 +41,11 @@ async function config({ readConfigFile }: FtrConfigProviderContext) { '--csp.warnLegacyBrowsers=false', // define custom kibana server args here `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, + + // Fleet config + `--xpack.fleet.packages.0.name=endpoint`, + `--xpack.fleet.packages.0.version=latest`, + `--xpack.fleet.registryUrl=http://localhost:${packageRegistryPort}`, ], }, }; diff --git a/x-pack/plugins/apm/ftr_e2e/ftr_config_run.ts b/x-pack/plugins/apm/ftr_e2e/ftr_config_run.ts index 51c859a8477f..a5a0b52e3fbe 100644 --- a/x-pack/plugins/apm/ftr_e2e/ftr_config_run.ts +++ b/x-pack/plugins/apm/ftr_e2e/ftr_config_run.ts @@ -5,16 +5,41 @@ * 2.0. */ -import { FtrConfigProviderContext } from '@kbn/test'; +import { defineDockerServersConfig, FtrConfigProviderContext } from '@kbn/test'; import cypress from 'cypress'; +import path from 'path'; import { cypressStart } from './cypress_start'; +import { packageRegistryPort } from './ftr_config'; import { FtrProviderContext } from './ftr_provider_context'; +export const dockerImage = + 'docker.elastic.co/package-registry/distribution@sha256:13d9996dd24161624784704e080f5f5b7f0ef34ff0d9259f8f05010ccae00058'; + async function ftrConfigRun({ readConfigFile }: FtrConfigProviderContext) { const kibanaConfig = await readConfigFile(require.resolve('./ftr_config.ts')); + + // mount the config file for the package registry + const dockerArgs: string[] = [ + '-v', + `${path.join( + path.dirname(__filename), + './apis/fixtures/package_registry_config.yml' + )}:/package-registry/config.yml`, + ]; + return { ...kibanaConfig.getAll(), testRunner, + dockerServers: defineDockerServersConfig({ + registry: { + enabled: true, + image: dockerImage, + portInContainer: 8080, + port: packageRegistryPort, + args: dockerArgs, + waitForLogLine: 'package manifests loaded', + }, + }), }; } diff --git a/x-pack/plugins/apm/public/components/app/correlations/chart_title_tool_tip.tsx b/x-pack/plugins/apm/public/components/app/correlations/chart_title_tool_tip.tsx new file mode 100644 index 000000000000..ed2bd4985831 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/correlations/chart_title_tool_tip.tsx @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiIconTip } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +export function ChartTitleToolTip() { + return ( + + ); +} diff --git a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx index b2efae74c9c7..c642ca7bd577 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx @@ -18,7 +18,6 @@ import { EuiTitle, EuiBetaBadge, EuiBadge, - EuiText, EuiToolTip, EuiSwitch, EuiIconTip, @@ -27,13 +26,11 @@ import type { EuiTableSortingType } from '@elastic/eui/src/components/basic_tabl import type { Direction } from '@elastic/eui/src/services/sort/sort_direction'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; import { useUiTracker } from '../../../../../observability/public'; import { asPercent } from '../../../../common/utils/formatters'; import { FailedTransactionsCorrelation } from '../../../../common/correlations/failed_transactions_correlations/types'; -import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../common/correlations/constants'; import { FieldStats } from '../../../../common/correlations/field_stats_types'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; @@ -48,18 +45,17 @@ import { CorrelationsTable } from './correlations_table'; import { FailedTransactionsCorrelationsHelpPopover } from './failed_transactions_correlations_help_popover'; import { getFailedTransactionsCorrelationImpactLabel } from './utils/get_failed_transactions_correlation_impact_label'; import { getOverallHistogram } from './utils/get_overall_histogram'; -import { - TransactionDistributionChart, - TransactionDistributionChartData, -} from '../../shared/charts/transaction_distribution_chart'; +import { TransactionDistributionChart } from '../../shared/charts/transaction_distribution_chart'; import { CorrelationsEmptyStatePrompt } from './empty_state_prompt'; import { CrossClusterSearchCompatibilityWarning } from './cross_cluster_search_warning'; import { CorrelationsProgressControls } from './progress_controls'; -import { useTransactionColors } from './use_transaction_colors'; import { CorrelationsContextPopover } from './context_popover'; import { OnAddFilter } from './context_popover/top_values'; import { useFailedTransactionsCorrelations } from './use_failed_transactions_correlations'; +import { getTransactionDistributionChartData } from './get_transaction_distribution_chart_data'; +import { ChartTitleToolTip } from './chart_title_tool_tip'; +import { MIN_TAB_TITLE_HEIGHT } from '../transaction_details/distribution'; export function FailedTransactionsCorrelations({ onFilter, @@ -67,7 +63,6 @@ export function FailedTransactionsCorrelations({ onFilter: () => void; }) { const euiTheme = useTheme(); - const transactionColors = useTransactionColors(); const { core: { notifications }, @@ -427,133 +422,75 @@ export function FailedTransactionsCorrelations({ correlationTerms.length < 1 && (progress.loaded === 1 || !progress.isRunning); - const transactionDistributionChartData: TransactionDistributionChartData[] = - []; - - if (Array.isArray(overallHistogram)) { - transactionDistributionChartData.push({ - id: i18n.translate( - 'xpack.apm.transactionDistribution.chart.allTransactionsLabel', - { defaultMessage: 'All transactions' } - ), - histogram: overallHistogram, - }); - } - - if (Array.isArray(response.errorHistogram)) { - transactionDistributionChartData.push({ - id: i18n.translate( - 'xpack.apm.transactionDistribution.chart.failedTransactionsLabel', - { defaultMessage: 'Failed transactions' } - ), - histogram: response.errorHistogram, - }); - } - - if (selectedTerm && Array.isArray(selectedTerm.histogram)) { - transactionDistributionChartData.push({ - id: `${selectedTerm.fieldName}:${selectedTerm.fieldValue}`, - histogram: selectedTerm.histogram, - }); - } + const transactionDistributionChartData = getTransactionDistributionChartData({ + euiTheme, + allTransactionsHistogram: overallHistogram, + failedTransactionsHistogram: response.errorHistogram, + selectedTerm, + }); return (
- - - - -
- {i18n.translate( - 'xpack.apm.correlations.failedTransactions.panelTitle', - { - defaultMessage: 'Failed transactions latency distribution', - } - )} -
-
-
- - - + + +
+ {i18n.translate( + 'xpack.apm.correlations.failedTransactions.panelTitle', { - defaultMessage: - 'Failed transaction correlations is not GA. Please help us by reporting any bugs.', + defaultMessage: 'Failed transactions latency distribution', } )} - /> - - +
+
+
+ + + + + + + + -
- - {selectedTerm && ( - - , - allTransactions: ( - - - - ), - failedTransactions: ( - - - - ), - focusTransaction: ( - - {selectedTerm?.fieldName}:{selectedTerm?.fieldValue} - - ), - }} - /> - - )} +
diff --git a/x-pack/plugins/apm/public/components/app/correlations/get_transaction_distribution_chart_data.ts b/x-pack/plugins/apm/public/components/app/correlations/get_transaction_distribution_chart_data.ts new file mode 100644 index 000000000000..49ddd8aec0fe --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/correlations/get_transaction_distribution_chart_data.ts @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { EuiTheme } from '../../../../../../../src/plugins/kibana_react/common'; +import type { + FieldValuePair, + HistogramItem, +} from '../../../../common/correlations/types'; +import { TransactionDistributionChartData } from '../../shared/charts/transaction_distribution_chart'; + +export function getTransactionDistributionChartData({ + euiTheme, + allTransactionsHistogram, + failedTransactionsHistogram, + selectedTerm, +}: { + euiTheme: EuiTheme; + allTransactionsHistogram?: HistogramItem[]; + failedTransactionsHistogram?: HistogramItem[]; + selectedTerm?: FieldValuePair & { histogram: HistogramItem[] }; +}) { + const transactionDistributionChartData: TransactionDistributionChartData[] = + []; + + if (Array.isArray(allTransactionsHistogram)) { + transactionDistributionChartData.push({ + id: i18n.translate( + 'xpack.apm.transactionDistribution.chart.allTransactionsLabel', + { defaultMessage: 'All transactions' } + ), + histogram: allTransactionsHistogram, + areaSeriesColor: euiTheme.eui.euiColorVis1, + }); + } + + if (Array.isArray(failedTransactionsHistogram)) { + transactionDistributionChartData.push({ + id: i18n.translate( + 'xpack.apm.transactionDistribution.chart.failedTransactionsLabel', + { defaultMessage: 'Failed transactions' } + ), + histogram: failedTransactionsHistogram, + areaSeriesColor: euiTheme.eui.euiColorVis7, + }); + } + + if (selectedTerm && Array.isArray(selectedTerm.histogram)) { + transactionDistributionChartData.push({ + id: `${selectedTerm.fieldName}:${selectedTerm.fieldValue}`, + histogram: selectedTerm.histogram, + areaSeriesColor: euiTheme.eui.euiColorVis2, + }); + } + + return transactionDistributionChartData; +} diff --git a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx index 629868fb88bf..f79e95559571 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx @@ -15,7 +15,6 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer, - EuiText, EuiTitle, EuiToolTip, } from '@elastic/eui'; @@ -23,22 +22,17 @@ import { Direction } from '@elastic/eui/src/services/sort/sort_direction'; import { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; import { useUiTracker } from '../../../../../observability/public'; import { asPreciseDecimal } from '../../../../common/utils/formatters'; -import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../common/correlations/constants'; import { LatencyCorrelation } from '../../../../common/correlations/latency_correlations/types'; import { FieldStats } from '../../../../common/correlations/field_stats_types'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; -import { - TransactionDistributionChart, - TransactionDistributionChartData, -} from '../../shared/charts/transaction_distribution_chart'; +import { TransactionDistributionChart } from '../../shared/charts/transaction_distribution_chart'; import { push } from '../../shared/Links/url_helpers'; import { CorrelationsTable } from './correlations_table'; @@ -47,18 +41,21 @@ import { getOverallHistogram } from './utils/get_overall_histogram'; import { CorrelationsEmptyStatePrompt } from './empty_state_prompt'; import { CrossClusterSearchCompatibilityWarning } from './cross_cluster_search_warning'; import { CorrelationsProgressControls } from './progress_controls'; -import { useTransactionColors } from './use_transaction_colors'; import { CorrelationsContextPopover } from './context_popover'; import { OnAddFilter } from './context_popover/top_values'; import { useLatencyCorrelations } from './use_latency_correlations'; +import { getTransactionDistributionChartData } from './get_transaction_distribution_chart_data'; +import { useTheme } from '../../../hooks/use_theme'; +import { ChartTitleToolTip } from './chart_title_tool_tip'; +import { MIN_TAB_TITLE_HEIGHT } from '../transaction_details/distribution'; export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { - const transactionColors = useTransactionColors(); - const { core: { notifications }, } = useApmPluginContext(); + const euiTheme = useTheme(); + const { progress, response, startFetch, cancelFetch } = useLatencyCorrelations(); const { overallHistogram, hasData, status } = getOverallHistogram( @@ -274,30 +271,20 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { const showCorrelationsEmptyStatePrompt = histogramTerms.length < 1 && (progress.loaded === 1 || !progress.isRunning); - const transactionDistributionChartData: TransactionDistributionChartData[] = - []; - - if (Array.isArray(overallHistogram)) { - transactionDistributionChartData.push({ - id: i18n.translate( - 'xpack.apm.transactionDistribution.chart.allTransactionsLabel', - { defaultMessage: 'All transactions' } - ), - histogram: overallHistogram, - }); - } - - if (selectedHistogram && Array.isArray(selectedHistogram.histogram)) { - transactionDistributionChartData.push({ - id: `${selectedHistogram.fieldName}:${selectedHistogram.fieldValue}`, - histogram: selectedHistogram.histogram, - }); - } + const transactionDistributionChartData = getTransactionDistributionChartData({ + euiTheme, + allTransactionsHistogram: overallHistogram, + selectedTerm: selectedHistogram, + }); return (
- - + +
{i18n.translate( @@ -309,40 +296,19 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) {
+ + + + +
- {selectedHistogram && ( - - , - allTransactions: ( - - - - ), - focusTransaction: ( - - {selectedHistogram?.fieldName}:{selectedHistogram?.fieldValue} - - ), - }} - /> - - )} - { - const euiTheme = useTheme(); - return { - ALL_TRANSACTIONS: euiTheme.eui.euiColorVis1, - ALL_FAILED_TRANSACTIONS: euiTheme.eui.euiColorVis7, - FOCUS_TRANSACTION: euiTheme.eui.euiColorVis2, - }; -}; diff --git a/x-pack/plugins/apm/public/components/app/trace_overview/trace_list.tsx b/x-pack/plugins/apm/public/components/app/trace_overview/trace_list.tsx index 0fc25b28b60e..58179366fa42 100644 --- a/x-pack/plugins/apm/public/components/app/trace_overview/trace_list.tsx +++ b/x-pack/plugins/apm/public/components/app/trace_overview/trace_list.tsx @@ -5,7 +5,13 @@ * 2.0. */ -import { EuiIcon, EuiToolTip, RIGHT_ALIGNMENT } from '@elastic/eui'; +import { + EuiIcon, + EuiToolTip, + EuiFlexGroup, + EuiFlexItem, + RIGHT_ALIGNMENT, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; @@ -19,6 +25,7 @@ import { EmptyMessage } from '../../shared/EmptyMessage'; import { ImpactBar } from '../../shared/ImpactBar'; import { TransactionDetailLink } from '../../shared/Links/apm/transaction_detail_link'; import { ITableColumn, ManagedTable } from '../../shared/managed_table'; +import { AgentIcon } from '../../shared/agent_icon'; type TraceGroup = APIReturnType<'GET /internal/apm/traces'>['items'][0]; @@ -65,6 +72,14 @@ const traceListColumns: Array> = [ } ), sortable: true, + render: (_: string, { serviceName, agentName }) => ( + + + + + {serviceName} + + ), }, { field: 'averageResponseTime', diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx index e6c189ed0c74..a2f6fd493313 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx @@ -18,18 +18,15 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; import { useUiTracker } from '../../../../../../observability/public'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; -import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../../common/correlations/constants'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; import { TransactionDistributionChart } from '../../../shared/charts/transaction_distribution_chart'; -import { useTransactionColors } from '../../correlations/use_transaction_colors'; import type { TabContentProps } from '../types'; import { useWaterfallFetcher } from '../use_waterfall_fetcher'; @@ -37,10 +34,11 @@ import { WaterfallWithSummary } from '../waterfall_with_summary'; import { useTransactionDistributionChartData } from './use_transaction_distribution_chart_data'; import { HeightRetainer } from '../../../shared/HeightRetainer'; +import { ChartTitleToolTip } from '../../correlations/chart_title_tool_tip'; // Enforce min height so it's consistent across all tabs on the same level // to prevent "flickering" behavior -const MIN_TAB_TITLE_HEIGHT = 56; +export const MIN_TAB_TITLE_HEIGHT = 56; type Selection = [number, number]; @@ -69,7 +67,6 @@ export function TransactionDistribution({ selection, traceSamples, }: TransactionDistributionProps) { - const transactionColors = useTransactionColors(); const { urlParams } = useLegacyUrlParams(); const { waterfall, status: waterfallStatus } = useWaterfallFetcher(); @@ -108,8 +105,12 @@ export function TransactionDistribution({ return (
- - + +
{i18n.translate( @@ -121,93 +122,65 @@ export function TransactionDistribution({
- {hasData && !selection && ( - - - - - - - {emptySelectionText} + + + + + + + + {selection ? ( + + + {i18n.translate( + 'xpack.apm.transactionDetails.distribution.selectionText', + { + defaultMessage: `Selection: {formattedSelection}`, + values: { + formattedSelection: getFormattedSelection(selection), + }, + } + )} + - - - )} - {hasData && selection && ( - - - {i18n.translate( - 'xpack.apm.transactionDetails.distribution.selectionText', - { - defaultMessage: `Selection: {formattedSelection}`, - values: { - formattedSelection: getFormattedSelection(selection), - }, - } - )} - - - )} + ) : ( + <> + + + + + {emptySelectionText} + + + )} + +
- - - - - ), - failedTransactions: ( - - - - ), - }} - /> - - diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/use_transaction_distribution_chart_data.ts b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/use_transaction_distribution_chart_data.ts index a02fc7fe6665..6d690415d8c6 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/use_transaction_distribution_chart_data.ts +++ b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/use_transaction_distribution_chart_data.ts @@ -6,23 +6,20 @@ */ import { useEffect } from 'react'; - import { i18n } from '@kbn/i18n'; - import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../../common/correlations/constants'; import { EVENT_OUTCOME } from '../../../../../common/elasticsearch_fieldnames'; import { EventOutcome } from '../../../../../common/event_outcome'; - import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; import { useFetcher, FETCH_STATUS } from '../../../../hooks/use_fetcher'; - -import type { TransactionDistributionChartData } from '../../../shared/charts/transaction_distribution_chart'; - import { isErrorMessage } from '../../correlations/utils/is_error_message'; import { useFetchParams } from '../../correlations/use_fetch_params'; +import { getTransactionDistributionChartData } from '../../correlations/get_transaction_distribution_chart_data'; +import { useTheme } from '../../../../hooks/use_theme'; export const useTransactionDistributionChartData = () => { const params = useFetchParams(); + const euiTheme = useTheme(); const { core: { notifications }, @@ -122,28 +119,11 @@ export const useTransactionDistributionChartData = () => { } }, [errorHistogramError, notifications.toasts]); - const transactionDistributionChartData: TransactionDistributionChartData[] = - []; - - if (Array.isArray(overallLatencyHistogram)) { - transactionDistributionChartData.push({ - id: i18n.translate( - 'xpack.apm.transactionDistribution.chart.allTransactionsLabel', - { defaultMessage: 'All transactions' } - ), - histogram: overallLatencyHistogram, - }); - } - - if (Array.isArray(errorHistogramData.overallHistogram)) { - transactionDistributionChartData.push({ - id: i18n.translate( - 'xpack.apm.transactionDistribution.chart.failedTransactionsLabel', - { defaultMessage: 'Failed transactions' } - ), - histogram: errorHistogramData.overallHistogram, - }); - } + const transactionDistributionChartData = getTransactionDistributionChartData({ + euiTheme, + allTransactionsHistogram: overallLatencyHistogram, + failedTransactionsHistogram: errorHistogramData.overallHistogram, + }); return { chartData: transactionDistributionChartData, diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx index d5cd423b2b12..b33f152a6301 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx @@ -33,6 +33,7 @@ import { useChartTheme } from '../../../../../../observability/public'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; import type { HistogramItem } from '../../../../../common/correlations/types'; +import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../../common/correlations/constants'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; import { useTheme } from '../../../../hooks/use_theme'; @@ -42,6 +43,7 @@ import { ChartContainer } from '../chart_container'; export interface TransactionDistributionChartData { id: string; histogram: HistogramItem[]; + areaSeriesColor: string; } interface TransactionDistributionChartProps { @@ -49,9 +51,7 @@ interface TransactionDistributionChartProps { hasData: boolean; markerCurrentTransaction?: number; markerValue: number; - markerPercentile: number; onChartSelection?: BrushEndListener; - palette?: string[]; selection?: [number, number]; status: FETCH_STATUS; } @@ -98,19 +98,13 @@ export function TransactionDistributionChart({ hasData, markerCurrentTransaction, markerValue, - markerPercentile, onChartSelection, - palette, selection, status, }: TransactionDistributionChartProps) { const chartTheme = useChartTheme(); const euiTheme = useTheme(); - - const areaSeriesColors = palette ?? [ - euiTheme.eui.euiColorVis1, - euiTheme.eui.euiColorVis2, - ]; + const markerPercentile = DEFAULT_PERCENTILE_THRESHOLD; const annotationsDataValues: LineAnnotationDatum[] = [ { @@ -265,7 +259,7 @@ export function TransactionDistributionChart({ curve={CurveType.CURVE_STEP_AFTER} xAccessor="key" yAccessors={['doc_count']} - color={areaSeriesColors[i]} + color={d.areaSeriesColor} fit="lookahead" // To make the area appear without the orphaned points technique, // we changed the original data to replace values of 0 with 0.0001. diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/lib/transaction_groups/__snapshots__/queries.test.ts.snap index 17c43e36e5cc..00440b2b5185 100644 --- a/x-pack/plugins/apm/server/lib/transaction_groups/__snapshots__/queries.test.ts.snap +++ b/x-pack/plugins/apm/server/lib/transaction_groups/__snapshots__/queries.test.ts.snap @@ -18,6 +18,9 @@ Array [ Object { "field": "transaction.type", }, + Object { + "field": "agent.name", + }, ], "sort": Object { "@timestamp": "desc", @@ -228,6 +231,9 @@ Array [ Object { "field": "transaction.type", }, + Object { + "field": "agent.name", + }, ], "sort": Object { "@timestamp": "desc", diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts b/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts index aea92d06b758..bca71ed71b1f 100644 --- a/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts +++ b/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts @@ -31,7 +31,7 @@ import { } from '../helpers/transactions'; import { Setup } from '../helpers/setup_request'; import { getAverages, getCounts, getSums } from './get_transaction_group_stats'; - +import { AgentName } from '../../../typings/es_schemas/ui/fields/agent'; export interface TopTraceOptions { environment: string; kuery: string; @@ -51,6 +51,7 @@ export interface TransactionGroup { averageResponseTime: number | null | undefined; transactionsPerMinute: number; impact: number; + agentName: AgentName; } export type ESResponse = Promise<{ items: TransactionGroup[] }>; @@ -142,6 +143,7 @@ function getItemsWithRelativeImpact( avg?: number | null; count?: number | null; transactionType?: string; + agentName?: AgentName; }>, start: number, end: number @@ -166,6 +168,7 @@ function getItemsWithRelativeImpact( item.sum !== null && item.sum !== undefined ? ((item.sum - min) / (max - min)) * 100 || 0 : 0, + agentName: item.agentName as AgentName, }; }); diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/get_transaction_group_stats.ts b/x-pack/plugins/apm/server/lib/transaction_groups/get_transaction_group_stats.ts index c79dde721d13..fd638a6731c6 100644 --- a/x-pack/plugins/apm/server/lib/transaction_groups/get_transaction_group_stats.ts +++ b/x-pack/plugins/apm/server/lib/transaction_groups/get_transaction_group_stats.ts @@ -7,11 +7,14 @@ import { merge } from 'lodash'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { TRANSACTION_TYPE } from '../../../common/elasticsearch_fieldnames'; +import { + TRANSACTION_TYPE, + AGENT_NAME, +} from '../../../common/elasticsearch_fieldnames'; import { arrayUnionToCallable } from '../../../common/utils/array_union_to_callable'; import { TransactionGroupRequestBase, TransactionGroupSetup } from './fetcher'; import { getTransactionDurationFieldForTransactions } from '../helpers/transactions'; - +import { AgentName } from '../../../typings/es_schemas/ui/fields/agent'; interface MetricParams { request: TransactionGroupRequestBase; setup: TransactionGroupSetup; @@ -79,6 +82,9 @@ export async function getCounts({ request, setup }: MetricParams) { { field: TRANSACTION_TYPE, } as const, + { + field: AGENT_NAME, + } as const, ], }, }, @@ -98,6 +104,9 @@ export async function getCounts({ request, setup }: MetricParams) { transactionType: bucket.transaction_type.top[0].metrics[ TRANSACTION_TYPE ] as string, + agentName: bucket.transaction_type.top[0].metrics[ + AGENT_NAME + ] as AgentName, }; }); } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/empty_state.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/empty_state.test.tsx index 19f45ced5dc5..cb1c34a19c01 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/empty_state.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/empty_state.test.tsx @@ -11,6 +11,8 @@ import { shallow } from 'enzyme'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; +import { docLinks } from '../../../../shared/doc_links'; + import { EmptyState } from './'; describe('EmptyState', () => { @@ -21,7 +23,7 @@ describe('EmptyState', () => { expect(wrapper.find('h2').text()).toEqual('No API events in the last 24 hours'); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('/api-reference.html') + expect.stringContaining(docLinks.appSearchApis) ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/empty_state.tsx index 76bd0cba1731..c78bf3e91873 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/empty_state.tsx @@ -8,9 +8,10 @@ import React from 'react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; + import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../../routes'; +import { API_DOCS_URL } from '../../../routes'; export const EmptyState: React.FC = () => ( (

} actions={ - + {i18n.translate('xpack.enterpriseSearch.appSearch.engine.apiLogs.empty.buttonLabel', { defaultMessage: 'View the API reference', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_rules_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_rules_table.tsx index d447db60fb25..bef8ed4462fd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_rules_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_rules_table.tsx @@ -27,7 +27,7 @@ import { clearFlashMessages, flashSuccessToast } from '../../../../shared/flash_ import { GenericEndpointInlineEditableTable } from '../../../../shared/tables/generic_endpoint_inline_editable_table'; import { InlineEditableTableColumn } from '../../../../shared/tables/inline_editable_table/types'; import { ItemWithAnID } from '../../../../shared/tables/types'; -import { DOCS_PREFIX } from '../../../routes'; +import { CRAWL_RULES_DOCS_URL } from '../../../routes'; import { CrawlerSingleDomainLogic } from '../crawler_single_domain_logic'; import { CrawlerPolicies, @@ -53,11 +53,7 @@ const DEFAULT_DESCRIPTION = ( defaultMessage="Create a crawl rule to include or exclude pages whose URL matches the rule. Rules run in sequential order, and each URL is evaluated according to the first match. {link}" values={{ link: ( - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.crawler.crawlRulesTable.descriptionLinkText', { defaultMessage: 'Learn more about crawl rules' } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/deduplication_panel/deduplication_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/deduplication_panel/deduplication_panel.tsx index ea894e2b00ac..26794d042135 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/deduplication_panel/deduplication_panel.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/deduplication_panel/deduplication_panel.tsx @@ -27,7 +27,7 @@ import { EuiSelectableLIOption } from '@elastic/eui/src/components/selectable/se import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { DOCS_PREFIX } from '../../../../routes'; +import { DUPLICATE_DOCS_URL } from '../../../../routes'; import { DataPanel } from '../../../data_panel'; import { CrawlerSingleDomainLogic } from '../../crawler_single_domain_logic'; @@ -84,11 +84,7 @@ export const DeduplicationPanel: React.FC = () => { documents on this domain. {documentationLink}." values={{ documentationLink: ( - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.crawler.deduplicationPanel.learnMoreMessage', { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.tsx index aaf3cc451606..4fc7a0569ba0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/entry_points_table.tsx @@ -17,7 +17,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { GenericEndpointInlineEditableTable } from '../../../../shared/tables/generic_endpoint_inline_editable_table'; import { InlineEditableTableColumn } from '../../../../shared/tables/inline_editable_table/types'; import { ItemWithAnID } from '../../../../shared/tables/types'; -import { DOCS_PREFIX } from '../../../routes'; +import { ENTRY_POINTS_DOCS_URL } from '../../../routes'; import { CrawlerDomain, EntryPoint } from '../types'; import { EntryPointsTableLogic } from './entry_points_table_logic'; @@ -80,11 +80,7 @@ export const EntryPointsTable: React.FC = ({ defaultMessage: 'Include the most important URLs for your website here. Entry point URLs will be the first pages to be indexed and processed for links to other pages.', })}{' '} - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.crawler.entryPointsTable.learnMoreLinkText', { defaultMessage: 'Learn more about entry points.' } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/automatic_crawl_scheduler.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/automatic_crawl_scheduler.tsx index 5f7200cb826d..128dcdcb778c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/automatic_crawl_scheduler.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/manage_crawls_popover/automatic_crawl_scheduler.tsx @@ -37,7 +37,7 @@ import { } from '../../../../..//shared/constants/units'; import { CANCEL_BUTTON_LABEL, SAVE_BUTTON_LABEL } from '../../../../../shared/constants'; -import { DOCS_PREFIX } from '../../../../routes'; +import { WEB_CRAWLER_DOCS_URL } from '../../../../routes'; import { CrawlUnits } from '../../types'; import { AutomaticCrawlSchedulerLogic } from './automatic_crawl_scheduler_logic'; @@ -81,7 +81,7 @@ export const AutomaticCrawlScheduler: React.FC = () => { defaultMessage="Don't worry about it, we'll start a crawl for you. {readMoreMessage}." values={{ readMoreMessage: ( - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.crawler.automaticCrawlSchedule.readMoreLink', { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx index 6c3cb51111ae..c84deb3cb0c9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx @@ -13,7 +13,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiSpacer, EuiText, EuiTitle } from import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../routes'; +import { WEB_CRAWLER_DOCS_URL, WEB_CRAWLER_LOG_DOCS_URL } from '../../routes'; import { getEngineBreadcrumbs } from '../engine'; import { AppSearchPageTemplate } from '../layout'; @@ -77,7 +77,7 @@ export const CrawlerOverview: React.FC = () => { defaultMessage: "Easily index your website's content. To get started, enter your domain name, provide optional entry points and crawl rules, and we will handle the rest.", })}{' '} - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.crawler.empty.crawlerDocumentationLinkDescription', { @@ -114,11 +114,7 @@ export const CrawlerOverview: React.FC = () => { defaultMessage: "Recent crawl requests are logged here. Using the request ID of each crawl, you can track progress and examine crawl events in Kibana's Discover or Logs user interfaces.", })}{' '} - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.crawler.configurationDocumentationLinkDescription', { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/constants.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/constants.ts index 6a5f3df0e86f..315b4d864b3f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/constants.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/constants.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../routes'; +import { AUTHENTICATION_DOCS_URL } from '../../routes'; export const CREDENTIALS_TITLE = i18n.translate( 'xpack.enterpriseSearch.appSearch.credentials.title', @@ -109,4 +109,4 @@ export const TOKEN_TYPE_INFO = [ export const FLYOUT_ARIA_LABEL_ID = 'credentialsFlyoutTitle'; -export const DOCS_HREF = `${DOCS_PREFIX}/authentication.html`; +export const DOCS_HREF = AUTHENTICATION_DOCS_URL; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_list/credentials_list.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_list/credentials_list.tsx index 040f313b1220..3ea2c022ec48 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_list/credentials_list.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/credentials/credentials_list/credentials_list.tsx @@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n'; import { EDIT_BUTTON_LABEL, DELETE_BUTTON_LABEL } from '../../../../shared/constants'; import { HiddenText } from '../../../../shared/hidden_text'; import { convertMetaToPagination, handlePageChange } from '../../../../shared/table_pagination'; -import { DOCS_PREFIX } from '../../../routes'; +import { API_KEYS_DOCS_URL } from '../../../routes'; import { TOKEN_TYPE_DISPLAY_NAMES } from '../constants'; import { CredentialsLogic } from '../credentials_logic'; import { ApiToken } from '../types'; @@ -141,12 +141,7 @@ export const CredentialsList: React.FC = () => { defaultMessage: 'Allow applications to access Elastic App Search on your behalf.', })} actions={ - + {i18n.translate('xpack.enterpriseSearch.appSearch.credentials.empty.buttonLabel', { defaultMessage: 'Learn about API keys', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/empty_state.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/empty_state.test.tsx index 60ae386bea58..69c2cc4b987b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/empty_state.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/empty_state.test.tsx @@ -11,6 +11,8 @@ import { shallow } from 'enzyme'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; +import { docLinks } from '../../../../shared/doc_links'; + import { EmptyState } from './'; describe('EmptyState', () => { @@ -21,7 +23,7 @@ describe('EmptyState', () => { expect(wrapper.find('h2').text()).toEqual('Create your first curation'); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('/curations-guide.html') + expect.stringContaining(docLinks.appSearchCurations) ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/empty_state.tsx index 872a7282136e..10d81f162395 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/components/empty_state.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../../routes'; +import { CURATIONS_DOCS_URL } from '../../../routes'; export const EmptyState: React.FC = () => ( (

} actions={ - + {i18n.translate('xpack.enterpriseSearch.appSearch.engine.curations.empty.buttonLabel', { defaultMessage: 'Read the curations guide', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.test.tsx index 4b4e11c31d4b..b95ae0bca5bf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.test.tsx @@ -19,6 +19,8 @@ import { EuiButtonEmpty, EuiCallOut, EuiSwitch } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test/jest'; +import { docLinks } from '../../../../../shared/doc_links'; + import { Loading } from '../../../../../shared/loading'; import { EuiButtonTo } from '../../../../../shared/react_router_helpers'; import { DataPanel } from '../../../data_panel'; @@ -227,7 +229,7 @@ describe('CurationsSettings', () => { const wrapper = shallow(); expect(wrapper.is(DataPanel)).toBe(true); expect(wrapper.prop('action').props.to).toEqual('/app/management/stack/license_management'); - expect(wrapper.find(EuiButtonEmpty).prop('href')).toEqual('/license-management.html'); + expect(wrapper.find(EuiButtonEmpty).prop('href')).toEqual(docLinks.licenseManagement); }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.tsx index d78ca852ee7d..ffefea96d3a2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.tsx @@ -110,11 +110,7 @@ export const CurationsSettings: React.FC = () => { } > - + {i18n.translate('xpack.enterpriseSearch.curations.settings.licenseUpgradeLink', { defaultMessage: 'Learn more about license upgrades', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/creation_mode_components/api_code_example.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/creation_mode_components/api_code_example.tsx index 793c6250d859..e86b06b423a9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/creation_mode_components/api_code_example.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/creation_mode_components/api_code_example.tsx @@ -30,7 +30,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { CANCEL_BUTTON_LABEL } from '../../../../shared/constants'; import { getEnterpriseSearchUrl } from '../../../../shared/enterprise_search_url'; -import { DOCS_PREFIX } from '../../../routes'; +import { API_CLIENTS_DOCS_URL, INDEXING_DOCS_URL } from '../../../routes'; import { EngineLogic } from '../../engine'; import { EngineDetails } from '../../engine/types'; @@ -74,12 +74,12 @@ export const FlyoutBody: React.FC = () => { defaultMessage="The {documentsApiLink} can be used to add new documents to your engine, update documents, retrieve documents by id, and delete documents. There are a variety of {clientLibrariesLink} to help you get started." values={{ documentsApiLink: ( - + documents API ), clientLibrariesLink: ( - + client libraries ), diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_buttons.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_buttons.tsx index 5366c00c0e7f..a8179f297644 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_buttons.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_buttons.tsx @@ -27,7 +27,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { parseQueryParams } from '../../../shared/query_params'; import { EuiCardTo } from '../../../shared/react_router_helpers'; -import { DOCS_PREFIX, ENGINE_CRAWLER_PATH } from '../../routes'; +import { INDEXING_DOCS_URL, ENGINE_CRAWLER_PATH } from '../../routes'; import { generateEnginePath } from '../engine'; import { DocumentCreationLogic } from './'; @@ -66,7 +66,7 @@ export const DocumentCreationButtons: React.FC = ({ disabled = false }) = jsonCode: .json, postCode: POST, documentsApiLink: ( - + documents API ), diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/components/empty_state.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/components/empty_state.test.tsx index 907dcf8c9c20..b8bb26fa9ad6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/components/empty_state.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/components/empty_state.test.tsx @@ -11,6 +11,8 @@ import { shallow } from 'enzyme'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; +import { docLinks } from '../../../../shared/doc_links'; + import { EmptyState } from './'; describe('EmptyState', () => { @@ -21,7 +23,7 @@ describe('EmptyState', () => { expect(wrapper.find('h2').text()).toEqual('Add your first documents'); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('/indexing-documents-guide.html') + expect.stringContaining(docLinks.appSearchIndexingDocs) ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/components/empty_state.tsx index 39fe02a84854..85e834b32075 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/documents/components/empty_state.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../../routes'; +import { INDEXING_DOCS_URL } from '../../../routes'; export const EmptyState = () => ( (

} actions={ - + {i18n.translate('xpack.enterpriseSearch.appSearch.engine.documents.empty.buttonLabel', { defaultMessage: 'Read the documents guide', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_empty.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_empty.test.tsx index 6750ebf1140e..54bc7fb26e9d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_empty.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_empty.test.tsx @@ -33,7 +33,7 @@ describe('EmptyEngineOverview', () => { it('renders a documentation link', () => { expect(getPageHeaderActions(wrapper).find(EuiButton).prop('href')).toEqual( - `${docLinks.appSearchBase}/index.html` + docLinks.appSearchGuide ); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_empty.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_empty.tsx index 6f8332e1e332..ada2df654d52 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_empty.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_overview_empty.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../routes'; +import { DOCS_URL } from '../../routes'; import { DocumentCreationButtons, DocumentCreationFlyout } from '../document_creation'; import { getEngineBreadcrumbs } from '../engine'; @@ -26,7 +26,7 @@ export const EmptyEngineOverview: React.FC = () => { { defaultMessage: 'Engine setup' } ), rightSideItems: [ - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.overview.empty.headingAction', { defaultMessage: 'View documentation' } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_meta_engines_state.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_meta_engines_state.test.tsx index 8b4f5a69b814..350412825b99 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_meta_engines_state.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_meta_engines_state.test.tsx @@ -11,6 +11,8 @@ import { shallow } from 'enzyme'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; +import { docLinks } from '../../../../shared/doc_links'; + import { EmptyMetaEnginesState } from './'; describe('EmptyMetaEnginesState', () => { @@ -21,7 +23,7 @@ describe('EmptyMetaEnginesState', () => { expect(wrapper.find('h3').text()).toEqual('Create your first meta engine'); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('/meta-engines-guide.html') + expect.stringContaining(docLinks.appSearchMetaEngines) ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_meta_engines_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_meta_engines_state.tsx index ad96f21022f2..3cf461e3f7d4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_meta_engines_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/empty_meta_engines_state.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../../routes'; +import { META_ENGINES_DOCS_URL } from '../../../routes'; export const EmptyMetaEnginesState: React.FC = () => ( (

} actions={ - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.engines.metaEngines.emptyPromptButtonLabel', { defaultMessage: 'Learn more about meta engines' } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/constants.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/constants.tsx index 8fbbf406cf5d..bf2a122ead42 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/constants.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/constants.tsx @@ -11,7 +11,7 @@ import { EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { DOCS_PREFIX } from '../../routes'; +import { META_ENGINES_DOCS_URL } from '../../routes'; import { META_ENGINE_CREATION_FORM_META_ENGINE_DESCRIPTION, META_ENGINE_CREATION_FORM_DOCUMENTATION_LINK, @@ -40,7 +40,7 @@ export const META_ENGINES_DESCRIPTION = ( defaultMessage="{readDocumentationLink} for more information or upgrade to a Platinum license to get started." values={{ readDocumentationLink: ( - + {META_ENGINE_CREATION_FORM_DOCUMENTATION_LINK} ), diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/constants.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/constants.tsx index af7b6f3201b3..e41809054e12 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/constants.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/constants.tsx @@ -11,7 +11,7 @@ import { EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { DOCS_PREFIX } from '../../routes'; +import { META_ENGINES_DOCS_URL } from '../../routes'; export const DEFAULT_LANGUAGE = 'Universal'; @@ -57,7 +57,7 @@ export const META_ENGINE_CREATION_FORM_DOCUMENTATION_DESCRIPTION = ( defaultMessage="{documentationLink} for information about how to get started." values={{ documentationLink: ( - + {META_ENGINE_CREATION_FORM_DOCUMENTATION_LINK} ), diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/empty_state.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/empty_state.test.tsx index a60f68c19f6d..454437a203bc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/empty_state.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/empty_state.test.tsx @@ -11,6 +11,8 @@ import { shallow } from 'enzyme'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; +import { docLinks } from '../../../../shared/doc_links'; + import { EmptyState } from './'; describe('EmptyState', () => { @@ -21,7 +23,7 @@ describe('EmptyState', () => { expect(wrapper.find('h2').text()).toEqual('Add documents to tune relevance'); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('/relevance-tuning-guide.html') + expect.stringContaining(docLinks.appSearchRelevance) ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/empty_state.tsx index df29010bd682..f17f7a582efd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/empty_state.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../../routes'; +import { RELEVANCE_DOCS_URL } from '../../../routes'; export const EmptyState: React.FC = () => ( ( } )} actions={ - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.empty.buttonLabel', { defaultMessage: 'Read the relevance tuning guide' } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.test.tsx index 3be30b77bc2e..0554b31c8835 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.test.tsx @@ -11,6 +11,8 @@ import React from 'react'; import { shallow, ShallowWrapper } from 'enzyme'; +import { docLinks } from '../../../../../shared/doc_links'; + import { rerender } from '../../../../../test_helpers'; import { STEP_DESCRIPTIONS } from './constants'; @@ -82,7 +84,7 @@ describe('PrecisionSlider', () => { it('contains a documentation link', () => { const documentationLink = wrapper.find('[data-test-subj="documentationLink"]'); - expect(documentationLink.prop('href')).toContain('/precision-tuning.html'); + expect(documentationLink.prop('href')).toContain(docLinks.appSearchPrecision); expect(documentationLink.prop('target')).toEqual('_blank'); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.tsx index 8e7a59c290ce..e4b2027aa3d6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/components/precision_slider/precision_slider.tsx @@ -21,7 +21,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../../../routes'; +import { PRECISION_DOCS_URL } from '../../../../routes'; import { RelevanceTuningLogic } from '../../relevance_tuning_logic'; import { STEP_DESCRIPTIONS } from './constants'; @@ -57,11 +57,7 @@ export const PrecisionSlider: React.FC = () => { defaultMessage: 'Fine tune the precision vs. recall settings on your engine.', } )}{' '} - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.precisionSlider.learnMore.link', { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_callouts.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_callouts.tsx index d8963b33b8ab..463c61fb60c9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_callouts.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_callouts.tsx @@ -14,7 +14,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLinkTo } from '../../../shared/react_router_helpers'; -import { DOCS_PREFIX, ENGINE_SCHEMA_PATH } from '../../routes'; +import { META_ENGINES_DOCS_URL, ENGINE_SCHEMA_PATH } from '../../routes'; import { EngineLogic, generateEnginePath } from '../engine'; import { RelevanceTuningLogic } from '.'; @@ -98,7 +98,7 @@ export const RelevanceTuningCallouts: React.FC = () => { values={{ schemaFieldsWithConflictsCount, link: ( - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.relevanceTuning.whatsThisLinkLabel', { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/components/empty_state.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/components/empty_state.test.tsx index 537fd9ec6a0d..8798c1a4bc52 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/components/empty_state.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/components/empty_state.test.tsx @@ -11,6 +11,8 @@ import { shallow } from 'enzyme'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; +import { docLinks } from '../../../../shared/doc_links'; + import { EmptyState } from './'; describe('EmptyState', () => { @@ -21,7 +23,7 @@ describe('EmptyState', () => { expect(wrapper.find('h2').text()).toEqual('Add documents to adjust settings'); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('/result-settings-guide.html') + expect.stringContaining(docLinks.appSearchResultSettings) ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/components/empty_state.tsx index dae8390a35fd..7f91447b910b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result_settings/components/empty_state.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../../routes'; +import { RESULT_SETTINGS_DOCS_URL } from '../../../routes'; export const EmptyState: React.FC = () => ( ( } )} actions={ - + {i18n.translate( 'xpack.enterpriseSearch.appSearch.engine.resultSettings.empty.buttonLabel', { defaultMessage: 'Read the result settings guide' } diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.tsx index 3e692aa48623..e2021ac582d0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/role_mappings/role_mappings.tsx @@ -22,7 +22,7 @@ import { } from '../../../shared/role_mapping'; import { ROLE_MAPPINGS_TITLE } from '../../../shared/role_mapping/constants'; -import { DOCS_PREFIX } from '../../routes'; +import { SECURITY_DOCS_URL } from '../../routes'; import { AppSearchPageTemplate } from '../layout'; import { ROLE_MAPPINGS_ENGINE_ACCESS_HEADING } from './constants'; @@ -30,8 +30,6 @@ import { RoleMapping } from './role_mapping'; import { RoleMappingsLogic } from './role_mappings_logic'; import { User } from './user'; -const ROLES_DOCS_LINK = `${DOCS_PREFIX}/security-and-users.html`; - export const RoleMappings: React.FC = () => { const { enableRoleBasedAccess, @@ -60,7 +58,7 @@ export const RoleMappings: React.FC = () => { const rolesEmptyState = ( ); @@ -69,7 +67,7 @@ export const RoleMappings: React.FC = () => {
initializeRoleMapping()} /> { expect(wrapper.find('h2').text()).toEqual('Create a schema'); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('#indexing-documents-guide-schema') + expect.stringContaining(docLinks.appSearchIndexingDocsSchema) ); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/empty_state.tsx index ad9285c7b8fe..3c2d5fc4df66 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/schema/components/empty_state.tsx @@ -13,7 +13,7 @@ import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { SchemaAddFieldModal } from '../../../../shared/schema'; -import { DOCS_PREFIX } from '../../../routes'; +import { INDEXING_SCHEMA_DOCS_URL } from '../../../routes'; import { SchemaLogic } from '../schema_logic'; export const EmptyState: React.FC = () => { @@ -40,12 +40,7 @@ export const EmptyState: React.FC = () => {

} actions={ - + {i18n.translate('xpack.enterpriseSearch.appSearch.engine.schema.empty.buttonLabel', { defaultMessage: 'Read the indexing schema guide', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/components/empty_state.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/components/empty_state.test.tsx index 39f0cb376b32..3466542c0973 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/components/empty_state.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/components/empty_state.test.tsx @@ -11,6 +11,8 @@ import { shallow } from 'enzyme'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; +import { docLinks } from '../../../../shared/doc_links'; + import { EmptyState } from './empty_state'; describe('EmptyState', () => { @@ -21,7 +23,7 @@ describe('EmptyState', () => { expect(wrapper.find('h2').text()).toEqual('Add documents to generate a Search UI'); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('/reference-ui-guide.html') + expect.stringContaining(docLinks.appSearchSearchUI) ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/components/empty_state.tsx index b7665a58de30..9a663e137221 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/components/empty_state.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../../routes'; +import { SEARCH_UI_DOCS_URL } from '../../../routes'; export const EmptyState: React.FC = () => ( (

} actions={ - + {i18n.translate('xpack.enterpriseSearch.appSearch.engine.searchUI.empty.buttonLabel', { defaultMessage: 'Read the Search UI guide', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui.tsx index 2b210bd07ab4..43ea60fa8461 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui.tsx @@ -12,7 +12,7 @@ import { useActions, useValues } from 'kea'; import { EuiText, EuiFlexItem, EuiFlexGroup, EuiSpacer, EuiLink } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { DOCS_PREFIX } from '../../routes'; +import { SEARCH_UI_DOCS_URL } from '../../routes'; import { EngineLogic, getEngineBreadcrumbs } from '../engine'; import { AppSearchPageTemplate } from '../layout'; @@ -62,7 +62,7 @@ export const SearchUI: React.FC = () => { defaultMessage="Use the fields below to generate a sample search experience built with Search UI. Use the sample to preview search results, or build upon it to create your own custom search experience. {link}." values={{ link: ( - + { defaultMessage: 'Log retention is determined by the ILM policies for your deployment.', })}
- + {i18n.translate('xpack.enterpriseSearch.appSearch.settings.logRetention.learnMore', { defaultMessage: 'Learn more about log retention for Enterprise Search.', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx index d460132dddbb..f1d9beaca513 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx @@ -15,7 +15,7 @@ import { APP_SEARCH_PLUGIN } from '../../../../../common/constants'; import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; import { SetupGuideLayout, SETUP_GUIDE_TITLE } from '../../../shared/setup_guide'; import { SendAppSearchTelemetry as SendTelemetry } from '../../../shared/telemetry'; -import { DOCS_PREFIX } from '../../routes'; +import { NATIVE_AUTH_DOCS_URL, STANDARD_AUTH_DOCS_URL } from '../../routes'; import GettingStarted from './assets/getting_started.png'; @@ -23,8 +23,8 @@ export const SetupGuide: React.FC = () => ( diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/empty_state.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/empty_state.test.tsx index a43f170e5822..cdfdbadf6759 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/empty_state.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/empty_state.test.tsx @@ -11,6 +11,8 @@ import { shallow } from 'enzyme'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; +import { docLinks } from '../../../../shared/doc_links'; + import { EmptyState, SynonymModal } from './'; describe('EmptyState', () => { @@ -21,7 +23,7 @@ describe('EmptyState', () => { expect(wrapper.find('h2').text()).toEqual('Create your first synonym set'); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('/synonyms-guide.html') + expect.stringContaining(docLinks.appSearchSynonyms) ); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/empty_state.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/empty_state.tsx index f856a5c035f8..ac8383ccea9e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/empty_state.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/empty_state.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { DOCS_PREFIX } from '../../../routes'; +import { SYNONYMS_DOCS_URL } from '../../../routes'; import { SynonymModal, SynonymIcon } from './'; @@ -35,12 +35,7 @@ export const EmptyState: React.FC = () => {

} actions={ - + {i18n.translate('xpack.enterpriseSearch.appSearch.engine.synonyms.empty.buttonLabel', { defaultMessage: 'Read the synonyms guide', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/routes.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/routes.ts index 97a9b407b3cd..1f2e7c883e1c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/routes.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/routes.ts @@ -7,7 +7,29 @@ import { docLinks } from '../shared/doc_links'; -export const DOCS_PREFIX = docLinks.appSearchBase; +export const API_DOCS_URL = docLinks.appSearchApis; +export const API_CLIENTS_DOCS_URL = docLinks.appSearchApiClients; +export const API_KEYS_DOCS_URL = docLinks.appSearchApiKeys; +export const AUTHENTICATION_DOCS_URL = docLinks.appSearchAuthentication; +export const CRAWL_RULES_DOCS_URL = docLinks.appSearchCrawlRules; +export const CURATIONS_DOCS_URL = docLinks.appSearchCurations; +export const DOCS_URL = docLinks.appSearchGuide; +export const DUPLICATE_DOCS_URL = docLinks.appSearchDuplicateDocuments; +export const ENTRY_POINTS_DOCS_URL = docLinks.appSearchEntryPoints; +export const INDEXING_DOCS_URL = docLinks.appSearchIndexingDocs; +export const INDEXING_SCHEMA_DOCS_URL = docLinks.appSearchIndexingDocsSchema; +export const LOG_SETTINGS_DOCS_URL = docLinks.appSearchLogSettings; +export const META_ENGINES_DOCS_URL = docLinks.appSearchMetaEngines; +export const NATIVE_AUTH_DOCS_URL = docLinks.appSearchNativeAuth; +export const PRECISION_DOCS_URL = docLinks.appSearchPrecision; +export const RELEVANCE_DOCS_URL = docLinks.appSearchRelevance; +export const RESULT_SETTINGS_DOCS_URL = docLinks.appSearchResultSettings; +export const SEARCH_UI_DOCS_URL = docLinks.appSearchSearchUI; +export const SECURITY_DOCS_URL = docLinks.appSearchSecurity; +export const STANDARD_AUTH_DOCS_URL = docLinks.appSearchStandardAuth; +export const SYNONYMS_DOCS_URL = docLinks.appSearchSynonyms; +export const WEB_CRAWLER_DOCS_URL = docLinks.appSearchWebCrawler; +export const WEB_CRAWLER_LOG_DOCS_URL = docLinks.appSearchWebCrawlerEventLogs; export const ROOT_PATH = '/'; export const SETUP_GUIDE_PATH = '/setup_guide'; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/setup_guide/setup_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/setup_guide/setup_guide.tsx index e82dbcaa4113..c7c85fdd4935 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/setup_guide/setup_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/setup_guide/setup_guide.tsx @@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { ENTERPRISE_SEARCH_PLUGIN } from '../../../../../common/constants'; -import { DOCS_PREFIX } from '../../../app_search/routes'; +import { NATIVE_AUTH_DOCS_URL, STANDARD_AUTH_DOCS_URL } from '../../../app_search/routes'; import { SetEnterpriseSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; import { SetupGuideLayout, SETUP_GUIDE_TITLE } from '../../../shared/setup_guide'; import { SendEnterpriseSearchTelemetry as SendTelemetry } from '../../../shared/telemetry'; @@ -23,8 +23,8 @@ export const SetupGuide: React.FC = () => ( diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.test.ts index cbd7a1c6107b..b14af1c69795 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.test.ts @@ -5,27 +5,23 @@ * 2.0. */ +import { docLinksServiceMock } from '../../../../../../../src/core/public/mocks'; + import { docLinks } from './'; describe('DocLinks', () => { it('setDocLinks', () => { const links = { - DOC_LINK_VERSION: '', - ELASTIC_WEBSITE_URL: 'https://elastic.co/', - links: { - enterpriseSearch: { - base: 'http://elastic.enterprise.search', - appSearchBase: 'http://elastic.app.search', - workplaceSearchBase: 'http://elastic.workplace.search', - }, - }, + DOC_LINK_VERSION: docLinksServiceMock.createStartContract().DOC_LINK_VERSION, + ELASTIC_WEBSITE_URL: docLinksServiceMock.createStartContract().ELASTIC_WEBSITE_URL, + links: docLinksServiceMock.createStartContract().links, }; docLinks.setDocLinks(links as any); - expect(docLinks.enterpriseSearchBase).toEqual('http://elastic.enterprise.search'); - expect(docLinks.appSearchBase).toEqual('http://elastic.app.search'); - expect(docLinks.workplaceSearchBase).toEqual('http://elastic.workplace.search'); - expect(docLinks.cloudBase).toEqual('https://elastic.co/guide/en/cloud/current'); + expect(docLinks.appSearchApis).toEqual(links.links.appSearch.apiRef); + expect(docLinks.cloudIndexManagement).toEqual(links.links.cloud.indexManagement); + expect(docLinks.enterpriseSearchConfig).toEqual(links.links.enterpriseSearch.configuration); + expect(docLinks.workplaceSearchZendesk).toEqual(links.links.workplaceSearch.zendesk); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts index 6034846fac4f..93bead4d31f4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/doc_links/doc_links.ts @@ -8,23 +8,174 @@ import { DocLinksStart } from 'kibana/public'; class DocLinks { - public enterpriseSearchBase: string; - public appSearchBase: string; - public workplaceSearchBase: string; - public cloudBase: string; + public appSearchApis: string; + public appSearchApiClients: string; + public appSearchApiKeys: string; + public appSearchAuthentication: string; + public appSearchCrawlRules: string; + public appSearchCurations: string; + public appSearchDuplicateDocuments: string; + public appSearchEntryPoints: string; + public appSearchGuide: string; + public appSearchIndexingDocs: string; + public appSearchIndexingDocsSchema: string; + public appSearchLogSettings: string; + public appSearchMetaEngines: string; + public appSearchNativeAuth: string; + public appSearchPrecision: string; + public appSearchRelevance: string; + public appSearchResultSettings: string; + public appSearchSearchUI: string; + public appSearchSecurity: string; + public appSearchStandardAuth: string; + public appSearchSynonyms: string; + public appSearchWebCrawler: string; + public appSearchWebCrawlerEventLogs: string; + public cloudIndexManagement: string; + public enterpriseSearchConfig: string; + public enterpriseSearchMailService: string; + public enterpriseSearchUsersAccess: string; + public licenseManagement: string; + public workplaceSearchBox: string; + public workplaceSearchConfluenceCloud: string; + public workplaceSearchConfluenceServer: string; + public workplaceSearchCustomSources: string; + public workplaceSearchCustomSourcePermissions: string; + public workplaceSearchDocumentPermissions: string; + public workplaceSearchDropbox: string; + public workplaceSearchExternalIdentities: string; + public workplaceSearchGettingStarted: string; + public workplaceSearchGitHub: string; + public workplaceSearchGmail: string; + public workplaceSearchGoogleDrive: string; + public workplaceSearchIndexingSchedule: string; + public workplaceSearchJiraCloud: string; + public workplaceSearchJiraServer: string; + public workplaceSearchNativeAuth: string; + public workplaceSearchOneDrive: string; + public workplaceSearchPermissions: string; + public workplaceSearchSalesforce: string; + public workplaceSearchSecurity: string; + public workplaceSearchServiceNow: string; + public workplaceSearchSharePoint: string; + public workplaceSearchSlack: string; + public workplaceSearchStandardAuth: string; + public workplaceSearchSynch: string; + public workplaceSearchZendesk: string; constructor() { - this.enterpriseSearchBase = ''; - this.appSearchBase = ''; - this.workplaceSearchBase = ''; - this.cloudBase = ''; + this.appSearchApis = ''; + this.appSearchApiClients = ''; + this.appSearchApiKeys = ''; + this.appSearchAuthentication = ''; + this.appSearchCrawlRules = ''; + this.appSearchCurations = ''; + this.appSearchDuplicateDocuments = ''; + this.appSearchEntryPoints = ''; + this.appSearchGuide = ''; + this.appSearchIndexingDocs = ''; + this.appSearchIndexingDocsSchema = ''; + this.appSearchLogSettings = ''; + this.appSearchMetaEngines = ''; + this.appSearchNativeAuth = ''; + this.appSearchPrecision = ''; + this.appSearchRelevance = ''; + this.appSearchResultSettings = ''; + this.appSearchSearchUI = ''; + this.appSearchSecurity = ''; + this.appSearchStandardAuth = ''; + this.appSearchSynonyms = ''; + this.appSearchWebCrawler = ''; + this.appSearchWebCrawlerEventLogs = ''; + this.cloudIndexManagement = ''; + this.enterpriseSearchConfig = ''; + this.enterpriseSearchMailService = ''; + this.enterpriseSearchUsersAccess = ''; + this.licenseManagement = ''; + this.workplaceSearchBox = ''; + this.workplaceSearchConfluenceCloud = ''; + this.workplaceSearchConfluenceServer = ''; + this.workplaceSearchCustomSources = ''; + this.workplaceSearchCustomSourcePermissions = ''; + this.workplaceSearchDocumentPermissions = ''; + this.workplaceSearchDropbox = ''; + this.workplaceSearchExternalIdentities = ''; + this.workplaceSearchGettingStarted = ''; + this.workplaceSearchGitHub = ''; + this.workplaceSearchGmail = ''; + this.workplaceSearchGoogleDrive = ''; + this.workplaceSearchIndexingSchedule = ''; + this.workplaceSearchJiraCloud = ''; + this.workplaceSearchJiraServer = ''; + this.workplaceSearchNativeAuth = ''; + this.workplaceSearchOneDrive = ''; + this.workplaceSearchPermissions = ''; + this.workplaceSearchSalesforce = ''; + this.workplaceSearchSecurity = ''; + this.workplaceSearchServiceNow = ''; + this.workplaceSearchSharePoint = ''; + this.workplaceSearchSlack = ''; + this.workplaceSearchStandardAuth = ''; + this.workplaceSearchSynch = ''; + this.workplaceSearchZendesk = ''; } public setDocLinks(docLinks: DocLinksStart): void { - this.enterpriseSearchBase = docLinks.links.enterpriseSearch.base; - this.appSearchBase = docLinks.links.enterpriseSearch.appSearchBase; - this.workplaceSearchBase = docLinks.links.enterpriseSearch.workplaceSearchBase; - this.cloudBase = `${docLinks.ELASTIC_WEBSITE_URL}guide/en/cloud/current`; + this.appSearchApis = docLinks.links.appSearch.apiRef; + this.appSearchApiClients = docLinks.links.appSearch.apiClients; + this.appSearchApiKeys = docLinks.links.appSearch.apiKeys; + this.appSearchAuthentication = docLinks.links.appSearch.authentication; + this.appSearchCrawlRules = docLinks.links.appSearch.crawlRules; + this.appSearchCurations = docLinks.links.appSearch.curations; + this.appSearchDuplicateDocuments = docLinks.links.appSearch.duplicateDocuments; + this.appSearchEntryPoints = docLinks.links.appSearch.entryPoints; + this.appSearchGuide = docLinks.links.appSearch.guide; + this.appSearchIndexingDocs = docLinks.links.appSearch.indexingDocuments; + this.appSearchIndexingDocsSchema = docLinks.links.appSearch.indexingDocumentsSchema; + this.appSearchLogSettings = docLinks.links.appSearch.logSettings; + this.appSearchMetaEngines = docLinks.links.appSearch.metaEngines; + this.appSearchNativeAuth = docLinks.links.appSearch.nativeAuth; + this.appSearchPrecision = docLinks.links.appSearch.precisionTuning; + this.appSearchRelevance = docLinks.links.appSearch.relevanceTuning; + this.appSearchResultSettings = docLinks.links.appSearch.resultSettings; + this.appSearchSearchUI = docLinks.links.appSearch.searchUI; + this.appSearchSecurity = docLinks.links.appSearch.security; + this.appSearchStandardAuth = docLinks.links.appSearch.standardAuth; + this.appSearchSynonyms = docLinks.links.appSearch.synonyms; + this.appSearchWebCrawler = docLinks.links.appSearch.webCrawler; + this.appSearchWebCrawlerEventLogs = docLinks.links.appSearch.webCrawlerEventLogs; + this.cloudIndexManagement = docLinks.links.cloud.indexManagement; + this.enterpriseSearchConfig = docLinks.links.enterpriseSearch.configuration; + this.enterpriseSearchMailService = docLinks.links.enterpriseSearch.mailService; + this.enterpriseSearchUsersAccess = docLinks.links.enterpriseSearch.usersAccess; + this.licenseManagement = docLinks.links.enterpriseSearch.licenseManagement; + this.workplaceSearchBox = docLinks.links.workplaceSearch.box; + this.workplaceSearchConfluenceCloud = docLinks.links.workplaceSearch.confluenceCloud; + this.workplaceSearchConfluenceServer = docLinks.links.workplaceSearch.confluenceServer; + this.workplaceSearchCustomSources = docLinks.links.workplaceSearch.customSources; + this.workplaceSearchCustomSourcePermissions = + docLinks.links.workplaceSearch.customSourcePermissions; + this.workplaceSearchDocumentPermissions = docLinks.links.workplaceSearch.documentPermissions; + this.workplaceSearchDropbox = docLinks.links.workplaceSearch.dropbox; + this.workplaceSearchExternalIdentities = docLinks.links.workplaceSearch.externalIdentities; + this.workplaceSearchGettingStarted = docLinks.links.workplaceSearch.gettingStarted; + this.workplaceSearchGitHub = docLinks.links.workplaceSearch.gitHub; + this.workplaceSearchGmail = docLinks.links.workplaceSearch.gmail; + this.workplaceSearchGoogleDrive = docLinks.links.workplaceSearch.googleDrive; + this.workplaceSearchIndexingSchedule = docLinks.links.workplaceSearch.indexingSchedule; + this.workplaceSearchJiraCloud = docLinks.links.workplaceSearch.jiraCloud; + this.workplaceSearchJiraServer = docLinks.links.workplaceSearch.jiraServer; + this.workplaceSearchNativeAuth = docLinks.links.workplaceSearch.nativeAuth; + this.workplaceSearchOneDrive = docLinks.links.workplaceSearch.oneDrive; + this.workplaceSearchPermissions = docLinks.links.workplaceSearch.permissions; + this.workplaceSearchSalesforce = docLinks.links.workplaceSearch.salesforce; + this.workplaceSearchSecurity = docLinks.links.workplaceSearch.security; + this.workplaceSearchServiceNow = docLinks.links.workplaceSearch.serviceNow; + this.workplaceSearchSharePoint = docLinks.links.workplaceSearch.sharePoint; + this.workplaceSearchSlack = docLinks.links.workplaceSearch.slack; + this.workplaceSearchStandardAuth = docLinks.links.workplaceSearch.standardAuth; + this.workplaceSearchSynch = docLinks.links.workplaceSearch.synch; + this.workplaceSearchZendesk = docLinks.links.workplaceSearch.zendesk; } } diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/licensing/manage_license_button.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/licensing/manage_license_button.test.tsx index 1877a4cbd0e4..07c71def01be 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/licensing/manage_license_button.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/licensing/manage_license_button.test.tsx @@ -13,6 +13,8 @@ import { shallow } from 'enzyme'; import { EuiButton } from '@elastic/eui'; +import { docLinks } from '../../shared/doc_links'; + import { EuiButtonTo } from '../react_router_helpers'; import { ManageLicenseButton } from './'; @@ -35,7 +37,7 @@ describe('ManageLicenseButton', () => { const wrapper = shallow(); expect(wrapper.find(EuiButton).prop('href')).toEqual( - expect.stringContaining('/license-management.html') + expect.stringContaining(docLinks.licenseManagement) ); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/licensing/manage_license_button.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/licensing/manage_license_button.tsx index af3b33e3d7a3..d0fe98a7c139 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/licensing/manage_license_button.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/licensing/manage_license_button.tsx @@ -27,12 +27,7 @@ export const ManageLicenseButton: React.FC = (props) => { })} ) : ( - + {i18n.translate('xpack.enterpriseSearch.licenseDocumentationLink', { defaultMessage: 'Learn more about license features', })} diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/role_mappings_table.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/role_mappings_table.tsx index 6e213edf457b..667980d5f049 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/role_mappings_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/role_mappings_table.tsx @@ -18,7 +18,7 @@ import { RoleRules } from '../types'; import './role_mappings_table.scss'; -const AUTH_PROVIDER_DOCUMENTATION_URL = `${docLinks.enterpriseSearchBase}/users-access.html`; +const AUTH_PROVIDER_DOCUMENTATION_URL = `${docLinks.enterpriseSearchUsersAccess}`; import { ANY_AUTH_PROVIDER, diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/user_selector.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/user_selector.tsx index 25aff5077c68..077ef44c66b2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/user_selector.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/user_selector.tsx @@ -24,7 +24,7 @@ import { Role as WSRole } from '../../workplace_search/types'; import { USERNAME_LABEL, EMAIL_LABEL } from '../constants'; import { docLinks } from '../doc_links'; -const SMTP_URL = `${docLinks.enterpriseSearchBase}/mailer-configuration.html`; +const SMTP_URL = `${docLinks.enterpriseSearchMailService}`; import { NEW_USER_LABEL, diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/users_empty_prompt.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/users_empty_prompt.tsx index 42bf690c388c..56e0a325aafd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/users_empty_prompt.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/role_mapping/users_empty_prompt.tsx @@ -20,7 +20,7 @@ import { docLinks } from '../doc_links'; import { NO_USERS_TITLE, NO_USERS_DESCRIPTION, ENABLE_USERS_LINK } from './constants'; -const USERS_DOCS_URL = `${docLinks.enterpriseSearchBase}/users-access.html`; +const USERS_DOCS_URL = `${docLinks.enterpriseSearchUsersAccess}`; export const UsersEmptyPrompt: React.FC = () => ( diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/cloud/instructions.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/cloud/instructions.tsx index 4845d682b877..8d41e221a2cc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/cloud/instructions.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/cloud/instructions.tsx @@ -80,10 +80,7 @@ export const CloudSetupInstructions: React.FC = ({ productName, cloudDepl defaultMessage="After enabling Enterprise Search for your instance you can customize the instance, including fault tolerance, RAM, and other {optionsLink}." values={{ optionsLink: ( - + {i18n.translate( 'xpack.enterpriseSearch.setupGuide.cloud.step3.instruction1LinkText', { defaultMessage: 'configurable options' } @@ -125,10 +122,7 @@ export const CloudSetupInstructions: React.FC = ({ productName, cloudDepl values={{ productName, configurePolicyLink: ( - + {i18n.translate( 'xpack.enterpriseSearch.setupGuide.cloud.step5.instruction1LinkText', { defaultMessage: 'configure an index lifecycle policy' } diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts index 1be152ad5ca0..b28343f37ea2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts @@ -17,37 +17,36 @@ export const LOGOUT_ROUTE = '/logout'; export const LEAVE_FEEDBACK_EMAIL = 'support@elastic.co'; export const LEAVE_FEEDBACK_URL = `mailto:${LEAVE_FEEDBACK_EMAIL}?Subject=Elastic%20Workplace%20Search%20Feedback`; -export const DOCS_PREFIX = docLinks.workplaceSearchBase; -export const PERMISSIONS_DOCS_URL = `${DOCS_PREFIX}/workplace-search-permissions.html`; -export const DOCUMENT_PERMISSIONS_DOCS_URL = `${DOCS_PREFIX}/workplace-search-sources-document-permissions.html`; -export const DOCUMENT_PERMISSIONS_SYNC_DOCS_URL = `${DOCUMENT_PERMISSIONS_DOCS_URL}#sources-permissions-synchronizing`; -export const PRIVATE_SOURCES_DOCS_URL = `${PERMISSIONS_DOCS_URL}#organizational-sources-private-sources`; -export const EXTERNAL_IDENTITIES_DOCS_URL = `${DOCS_PREFIX}/workplace-search-external-identities-api.html`; -export const SECURITY_DOCS_URL = `${DOCS_PREFIX}/workplace-search-security.html`; -export const SMTP_DOCS_URL = `${DOCS_PREFIX}/workplace-search-smtp-mailer.html`; -export const BOX_DOCS_URL = `${DOCS_PREFIX}/workplace-search-box-connector.html`; -export const CONFLUENCE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-confluence-cloud-connector.html`; -export const CONFLUENCE_SERVER_DOCS_URL = `${DOCS_PREFIX}/workplace-search-confluence-server-connector.html`; -export const DROPBOX_DOCS_URL = `${DOCS_PREFIX}/workplace-search-dropbox-connector.html`; -export const GITHUB_DOCS_URL = `${DOCS_PREFIX}/workplace-search-github-connector.html`; -export const GITHUB_ENTERPRISE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-github-connector.html`; -export const GMAIL_DOCS_URL = `${DOCS_PREFIX}/workplace-search-gmail-connector.html`; -export const GOOGLE_DRIVE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-google-drive-connector.html`; -export const JIRA_DOCS_URL = `${DOCS_PREFIX}/workplace-search-jira-cloud-connector.html`; -export const JIRA_SERVER_DOCS_URL = `${DOCS_PREFIX}/workplace-search-jira-server-connector.html`; -export const ONEDRIVE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-onedrive-connector.html`; -export const SALESFORCE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-salesforce-connector.html`; -export const SERVICENOW_DOCS_URL = `${DOCS_PREFIX}/workplace-search-servicenow-connector.html`; -export const SHAREPOINT_DOCS_URL = `${DOCS_PREFIX}/workplace-search-sharepoint-online-connector.html`; -export const SLACK_DOCS_URL = `${DOCS_PREFIX}/workplace-search-slack-connector.html`; -export const ZENDESK_DOCS_URL = `${DOCS_PREFIX}/workplace-search-zendesk-connector.html`; -export const CUSTOM_SOURCE_DOCS_URL = `${DOCS_PREFIX}/workplace-search-custom-api-sources.html`; -export const CUSTOM_API_DOCS_URL = `${DOCS_PREFIX}/workplace-search-custom-sources-api.html`; -export const CUSTOM_API_DOCUMENT_PERMISSIONS_DOCS_URL = `${CUSTOM_SOURCE_DOCS_URL}#custom-api-source-document-level-access-control`; -export const ENT_SEARCH_LICENSE_MANAGEMENT = `${docLinks.enterpriseSearchBase}/license-management.html`; -export const SYNCHRONIZATION_DOCS_URL = `${DOCS_PREFIX}}/workplace-search-customizing-indexing-rules.html#workplace-search-customizing-indexing-rules`; -export const DIFFERENT_SYNC_TYPES_DOCS_URL = `${DOCS_PREFIX}}/workplace-search-customizing-indexing-rules.html#_indexing_schedule`; -export const OBJECTS_AND_ASSETS_DOCS_URL = `${DOCS_PREFIX}}/workplace-search-customizing-indexing-rules.html#workplace-search-customizing-indexing-rules`; +export const BOX_DOCS_URL = docLinks.workplaceSearchBox; +export const CONFLUENCE_DOCS_URL = docLinks.workplaceSearchConfluenceCloud; +export const CONFLUENCE_SERVER_DOCS_URL = docLinks.workplaceSearchConfluenceServer; +export const CUSTOM_SOURCE_DOCS_URL = docLinks.workplaceSearchCustomSources; +export const CUSTOM_API_DOCUMENT_PERMISSIONS_DOCS_URL = + docLinks.workplaceSearchCustomSourcePermissions; +export const DIFFERENT_SYNC_TYPES_DOCS_URL = docLinks.workplaceSearchIndexingSchedule; +export const DOCUMENT_PERMISSIONS_DOCS_URL = docLinks.workplaceSearchDocumentPermissions; +export const DROPBOX_DOCS_URL = docLinks.workplaceSearchDropbox; +export const ENT_SEARCH_LICENSE_MANAGEMENT = docLinks.licenseManagement; +export const EXTERNAL_IDENTITIES_DOCS_URL = docLinks.workplaceSearchExternalIdentities; +export const GETTING_STARTED_DOCS_URL = docLinks.workplaceSearchGettingStarted; +export const GITHUB_DOCS_URL = docLinks.workplaceSearchGitHub; +export const GITHUB_ENTERPRISE_DOCS_URL = docLinks.workplaceSearchGitHub; +export const GMAIL_DOCS_URL = docLinks.workplaceSearchGmail; +export const GOOGLE_DRIVE_DOCS_URL = docLinks.workplaceSearchGoogleDrive; +export const JIRA_DOCS_URL = docLinks.workplaceSearchJiraCloud; +export const JIRA_SERVER_DOCS_URL = docLinks.workplaceSearchJiraServer; +export const NATIVE_AUTH_DOCS_URL = docLinks.workplaceSearchNativeAuth; +export const OBJECTS_AND_ASSETS_DOCS_URL = docLinks.workplaceSearchSynch; +export const ONEDRIVE_DOCS_URL = docLinks.workplaceSearchOneDrive; +export const PRIVATE_SOURCES_DOCS_URL = docLinks.workplaceSearchPermissions; +export const SALESFORCE_DOCS_URL = docLinks.workplaceSearchSalesforce; +export const SECURITY_DOCS_URL = docLinks.workplaceSearchSecurity; +export const SERVICENOW_DOCS_URL = docLinks.workplaceSearchServiceNow; +export const SHAREPOINT_DOCS_URL = docLinks.workplaceSearchSharePoint; +export const SLACK_DOCS_URL = docLinks.workplaceSearchSlack; +export const STANDARD_AUTH_DOCS_URL = docLinks.workplaceSearchStandardAuth; +export const SYNCHRONIZATION_DOCS_URL = docLinks.workplaceSearchSynch; +export const ZENDESK_DOCS_URL = docLinks.workplaceSearchZendesk; export const PERSONAL_PATH = '/p'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/oauth_application.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/oauth_application.test.tsx index 4d329ff357b8..a992cf49f75f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/oauth_application.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/oauth_application.test.tsx @@ -124,9 +124,9 @@ describe('OauthApplication', () => { `); }); + /* This href test should ultimately use the docLinkServiceMock */ it('renders description', () => { const wrapper = shallow(); - expect(wrapper.prop('pageHeader').description).toMatchInlineSnapshot(` { Explore Platinum features diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx index 905ba20e4f66..e52a174850c4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx @@ -15,19 +15,23 @@ import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants'; import { SetWorkplaceSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; import { SetupGuideLayout, SETUP_GUIDE_TITLE } from '../../../shared/setup_guide'; import { SendWorkplaceSearchTelemetry as SendTelemetry } from '../../../shared/telemetry'; -import { DOCS_PREFIX } from '../../routes'; +import { + GETTING_STARTED_DOCS_URL, + NATIVE_AUTH_DOCS_URL, + STANDARD_AUTH_DOCS_URL, +} from '../../routes'; import GettingStarted from './assets/getting_started.png'; -const GETTING_STARTED_LINK_URL = `${DOCS_PREFIX}/workplace-search-getting-started.html`; +const GETTING_STARTED_LINK_URL = GETTING_STARTED_DOCS_URL; export const SetupGuide: React.FC = () => { return ( diff --git a/x-pack/plugins/fleet/server/services/package_policy.test.ts b/x-pack/plugins/fleet/server/services/package_policy.test.ts index 36976bea4a97..ac88204f082b 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.test.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.test.ts @@ -39,7 +39,8 @@ import type { import { IngestManagerError } from '../errors'; import { - overridePackageInputs, + preconfigurePackageInputs, + updatePackageInputs, packagePolicyService, _applyIndexPrivileges, } from './package_policy'; @@ -1170,7 +1171,776 @@ describe('Package policy service', () => { }); }); - describe('overridePackageInputs', () => { + describe('preconfigurePackageInputs', () => { + describe('when variable is already defined', () => { + it('override original variable value', () => { + const basePackagePolicy: NewPackagePolicy = { + name: 'base-package-policy', + description: 'Base Package Policy', + namespace: 'default', + enabled: true, + policy_id: 'xxxx', + output_id: 'xxxx', + package: { + name: 'test-package', + title: 'Test Package', + version: '0.0.1', + }, + inputs: [ + { + type: 'logs', + policy_template: 'template_1', + enabled: true, + vars: { + path: { + type: 'text', + value: ['/var/log/logfile.log'], + }, + }, + streams: [], + }, + ], + }; + + const packageInfo: PackageInfo = { + name: 'test-package', + description: 'Test Package', + title: 'Test Package', + version: '0.0.1', + latestVersion: '0.0.1', + release: 'experimental', + format_version: '1.0.0', + owner: { github: 'elastic/fleet' }, + policy_templates: [ + { + name: 'template_1', + title: 'Template 1', + description: 'Template 1', + inputs: [ + { + type: 'logs', + title: 'Log', + description: 'Log Input', + vars: [ + { + name: 'path', + type: 'text', + }, + ], + }, + ], + }, + ], + // @ts-ignore + assets: {}, + }; + + const inputsOverride: NewPackagePolicyInput[] = [ + { + type: 'logs', + enabled: true, + streams: [], + vars: { + path: { + type: 'text', + value: '/var/log/new-logfile.log', + }, + }, + }, + ]; + + const result = preconfigurePackageInputs( + basePackagePolicy, + packageInfo, + // TODO: Update this type assertion when the `InputsOverride` type is updated such + // that it no longer causes unresolvable type errors when used directly + inputsOverride as InputsOverride[] + ); + expect(result.inputs[0]?.vars?.path.value).toEqual('/var/log/new-logfile.log'); + }); + }); + + describe('when variable is undefined in original object', () => { + it('adds the variable definition to the resulting object', () => { + const basePackagePolicy: NewPackagePolicy = { + name: 'base-package-policy', + description: 'Base Package Policy', + namespace: 'default', + enabled: true, + policy_id: 'xxxx', + output_id: 'xxxx', + package: { + name: 'test-package', + title: 'Test Package', + version: '0.0.1', + }, + inputs: [ + { + type: 'logs', + policy_template: 'template_1', + enabled: true, + vars: { + path: { + type: 'text', + value: ['/var/log/logfile.log'], + }, + }, + streams: [], + }, + ], + }; + + const packageInfo: PackageInfo = { + name: 'test-package', + description: 'Test Package', + title: 'Test Package', + version: '0.0.1', + latestVersion: '0.0.1', + release: 'experimental', + format_version: '1.0.0', + owner: { github: 'elastic/fleet' }, + policy_templates: [ + { + name: 'template_1', + title: 'Template 1', + description: 'Template 1', + inputs: [ + { + type: 'logs', + title: 'Log', + description: 'Log Input', + vars: [ + { + name: 'path', + type: 'text', + }, + { + name: 'path_2', + type: 'text', + }, + ], + }, + ], + }, + ], + // @ts-ignore + assets: {}, + }; + + const inputsOverride: NewPackagePolicyInput[] = [ + { + type: 'logs', + enabled: true, + streams: [], + policy_template: 'template_1', + vars: { + path: { + type: 'text', + value: '/var/log/new-logfile.log', + }, + path_2: { + type: 'text', + value: '/var/log/custom.log', + }, + }, + }, + ]; + + const result = preconfigurePackageInputs( + basePackagePolicy, + packageInfo, + // TODO: Update this type assertion when the `InputsOverride` type is updated such + // that it no longer causes unresolvable type errors when used directly + inputsOverride as InputsOverride[] + ); + + expect(result.inputs[0]?.vars?.path_2.value).toEqual('/var/log/custom.log'); + }); + }); + + describe('when variable is undefined in original object and policy_template is undefined', () => { + it('adds the variable definition to the resulting object', () => { + const basePackagePolicy: NewPackagePolicy = { + name: 'base-package-policy', + description: 'Base Package Policy', + namespace: 'default', + enabled: true, + policy_id: 'xxxx', + output_id: 'xxxx', + package: { + name: 'test-package', + title: 'Test Package', + version: '0.0.1', + }, + inputs: [ + { + type: 'logs', + policy_template: 'template_1', + enabled: true, + vars: { + path: { + type: 'text', + value: ['/var/log/logfile.log'], + }, + }, + streams: [], + }, + ], + }; + + const packageInfo: PackageInfo = { + name: 'test-package', + description: 'Test Package', + title: 'Test Package', + version: '0.0.1', + latestVersion: '0.0.1', + release: 'experimental', + format_version: '1.0.0', + owner: { github: 'elastic/fleet' }, + policy_templates: [ + { + name: 'template_1', + title: 'Template 1', + description: 'Template 1', + inputs: [ + { + type: 'logs', + title: 'Log', + description: 'Log Input', + vars: [ + { + name: 'path', + type: 'text', + }, + { + name: 'path_2', + type: 'text', + }, + ], + }, + ], + }, + ], + // @ts-ignore + assets: {}, + }; + + const inputsOverride: NewPackagePolicyInput[] = [ + { + type: 'logs', + enabled: true, + streams: [], + policy_template: undefined, // preconfigured input overrides don't have a policy_template + vars: { + path: { + type: 'text', + value: '/var/log/new-logfile.log', + }, + path_2: { + type: 'text', + value: '/var/log/custom.log', + }, + }, + }, + ]; + + const result = preconfigurePackageInputs( + basePackagePolicy, + packageInfo, + // TODO: Update this type assertion when the `InputsOverride` type is updated such + // that it no longer causes unresolvable type errors when used directly + inputsOverride as InputsOverride[] + ); + + expect(result.inputs[0]?.vars?.path_2.value).toEqual('/var/log/custom.log'); + }); + }); + + describe('when an input of the same type exists under multiple policy templates', () => { + it('adds variable definitions to the proper streams', () => { + const basePackagePolicy: NewPackagePolicy = { + name: 'base-package-policy', + description: 'Base Package Policy', + namespace: 'default', + enabled: true, + policy_id: 'xxxx', + output_id: 'xxxx', + package: { + name: 'test-package', + title: 'Test Package', + version: '0.0.1', + }, + inputs: [ + { + type: 'logs', + policy_template: 'template_1', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile', + }, + vars: { + log_file_path: { + type: 'text', + }, + }, + }, + ], + }, + { + type: 'logs', + policy_template: 'template_2', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile', + }, + vars: { + log_file_path: { + type: 'text', + }, + }, + }, + ], + }, + ], + }; + + const packageInfo: PackageInfo = { + name: 'test-package', + description: 'Test Package', + title: 'Test Package', + version: '0.0.1', + latestVersion: '0.0.1', + release: 'experimental', + format_version: '1.0.0', + owner: { github: 'elastic/fleet' }, + policy_templates: [ + { + name: 'template_1', + title: 'Template 1', + description: 'Template 1', + inputs: [ + { + type: 'logs', + title: 'Log', + description: 'Log Input', + vars: [], + }, + ], + }, + { + name: 'template_2', + title: 'Template 2', + description: 'Template 2', + inputs: [ + { + type: 'logs', + title: 'Log', + description: 'Log Input', + vars: [], + }, + ], + }, + ], + // @ts-ignore + assets: {}, + }; + + const inputsOverride: NewPackagePolicyInput[] = [ + { + type: 'logs', + enabled: true, + policy_template: 'template_1', + streams: [ + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile', + }, + vars: { + log_file_path: { + type: 'text', + value: '/var/log/template1-logfile.log', + }, + }, + }, + ], + }, + { + type: 'logs', + enabled: true, + policy_template: 'template_2', + streams: [ + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile', + }, + vars: { + log_file_path: { + type: 'text', + value: '/var/log/template2-logfile.log', + }, + }, + }, + ], + }, + ]; + + const result = preconfigurePackageInputs( + basePackagePolicy, + packageInfo, + // TODO: Update this type assertion when the `InputsOverride` type is updated such + // that it no longer causes unresolvable type errors when used directly + inputsOverride as InputsOverride[] + ); + + expect(result.inputs).toHaveLength(2); + + const template1Input = result.inputs.find( + (input) => input.policy_template === 'template_1' + ); + const template2Input = result.inputs.find( + (input) => input.policy_template === 'template_2' + ); + + expect(template1Input).toBeDefined(); + expect(template2Input).toBeDefined(); + + expect(template1Input?.streams[0].vars?.log_file_path.value).toBe( + '/var/log/template1-logfile.log' + ); + + expect(template2Input?.streams[0].vars?.log_file_path.value).toBe( + '/var/log/template2-logfile.log' + ); + }); + }); + + describe('when an input or stream is disabled on the original policy object', () => { + it('remains disabled on the resulting policy object', () => { + const basePackagePolicy: NewPackagePolicy = { + name: 'base-package-policy', + description: 'Base Package Policy', + namespace: 'default', + enabled: true, + policy_id: 'xxxx', + output_id: 'xxxx', + package: { + name: 'test-package', + title: 'Test Package', + version: '0.0.1', + }, + inputs: [ + { + type: 'logs', + policy_template: 'template_1', + enabled: false, + streams: [ + { + enabled: false, + data_stream: { + dataset: 'test.logs', + type: 'logfile', + }, + vars: { + log_file_path: { + type: 'text', + }, + }, + }, + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile2', + }, + vars: { + log_file_path_2: { + type: 'text', + }, + }, + }, + ], + }, + { + type: 'logs_2', + policy_template: 'template_1', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile', + }, + vars: { + log_file_path: { + type: 'text', + }, + }, + }, + ], + }, + { + type: 'logs', + policy_template: 'template_2', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile', + }, + vars: { + log_file_path: { + type: 'text', + }, + }, + }, + ], + }, + ], + }; + + const packageInfo: PackageInfo = { + name: 'test-package', + description: 'Test Package', + title: 'Test Package', + version: '0.0.1', + latestVersion: '0.0.1', + release: 'experimental', + format_version: '1.0.0', + owner: { github: 'elastic/fleet' }, + policy_templates: [ + { + name: 'template_1', + title: 'Template 1', + description: 'Template 1', + inputs: [ + { + type: 'logs', + title: 'Log', + description: 'Log Input', + vars: [], + }, + { + type: 'logs_2', + title: 'Log 2', + description: 'Log Input 2', + vars: [], + }, + ], + }, + { + name: 'template_2', + title: 'Template 2', + description: 'Template 2', + inputs: [ + { + type: 'logs', + title: 'Log', + description: 'Log Input', + vars: [], + }, + ], + }, + ], + // @ts-ignore + assets: {}, + }; + + const inputsOverride: NewPackagePolicyInput[] = [ + { + type: 'logs', + enabled: true, + policy_template: 'template_1', + streams: [ + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile', + }, + vars: { + log_file_path: { + type: 'text', + value: '/var/log/template1-logfile.log', + }, + }, + }, + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile2', + }, + vars: { + log_file_path_2: { + type: 'text', + value: '/var/log/template1-logfile2.log', + }, + }, + }, + ], + }, + { + type: 'logs', + enabled: true, + policy_template: 'template_2', + streams: [ + { + enabled: true, + data_stream: { + dataset: 'test.logs', + type: 'logfile', + }, + vars: { + log_file_path: { + type: 'text', + value: '/var/log/template2-logfile.log', + }, + }, + }, + ], + }, + ]; + + const result = preconfigurePackageInputs( + basePackagePolicy, + packageInfo, + // TODO: Update this type assertion when the `InputsOverride` type is updated such + // that it no longer causes unresolvable type errors when used directly + inputsOverride as InputsOverride[] + ); + + const template1Inputs = result.inputs.filter( + (input) => input.policy_template === 'template_1' + ); + + const template2Inputs = result.inputs.filter( + (input) => input.policy_template === 'template_2' + ); + + expect(template1Inputs).toHaveLength(2); + expect(template2Inputs).toHaveLength(1); + + const logsInput = template1Inputs?.find((input) => input.type === 'logs'); + expect(logsInput?.enabled).toBe(false); + + const logfileStream = logsInput?.streams.find( + (stream) => stream.data_stream.type === 'logfile' + ); + + expect(logfileStream?.enabled).toBe(false); + }); + }); + + describe('when a datastream is deleted from an input', () => { + it('it remove the non existing datastream', () => { + const basePackagePolicy: NewPackagePolicy = { + name: 'base-package-policy', + description: 'Base Package Policy', + namespace: 'default', + enabled: true, + policy_id: 'xxxx', + output_id: 'xxxx', + package: { + name: 'test-package', + title: 'Test Package', + version: '0.0.1', + }, + inputs: [ + { + type: 'logs', + policy_template: 'template_1', + enabled: true, + vars: { + path: { + type: 'text', + value: ['/var/log/logfile.log'], + }, + }, + streams: [ + { + enabled: true, + data_stream: { dataset: 'dataset.test123', type: 'log' }, + }, + ], + }, + ], + }; + + const packageInfo: PackageInfo = { + name: 'test-package', + description: 'Test Package', + title: 'Test Package', + version: '0.0.1', + latestVersion: '0.0.1', + release: 'experimental', + format_version: '1.0.0', + owner: { github: 'elastic/fleet' }, + policy_templates: [ + { + name: 'template_1', + title: 'Template 1', + description: 'Template 1', + inputs: [ + { + type: 'logs', + title: 'Log', + description: 'Log Input', + vars: [ + { + name: 'path', + type: 'text', + }, + ], + }, + ], + }, + ], + // @ts-ignore + assets: {}, + }; + + const inputsOverride: NewPackagePolicyInput[] = [ + { + type: 'logs', + enabled: true, + streams: [], + vars: { + path: { + type: 'text', + value: '/var/log/new-logfile.log', + }, + }, + }, + ]; + + const result = preconfigurePackageInputs( + basePackagePolicy, + packageInfo, + // TODO: Update this type assertion when the `InputsOverride` type is updated such + // that it no longer causes unresolvable type errors when used directly + inputsOverride as InputsOverride[] + ); + expect(result.inputs[0]?.vars?.path.value).toEqual('/var/log/new-logfile.log'); + }); + }); + }); + + describe('updatePackageInputs', () => { describe('when variable is already defined', () => { it('preserves original variable value without overwriting', () => { const basePackagePolicy: NewPackagePolicy = { @@ -1248,7 +2018,7 @@ describe('Package policy service', () => { }, ]; - const result = overridePackageInputs( + const result = updatePackageInputs( basePackagePolicy, packageInfo, // TODO: Update this type assertion when the `InputsOverride` type is updated such @@ -1346,7 +2116,7 @@ describe('Package policy service', () => { }, ]; - const result = overridePackageInputs( + const result = updatePackageInputs( basePackagePolicy, packageInfo, // TODO: Update this type assertion when the `InputsOverride` type is updated such @@ -1445,7 +2215,7 @@ describe('Package policy service', () => { }, ]; - const result = overridePackageInputs( + const result = updatePackageInputs( basePackagePolicy, packageInfo, // TODO: Update this type assertion when the `InputsOverride` type is updated such @@ -1598,7 +2368,7 @@ describe('Package policy service', () => { }, ]; - const result = overridePackageInputs( + const result = updatePackageInputs( basePackagePolicy, packageInfo, // TODO: Update this type assertion when the `InputsOverride` type is updated such @@ -1819,7 +2589,7 @@ describe('Package policy service', () => { }, ]; - const result = overridePackageInputs( + const result = updatePackageInputs( basePackagePolicy, packageInfo, // TODO: Update this type assertion when the `InputsOverride` type is updated such @@ -1932,7 +2702,7 @@ describe('Package policy service', () => { }, ]; - const result = overridePackageInputs( + const result = updatePackageInputs( basePackagePolicy, packageInfo, // TODO: Update this type assertion when the `InputsOverride` type is updated such diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index 535d93cc3ece..5ac348ad7c8a 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -590,7 +590,7 @@ class PackagePolicyService { try { const { packagePolicy, packageInfo } = await this.getUpgradePackagePolicyInfo(soClient, id); - const updatePackagePolicy = overridePackageInputs( + const updatePackagePolicy = updatePackageInputs( { ...omit(packagePolicy, 'id'), inputs: packagePolicy.inputs, @@ -648,7 +648,7 @@ class PackagePolicyService { packageVersion ); - const updatedPackagePolicy = overridePackageInputs( + const updatedPackagePolicy = updatePackageInputs( { ...omit(packagePolicy, 'id'), inputs: packagePolicy.inputs, @@ -1030,13 +1030,13 @@ export const packagePolicyService = new PackagePolicyService(); export type { PackagePolicyService }; -export function overridePackageInputs( +export function updatePackageInputs( basePackagePolicy: NewPackagePolicy, packageInfo: PackageInfo, - inputsOverride?: InputsOverride[], + inputsUpdated?: InputsOverride[], dryRun?: boolean ): DryRunPackagePolicy { - if (!inputsOverride) return basePackagePolicy; + if (!inputsUpdated) return basePackagePolicy; const availablePolicyTemplates = packageInfo.policy_templates ?? []; @@ -1065,42 +1065,40 @@ export function overridePackageInputs( }), ]; - for (const override of inputsOverride) { - // Preconfiguration does not currently support multiple policy templates, so overrides will have an undefined - // policy template, so we only match on `type` in that case. - let originalInput = override.policy_template - ? inputs.find( - (i) => i.type === override.type && i.policy_template === override.policy_template - ) - : inputs.find((i) => i.type === override.type); + for (const update of inputsUpdated) { + // If update have an undefined policy template + // we only match on `type` . + let originalInput = update.policy_template + ? inputs.find((i) => i.type === update.type && i.policy_template === update.policy_template) + : inputs.find((i) => i.type === update.type); // If there's no corresponding input on the original package policy, just // take the override value from the new package as-is. This case typically // occurs when inputs or package policy templates are added/removed between versions. if (originalInput === undefined) { - inputs.push(override as NewPackagePolicyInput); + inputs.push(update as NewPackagePolicyInput); continue; } // For flags like this, we only want to override the original value if it was set // as `undefined` in the original object. An explicit true/false value should be // persisted from the original object to the result after the override process is complete. - if (originalInput.enabled === undefined && override.enabled !== undefined) { - originalInput.enabled = override.enabled; + if (originalInput.enabled === undefined && update.enabled !== undefined) { + originalInput.enabled = update.enabled; } - if (originalInput.keep_enabled === undefined && override.keep_enabled !== undefined) { - originalInput.keep_enabled = override.keep_enabled; + if (originalInput.keep_enabled === undefined && update.keep_enabled !== undefined) { + originalInput.keep_enabled = update.keep_enabled; } - if (override.vars) { + if (update.vars) { const indexOfInput = inputs.indexOf(originalInput); - inputs[indexOfInput] = deepMergeVars(originalInput, override) as NewPackagePolicyInput; + inputs[indexOfInput] = deepMergeVars(originalInput, update, true) as NewPackagePolicyInput; originalInput = inputs[indexOfInput]; } - if (override.streams) { - for (const stream of override.streams) { + if (update.streams) { + for (const stream of update.streams) { let originalStream = originalInput?.streams.find( (s) => s.data_stream.dataset === stream.data_stream.dataset ); @@ -1118,7 +1116,8 @@ export function overridePackageInputs( const indexOfStream = originalInput.streams.indexOf(originalStream); originalInput.streams[indexOfStream] = deepMergeVars( originalStream, - stream as InputsOverride + stream as InputsOverride, + true ); originalStream = originalInput.streams[indexOfStream]; } @@ -1128,9 +1127,8 @@ export function overridePackageInputs( // Filter all stream that have been removed from the input originalInput.streams = originalInput.streams.filter((originalStream) => { return ( - override.streams?.some( - (s) => s.data_stream.dataset === originalStream.data_stream.dataset - ) ?? false + update.streams?.some((s) => s.data_stream.dataset === originalStream.data_stream.dataset) ?? + false ); }); } @@ -1171,7 +1169,110 @@ export function overridePackageInputs( return resultingPackagePolicy; } -function deepMergeVars(original: any, override: any): any { +export function preconfigurePackageInputs( + basePackagePolicy: NewPackagePolicy, + packageInfo: PackageInfo, + preconfiguredInputs?: InputsOverride[] +): NewPackagePolicy { + if (!preconfiguredInputs) return basePackagePolicy; + + const inputs = [...basePackagePolicy.inputs]; + + for (const preconfiguredInput of preconfiguredInputs) { + // Preconfiguration does not currently support multiple policy templates, so overrides will have an undefined + // policy template, so we only match on `type` in that case. + let originalInput = preconfiguredInput.policy_template + ? inputs.find( + (i) => + i.type === preconfiguredInput.type && + i.policy_template === preconfiguredInput.policy_template + ) + : inputs.find((i) => i.type === preconfiguredInput.type); + + // If the input do not exist skip + if (originalInput === undefined) { + continue; + } + + // For flags like this, we only want to override the original value if it was set + // as `undefined` in the original object. An explicit true/false value should be + // persisted from the original object to the result after the override process is complete. + if (originalInput.enabled === undefined && preconfiguredInput.enabled !== undefined) { + originalInput.enabled = preconfiguredInput.enabled; + } + + if (originalInput.keep_enabled === undefined && preconfiguredInput.keep_enabled !== undefined) { + originalInput.keep_enabled = preconfiguredInput.keep_enabled; + } + + if (preconfiguredInput.vars) { + const indexOfInput = inputs.indexOf(originalInput); + inputs[indexOfInput] = deepMergeVars( + originalInput, + preconfiguredInput + ) as NewPackagePolicyInput; + originalInput = inputs[indexOfInput]; + } + + if (preconfiguredInput.streams) { + for (const stream of preconfiguredInput.streams) { + let originalStream = originalInput?.streams.find( + (s) => s.data_stream.dataset === stream.data_stream.dataset + ); + + if (originalStream === undefined) { + continue; + } + + if (originalStream?.enabled === undefined) { + originalStream.enabled = stream.enabled; + } + + if (stream.vars) { + const indexOfStream = originalInput.streams.indexOf(originalStream); + originalInput.streams[indexOfStream] = deepMergeVars( + originalStream, + stream as InputsOverride + ); + originalStream = originalInput.streams[indexOfStream]; + } + } + } + } + + const resultingPackagePolicy: NewPackagePolicy = { + ...basePackagePolicy, + inputs, + }; + + const validationResults = validatePackagePolicy(resultingPackagePolicy, packageInfo, safeLoad); + + if (validationHasErrors(validationResults)) { + const responseFormattedValidationErrors = Object.entries(getFlattenedObject(validationResults)) + .map(([key, value]) => ({ + key, + message: value, + })) + .filter(({ message }) => !!message); + + if (responseFormattedValidationErrors.length) { + throw new PackagePolicyValidationError( + i18n.translate('xpack.fleet.packagePolicyInvalidError', { + defaultMessage: 'Package policy is invalid: {errors}', + values: { + errors: responseFormattedValidationErrors + .map(({ key, message }) => `${key}: ${message}`) + .join('\n'), + }, + }) + ); + } + } + + return resultingPackagePolicy; +} + +function deepMergeVars(original: any, override: any, keepOriginalValue = false): any { if (!original.vars) { original.vars = { ...override.vars }; } @@ -1192,7 +1293,7 @@ function deepMergeVars(original: any, override: any): any { // Ensure that any value from the original object is persisted on the newly merged resulting object, // even if we merge other data about the given variable - if (originalVar?.value) { + if (keepOriginalValue && originalVar?.value) { result.vars[name].value = originalVar.value; } } diff --git a/x-pack/plugins/fleet/server/services/preconfiguration.ts b/x-pack/plugins/fleet/server/services/preconfiguration.ts index 8b906b68556a..76fa7778eafa 100644 --- a/x-pack/plugins/fleet/server/services/preconfiguration.ts +++ b/x-pack/plugins/fleet/server/services/preconfiguration.ts @@ -34,7 +34,7 @@ import { ensurePackagesCompletedInstall } from './epm/packages/install'; import { bulkInstallPackages } from './epm/packages/bulk_install_packages'; import { agentPolicyService, addPackageToAgentPolicy } from './agent_policy'; import type { InputsOverride } from './package_policy'; -import { overridePackageInputs, packagePolicyService } from './package_policy'; +import { preconfigurePackageInputs, packagePolicyService } from './package_policy'; import { appContextService } from './app_context'; import type { UpgradeManagedPackagePoliciesResult } from './managed_package_policies'; import { upgradeManagedPackagePolicies } from './managed_package_policies'; @@ -428,7 +428,7 @@ async function addPreconfiguredPolicyPackages( defaultOutput, name, description, - (policy) => overridePackageInputs(policy, packageInfo, inputs), + (policy) => preconfigurePackageInputs(policy, packageInfo, inputs), bumpAgentPolicyRevison ); } diff --git a/x-pack/plugins/observability/public/application/application.test.tsx b/x-pack/plugins/observability/public/application/application.test.tsx index 6b5863c8b122..dddc44c3c26e 100644 --- a/x-pack/plugins/observability/public/application/application.test.tsx +++ b/x-pack/plugins/observability/public/application/application.test.tsx @@ -46,7 +46,13 @@ describe('renderApp', () => { uiSettings: { get: () => false }, http: { basePath: { prepend: (path: string) => path } }, } as unknown as CoreStart; - const config = { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } }; + const config = { + unsafe: { + alertingExperience: { enabled: true }, + cases: { enabled: true }, + overviewNext: { enabled: false }, + }, + }; const params = { element: window.document.createElement('div'), history: createMemoryHistory(), diff --git a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx index c9c2ed549a1c..35835cd0bc8e 100644 --- a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx +++ b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx @@ -42,7 +42,13 @@ describe('APMSection', () => { http: { basePath: { prepend: jest.fn() } }, } as unknown as CoreStart, appMountParameters: {} as AppMountParameters, - config: { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } }, + config: { + unsafe: { + alertingExperience: { enabled: true }, + cases: { enabled: true }, + overviewNext: { enabled: false }, + }, + }, observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(), plugins: { data: { diff --git a/x-pack/plugins/observability/public/components/app/section/ux/index.test.tsx b/x-pack/plugins/observability/public/components/app/section/ux/index.test.tsx index 8a99b6a53cf0..b4dda3ed3559 100644 --- a/x-pack/plugins/observability/public/components/app/section/ux/index.test.tsx +++ b/x-pack/plugins/observability/public/components/app/section/ux/index.test.tsx @@ -42,7 +42,13 @@ describe('UXSection', () => { http: { basePath: { prepend: jest.fn() } }, } as unknown as CoreStart, appMountParameters: {} as AppMountParameters, - config: { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } }, + config: { + unsafe: { + alertingExperience: { enabled: true }, + cases: { enabled: true }, + overviewNext: { enabled: false }, + }, + }, plugins: { data: { query: { diff --git a/x-pack/plugins/observability/public/hooks/use_time_range.test.ts b/x-pack/plugins/observability/public/hooks/use_time_range.test.ts index bf513d8a1a99..bbf3096e5510 100644 --- a/x-pack/plugins/observability/public/hooks/use_time_range.test.ts +++ b/x-pack/plugins/observability/public/hooks/use_time_range.test.ts @@ -24,7 +24,13 @@ describe('useTimeRange', () => { jest.spyOn(pluginContext, 'usePluginContext').mockImplementation(() => ({ core: {} as CoreStart, appMountParameters: {} as AppMountParameters, - config: { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } }, + config: { + unsafe: { + alertingExperience: { enabled: true }, + cases: { enabled: true }, + overviewNext: { enabled: false }, + }, + }, plugins: { data: { query: { @@ -67,7 +73,13 @@ describe('useTimeRange', () => { jest.spyOn(pluginContext, 'usePluginContext').mockImplementation(() => ({ core: {} as CoreStart, appMountParameters: {} as AppMountParameters, - config: { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } }, + config: { + unsafe: { + alertingExperience: { enabled: true }, + cases: { enabled: true }, + overviewNext: { enabled: false }, + }, + }, plugins: { data: { query: { diff --git a/x-pack/plugins/observability/public/index.ts b/x-pack/plugins/observability/public/index.ts index 0dab3e513571..2383044bc14c 100644 --- a/x-pack/plugins/observability/public/index.ts +++ b/x-pack/plugins/observability/public/index.ts @@ -26,7 +26,11 @@ export type { export { enableInspectEsQueries } from '../common/ui_settings_keys'; export interface ConfigSchema { - unsafe: { alertingExperience: { enabled: boolean }; cases: { enabled: boolean } }; + unsafe: { + alertingExperience: { enabled: boolean }; + cases: { enabled: boolean }; + overviewNext: { enabled: boolean }; + }; } export const plugin: PluginInitializer< @@ -60,7 +64,9 @@ export { METRIC_TYPE, } from './hooks/use_track_metric'; -export const LazyAlertsFlyout = lazy(() => import('./pages/alerts/alerts_flyout')); +export const LazyAlertsFlyout = lazy( + () => import('./pages/alerts/components/alerts_flyout/alerts_flyout') +); export { useFetcher, FETCH_STATUS } from './hooks/use_fetcher'; export { useEsSearch, createEsParams } from './hooks/use_es_search'; diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_disclaimer.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_disclaimer.tsx similarity index 100% rename from x-pack/plugins/observability/public/pages/alerts/alerts_disclaimer.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/alerts_disclaimer.tsx diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/alerts_flyout.stories.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout.stories.tsx similarity index 85% rename from x-pack/plugins/observability/public/pages/alerts/alerts_flyout/alerts_flyout.stories.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout.stories.tsx index 64d495dbbc79..36b1fc2f2b6e 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/alerts_flyout.stories.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout.stories.tsx @@ -7,11 +7,11 @@ import { ALERT_UUID } from '@kbn/rule-data-utils/technical_field_names'; import React, { ComponentType } from 'react'; -import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; -import { PluginContext, PluginContextValue } from '../../../context/plugin_context'; -import { createObservabilityRuleTypeRegistryMock } from '../../../rules/observability_rule_type_registry_mock'; -import { apmAlertResponseExample } from '../example_data'; -import { AlertsFlyout } from './'; +import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public'; +import { PluginContext, PluginContextValue } from '../../../../context/plugin_context'; +import { createObservabilityRuleTypeRegistryMock } from '../../../../rules/observability_rule_type_registry_mock'; +import { apmAlertResponseExample } from './example_data'; +import { AlertsFlyout } from '..'; interface Args { alerts: Array>; diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/alerts_flyout.test.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout.test.tsx similarity index 91% rename from x-pack/plugins/observability/public/pages/alerts/alerts_flyout/alerts_flyout.test.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout.test.tsx index 4fdc8d245799..13fb5d805fb8 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/alerts_flyout.test.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout.test.tsx @@ -6,11 +6,11 @@ */ import React from 'react'; -import * as useUiSettingHook from '../../../../../../../src/plugins/kibana_react/public/ui_settings/use_ui_setting'; -import { createObservabilityRuleTypeRegistryMock } from '../../../rules/observability_rule_type_registry_mock'; -import { render } from '../../../utils/test_helper'; -import type { TopAlert } from '../'; -import { AlertsFlyout } from './'; +import * as useUiSettingHook from '../../../../../../../../src/plugins/kibana_react/public/ui_settings/use_ui_setting'; +import { createObservabilityRuleTypeRegistryMock } from '../../../../rules/observability_rule_type_registry_mock'; +import { render } from '../../../../utils/test_helper'; +import type { TopAlert } from '../../containers/alerts_page'; +import { AlertsFlyout } from '..'; describe('AlertsFlyout', () => { jest diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/index.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout.tsx similarity index 89% rename from x-pack/plugins/observability/public/pages/alerts/alerts_flyout/index.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout.tsx index c5cad5f3b1c8..ced4896c5f31 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/index.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/alerts_flyout.tsx @@ -35,14 +35,14 @@ import { } from '@kbn/rule-data-utils/alerts_as_data_status'; import moment from 'moment-timezone'; import React, { useMemo } from 'react'; -import type { TopAlert } from '../'; -import { useKibana, useUiSetting } from '../../../../../../../src/plugins/kibana_react/public'; -import { asDuration } from '../../../../common/utils/formatters'; -import type { ObservabilityRuleTypeRegistry } from '../../../rules/create_observability_rule_type_registry'; +import type { TopAlert } from '../../containers'; +import { useKibana, useUiSetting } from '../../../../../../../../src/plugins/kibana_react/public'; +import { asDuration } from '../../../../../common/utils/formatters'; +import type { ObservabilityRuleTypeRegistry } from '../../../../rules/create_observability_rule_type_registry'; import { parseAlert } from '../parse_alert'; -import { AlertStatusIndicator } from '../../../components/shared/alert_status_indicator'; -import { ExperimentalBadge } from '../../../components/shared/experimental_badge'; -import { translations, paths } from '../../../config'; +import { AlertStatusIndicator } from '../../../../components/shared/alert_status_indicator'; +import { ExperimentalBadge } from '../../../../components/shared/experimental_badge'; +import { translations, paths } from '../../../../config'; type AlertsFlyoutProps = { alert?: TopAlert; diff --git a/x-pack/plugins/observability/public/pages/alerts/example_data.ts b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/example_data.ts similarity index 100% rename from x-pack/plugins/observability/public/pages/alerts/example_data.ts rename to x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/example_data.ts diff --git a/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/index.ts b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/index.ts new file mode 100644 index 000000000000..4153ab6e5b59 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_flyout/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { AlertsFlyout } from './alerts_flyout'; diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_search_bar.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx similarity index 92% rename from x-pack/plugins/observability/public/pages/alerts/alerts_search_bar.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx index 926f03acf01d..14d47d1e7e9d 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_search_bar.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_search_bar.tsx @@ -8,8 +8,8 @@ import { IndexPatternBase } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import React, { useMemo, useState } from 'react'; -import { SearchBar, TimeHistory } from '../../../../../../src/plugins/data/public'; -import { Storage } from '../../../../../../src/plugins/kibana_utils/public'; +import { SearchBar, TimeHistory } from '../../../../../../../src/plugins/data/public'; +import { Storage } from '../../../../../../../src/plugins/kibana_utils/public'; export function AlertsSearchBar({ dynamicIndexPatterns, diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_status_filter.tsx b/x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx similarity index 94% rename from x-pack/plugins/observability/public/pages/alerts/alerts_status_filter.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx index 38c753bbebf3..d717e916de2c 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_status_filter.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/alerts_status_filter.tsx @@ -13,8 +13,8 @@ import { ALERT_STATUS_RECOVERED, } from '@kbn/rule-data-utils/alerts_as_data_status'; import { ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names'; -import { AlertStatusFilterButton } from '../../../common/typings'; -import { AlertStatusFilter } from '../../../common/typings'; +import { AlertStatusFilterButton } from '../../../../common/typings'; +import { AlertStatusFilter } from '../../../../common/typings'; export interface AlertStatusFilterProps { status: AlertStatusFilterButton; diff --git a/x-pack/plugins/observability/public/pages/alerts/default_cell_actions.tsx b/x-pack/plugins/observability/public/pages/alerts/components/default_cell_actions.tsx similarity index 85% rename from x-pack/plugins/observability/public/pages/alerts/default_cell_actions.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/default_cell_actions.tsx index 3adfb0a1d9c8..5126647161fa 100644 --- a/x-pack/plugins/observability/public/pages/alerts/default_cell_actions.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/default_cell_actions.tsx @@ -9,9 +9,9 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { getMappedNonEcsValue } from './render_cell_value'; import FilterForValueButton from './filter_for_value'; -import { TimelineNonEcsData } from '../../../../timelines/common/search_strategy'; -import { TGridCellAction } from '../../../../timelines/common/types/timeline'; -import { getPageRowIndex } from '../../../../timelines/public'; +import { TimelineNonEcsData } from '../../../../../timelines/common/search_strategy'; +import { TGridCellAction } from '../../../../../timelines/common/types/timeline'; +import { getPageRowIndex } from '../../../../../timelines/public'; export const FILTER_FOR_VALUE = i18n.translate('xpack.observability.hoverActions.filterForValue', { defaultMessage: 'Filter for value', diff --git a/x-pack/plugins/observability/public/pages/alerts/filter_for_value.tsx b/x-pack/plugins/observability/public/pages/alerts/components/filter_for_value.tsx similarity index 100% rename from x-pack/plugins/observability/public/pages/alerts/filter_for_value.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/filter_for_value.tsx diff --git a/x-pack/plugins/observability/public/pages/alerts/components/index.ts b/x-pack/plugins/observability/public/pages/alerts/components/index.ts new file mode 100644 index 000000000000..57ad311f65d1 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/alerts/components/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './alerts_flyout'; +export * from './render_cell_value'; +export * from './severity_badge'; +export * from './workflow_status_filter'; +export * from './alerts_search_bar'; +export * from './alerts_disclaimer'; +export * from './default_cell_actions'; +export * from './filter_for_value'; +export * from './parse_alert'; +export * from './alerts_status_filter'; diff --git a/x-pack/plugins/observability/public/pages/alerts/parse_alert.ts b/x-pack/plugins/observability/public/pages/alerts/components/parse_alert.ts similarity index 78% rename from x-pack/plugins/observability/public/pages/alerts/parse_alert.ts rename to x-pack/plugins/observability/public/pages/alerts/components/parse_alert.ts index 7b2880308406..680798811e9a 100644 --- a/x-pack/plugins/observability/public/pages/alerts/parse_alert.ts +++ b/x-pack/plugins/observability/public/pages/alerts/components/parse_alert.ts @@ -12,10 +12,10 @@ import { ALERT_RULE_NAME, } from '@kbn/rule-data-utils/technical_field_names'; import { ALERT_STATUS_ACTIVE } from '@kbn/rule-data-utils/alerts_as_data_status'; -import type { TopAlert } from '.'; -import { parseTechnicalFields } from '../../../../rule_registry/common/parse_technical_fields'; -import { asDuration, asPercent } from '../../../common/utils/formatters'; -import { ObservabilityRuleTypeRegistry } from '../../rules/create_observability_rule_type_registry'; +import type { TopAlert } from '../'; +import { parseTechnicalFields } from '../../../../../rule_registry/common/parse_technical_fields'; +import { asDuration, asPercent } from '../../../../common/utils/formatters'; +import { ObservabilityRuleTypeRegistry } from '../../../rules/create_observability_rule_type_registry'; export const parseAlert = (observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry) => diff --git a/x-pack/plugins/observability/public/pages/alerts/components/render_cell_value/index.ts b/x-pack/plugins/observability/public/pages/alerts/components/render_cell_value/index.ts new file mode 100644 index 000000000000..b6df77f07588 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/alerts/components/render_cell_value/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { getRenderCellValue, getMappedNonEcsValue } from './render_cell_value'; diff --git a/x-pack/plugins/observability/public/pages/alerts/render_cell_value.test.tsx b/x-pack/plugins/observability/public/pages/alerts/components/render_cell_value/render_cell_value.test.tsx similarity index 87% rename from x-pack/plugins/observability/public/pages/alerts/render_cell_value.test.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/render_cell_value/render_cell_value.test.tsx index 79a27faa96c6..25de2e36b08c 100644 --- a/x-pack/plugins/observability/public/pages/alerts/render_cell_value.test.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/render_cell_value/render_cell_value.test.tsx @@ -10,10 +10,10 @@ import { ALERT_STATUS_RECOVERED, } from '@kbn/rule-data-utils/alerts_as_data_status'; import { ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names'; -import type { CellValueElementProps } from '../../../../timelines/common'; -import { createObservabilityRuleTypeRegistryMock } from '../../rules/observability_rule_type_registry_mock'; -import * as PluginHook from '../../hooks/use_plugin_context'; -import { render } from '../../utils/test_helper'; +import type { CellValueElementProps } from '../../../../../../timelines/common'; +import { createObservabilityRuleTypeRegistryMock } from '../../../../rules/observability_rule_type_registry_mock'; +import * as PluginHook from '../../../../hooks/use_plugin_context'; +import { render } from '../../../../utils/test_helper'; import { getRenderCellValue } from './render_cell_value'; interface AlertsTableRow { diff --git a/x-pack/plugins/observability/public/pages/alerts/render_cell_value.tsx b/x-pack/plugins/observability/public/pages/alerts/components/render_cell_value/render_cell_value.tsx similarity index 86% rename from x-pack/plugins/observability/public/pages/alerts/render_cell_value.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/render_cell_value/render_cell_value.tsx index 80ccd4a69b28..d9fa6c6e2221 100644 --- a/x-pack/plugins/observability/public/pages/alerts/render_cell_value.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/render_cell_value/render_cell_value.tsx @@ -17,14 +17,14 @@ import { ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED, } from '@kbn/rule-data-utils/alerts_as_data_status'; -import type { CellValueElementProps, TimelineNonEcsData } from '../../../../timelines/common'; -import { AlertStatusIndicator } from '../../components/shared/alert_status_indicator'; -import { TimestampTooltip } from '../../components/shared/timestamp_tooltip'; -import { asDuration } from '../../../common/utils/formatters'; -import { SeverityBadge } from './severity_badge'; -import { TopAlert } from '.'; -import { parseAlert } from './parse_alert'; -import { usePluginContext } from '../../hooks/use_plugin_context'; +import type { CellValueElementProps, TimelineNonEcsData } from '../../../../../../timelines/common'; +import { AlertStatusIndicator } from '../../../../components/shared/alert_status_indicator'; +import { TimestampTooltip } from '../../../../components/shared/timestamp_tooltip'; +import { asDuration } from '../../../../../common/utils/formatters'; +import { SeverityBadge } from '../severity_badge'; +import { TopAlert } from '../../'; +import { parseAlert } from '../parse_alert'; +import { usePluginContext } from '../../../../hooks/use_plugin_context'; export const getMappedNonEcsValue = ({ data, diff --git a/x-pack/plugins/observability/public/pages/alerts/components/severity_badge/index.ts b/x-pack/plugins/observability/public/pages/alerts/components/severity_badge/index.ts new file mode 100644 index 000000000000..797415632708 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/alerts/components/severity_badge/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { SeverityBadge } from './severity_badge'; diff --git a/x-pack/plugins/observability/public/pages/alerts/severity_badge.stories.tsx b/x-pack/plugins/observability/public/pages/alerts/components/severity_badge/severity_badge.stories.tsx similarity index 100% rename from x-pack/plugins/observability/public/pages/alerts/severity_badge.stories.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/severity_badge/severity_badge.stories.tsx diff --git a/x-pack/plugins/observability/public/pages/alerts/severity_badge.tsx b/x-pack/plugins/observability/public/pages/alerts/components/severity_badge/severity_badge.tsx similarity index 100% rename from x-pack/plugins/observability/public/pages/alerts/severity_badge.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/severity_badge/severity_badge.tsx diff --git a/x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/index.ts b/x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/index.ts new file mode 100644 index 000000000000..84badecd29dc --- /dev/null +++ b/x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { WorkflowStatusFilter } from './workflow_status_filter'; diff --git a/x-pack/plugins/observability/public/pages/alerts/workflow_status_filter.stories.tsx b/x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/workflow_status_filter.stories.tsx similarity index 92% rename from x-pack/plugins/observability/public/pages/alerts/workflow_status_filter.stories.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/workflow_status_filter.stories.tsx index e06b5d333a9a..4dce3ee80b83 100644 --- a/x-pack/plugins/observability/public/pages/alerts/workflow_status_filter.stories.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/workflow_status_filter.stories.tsx @@ -6,7 +6,7 @@ */ import React, { ComponentProps, useState } from 'react'; -import type { AlertWorkflowStatus } from '../../../common/typings'; +import type { AlertWorkflowStatus } from '../../../../../common/typings'; import { WorkflowStatusFilter } from './workflow_status_filter'; type Args = ComponentProps; diff --git a/x-pack/plugins/observability/public/pages/alerts/workflow_status_filter.test.tsx b/x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/workflow_status_filter.test.tsx similarity index 95% rename from x-pack/plugins/observability/public/pages/alerts/workflow_status_filter.test.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/workflow_status_filter.test.tsx index 29c5e88788a8..a9819a6619dc 100644 --- a/x-pack/plugins/observability/public/pages/alerts/workflow_status_filter.test.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/workflow_status_filter.test.tsx @@ -8,7 +8,7 @@ import { render } from '@testing-library/react'; import { Simulate } from 'react-dom/test-utils'; import React from 'react'; -import type { AlertWorkflowStatus } from '../../../common/typings'; +import type { AlertWorkflowStatus } from '../../../../../common/typings'; import { WorkflowStatusFilter } from './workflow_status_filter'; describe('StatusFilter', () => { diff --git a/x-pack/plugins/observability/public/pages/alerts/workflow_status_filter.tsx b/x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/workflow_status_filter.tsx similarity index 95% rename from x-pack/plugins/observability/public/pages/alerts/workflow_status_filter.tsx rename to x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/workflow_status_filter.tsx index d857b9d6bd65..86116fb96968 100644 --- a/x-pack/plugins/observability/public/pages/alerts/workflow_status_filter.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/components/workflow_status_filter/workflow_status_filter.tsx @@ -8,7 +8,7 @@ import { EuiButtonGroup, EuiButtonGroupOptionProps } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import type { AlertWorkflowStatus } from '../../../common/typings'; +import type { AlertWorkflowStatus } from '../../../../../common/typings'; export interface WorkflowStatusFilterProps { status: AlertWorkflowStatus; diff --git a/x-pack/plugins/observability/public/pages/alerts/index.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx similarity index 87% rename from x-pack/plugins/observability/public/pages/alerts/index.tsx rename to x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx index 2636463bcfd7..b19a1dbe86fe 100644 --- a/x-pack/plugins/observability/public/pages/alerts/index.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx @@ -14,23 +14,25 @@ import useAsync from 'react-use/lib/useAsync'; import { AlertStatus } from '@kbn/rule-data-utils/alerts_as_data_status'; import { ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names'; -import { AlertStatusFilterButton } from '../../../common/typings'; -import { ParsedTechnicalFields } from '../../../../rule_registry/common/parse_technical_fields'; -import { ExperimentalBadge } from '../../components/shared/experimental_badge'; -import { useBreadcrumbs } from '../../hooks/use_breadcrumbs'; -import { useFetcher } from '../../hooks/use_fetcher'; -import { useHasData } from '../../hooks/use_has_data'; -import { usePluginContext } from '../../hooks/use_plugin_context'; -import { useTimefilterService } from '../../hooks/use_timefilter_service'; -import { callObservabilityApi } from '../../services/call_observability_api'; -import { getNoDataConfig } from '../../utils/no_data_config'; -import { LoadingObservability } from '../overview/loading_observability'; -import { AlertsSearchBar } from './alerts_search_bar'; -import { AlertsTableTGrid } from './alerts_table_t_grid'; -import { Provider, alertsPageStateContainer, useAlertsPageStateContainer } from './state_container'; +import { AlertStatusFilterButton } from '../../../../../common/typings'; +import { ParsedTechnicalFields } from '../../../../../../rule_registry/common/parse_technical_fields'; +import { ExperimentalBadge } from '../../../../components/shared/experimental_badge'; +import { useBreadcrumbs } from '../../../../hooks/use_breadcrumbs'; +import { useFetcher } from '../../../../hooks/use_fetcher'; +import { useHasData } from '../../../../hooks/use_has_data'; +import { usePluginContext } from '../../../../hooks/use_plugin_context'; +import { useTimefilterService } from '../../../../hooks/use_timefilter_service'; +import { callObservabilityApi } from '../../../../services/call_observability_api'; +import { getNoDataConfig } from '../../../../utils/no_data_config'; +import { LoadingObservability } from '../../../overview/loading_observability'; +import { AlertsTableTGrid } from '../alerts_table_t_grid'; +import { + Provider, + alertsPageStateContainer, + useAlertsPageStateContainer, +} from '../state_container'; import './styles.scss'; -import { AlertsStatusFilter } from './alerts_status_filter'; -import { AlertsDisclaimer } from './alerts_disclaimer'; +import { AlertsStatusFilter, AlertsDisclaimer, AlertsSearchBar } from '../../components'; export interface TopAlert { fields: ParsedTechnicalFields; @@ -243,12 +245,10 @@ function AlertsPage() { ); } -function WrappedAlertsPage() { +export function WrappedAlertsPage() { return ( ); } - -export { WrappedAlertsPage as AlertsPage }; diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/index.ts b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/index.ts new file mode 100644 index 000000000000..e3509e04b2f2 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { WrappedAlertsPage as AlertsPage } from './alerts_page'; +export type { TopAlert } from './alerts_page'; diff --git a/x-pack/plugins/observability/public/pages/alerts/styles.scss b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/styles.scss similarity index 100% rename from x-pack/plugins/observability/public/pages/alerts/styles.scss rename to x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/styles.scss diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_table_t_grid/alerts_table_t_grid.tsx similarity index 94% rename from x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx rename to x-pack/plugins/observability/public/pages/alerts/containers/alerts_table_t_grid/alerts_table_t_grid.tsx index 4b64ae07ddf0..bf99bcedc16b 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_table_t_grid/alerts_table_t_grid.tsx @@ -33,33 +33,33 @@ import styled from 'styled-components'; import React, { Suspense, useMemo, useState, useCallback, useEffect } from 'react'; import usePrevious from 'react-use/lib/usePrevious'; import { pick } from 'lodash'; -import { getAlertsPermissions } from '../../hooks/use_alert_permission'; +import { getAlertsPermissions } from '../../../../hooks/use_alert_permission'; import type { TimelinesUIStart, TGridType, TGridState, TGridModel, SortDirection, -} from '../../../../timelines/public'; +} from '../../../../../../timelines/public'; -import type { TopAlert } from './'; -import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; +import type { TopAlert } from '../alerts_page/alerts_page'; +import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; import type { ActionProps, AlertWorkflowStatus, ColumnHeaderOptions, ControlColumnProps, RowRenderer, -} from '../../../../timelines/common'; - -import { getRenderCellValue } from './render_cell_value'; -import { observabilityAppId, observabilityFeatureId } from '../../../common'; -import { useGetUserCasesPermissions } from '../../hooks/use_get_user_cases_permissions'; -import { usePluginContext } from '../../hooks/use_plugin_context'; -import { LazyAlertsFlyout } from '../..'; -import { parseAlert } from './parse_alert'; -import { CoreStart } from '../../../../../../src/core/public'; -import { translations, paths } from '../../config'; +} from '../../../../../../timelines/common'; + +import { getRenderCellValue } from '../../components/render_cell_value'; +import { observabilityAppId, observabilityFeatureId } from '../../../../../common'; +import { useGetUserCasesPermissions } from '../../../../hooks/use_get_user_cases_permissions'; +import { usePluginContext } from '../../../../hooks/use_plugin_context'; +import { LazyAlertsFlyout } from '../../../..'; +import { parseAlert } from '../../components/parse_alert'; +import { CoreStart } from '../../../../../../../../src/core/public'; +import { translations, paths } from '../../../../config'; const ALERT_TABLE_STATE_STORAGE_KEY = 'xpack.observability.alert.tableState'; diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_table_t_grid/index.ts b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_table_t_grid/index.ts new file mode 100644 index 000000000000..7bbcc43230a4 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_table_t_grid/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { AlertsTableTGrid } from './alerts_table_t_grid'; diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/index.ts b/x-pack/plugins/observability/public/pages/alerts/containers/index.ts new file mode 100644 index 000000000000..074f48f42664 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/alerts/containers/index.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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './alerts_page'; +export * from './alerts_table_t_grid'; +export * from './state_container'; diff --git a/x-pack/plugins/observability/public/pages/alerts/state_container/index.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/index.tsx similarity index 100% rename from x-pack/plugins/observability/public/pages/alerts/state_container/index.tsx rename to x-pack/plugins/observability/public/pages/alerts/containers/state_container/index.tsx diff --git a/x-pack/plugins/observability/public/pages/alerts/state_container/state_container.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx similarity index 92% rename from x-pack/plugins/observability/public/pages/alerts/state_container/state_container.tsx rename to x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx index 3e0a801fedbe..d00109cc5d63 100644 --- a/x-pack/plugins/observability/public/pages/alerts/state_container/state_container.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/state_container.tsx @@ -8,8 +8,8 @@ import { createStateContainer, createStateContainerReactHelpers, -} from '../../../../../../../src/plugins/kibana_utils/public'; -import type { AlertWorkflowStatus } from '../../../../common/typings'; +} from '../../../../../../../../src/plugins/kibana_utils/public'; +import type { AlertWorkflowStatus } from '../../../../../common/typings'; interface AlertsPageContainerState { rangeFrom: string; diff --git a/x-pack/plugins/observability/public/pages/alerts/state_container/use_alerts_page_state_container.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.tsx similarity index 92% rename from x-pack/plugins/observability/public/pages/alerts/state_container/use_alerts_page_state_container.tsx rename to x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.tsx index dfa4afcd939c..5e81286affba 100644 --- a/x-pack/plugins/observability/public/pages/alerts/state_container/use_alerts_page_state_container.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/state_container/use_alerts_page_state_container.tsx @@ -8,14 +8,14 @@ import { useEffect } from 'react'; import { useHistory } from 'react-router-dom'; -import { TimefilterContract } from '../../../../../../../src/plugins/data/public'; +import { TimefilterContract } from '../../../../../../../../src/plugins/data/public'; import { createKbnUrlStateStorage, syncState, IKbnUrlStateStorage, useContainerSelector, -} from '../../../../../../../src/plugins/kibana_utils/public'; -import { useTimefilterService } from '../../../hooks/use_timefilter_service'; +} from '../../../../../../../../src/plugins/kibana_utils/public'; +import { useTimefilterService } from '../../../../hooks/use_timefilter_service'; import { useContainer, diff --git a/x-pack/plugins/observability/public/pages/alerts/index.ts b/x-pack/plugins/observability/public/pages/alerts/index.ts new file mode 100644 index 000000000000..525f3441c447 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/alerts/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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './components'; +export * from './containers'; diff --git a/x-pack/plugins/observability/public/pages/cases/helpers.ts b/x-pack/plugins/observability/public/pages/cases/helpers.ts index 91f45c711d6a..f4bc5af7f604 100644 --- a/x-pack/plugins/observability/public/pages/cases/helpers.ts +++ b/x-pack/plugins/observability/public/pages/cases/helpers.ts @@ -6,10 +6,8 @@ */ import { useEffect, useState } from 'react'; import { isEmpty } from 'lodash'; - import { usePluginContext } from '../../hooks/use_plugin_context'; -import { parseAlert } from '../../pages/alerts/parse_alert'; -import { TopAlert } from '../../pages/alerts/'; +import { TopAlert, parseAlert } from '../../pages/alerts/'; import { useKibana } from '../../utils/kibana_react'; import { Ecs } from '../../../../cases/common'; diff --git a/x-pack/plugins/observability/public/pages/overview/index.test.tsx b/x-pack/plugins/observability/public/pages/overview/index.test.tsx new file mode 100644 index 000000000000..b37ed1d873ba --- /dev/null +++ b/x-pack/plugins/observability/public/pages/overview/index.test.tsx @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { shallow } from 'enzyme'; +import * as PluginContext from '../../hooks/use_plugin_context'; +import { PluginContextValue } from '../../context/plugin_context'; +import { OverviewPage } from './'; +import { OverviewPage as OldOverviewPage } from './old_overview_page'; +import { OverviewPage as NewOverviewPage } from './overview_page'; + +describe('Overview page', () => { + it('should render the old overview page when feature flag is disabled', () => { + const pluginContext = { + config: { + unsafe: { + overviewNext: { enabled: false }, + }, + }, + }; + + jest + .spyOn(PluginContext, 'usePluginContext') + .mockReturnValue(pluginContext as PluginContextValue); + + const component = shallow(); + expect(component.find(OldOverviewPage)).toHaveLength(1); + expect(component.find(NewOverviewPage)).toHaveLength(0); + }); + + it('should render the new overview page when feature flag is enabled', () => { + const pluginContext = { + config: { + unsafe: { + overviewNext: { enabled: true }, + }, + }, + }; + + jest + .spyOn(PluginContext, 'usePluginContext') + .mockReturnValue(pluginContext as PluginContextValue); + + const component = shallow(); + expect(component.find(OldOverviewPage)).toHaveLength(0); + expect(component.find(NewOverviewPage)).toHaveLength(1); + }); +}); diff --git a/x-pack/plugins/observability/public/pages/overview/index.tsx b/x-pack/plugins/observability/public/pages/overview/index.tsx index 7100a0552876..cc38445e3a0f 100644 --- a/x-pack/plugins/observability/public/pages/overview/index.tsx +++ b/x-pack/plugins/observability/public/pages/overview/index.tsx @@ -4,133 +4,24 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiPanel } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; import React from 'react'; -import { useTrackPageview } from '../..'; -import { EmptySections } from '../../components/app/empty_sections'; -import { ObservabilityHeaderMenu } from '../../components/app/header'; -import { NewsFeed } from '../../components/app/news_feed'; -import { Resources } from '../../components/app/resources'; -import { AlertsSection } from '../../components/app/section/alerts'; -import { DatePicker } from '../../components/shared/date_picker'; -import { useBreadcrumbs } from '../../hooks/use_breadcrumbs'; -import { useFetcher } from '../../hooks/use_fetcher'; -import { useHasData } from '../../hooks/use_has_data'; -import { usePluginContext } from '../../hooks/use_plugin_context'; -import { useTimeRange } from '../../hooks/use_time_range'; import { RouteParams } from '../../routes'; -import { getNewsFeed } from '../../services/get_news_feed'; -import { getBucketSize } from '../../utils/get_bucket_size'; -import { getNoDataConfig } from '../../utils/no_data_config'; -import { DataSections } from './data_sections'; -import { LoadingObservability } from './loading_observability'; +import { usePluginContext } from '../../hooks/use_plugin_context'; +import { OverviewPage as OldOverviewPage } from './old_overview_page'; +import { OverviewPage as NewOverviewPage } from './overview_page'; + +export type { BucketSize } from './old_overview_page'; interface Props { routeParams: RouteParams<'/overview'>; } -export type BucketSize = ReturnType; -function calculateBucketSize({ start, end }: { start?: number; end?: number }) { - if (start && end) { - return getBucketSize({ start, end, minInterval: '60s' }); - } -} - -export function OverviewPage({ routeParams }: Props) { - useTrackPageview({ app: 'observability-overview', path: 'overview' }); - useTrackPageview({ app: 'observability-overview', path: 'overview', delay: 15000 }); - useBreadcrumbs([ - { - text: i18n.translate('xpack.observability.breadcrumbs.overviewLinkText', { - defaultMessage: 'Overview', - }), - }, - ]); - - const { core, ObservabilityPageTemplate } = usePluginContext(); - - const { relativeStart, relativeEnd, absoluteStart, absoluteEnd } = useTimeRange(); - const relativeTime = { start: relativeStart, end: relativeEnd }; - const absoluteTime = { start: absoluteStart, end: absoluteEnd }; +export function OverviewPage(props: Props) { + const { config } = usePluginContext(); - const { data: newsFeed } = useFetcher(() => getNewsFeed({ core }), [core]); - - const { hasDataMap, hasAnyData, isAllRequestsComplete } = useHasData(); - - if (hasAnyData === undefined) { - return ; + if (config.unsafe.overviewNext.enabled) { + return ; + } else { + return ; } - - const hasData = hasAnyData === true || (isAllRequestsComplete === false ? undefined : false); - - const noDataConfig = getNoDataConfig({ - hasData, - basePath: core.http.basePath, - docsLink: core.docLinks.links.observability.guide, - }); - - const { refreshInterval = 10000, refreshPaused = true } = routeParams.query; - - const bucketSize = calculateBucketSize({ - start: absoluteTime.start, - end: absoluteTime.end, - }); - - return ( - , - ], - } - : undefined - } - > - {hasData && ( - <> - - - - {/* Data sections */} - {hasAnyData && } - - - - - {/* Resources / What's New sections */} - - - - {!!newsFeed?.items?.length && } - - - {hasDataMap?.alert?.hasData && ( - - - - - - )} - - - - - )} - - ); } - -const overviewPageTitle = i18n.translate('xpack.observability.overview.pageTitle', { - defaultMessage: 'Overview', -}); diff --git a/x-pack/plugins/observability/public/pages/overview/old_overview_page.tsx b/x-pack/plugins/observability/public/pages/overview/old_overview_page.tsx new file mode 100644 index 000000000000..7100a0552876 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/overview/old_overview_page.tsx @@ -0,0 +1,136 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiPanel } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { useTrackPageview } from '../..'; +import { EmptySections } from '../../components/app/empty_sections'; +import { ObservabilityHeaderMenu } from '../../components/app/header'; +import { NewsFeed } from '../../components/app/news_feed'; +import { Resources } from '../../components/app/resources'; +import { AlertsSection } from '../../components/app/section/alerts'; +import { DatePicker } from '../../components/shared/date_picker'; +import { useBreadcrumbs } from '../../hooks/use_breadcrumbs'; +import { useFetcher } from '../../hooks/use_fetcher'; +import { useHasData } from '../../hooks/use_has_data'; +import { usePluginContext } from '../../hooks/use_plugin_context'; +import { useTimeRange } from '../../hooks/use_time_range'; +import { RouteParams } from '../../routes'; +import { getNewsFeed } from '../../services/get_news_feed'; +import { getBucketSize } from '../../utils/get_bucket_size'; +import { getNoDataConfig } from '../../utils/no_data_config'; +import { DataSections } from './data_sections'; +import { LoadingObservability } from './loading_observability'; + +interface Props { + routeParams: RouteParams<'/overview'>; +} +export type BucketSize = ReturnType; +function calculateBucketSize({ start, end }: { start?: number; end?: number }) { + if (start && end) { + return getBucketSize({ start, end, minInterval: '60s' }); + } +} + +export function OverviewPage({ routeParams }: Props) { + useTrackPageview({ app: 'observability-overview', path: 'overview' }); + useTrackPageview({ app: 'observability-overview', path: 'overview', delay: 15000 }); + useBreadcrumbs([ + { + text: i18n.translate('xpack.observability.breadcrumbs.overviewLinkText', { + defaultMessage: 'Overview', + }), + }, + ]); + + const { core, ObservabilityPageTemplate } = usePluginContext(); + + const { relativeStart, relativeEnd, absoluteStart, absoluteEnd } = useTimeRange(); + + const relativeTime = { start: relativeStart, end: relativeEnd }; + const absoluteTime = { start: absoluteStart, end: absoluteEnd }; + + const { data: newsFeed } = useFetcher(() => getNewsFeed({ core }), [core]); + + const { hasDataMap, hasAnyData, isAllRequestsComplete } = useHasData(); + + if (hasAnyData === undefined) { + return ; + } + + const hasData = hasAnyData === true || (isAllRequestsComplete === false ? undefined : false); + + const noDataConfig = getNoDataConfig({ + hasData, + basePath: core.http.basePath, + docsLink: core.docLinks.links.observability.guide, + }); + + const { refreshInterval = 10000, refreshPaused = true } = routeParams.query; + + const bucketSize = calculateBucketSize({ + start: absoluteTime.start, + end: absoluteTime.end, + }); + + return ( + , + ], + } + : undefined + } + > + {hasData && ( + <> + + + + {/* Data sections */} + {hasAnyData && } + + + + + {/* Resources / What's New sections */} + + + + {!!newsFeed?.items?.length && } + + + {hasDataMap?.alert?.hasData && ( + + + + + + )} + + + + + )} + + ); +} + +const overviewPageTitle = i18n.translate('xpack.observability.overview.pageTitle', { + defaultMessage: 'Overview', +}); diff --git a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx index 6549e892cab1..6213ea3e66d4 100644 --- a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx +++ b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx @@ -66,7 +66,11 @@ const withCore = makeDecorator({ setHeaderActionMenu: () => {}, } as unknown as AppMountParameters, config: { - unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } }, + unsafe: { + alertingExperience: { enabled: true }, + cases: { enabled: true }, + overviewNext: { enabled: false }, + }, }, core: options as CoreStart, plugins: { diff --git a/x-pack/plugins/observability/public/pages/overview/overview_page.tsx b/x-pack/plugins/observability/public/pages/overview/overview_page.tsx new file mode 100644 index 000000000000..f4cdec680af9 --- /dev/null +++ b/x-pack/plugins/observability/public/pages/overview/overview_page.tsx @@ -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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { useTrackPageview } from '../..'; +import { DatePicker } from '../../components/shared/date_picker'; +import { useBreadcrumbs } from '../../hooks/use_breadcrumbs'; +import { useHasData } from '../../hooks/use_has_data'; +import { usePluginContext } from '../../hooks/use_plugin_context'; +import { useTimeRange } from '../../hooks/use_time_range'; +import { RouteParams } from '../../routes'; +import { getNoDataConfig } from '../../utils/no_data_config'; +import { LoadingObservability } from './loading_observability'; + +interface Props { + routeParams: RouteParams<'/overview'>; +} + +export function OverviewPage({ routeParams }: Props) { + useTrackPageview({ app: 'observability-overview', path: 'overview' }); + useTrackPageview({ app: 'observability-overview', path: 'overview', delay: 15000 }); + useBreadcrumbs([ + { + text: i18n.translate('xpack.observability.breadcrumbs.overviewLinkText', { + defaultMessage: 'Overview', + }), + }, + ]); + + const { core, ObservabilityPageTemplate } = usePluginContext(); + + const { relativeStart, relativeEnd } = useTimeRange(); + + const relativeTime = { start: relativeStart, end: relativeEnd }; + + const { hasAnyData, isAllRequestsComplete } = useHasData(); + + if (hasAnyData === undefined) { + return ; + } + + const hasData = hasAnyData === true || (isAllRequestsComplete === false ? undefined : false); + + const noDataConfig = getNoDataConfig({ + hasData, + basePath: core.http.basePath, + docsLink: core.docLinks.links.observability.guide, + }); + + const { refreshInterval = 10000, refreshPaused = true } = routeParams.query; + + return ( + , + ], + } + : undefined + } + > + {hasData &&
New observability content goes here
} +
+ ); +} + +const overviewPageTitle = i18n.translate('xpack.observability.overview.pageTitle', { + defaultMessage: 'Overview', +}); diff --git a/x-pack/plugins/observability/public/routes/index.tsx b/x-pack/plugins/observability/public/routes/index.tsx index 169f4b5254c0..6f38a66cdb64 100644 --- a/x-pack/plugins/observability/public/routes/index.tsx +++ b/x-pack/plugins/observability/public/routes/index.tsx @@ -8,8 +8,8 @@ import * as t from 'io-ts'; import React from 'react'; import { casesPath } from '../../common'; -import { AlertsPage } from '../pages/alerts'; import { CasesPage } from '../pages/cases'; +import { AlertsPage } from '../pages/alerts/containers/alerts_page'; import { HomePage } from '../pages/home'; import { LandingPage } from '../pages/landing'; import { OverviewPage } from '../pages/overview'; diff --git a/x-pack/plugins/observability/public/utils/test_helper.tsx b/x-pack/plugins/observability/public/utils/test_helper.tsx index 544f3feecb2b..a3ec446e5c30 100644 --- a/x-pack/plugins/observability/public/utils/test_helper.tsx +++ b/x-pack/plugins/observability/public/utils/test_helper.tsx @@ -34,7 +34,13 @@ export const core = { }, } as unknown as CoreStart; -const config = { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } }; +const config = { + unsafe: { + alertingExperience: { enabled: true }, + cases: { enabled: true }, + overviewNext: { enabled: false }, + }, +}; const plugins = { data: { query: { timefilter: { timefilter: { setTime: jest.fn() } } } }, diff --git a/x-pack/plugins/observability/server/index.ts b/x-pack/plugins/observability/server/index.ts index d99cf0865c0d..51204c7512a3 100644 --- a/x-pack/plugins/observability/server/index.ts +++ b/x-pack/plugins/observability/server/index.ts @@ -34,6 +34,7 @@ export const config: PluginConfigDescriptor = { unsafe: schema.object({ alertingExperience: schema.object({ enabled: schema.boolean({ defaultValue: true }) }), cases: schema.object({ enabled: schema.boolean({ defaultValue: true }) }), + overviewNext: schema.object({ enabled: schema.boolean({ defaultValue: false }) }), }), }), }; diff --git a/x-pack/plugins/rule_registry/common/assets/field_maps/ecs_field_map.ts b/x-pack/plugins/rule_registry/common/assets/field_maps/ecs_field_map.ts index 859070bd498e..1ea85e5a5434 100644 --- a/x-pack/plugins/rule_registry/common/assets/field_maps/ecs_field_map.ts +++ b/x-pack/plugins/rule_registry/common/assets/field_maps/ecs_field_map.ts @@ -2550,6 +2550,426 @@ export const ecsFieldMap = { array: false, required: false, }, + 'threat.enrichments': { + type: 'nested', + array: true, + required: false, + }, + 'threat.enrichments.indicator': { + type: 'object', + array: false, + required: false, + }, + 'threat.enrichments.indicator.as.number': { + type: 'long', + array: false, + required: false, + }, + 'threat.enrichments.indicator.as.organization.name': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.confidence': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.description': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.email.address': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.accessed': { + type: 'date', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.attributes': { + type: 'keyword', + array: true, + required: false, + }, + 'threat.enrichments.indicator.file.code_signature.digest_algorithm': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.code_signature.exists': { + type: 'boolean', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.code_signature.signing_id': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.code_signature.status': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.code_signature.subject_name': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.code_signature.team_id': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.code_signature.timestamp': { + type: 'date', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.code_signature.trusted': { + type: 'boolean', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.code_signature.valid': { + type: 'boolean', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.created': { + type: 'date', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.ctime': { + type: 'date', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.device': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.directory': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.drive_letter': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.extension': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.fork_name': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.gid': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.group': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.hash.md5': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.hash.sha1': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.hash.sha256': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.hash.sha512': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.hash.ssdeep': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.inode': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.mime_type': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.mode': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.mtime': { + type: 'date', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.name': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.owner': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.path': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.size': { + type: 'long', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.target_path': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.type': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.file.uid': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.first_seen': { + type: 'date', + array: false, + required: false, + }, + 'threat.enrichments.indicator.ip': { + type: 'ip', + array: false, + required: false, + }, + 'threat.enrichments.indicator.last_seen': { + type: 'date', + array: false, + required: false, + }, + 'threat.enrichments.indicator.marking.tlp': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.modified_at': { + type: 'date', + array: false, + required: false, + }, + 'threat.enrichments.indicator.port': { + type: 'long', + array: false, + required: false, + }, + 'threat.enrichments.indicator.provider': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.reference': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.registry.data.bytes': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.registry.data.strings': { + type: 'wildcard', + array: true, + required: false, + }, + 'threat.enrichments.indicator.registry.data.type': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.registry.hive': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.registry.key': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.registry.path': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.registry.value': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.scanner_stats': { + type: 'long', + array: false, + required: false, + }, + 'threat.enrichments.indicator.sightings': { + type: 'long', + array: false, + required: false, + }, + 'threat.enrichments.indicator.type': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.domain': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.extension': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.fragment': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.full': { + type: 'wildcard', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.original': { + type: 'wildcard', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.password': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.path': { + type: 'wildcard', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.port': { + type: 'long', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.query': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.registered_domain': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.scheme': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.subdomain': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.top_level_domain': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.indicator.url.username': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.matched.atomic': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.matched.field': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.matched.id': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.matched.index': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.enrichments.matched.type': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.group.alias': { + type: 'keyword', + array: true, + required: false, + }, + 'threat.group.id': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.group.name': { + type: 'keyword', + array: false, + required: false, + }, + 'threat.group.reference': { + type: 'keyword', + array: false, + required: false, + }, 'threat.tactic.id': { type: 'keyword', array: true, diff --git a/x-pack/plugins/rule_registry/scripts/generate_ecs_fieldmap/index.js b/x-pack/plugins/rule_registry/scripts/generate_ecs_fieldmap/index.js index 6b10ca5f837d..bbcf651bd6d6 100644 --- a/x-pack/plugins/rule_registry/scripts/generate_ecs_fieldmap/index.js +++ b/x-pack/plugins/rule_registry/scripts/generate_ecs_fieldmap/index.js @@ -19,7 +19,7 @@ const exec = util.promisify(execCb); const ecsDir = path.resolve(__dirname, '../../../../../../ecs'); const ecsYamlFilename = path.join(ecsDir, 'generated/ecs/ecs_flat.yml'); -const outputDir = path.join(__dirname, '../../common/field_map'); +const outputDir = path.join(__dirname, '../../common/assets/field_maps'); const outputFieldMapFilename = path.join(outputDir, 'ecs_field_map.ts'); diff --git a/x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts b/x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts index bfdec28a5098..bbfa17c5694f 100644 --- a/x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts +++ b/x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts @@ -316,7 +316,7 @@ export class ResourceInstaller { // @ts-expect-error rollover_alias: primaryNamespacedAlias, }, - 'index.mapping.total_fields.limit': 1100, + 'index.mapping.total_fields.limit': 1200, }, mappings: { dynamic: false, diff --git a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx index 007c3e306372..1601ea481cf2 100644 --- a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx @@ -104,7 +104,7 @@ describe('rolesManagementApp', () => { expect(docTitle.reset).not.toHaveBeenCalled(); expect(container).toMatchInlineSnapshot(`
- Role Edit Page: {"action":"edit","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"fieldCache":{}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit","search":"","hash":""}}} + Role Edit Page: {"action":"edit","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"fieldCache":{},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit","search":"","hash":""}}}
`); @@ -129,7 +129,7 @@ describe('rolesManagementApp', () => { expect(docTitle.reset).not.toHaveBeenCalled(); expect(container).toMatchInlineSnapshot(`
- Role Edit Page: {"action":"edit","roleName":"role@name","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"fieldCache":{}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit/role@name","search":"","hash":""}}} + Role Edit Page: {"action":"edit","roleName":"role@name","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"fieldCache":{},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/edit/role@name","search":"","hash":""}}}
`); @@ -154,7 +154,7 @@ describe('rolesManagementApp', () => { expect(docTitle.reset).not.toHaveBeenCalled(); expect(container).toMatchInlineSnapshot(`
- Role Edit Page: {"action":"clone","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"fieldCache":{}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/clone/someRoleName","search":"","hash":""}}} + Role Edit Page: {"action":"clone","roleName":"someRoleName","rolesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"userAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"indicesAPIClient":{"fieldCache":{},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"privilegesAPIClient":{"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}}},"http":{"basePath":{"basePath":"","serverBasePath":""},"anonymousPaths":{},"externalUrl":{}},"notifications":{"toasts":{}},"fatalErrors":{},"license":{"features$":{"_isScalar":false}},"docLinks":{},"uiCapabilities":{"catalogue":{},"management":{},"navLinks":{}},"history":{"action":"PUSH","length":1,"location":{"pathname":"/clone/someRoleName","search":"","hash":""}}}
`); diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx index eb4e226940c5..87a5710ab037 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx @@ -30,6 +30,8 @@ const columns: Array> = [ align: 'right', field: 'count', name: 'Risk Score', + render: (riskScore) => + Number.isNaN(riskScore) ? riskScore : Number.parseFloat(riskScore).toFixed(2), sortable: true, truncateText: true, width: '15%', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.ts index 187de40d33df..b056fd3ed80f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.ts @@ -326,6 +326,7 @@ export const importRulesRoute = ( threshold, threatFilters, threatIndex, + threatIndicatorPath, threatQuery, threatMapping, threatLanguage, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts index 838bfe63782c..9e821c8f686f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts @@ -98,6 +98,7 @@ export const patchRulesBulkRoute = ( threshold, threat_filters: threatFilters, threat_index: threatIndex, + threat_indicator_path: threatIndicatorPath, threat_query: threatQuery, threat_mapping: threatMapping, threat_language: threatLanguage, @@ -178,6 +179,7 @@ export const patchRulesBulkRoute = ( threshold, threatFilters, threatIndex, + threatIndicatorPath, threatQuery, threatMapping, threatLanguage, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.ts index bb9f7e147524..da3e4ccc99b9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/patch_rules_route.ts @@ -86,6 +86,7 @@ export const patchRulesRoute = ( threshold, threat_filters: threatFilters, threat_index: threatIndex, + threat_indicator_path: threatIndicatorPath, threat_query: threatQuery, threat_mapping: threatMapping, threat_language: threatLanguage, @@ -179,6 +180,7 @@ export const patchRulesRoute = ( threshold, threatFilters, threatIndex, + threatIndicatorPath, threatQuery, threatMapping, threatLanguage, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.mock.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.mock.ts index 3626bcd5f127..3a602a54ca09 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.mock.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.mock.ts @@ -49,6 +49,7 @@ export const getPatchRulesOptionsMock = (isRuleRegistryEnabled: boolean): PatchR threshold: undefined, threatFilters: undefined, threatIndex: undefined, + threatIndicatorPath: undefined, threatQuery: undefined, threatMapping: undefined, threatLanguage: undefined, @@ -103,6 +104,7 @@ export const getPatchMlRulesOptionsMock = (isRuleRegistryEnabled: boolean): Patc threshold: undefined, threatFilters: undefined, threatIndex: undefined, + threatIndicatorPath: undefined, threatQuery: undefined, threatMapping: undefined, threatLanguage: undefined, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts index fd48cd4eebc2..ee3098b8577d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/patch_rules.ts @@ -71,6 +71,7 @@ export const patchRules = async ({ threshold, threatFilters, threatIndex, + threatIndicatorPath, threatQuery, threatMapping, threatLanguage, @@ -123,6 +124,7 @@ export const patchRules = async ({ threshold, threatFilters, threatIndex, + threatIndicatorPath, threatQuery, threatMapping, threatLanguage, @@ -170,6 +172,7 @@ export const patchRules = async ({ threshold: threshold ? normalizeThresholdObject(threshold) : undefined, threatFilters, threatIndex, + threatIndicatorPath, threatQuery, threatMapping, threatLanguage, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts index f847e385e647..06328137973c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/types.ts @@ -310,6 +310,7 @@ export interface PatchRulesOptions { threshold: ThresholdOrUndefined; threatFilters: ThreatFiltersOrUndefined; threatIndex: ThreatIndexOrUndefined; + threatIndicatorPath: ThreatIndicatorPathOrUndefined; threatQuery: ThreatQueryOrUndefined; threatMapping: ThreatMappingOrUndefined; threatLanguage: ThreatLanguageOrUndefined; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.test.ts index 9bd0fe3cef59..c4cd5d4211c9 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.test.ts @@ -63,4 +63,42 @@ describe.each([ }) ); }); + + it('should update threat match rules', async () => { + const updatedThreatParams = { + threat_index: ['test-index'], + threat_indicator_path: 'test.path', + threat_query: 'threat:*', + }; + const prepackagedRule = getAddPrepackagedRulesSchemaDecodedMock(); + rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(isRuleRegistryEnabled)); + + await updatePrepackagedRules( + rulesClient, + savedObjectsClient, + 'default', + ruleStatusClient, + [{ ...prepackagedRule, ...updatedThreatParams }], + 'output-index', + isRuleRegistryEnabled + ); + + expect(patchRules).toHaveBeenCalledWith( + expect.objectContaining({ + threatIndicatorPath: 'test.path', + }) + ); + + expect(patchRules).toHaveBeenCalledWith( + expect.objectContaining({ + threatIndex: ['test-index'], + }) + ); + + expect(patchRules).toHaveBeenCalledWith( + expect.objectContaining({ + threatQuery: 'threat:*', + }) + ); + }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.ts index dcf43d41e8d7..e24a6a883b6d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/update_prepacked_rules.ts @@ -124,6 +124,7 @@ export const createPromises = ( threshold, threat_filters: threatFilters, threat_index: threatIndex, + threat_indicator_path: threatIndicatorPath, threat_query: threatQuery, threat_mapping: threatMapping, threat_language: threatLanguage, @@ -195,6 +196,7 @@ export const createPromises = ( threshold, threatFilters, threatIndex, + threatIndicatorPath, threatQuery, threatMapping, threatLanguage, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts index 2cf7e95f3c62..448d1b1a1db6 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.test.ts @@ -75,6 +75,7 @@ describe('utils', () => { threshold: undefined, threatFilters: undefined, threatIndex: undefined, + threatIndicatorPath: undefined, threatQuery: undefined, threatMapping: undefined, threatLanguage: undefined, @@ -126,6 +127,7 @@ describe('utils', () => { threshold: undefined, threatFilters: undefined, threatIndex: undefined, + threatIndicatorPath: undefined, threatQuery: undefined, threatMapping: undefined, threatLanguage: undefined, @@ -177,6 +179,7 @@ describe('utils', () => { threshold: undefined, threatFilters: undefined, threatIndex: undefined, + threatIndicatorPath: undefined, threatQuery: undefined, threatMapping: undefined, threatLanguage: undefined, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts index ec25b45dd159..4ab8afd796f6 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/utils.ts @@ -15,6 +15,7 @@ import type { ItemsPerSearchOrUndefined, ThreatFiltersOrUndefined, ThreatIndexOrUndefined, + ThreatIndicatorPathOrUndefined, ThreatLanguageOrUndefined, ThreatMappingOrUndefined, ThreatQueryOrUndefined, @@ -113,6 +114,7 @@ export interface UpdateProperties { threshold: ThresholdOrUndefined; threatFilters: ThreatFiltersOrUndefined; threatIndex: ThreatIndexOrUndefined; + threatIndicatorPath: ThreatIndicatorPathOrUndefined; threatQuery: ThreatQueryOrUndefined; threatMapping: ThreatMappingOrUndefined; threatLanguage: ThreatLanguageOrUndefined; diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 9fc49535e18e..6d54be0664e0 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -6233,13 +6233,9 @@ "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsBetaDescription": "失敗したトランザクションの相関関係はGAではありません。不具合が発生したら報告してください。", "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsBetaLabel": "ベータ", "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsBetaTitle": "失敗したトランザクションの相関関係", - "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsChartAllTransactions": "すべてのトランザクション", "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsLabel": "失敗したトランザクションの相関関係", - "xpack.apm.transactionDetails.tabs.latencyCorrelationsChartAllTransactions": "すべてのトランザクション", - "xpack.apm.transactionDetails.tabs.latencyCorrelationsChartDescription": "{allTransactions}と{focusTransaction}の{br}重複する帯を使用した遅延(x)とトランザクション(y)の両対数プロット。", "xpack.apm.transactionDetails.tabs.latencyLabel": "遅延の相関関係", "xpack.apm.transactionDetails.tabs.traceSamplesLabel": "トレースのサンプル", - "xpack.apm.transactionDetails.tabs.transactionDistributionChartAllTransactions": "すべてのトランザクション", "xpack.apm.transactionDetails.traceNotFound": "選択されたトレースが見つかりません", "xpack.apm.transactionDetails.traceSampleTitle": "トレースのサンプル", "xpack.apm.transactionDetails.transactionLabel": "トランザクション", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 102051ac2a9d..f04696d7dbe3 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -6276,13 +6276,9 @@ "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsBetaDescription": "失败事务相关性不是 GA 版。请通过报告错误来帮助我们。", "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsBetaLabel": "公测版", "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsBetaTitle": "失败事务相关性", - "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsChartAllTransactions": "所有事务", "xpack.apm.transactionDetails.tabs.failedTransactionsCorrelationsLabel": "失败事务相关性", - "xpack.apm.transactionDetails.tabs.latencyCorrelationsChartAllTransactions": "所有事务", - "xpack.apm.transactionDetails.tabs.latencyCorrelationsChartDescription": "{allTransactions}和{focusTransaction}{br}带重叠的延迟 (x) 与事务 (y) 双对数坐标图。", "xpack.apm.transactionDetails.tabs.latencyLabel": "延迟相关性", "xpack.apm.transactionDetails.tabs.traceSamplesLabel": "跟踪样例", - "xpack.apm.transactionDetails.tabs.transactionDistributionChartAllTransactions": "所有事务", "xpack.apm.transactionDetails.traceNotFound": "找不到所选跟踪", "xpack.apm.transactionDetails.traceSampleTitle": "跟踪样例", "xpack.apm.transactionDetails.transactionLabel": "事务", diff --git a/x-pack/plugins/uptime/common/config.ts b/x-pack/plugins/uptime/common/config.ts index ccd5e7b5a2cc..8b7086964564 100644 --- a/x-pack/plugins/uptime/common/config.ts +++ b/x-pack/plugins/uptime/common/config.ts @@ -36,7 +36,7 @@ export const config: PluginConfigDescriptor = { username: schema.string(), password: schema.string(), manifestUrl: schema.string(), - hosts: schema.arrayOf(schema.string()), + hosts: schema.maybe(schema.arrayOf(schema.string())), }) ), }) diff --git a/x-pack/plugins/uptime/common/constants/rest_api.ts b/x-pack/plugins/uptime/common/constants/rest_api.ts index bef84c41796d..9c8098390d12 100644 --- a/x-pack/plugins/uptime/common/constants/rest_api.ts +++ b/x-pack/plugins/uptime/common/constants/rest_api.ts @@ -37,5 +37,6 @@ export enum API_URLS { CONNECTOR_TYPES = '/api/actions/connector_types', // Service end points - INDEX_TEMPLATES = '/api/uptime/service/index_templates', + INDEX_TEMPLATES = '/internal/uptime/service/index_templates', + SYNTHETICS_MONITORS = '/internal/uptime/service/monitors', } diff --git a/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts index eae9dd5e73ca..d51496d6efaf 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts @@ -20,6 +20,7 @@ export class UMKibanaBackendFrameworkAdapter implements UMBackendFrameworkAdapte validate, options, }; + switch (method) { case 'GET': this.server.router.get(routeDefinition, handler); @@ -27,6 +28,12 @@ export class UMKibanaBackendFrameworkAdapter implements UMBackendFrameworkAdapte case 'POST': this.server.router.post(routeDefinition, handler); break; + case 'PUT': + this.server.router.put(routeDefinition, handler); + break; + case 'DELETE': + this.server.router.delete(routeDefinition, handler); + break; default: throw new Error(`Handler for method ${method} is not defined`); } diff --git a/x-pack/plugins/uptime/server/rest_api/index.ts b/x-pack/plugins/uptime/server/rest_api/index.ts index 344dd4d203d8..4eb6ae307125 100644 --- a/x-pack/plugins/uptime/server/rest_api/index.ts +++ b/x-pack/plugins/uptime/server/rest_api/index.ts @@ -28,6 +28,13 @@ import { createNetworkEventsRoute } from './network_events'; import { createJourneyFailedStepsRoute } from './pings/journeys'; import { createLastSuccessfulStepRoute } from './synthetics/last_successful_step'; import { installIndexTemplatesRoute } from './synthetics_service/install_index_templates'; +import { + getAllSyntheticsMonitorRoute, + getSyntheticsMonitorRoute, +} from './synthetics_service/get_monitors'; +import { addSyntheticsMonitorRoute } from './synthetics_service/add_monitor'; +import { editSyntheticsMonitorRoute } from './synthetics_service/edit_monitor'; +import { deleteSyntheticsMonitorRoute } from './synthetics_service/delete_monitor'; export * from './types'; export { createRouteWithAuth } from './create_route_with_auth'; @@ -53,4 +60,9 @@ export const restApiRoutes: UMRestApiRouteFactory[] = [ createLastSuccessfulStepRoute, createJourneyScreenshotBlocksRoute, installIndexTemplatesRoute, + getSyntheticsMonitorRoute, + getAllSyntheticsMonitorRoute, + addSyntheticsMonitorRoute, + editSyntheticsMonitorRoute, + deleteSyntheticsMonitorRoute, ]; diff --git a/x-pack/plugins/uptime/server/rest_api/synthetics_service/add_monitor.ts b/x-pack/plugins/uptime/server/rest_api/synthetics_service/add_monitor.ts new file mode 100644 index 000000000000..11d7dcedcaa3 --- /dev/null +++ b/x-pack/plugins/uptime/server/rest_api/synthetics_service/add_monitor.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 + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { schema } from '@kbn/config-schema'; +import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; +import { SyntheticsMonitorSavedObject } from '../../../common/types'; +import { syntheticsMonitorType } from '../../lib/saved_objects/synthetics_monitor'; + +export const addSyntheticsMonitorRoute: UMRestApiRouteFactory = () => ({ + method: 'POST', + path: API_URLS.SYNTHETICS_MONITORS, + validate: { + body: schema.any(), + }, + handler: async ({ request, savedObjectsClient }): Promise => { + const monitor = request.body as SyntheticsMonitorSavedObject; + + const newMonitor = await savedObjectsClient.create(syntheticsMonitorType, monitor); + // TODO: call to service sync + return newMonitor; + }, +}); diff --git a/x-pack/plugins/uptime/server/rest_api/synthetics_service/delete_monitor.ts b/x-pack/plugins/uptime/server/rest_api/synthetics_service/delete_monitor.ts new file mode 100644 index 000000000000..68eb8aa130d2 --- /dev/null +++ b/x-pack/plugins/uptime/server/rest_api/synthetics_service/delete_monitor.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { schema } from '@kbn/config-schema'; +import { SavedObjectsErrorHelpers } from '../../../../../../src/core/server'; +import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; +import { syntheticsMonitorType } from '../../lib/saved_objects/synthetics_monitor'; + +export const deleteSyntheticsMonitorRoute: UMRestApiRouteFactory = () => ({ + method: 'DELETE', + path: API_URLS.SYNTHETICS_MONITORS + '/{monitorId}', + validate: { + params: schema.object({ + monitorId: schema.string(), + }), + }, + handler: async ({ request, savedObjectsClient }): Promise => { + const { monitorId } = request.params; + + try { + await savedObjectsClient.delete(syntheticsMonitorType, monitorId); + // TODO: call to service sync + return monitorId; + } catch (getErr) { + if (SavedObjectsErrorHelpers.isNotFoundError(getErr)) { + return 'Not found'; + } + } + }, +}); diff --git a/x-pack/plugins/uptime/server/rest_api/synthetics_service/edit_monitor.ts b/x-pack/plugins/uptime/server/rest_api/synthetics_service/edit_monitor.ts new file mode 100644 index 000000000000..46a91738c380 --- /dev/null +++ b/x-pack/plugins/uptime/server/rest_api/synthetics_service/edit_monitor.ts @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { schema } from '@kbn/config-schema'; +import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; +import { SyntheticsMonitorSavedObject } from '../../../common/types'; +import { syntheticsMonitorType } from '../../lib/saved_objects/synthetics_monitor'; + +export const editSyntheticsMonitorRoute: UMRestApiRouteFactory = () => ({ + method: 'PUT', + path: API_URLS.SYNTHETICS_MONITORS + '/{monitorId}', + validate: { + params: schema.object({ + monitorId: schema.string(), + }), + body: schema.any(), + }, + handler: async ({ request, savedObjectsClient }): Promise => { + const monitor = request.body as SyntheticsMonitorSavedObject['attributes']; + + const { monitorId } = request.params; + + const editMonitor = await savedObjectsClient.update(syntheticsMonitorType, monitorId, monitor); + // TODO: call to service sync + return editMonitor; + }, +}); diff --git a/x-pack/plugins/uptime/server/rest_api/synthetics_service/get_monitors.ts b/x-pack/plugins/uptime/server/rest_api/synthetics_service/get_monitors.ts new file mode 100644 index 000000000000..537d6c77195c --- /dev/null +++ b/x-pack/plugins/uptime/server/rest_api/synthetics_service/get_monitors.ts @@ -0,0 +1,40 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { schema } from '@kbn/config-schema'; +import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants'; +import { syntheticsMonitorType } from '../../lib/saved_objects/synthetics_monitor'; + +export const getSyntheticsMonitorRoute: UMRestApiRouteFactory = () => ({ + method: 'GET', + path: API_URLS.SYNTHETICS_MONITORS + '/{monitorId}', + validate: { + params: schema.object({ + monitorId: schema.string(), + }), + }, + handler: async ({ request, savedObjectsClient }): Promise => { + const { monitorId } = request.params; + return await savedObjectsClient.get(syntheticsMonitorType, monitorId); + }, +}); + +export const getAllSyntheticsMonitorRoute: UMRestApiRouteFactory = () => ({ + method: 'GET', + path: API_URLS.SYNTHETICS_MONITORS, + validate: { + query: schema.object({ + page: schema.maybe(schema.number()), + perPage: schema.maybe(schema.number()), + }), + }, + handler: async ({ request, savedObjectsClient }): Promise => { + const { perPage = 50, page } = request.query; + // TODO: add query/filtering params + return await savedObjectsClient.find({ type: syntheticsMonitorType, perPage, page }); + }, +}); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts index 9bf7baf95d8d..806c1fa3a4ea 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/event_log.ts @@ -490,8 +490,11 @@ export default function eventLogTests({ getService }: FtrProviderContext) { }); }); - const startEvent = events[0]; - const executeEvent = events[1]; + const executeEvents = getEventsByAction(events, 'execute'); + const executeStartEvents = getEventsByAction(events, 'execute-start'); + + const startEvent = executeStartEvents[0]; + const executeEvent = executeEvents[0]; expect(startEvent).to.be.ok(); expect(executeEvent).to.be.ok(); diff --git a/x-pack/test/api_integration/apis/uptime/rest/add_monitor.ts b/x-pack/test/api_integration/apis/uptime/rest/add_monitor.ts new file mode 100644 index 000000000000..a57a03fd3a1f --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/add_monitor.ts @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; + +export default function ({ getService }: FtrProviderContext) { + describe('add synthetics monitor', () => { + const supertest = getService('supertest'); + const newMonitor = { + type: 'http', + name: 'Test monitor', + urls: 'https://www.elastic.co', + }; + + it('returns the newly added monitor', async () => { + const apiResponse = await supertest + .post(API_URLS.SYNTHETICS_MONITORS) + .set('kbn-xsrf', 'true') + .send(newMonitor); + + expect(apiResponse.body.attributes).eql(newMonitor); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/delete_monitor.ts b/x-pack/test/api_integration/apis/uptime/rest/delete_monitor.ts new file mode 100644 index 000000000000..bc49587fab87 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/delete_monitor.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; + +export default function ({ getService }: FtrProviderContext) { + describe('delete synthetics monitor', () => { + const supertest = getService('supertest'); + const newMonitor = { + type: 'http', + name: 'Test monitor', + urls: 'https://www.elastic.co', + }; + + it('deleted monitor by id', async () => { + const apiResponse = await supertest + .post(API_URLS.SYNTHETICS_MONITORS) + .set('kbn-xsrf', 'true') + .send(newMonitor); + + const monitorId = apiResponse.body.id; + + const deleteResponse = await supertest + .delete(API_URLS.SYNTHETICS_MONITORS + '/' + monitorId) + .set('kbn-xsrf', 'true'); + // + expect(deleteResponse.body).eql(monitorId); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/edit_monitor.ts b/x-pack/test/api_integration/apis/uptime/rest/edit_monitor.ts new file mode 100644 index 000000000000..f5d54c40a864 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/edit_monitor.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; +export default function ({ getService }: FtrProviderContext) { + describe('edit synthetics monitor', () => { + const supertest = getService('supertest'); + const newMonitor = { + type: 'http', + name: 'Test monitor', + urls: 'https://www.elastic.co', + }; + + it('edits the monitor', async () => { + const apiResponse = await supertest + .post(API_URLS.SYNTHETICS_MONITORS) + .set('kbn-xsrf', 'true') + .send(newMonitor); + + const monitorId = apiResponse.body.id; + + expect(apiResponse.body.attributes).eql(newMonitor); + + const editResponse = await supertest + .put(API_URLS.SYNTHETICS_MONITORS + '/' + monitorId) + .set('kbn-xsrf', 'true') + .send({ ...newMonitor, name: 'New name' }); + + expect(editResponse.body.attributes.name).eql('New name'); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/get_monitor.ts b/x-pack/test/api_integration/apis/uptime/rest/get_monitor.ts new file mode 100644 index 000000000000..76d27ff8a9d1 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/get_monitor.ts @@ -0,0 +1,51 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; + +export default function ({ getService }: FtrProviderContext) { + describe('get synthetics monitor', () => { + const newMonitor = { + type: 'http', + name: 'Test monitor', + urls: 'https://www.elastic.co', + }; + + const addMonitor = async () => { + const res = await supertest + .post(API_URLS.SYNTHETICS_MONITORS) + .set('kbn-xsrf', 'true') + .send(newMonitor); + return res.body.id; + }; + + const supertest = getService('supertest'); + + it('get all monitors', async () => { + const id1 = await addMonitor(); + const id2 = await addMonitor(); + + const apiResponse = await supertest.get(API_URLS.SYNTHETICS_MONITORS); + + const monitor1 = apiResponse.body.saved_objects.find((obj: any) => obj.id === id1); + const monitor2 = apiResponse.body.saved_objects.find((obj: any) => obj.id === id2); + + expect(monitor1.id).eql(id1); + expect(monitor2.id).eql(id2); + }); + + it('get monitor by id', async () => { + const monitorId = await addMonitor(); + + const apiResponse = await supertest.get(API_URLS.SYNTHETICS_MONITORS + '/' + monitorId); + + expect(apiResponse.body.id).eql(monitorId); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/index.ts b/x-pack/test/api_integration/apis/uptime/rest/index.ts index dc3c00b03f71..f674879552d6 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/index.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/index.ts @@ -71,5 +71,12 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./index_status')); loadTestFile(require.resolve('./monitor_states_real_data')); }); + + describe('uptime CRUD routes', () => { + loadTestFile(require.resolve('./get_monitor')); + loadTestFile(require.resolve('./add_monitor')); + loadTestFile(require.resolve('./edit_monitor')); + loadTestFile(require.resolve('./delete_monitor')); + }); }); } diff --git a/x-pack/test/api_integration/config.ts b/x-pack/test/api_integration/config.ts index e2c2e0b52dfd..bf42a5b0865a 100644 --- a/x-pack/test/api_integration/config.ts +++ b/x-pack/test/api_integration/config.ts @@ -35,6 +35,10 @@ export async function getApiIntegrationConfig({ readConfigFile }: FtrConfigProvi '--xpack.ruleRegistry.write.enabled=true', '--xpack.ruleRegistry.write.enabled=true', '--xpack.ruleRegistry.write.cache.enabled=false', + '--xpack.uptime.unsafe.service.enabled=true', + '--xpack.uptime.unsafe.service.password=test', + '--xpack.uptime.unsafe.service.manifestUrl=http://test.com', + '--xpack.uptime.unsafe.service.username=user', `--xpack.securitySolution.enableExperimental=${JSON.stringify(['ruleRegistryEnabled'])}`, ], }, diff --git a/x-pack/test/apm_api_integration/tests/traces/__snapshots__/top_traces.spec.snap b/x-pack/test/apm_api_integration/tests/traces/__snapshots__/top_traces.spec.snap index 604348355f38..528963709712 100644 --- a/x-pack/test/apm_api_integration/tests/traces/__snapshots__/top_traces.spec.snap +++ b/x-pack/test/apm_api_integration/tests/traces/__snapshots__/top_traces.spec.snap @@ -3,6 +3,7 @@ exports[`APM API tests basic apm_8.0.0 Top traces when data is loaded returns the correct buckets 1`] = ` Array [ Object { + "agentName": "java", "averageResponseTime": 1639, "impact": 0, "key": Object { @@ -15,6 +16,7 @@ Array [ "transactionsPerMinute": 0.0333333333333333, }, Object { + "agentName": "nodejs", "averageResponseTime": 3279, "impact": 0.00144735571024101, "key": Object { @@ -27,6 +29,7 @@ Array [ "transactionsPerMinute": 0.0333333333333333, }, Object { + "agentName": "nodejs", "averageResponseTime": 6175, "impact": 0.00400317408637392, "key": Object { @@ -39,6 +42,7 @@ Array [ "transactionsPerMinute": 0.0333333333333333, }, Object { + "agentName": "dotnet", "averageResponseTime": 3495, "impact": 0.00472243927164613, "key": Object { @@ -51,6 +55,7 @@ Array [ "transactionsPerMinute": 0.0666666666666667, }, Object { + "agentName": "python", "averageResponseTime": 7039, "impact": 0.00476568343615943, "key": Object { @@ -63,6 +68,7 @@ Array [ "transactionsPerMinute": 0.0333333333333333, }, Object { + "agentName": "ruby", "averageResponseTime": 6303, "impact": 0.00967875004525193, "key": Object { @@ -75,6 +81,7 @@ Array [ "transactionsPerMinute": 0.0666666666666667, }, Object { + "agentName": "java", "averageResponseTime": 7209.66666666667, "impact": 0.0176418540534865, "key": Object { @@ -87,6 +94,7 @@ Array [ "transactionsPerMinute": 0.1, }, Object { + "agentName": "java", "averageResponseTime": 4511, "impact": 0.0224401912465233, "key": Object { @@ -99,6 +107,7 @@ Array [ "transactionsPerMinute": 0.2, }, Object { + "agentName": "python", "averageResponseTime": 7607, "impact": 0.0254072704525173, "key": Object { @@ -111,6 +120,7 @@ Array [ "transactionsPerMinute": 0.133333333333333, }, Object { + "agentName": "nodejs", "averageResponseTime": 10143, "impact": 0.025408152986487, "key": Object { @@ -123,6 +133,7 @@ Array [ "transactionsPerMinute": 0.1, }, Object { + "agentName": "ruby", "averageResponseTime": 6105.66666666667, "impact": 0.0308842762682221, "key": Object { @@ -135,6 +146,7 @@ Array [ "transactionsPerMinute": 0.2, }, Object { + "agentName": "java", "averageResponseTime": 6116.33333333333, "impact": 0.0309407584422802, "key": Object { @@ -147,6 +159,7 @@ Array [ "transactionsPerMinute": 0.2, }, Object { + "agentName": "java", "averageResponseTime": 12543, "impact": 0.0317623975680329, "key": Object { @@ -159,6 +172,7 @@ Array [ "transactionsPerMinute": 0.1, }, Object { + "agentName": "nodejs", "averageResponseTime": 5551, "impact": 0.0328461492827744, "key": Object { @@ -171,6 +185,7 @@ Array [ "transactionsPerMinute": 0.233333333333333, }, Object { + "agentName": "java", "averageResponseTime": 13183, "impact": 0.0334568627897785, "key": Object { @@ -183,6 +198,7 @@ Array [ "transactionsPerMinute": 0.1, }, Object { + "agentName": "go", "averageResponseTime": 8050.2, "impact": 0.0340764016364792, "key": Object { @@ -195,6 +211,7 @@ Array [ "transactionsPerMinute": 0.166666666666667, }, Object { + "agentName": "ruby", "averageResponseTime": 10079, "impact": 0.0341337663445071, "key": Object { @@ -207,6 +224,7 @@ Array [ "transactionsPerMinute": 0.133333333333333, }, Object { + "agentName": "nodejs", "averageResponseTime": 8463, "impact": 0.0358979517498557, "key": Object { @@ -219,6 +237,7 @@ Array [ "transactionsPerMinute": 0.166666666666667, }, Object { + "agentName": "ruby", "averageResponseTime": 10799, "impact": 0.0366754641771254, "key": Object { @@ -231,6 +250,7 @@ Array [ "transactionsPerMinute": 0.133333333333333, }, Object { + "agentName": "ruby", "averageResponseTime": 7428.33333333333, "impact": 0.0378880658514371, "key": Object { @@ -243,6 +263,7 @@ Array [ "transactionsPerMinute": 0.2, }, Object { + "agentName": "java", "averageResponseTime": 3105.13333333333, "impact": 0.039659311528543, "key": Object { @@ -255,6 +276,7 @@ Array [ "transactionsPerMinute": 0.5, }, Object { + "agentName": "java", "averageResponseTime": 6883.57142857143, "impact": 0.0410784261517549, "key": Object { @@ -267,6 +289,7 @@ Array [ "transactionsPerMinute": 0.233333333333333, }, Object { + "agentName": "dotnet", "averageResponseTime": 3505, "impact": 0.0480460318422139, "key": Object { @@ -279,6 +302,7 @@ Array [ "transactionsPerMinute": 0.533333333333333, }, Object { + "agentName": "java", "averageResponseTime": 5621.4, "impact": 0.0481642913941483, "key": Object { @@ -291,6 +315,7 @@ Array [ "transactionsPerMinute": 0.333333333333333, }, Object { + "agentName": "nodejs", "averageResponseTime": 8428.71428571429, "impact": 0.0506239135675883, "key": Object { @@ -303,6 +328,7 @@ Array [ "transactionsPerMinute": 0.233333333333333, }, Object { + "agentName": "nodejs", "averageResponseTime": 8520.14285714286, "impact": 0.0511887353081702, "key": Object { @@ -315,6 +341,7 @@ Array [ "transactionsPerMinute": 0.233333333333333, }, Object { + "agentName": "nodejs", "averageResponseTime": 6683.44444444444, "impact": 0.0516388276326964, "key": Object { @@ -327,6 +354,7 @@ Array [ "transactionsPerMinute": 0.3, }, Object { + "agentName": "dotnet", "averageResponseTime": 3482.78947368421, "impact": 0.0569534471979838, "key": Object { @@ -339,6 +367,7 @@ Array [ "transactionsPerMinute": 0.633333333333333, }, Object { + "agentName": "python", "averageResponseTime": 16703, "impact": 0.057517386404596, "key": Object { @@ -351,6 +380,7 @@ Array [ "transactionsPerMinute": 0.133333333333333, }, Object { + "agentName": "dotnet", "averageResponseTime": 4943, "impact": 0.0596266425920813, "key": Object { @@ -363,6 +393,7 @@ Array [ "transactionsPerMinute": 0.466666666666667, }, Object { + "agentName": "nodejs", "averageResponseTime": 7892.33333333333, "impact": 0.0612407972225879, "key": Object { @@ -375,6 +406,7 @@ Array [ "transactionsPerMinute": 0.3, }, Object { + "agentName": "dotnet", "averageResponseTime": 6346.42857142857, "impact": 0.0769666700279444, "key": Object { @@ -387,6 +419,7 @@ Array [ "transactionsPerMinute": 0.466666666666667, }, Object { + "agentName": "go", "averageResponseTime": 7052.84615384615, "impact": 0.0794704188998674, "key": Object { @@ -399,6 +432,7 @@ Array [ "transactionsPerMinute": 0.433333333333333, }, Object { + "agentName": "java", "averageResponseTime": 10484.3333333333, "impact": 0.0818285496667966, "key": Object { @@ -411,6 +445,7 @@ Array [ "transactionsPerMinute": 0.3, }, Object { + "agentName": "nodejs", "averageResponseTime": 23711, "impact": 0.0822565786420813, "key": Object { @@ -423,6 +458,7 @@ Array [ "transactionsPerMinute": 0.133333333333333, }, Object { + "agentName": "dotnet", "averageResponseTime": 4491.36363636364, "impact": 0.0857567083657495, "key": Object { @@ -435,6 +471,7 @@ Array [ "transactionsPerMinute": 0.733333333333333, }, Object { + "agentName": "python", "averageResponseTime": 20715.8, "impact": 0.089965512867054, "key": Object { @@ -447,6 +484,7 @@ Array [ "transactionsPerMinute": 0.166666666666667, }, Object { + "agentName": "nodejs", "averageResponseTime": 9036.33333333333, "impact": 0.0942519803576885, "key": Object { @@ -459,6 +497,7 @@ Array [ "transactionsPerMinute": 0.4, }, Object { + "agentName": "java", "averageResponseTime": 7504.06666666667, "impact": 0.0978924329825326, "key": Object { @@ -471,6 +510,7 @@ Array [ "transactionsPerMinute": 0.5, }, Object { + "agentName": "go", "averageResponseTime": 4250.55555555556, "impact": 0.0998375378516613, "key": Object { @@ -483,6 +523,7 @@ Array [ "transactionsPerMinute": 0.9, }, Object { + "agentName": "nodejs", "averageResponseTime": 21343, "impact": 0.11156906191034, "key": Object { @@ -495,6 +536,7 @@ Array [ "transactionsPerMinute": 0.2, }, Object { + "agentName": "ruby", "averageResponseTime": 16655, "impact": 0.116142352941114, "key": Object { @@ -507,6 +549,7 @@ Array [ "transactionsPerMinute": 0.266666666666667, }, Object { + "agentName": "go", "averageResponseTime": 5749, "impact": 0.12032203382142, "key": Object { @@ -519,6 +562,7 @@ Array [ "transactionsPerMinute": 0.8, }, Object { + "agentName": "ruby", "averageResponseTime": 9951, "impact": 0.121502864272824, "key": Object { @@ -531,6 +575,7 @@ Array [ "transactionsPerMinute": 0.466666666666667, }, Object { + "agentName": "go", "averageResponseTime": 14040.6, "impact": 0.122466591367692, "key": Object { @@ -543,6 +588,7 @@ Array [ "transactionsPerMinute": 0.333333333333333, }, Object { + "agentName": "ruby", "averageResponseTime": 20963.5714285714, "impact": 0.128060974201361, "key": Object { @@ -555,6 +601,7 @@ Array [ "transactionsPerMinute": 0.233333333333333, }, Object { + "agentName": "python", "averageResponseTime": 22874.4285714286, "impact": 0.139865748579522, "key": Object { @@ -567,6 +614,7 @@ Array [ "transactionsPerMinute": 0.233333333333333, }, Object { + "agentName": "python", "averageResponseTime": 32203.8, "impact": 0.140658264084276, "key": Object { @@ -579,6 +627,7 @@ Array [ "transactionsPerMinute": 0.166666666666667, }, Object { + "agentName": "go", "averageResponseTime": 4482.11111111111, "impact": 0.140955678032051, "key": Object { @@ -591,6 +640,7 @@ Array [ "transactionsPerMinute": 1.2, }, Object { + "agentName": "ruby", "averageResponseTime": 12582.3846153846, "impact": 0.142910490774846, "key": Object { @@ -603,6 +653,7 @@ Array [ "transactionsPerMinute": 0.433333333333333, }, Object { + "agentName": "ruby", "averageResponseTime": 10009.9473684211, "impact": 0.166401779979233, "key": Object { @@ -615,6 +666,7 @@ Array [ "transactionsPerMinute": 0.633333333333333, }, Object { + "agentName": "python", "averageResponseTime": 27825.2857142857, "impact": 0.170450845832029, "key": Object { @@ -627,6 +679,7 @@ Array [ "transactionsPerMinute": 0.233333333333333, }, Object { + "agentName": "python", "averageResponseTime": 20562.2, "impact": 0.180021926732983, "key": Object { @@ -639,6 +692,7 @@ Array [ "transactionsPerMinute": 0.333333333333333, }, Object { + "agentName": "dotnet", "averageResponseTime": 7106.76470588235, "impact": 0.21180020991247, "key": Object { @@ -651,6 +705,7 @@ Array [ "transactionsPerMinute": 1.13333333333333, }, Object { + "agentName": "go", "averageResponseTime": 8612.51724137931, "impact": 0.218977858687708, "key": Object { @@ -663,6 +718,7 @@ Array [ "transactionsPerMinute": 0.966666666666667, }, Object { + "agentName": "ruby", "averageResponseTime": 11295, "impact": 0.277663720068132, "key": Object { @@ -675,6 +731,7 @@ Array [ "transactionsPerMinute": 0.933333333333333, }, Object { + "agentName": "python", "averageResponseTime": 65035.8, "impact": 0.285535040543522, "key": Object { @@ -687,6 +744,7 @@ Array [ "transactionsPerMinute": 0.166666666666667, }, Object { + "agentName": "go", "averageResponseTime": 30999.4705882353, "impact": 0.463640986028375, "key": Object { @@ -699,6 +757,7 @@ Array [ "transactionsPerMinute": 0.566666666666667, }, Object { + "agentName": "go", "averageResponseTime": 20197.4, "impact": 0.622424732781511, "key": Object { @@ -711,6 +770,7 @@ Array [ "transactionsPerMinute": 1.16666666666667, }, Object { + "agentName": "python", "averageResponseTime": 64681.6666666667, "impact": 0.68355874339377, "key": Object { @@ -723,6 +783,7 @@ Array [ "transactionsPerMinute": 0.4, }, Object { + "agentName": "dotnet", "averageResponseTime": 41416.1428571429, "impact": 0.766127739061111, "key": Object { @@ -735,6 +796,7 @@ Array [ "transactionsPerMinute": 0.7, }, Object { + "agentName": "go", "averageResponseTime": 19429, "impact": 0.821597646656097, "key": Object { @@ -747,6 +809,7 @@ Array [ "transactionsPerMinute": 1.6, }, Object { + "agentName": "dotnet", "averageResponseTime": 62390.652173913, "impact": 1.26497653527507, "key": Object { @@ -759,6 +822,7 @@ Array [ "transactionsPerMinute": 0.766666666666667, }, Object { + "agentName": "python", "averageResponseTime": 33266.2, "impact": 1.76006661931225, "key": Object { @@ -771,6 +835,7 @@ Array [ "transactionsPerMinute": 2, }, Object { + "agentName": "nodejs", "averageResponseTime": 38491.4444444444, "impact": 1.83293391905112, "key": Object { @@ -783,6 +848,7 @@ Array [ "transactionsPerMinute": 1.8, }, Object { + "agentName": "dotnet", "averageResponseTime": 118488.6, "impact": 2.08995781717084, "key": Object { @@ -795,6 +861,7 @@ Array [ "transactionsPerMinute": 0.666666666666667, }, Object { + "agentName": "dotnet", "averageResponseTime": 250440.142857143, "impact": 4.64001412901584, "key": Object { @@ -807,6 +874,7 @@ Array [ "transactionsPerMinute": 0.7, }, Object { + "agentName": "java", "averageResponseTime": 312096.523809524, "impact": 5.782704992387, "key": Object { @@ -819,6 +887,7 @@ Array [ "transactionsPerMinute": 0.7, }, Object { + "agentName": "ruby", "averageResponseTime": 91519.7032967033, "impact": 7.34855500859826, "key": Object { @@ -831,6 +900,7 @@ Array [ "transactionsPerMinute": 3.03333333333333, }, Object { + "agentName": "rum-js", "averageResponseTime": 648269.769230769, "impact": 7.43611473386403, "key": Object { @@ -843,6 +913,7 @@ Array [ "transactionsPerMinute": 0.433333333333333, }, Object { + "agentName": "python", "averageResponseTime": 1398919.72727273, "impact": 13.5790895084132, "key": Object { @@ -855,6 +926,7 @@ Array [ "transactionsPerMinute": 0.366666666666667, }, Object { + "agentName": "rum-js", "averageResponseTime": 1199907.57142857, "impact": 14.8239822181408, "key": Object { @@ -867,6 +939,7 @@ Array [ "transactionsPerMinute": 0.466666666666667, }, Object { + "agentName": "rum-js", "averageResponseTime": 955876.052631579, "impact": 16.026822184214, "key": Object { @@ -879,6 +952,7 @@ Array [ "transactionsPerMinute": 0.633333333333333, }, Object { + "agentName": "go", "averageResponseTime": 965009.526315789, "impact": 16.1799735991728, "key": Object { @@ -891,6 +965,7 @@ Array [ "transactionsPerMinute": 0.633333333333333, }, Object { + "agentName": "rum-js", "averageResponseTime": 1213675.30769231, "impact": 27.8474053933734, "key": Object { @@ -903,6 +978,7 @@ Array [ "transactionsPerMinute": 0.866666666666667, }, Object { + "agentName": "nodejs", "averageResponseTime": 924019.363636364, "impact": 35.8796065162284, "key": Object { @@ -915,6 +991,7 @@ Array [ "transactionsPerMinute": 1.46666666666667, }, Object { + "agentName": "nodejs", "averageResponseTime": 1060469.15384615, "impact": 36.498655556576, "key": Object { @@ -927,6 +1004,7 @@ Array [ "transactionsPerMinute": 1.3, }, Object { + "agentName": "python", "averageResponseTime": 118686.822222222, "impact": 37.7068083771466, "key": Object { @@ -939,6 +1017,7 @@ Array [ "transactionsPerMinute": 12, }, Object { + "agentName": "nodejs", "averageResponseTime": 1039228.27659574, "impact": 43.1048035741496, "key": Object { @@ -951,6 +1030,7 @@ Array [ "transactionsPerMinute": 1.56666666666667, }, Object { + "agentName": "python", "averageResponseTime": 1949922.55555556, "impact": 61.9499776921889, "key": Object { @@ -963,6 +1043,7 @@ Array [ "transactionsPerMinute": 1.2, }, Object { + "agentName": "dotnet", "averageResponseTime": 5963775, "impact": 100, "key": Object { diff --git a/x-pack/test/apm_api_integration/tests/traces/top_traces.spec.ts b/x-pack/test/apm_api_integration/tests/traces/top_traces.spec.ts index 51b14809982d..06a24cbd34a4 100644 --- a/x-pack/test/apm_api_integration/tests/traces/top_traces.spec.ts +++ b/x-pack/test/apm_api_integration/tests/traces/top_traces.spec.ts @@ -63,6 +63,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { expectSnapshot(firstItem).toMatchInline(` Object { + "agentName": "java", "averageResponseTime": 1639, "impact": 0, "key": Object { @@ -78,6 +79,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { expectSnapshot(lastItem).toMatchInline(` Object { + "agentName": "dotnet", "averageResponseTime": 5963775, "impact": 100, "key": Object { diff --git a/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts b/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts index bb89fa8f683f..1d8a172e57b7 100644 --- a/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts +++ b/x-pack/test/functional_with_es_ssl/apps/uptime/alert_flyout.ts @@ -142,7 +142,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); }); - describe('tls alert', function () { + // FLAKY: https://github.com/elastic/kibana/issues/116865 + describe.skip('tls alert', function () { const DEFAULT_DATE_START = 'Sep 10, 2019 @ 12:40:08.078'; const DEFAULT_DATE_END = 'Sep 11, 2019 @ 19:40:08.078'; let alerts: any; diff --git a/x-pack/test/upgrade/apps/dashboard/dashboard_smoke_tests.ts b/x-pack/test/upgrade/apps/dashboard/dashboard_smoke_tests.ts index c98336107117..2f35f0e1e12d 100644 --- a/x-pack/test/upgrade/apps/dashboard/dashboard_smoke_tests.ts +++ b/x-pack/test/upgrade/apps/dashboard/dashboard_smoke_tests.ts @@ -25,7 +25,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { ]; const dashboardTests = [ - { name: 'flights', numPanels: 17 }, + { name: 'flights', numPanels: 16 }, { name: 'logs', numPanels: 10 }, { name: 'ecommerce', numPanels: 11 }, ]; diff --git a/x-pack/test/upgrade/apps/maps/maps_smoke_tests.ts b/x-pack/test/upgrade/apps/maps/maps_smoke_tests.ts index 53acb8b01631..22e081e88bfc 100644 --- a/x-pack/test/upgrade/apps/maps/maps_smoke_tests.ts +++ b/x-pack/test/upgrade/apps/maps/maps_smoke_tests.ts @@ -167,7 +167,7 @@ export default function ({ ); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.maps.waitForLayersToLoad(); - await PageObjects.maps.toggleLayerVisibility('Road map - desaturated'); + await PageObjects.maps.toggleLayerVisibility('Road map'); await PageObjects.maps.toggleLayerVisibility('Total Requests by Country'); await PageObjects.timePicker.setCommonlyUsedTime('sample_data range'); await PageObjects.maps.enterFullScreen(); diff --git a/yarn.lock b/yarn.lock index 44185306ca38..71b82ffdf5af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5259,10 +5259,10 @@ resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.9.tgz#d868b6febb02666330410fe7f58f3c4b8258be7b" integrity sha512-MNl+rT5UmZeilaPxAVs6YaPC2m6aA8rofviZbhbxpPpl61uKodfdQVsBtgJGTqGizEf02oW3tsVe7FYB8kK14A== -"@types/clone@~2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@types/clone/-/clone-2.1.0.tgz#cb888a3fe5319275b566ae3a9bc606e310c533d4" - integrity sha512-d/aS/lPOnUSruPhgNtT8jW39fHRVTLQy9sodysP1kkG8EdAtdZu1vt8NJaYA8w/6Z9j8izkAsx1A/yJhcYR1CA== +"@types/clone@~2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@types/clone/-/clone-2.1.1.tgz#9b880d0ce9b1f209b5e0bd6d9caa38209db34024" + integrity sha512-BZIU34bSYye0j/BFcPraiDZ5ka6MJADjcDVELGf7glr9K+iE8NYVjFslJFVWzskSxkLLyCrSPScE82/UUoBSvg== "@types/cmd-shim@^2.0.0": version "2.0.0" @@ -5424,7 +5424,7 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*": +"@types/estree@*", "@types/estree@^0.0.50": version "0.0.50" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== @@ -5468,11 +5468,6 @@ resolved "https://registry.yarnpkg.com/@types/fancy-log/-/fancy-log-1.3.1.tgz#dd94fbc8c2e2ab8ab402ca8d04bb8c34965f0696" integrity sha512-31Dt9JaGfHretvwVxCBrCFL5iC9MQ3zOXpu+8C4qzW0cxc5rJJVGxB5c/vZ+wmeTk/JjPz/D0gv8BZ+Ip6iCqQ== -"@types/fast-json-stable-stringify@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@types/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#40363bb847cb86b2c2e1599f1398d11e8329c921" - integrity sha512-mky/O83TXmGY39P1H9YbUpjV6l6voRYlufqfFCvel8l1phuy8HRjdWc1rrPuN53ITBJlbyMSV6z3niOySO5pgQ== - "@types/fetch-mock@^7.3.1": version "7.3.1" resolved "https://registry.yarnpkg.com/@types/fetch-mock/-/fetch-mock-7.3.1.tgz#df7421e8bcb351b430bfbfa5c52bb353826ac94f" @@ -5814,6 +5809,10 @@ version "0.0.0" uid "" +"@types/kbn__alerts@link:bazel-bin/packages/kbn-alerts/npm_module_types": + version "0.0.0" + uid "" + "@types/kbn__i18n-react@link:bazel-bin/packages/kbn-i18n-react/npm_module_types": version "0.0.0" uid "" @@ -27558,16 +27557,11 @@ tslib@^2.0.0, tslib@^2.0.1, tslib@^2.2.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c" integrity sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w== -tslib@^2.3.0: +tslib@^2.3.0, tslib@~2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== -tslib@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" - integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== - tsutils@2.27.2: version "2.27.2" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.27.2.tgz#60ba88a23d6f785ec4b89c6e8179cac9b431f1c7" @@ -28574,14 +28568,14 @@ vega-crossfilter@~4.0.5: vega-dataflow "^5.7.3" vega-util "^1.15.2" -vega-dataflow@^5.7.3, vega-dataflow@~5.7.3: - version "5.7.3" - resolved "https://registry.yarnpkg.com/vega-dataflow/-/vega-dataflow-5.7.3.tgz#66ca06a61f72a210b0732e3b6cc1eec5117197f7" - integrity sha512-2ipzKgQUmbSXcQBH+9XF0BYbXyZrHvjlbJ8ifyRWYQk78w8kMvE6wy/rcdXYK6iVZ6aAbEDDT7jTI+rFt3tGLA== +vega-dataflow@^5.7.3, vega-dataflow@^5.7.4, vega-dataflow@~5.7.4: + version "5.7.4" + resolved "https://registry.yarnpkg.com/vega-dataflow/-/vega-dataflow-5.7.4.tgz#7cafc0a41b9d0b11dd2e34a513f8b7ca345dfd74" + integrity sha512-JGHTpUo8XGETH3b1V892we6hdjzCWB977ybycIu8DPqRoyrZuj6t1fCVImazfMgQD1LAfJlQybWP+alwKDpKig== dependencies: vega-format "^1.0.4" vega-loader "^4.3.2" - vega-util "^1.15.2" + vega-util "^1.16.1" vega-encode@~4.8.3: version "4.8.3" @@ -28594,16 +28588,17 @@ vega-encode@~4.8.3: vega-scale "^7.0.3" vega-util "^1.15.2" -vega-event-selector@^2.0.6, vega-event-selector@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/vega-event-selector/-/vega-event-selector-2.0.6.tgz#6beb00e066b78371dde1a0f40cb5e0bbaecfd8bc" - integrity sha512-UwCu50Sqd8kNZ1X/XgiAY+QAyQUmGFAwyDu7y0T5fs6/TPQnDo/Bo346NgSgINBEhEKOAMY1Nd/rPOk4UEm/ew== +vega-event-selector@^3.0.0, vega-event-selector@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/vega-event-selector/-/vega-event-selector-3.0.0.tgz#7b855ac0c3ddb59bc5b5caa0d96dbbc9fbd33a4c" + integrity sha512-Gls93/+7tEJGE3kUuUnxrBIxtvaNeF01VIFB2Q2Of2hBIBvtHX74jcAdDtkh5UhhoYGD8Q1J30P5cqEBEwtPoQ== -vega-expression@^4.0.1, vega-expression@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/vega-expression/-/vega-expression-4.0.1.tgz#c03e4fc68a00acac49557faa4e4ed6ac8a59c5fd" - integrity sha512-ZrDj0hP8NmrCpdLFf7Rd/xMUHGoSYsAOTaYp7uXZ2dkEH5x0uPy5laECMc8TiQvL8W+8IrN2HAWCMRthTSRe2Q== +vega-expression@^5.0.0, vega-expression@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/vega-expression/-/vega-expression-5.0.0.tgz#938f26689693a1e0d26716030cdaed43ca7abdfb" + integrity sha512-y5+c2frq0tGwJ7vYXzZcfVcIRF/QGfhf2e+bV1Z0iQs+M2lI1II1GPDdmOcMKimpoCVp/D61KUJDIGE1DSmk2w== dependencies: + "@types/estree" "^0.0.50" vega-util "^1.16.0" vega-force@~4.0.7: @@ -28626,19 +28621,19 @@ vega-format@^1.0.4, vega-format@~1.0.4: vega-time "^2.0.3" vega-util "^1.15.2" -vega-functions@^5.10.0, vega-functions@^5.12.0, vega-functions@~5.12.0: - version "5.12.0" - resolved "https://registry.yarnpkg.com/vega-functions/-/vega-functions-5.12.0.tgz#44bf08a7b20673dc8cf51d6781c8ea1399501668" - integrity sha512-3hljmGs+gR7TbO/yYuvAP9P5laKISf1GKk4yRHLNdM61fWgKm8pI3f6LY2Hvq9cHQFTiJ3/5/Bx2p1SX5R4quQ== +vega-functions@^5.10.0, vega-functions@^5.12.1, vega-functions@~5.12.1: + version "5.12.1" + resolved "https://registry.yarnpkg.com/vega-functions/-/vega-functions-5.12.1.tgz#b69f9ad4cd9f777dbc942587c02261b2f4cdba2c" + integrity sha512-7cHfcjXOj27qEbh2FTzWDl7FJK4xGcMFF7+oiyqa0fp7BU/wNT5YdNV0t5kCX9WjV7mfJWACKV74usLJbyM6GA== dependencies: d3-array "^2.7.1" d3-color "^2.0.0" d3-geo "^2.0.1" vega-dataflow "^5.7.3" - vega-expression "^4.0.1" + vega-expression "^5.0.0" vega-scale "^7.1.1" vega-scenegraph "^4.9.3" - vega-selections "^5.3.0" + vega-selections "^5.3.1" vega-statistics "^1.7.9" vega-time "^2.0.4" vega-util "^1.16.0" @@ -28671,38 +28666,37 @@ vega-interpreter@^1.0.4: resolved "https://registry.yarnpkg.com/vega-interpreter/-/vega-interpreter-1.0.4.tgz#291ebf85bc2d1c3550a3da22ff75b3ba0d326a39" integrity sha512-6tpYIa/pJz0cZo5fSxDSkZkAA51pID2LjOtQkOQvbzn+sJiCaWKPFhur8MBqbcmYZ9bnap1OYNwlrvpd2qBLvg== -vega-label@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/vega-label/-/vega-label-1.0.0.tgz#c3bea3a608a62217ca554ecc0f7fe0395d81bd1b" - integrity sha512-hCdm2pcHgkKgxnzW9GvX5JmYNiUMlOXOibtMmBzvFBQHX3NiV9giQ5nsPiQiFbV08VxEPtM+VYXr2HyrIcq5zQ== +vega-label@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vega-label/-/vega-label-1.1.0.tgz#0a11ae3ba18d7aed909c51ec67c2a9dde4426c6f" + integrity sha512-LAThIiDEsZxYvbSkvPLJ93eJF+Ts8RXv1IpBh8gmew8XGmaLJvVkzdsMe7WJJwuaVEsK7ZZFyB/Inkp842GW6w== dependencies: vega-canvas "^1.2.5" vega-dataflow "^5.7.3" vega-scenegraph "^4.9.2" vega-util "^1.15.2" -vega-lite@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.0.0.tgz#93898a910702736da41048f590882b907d78ac65" - integrity sha512-CrMAy3D2E662qtShrOeGttwwthRxUOZUfdu39THyxkOfLNJBCLkNjfQpFekEidxwbtFTO1zMZzyFIP3AE2I8kQ== +vega-lite@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/vega-lite/-/vega-lite-5.2.0.tgz#bc3c5c70a38d9de8f3fb9644c7dd52f3b9f47a1b" + integrity sha512-Yxcg8MvYfxHcG6BbkaKT0oVCIMIcE19UvqIsEwBmyd/7h2nzW7oRnID81T8UrY7hpDrIr6wa2JADOT2dhGNErw== dependencies: - "@types/clone" "~2.1.0" - "@types/fast-json-stable-stringify" "^2.0.0" + "@types/clone" "~2.1.1" array-flat-polyfill "^1.0.1" clone "~2.1.2" fast-deep-equal "~3.1.3" fast-json-stable-stringify "~2.1.0" json-stringify-pretty-compact "~3.0.0" - tslib "~2.1.0" - vega-event-selector "~2.0.6" - vega-expression "~4.0.1" - vega-util "~1.16.0" - yargs "~16.2.0" + tslib "~2.3.1" + vega-event-selector "~3.0.0" + vega-expression "~5.0.0" + vega-util "~1.17.0" + yargs "~17.2.1" -vega-loader@^4.3.2, vega-loader@^4.3.3, vega-loader@~4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/vega-loader/-/vega-loader-4.4.0.tgz#fc515b7368c46b2be8df1fcf3c35c696c13c453d" - integrity sha512-e5enQECdau7rJob0NFB5pGumh3RaaSWWm90+boxMy3ay2b4Ki/3XIvo+C4F1Lx04qSxvQF7tO2LJcklRm6nqRA== +vega-loader@^4.3.2, vega-loader@^4.3.3, vega-loader@~4.4.1: + version "4.4.1" + resolved "https://registry.yarnpkg.com/vega-loader/-/vega-loader-4.4.1.tgz#8f9de46202f33659d1a2737f6e322a9fc3364275" + integrity sha512-dj65i4qlNhK0mOmjuchHgUrF5YUaWrYpx0A8kXA68lBk5Hkx8FNRztkcl07CZJ1+8V81ymEyJii9jzGbhEX0ag== dependencies: d3-dsv "^2.0.0" node-fetch "^2.6.1" @@ -28710,14 +28704,14 @@ vega-loader@^4.3.2, vega-loader@^4.3.3, vega-loader@~4.4.0: vega-format "^1.0.4" vega-util "^1.16.0" -vega-parser@~6.1.3: - version "6.1.3" - resolved "https://registry.yarnpkg.com/vega-parser/-/vega-parser-6.1.3.tgz#df72785e4b086eceb90ee6219a399210933b507b" - integrity sha512-8oiVhhW26GQ4GZBvolId8FVFvhn3s1KGgPlD7Z+4P2wkV+xe5Nqu0TEJ20F/cn3b88fd0Vj48X3BH3dlSeKNFg== +vega-parser@~6.1.4: + version "6.1.4" + resolved "https://registry.yarnpkg.com/vega-parser/-/vega-parser-6.1.4.tgz#4868e41af2c9645b6d7daeeb205cfad06b9d465c" + integrity sha512-tORdpWXiH/kkXcpNdbSVEvtaxBuuDtgYp9rBunVW9oLsjFvFXbSWlM1wvJ9ZFSaTfx6CqyTyGMiJemmr1QnTjQ== dependencies: vega-dataflow "^5.7.3" - vega-event-selector "^2.0.6" - vega-functions "^5.12.0" + vega-event-selector "^3.0.0" + vega-functions "^5.12.1" vega-scale "^7.1.1" vega-util "^1.16.0" @@ -28758,10 +28752,10 @@ vega-scale@^7.0.3, vega-scale@^7.1.1, vega-scale@~7.1.1: vega-time "^2.0.4" vega-util "^1.15.2" -vega-scenegraph@^4.9.2, vega-scenegraph@^4.9.3, vega-scenegraph@~4.9.3: - version "4.9.3" - resolved "https://registry.yarnpkg.com/vega-scenegraph/-/vega-scenegraph-4.9.3.tgz#c4720550ea7ff5c8d9d0690f47fe2640547cfc6b" - integrity sha512-lBvqLbXqrqRCTGJmSgzZC/tLR/o+TXfakbdhDzNdpgTavTaQ65S/67Gpj5hPpi77DvsfZUIY9lCEeO37aJhy0Q== +vega-scenegraph@^4.9.2, vega-scenegraph@^4.9.3, vega-scenegraph@^4.9.4, vega-scenegraph@~4.9.4: + version "4.9.4" + resolved "https://registry.yarnpkg.com/vega-scenegraph/-/vega-scenegraph-4.9.4.tgz#468408c1e89703fa9d3450445daabff623de2757" + integrity sha512-QaegQzbFE2yhYLNWAmHwAuguW3yTtQrmwvfxYT8tk0g+KKodrQ5WSmNrphWXhqwtsgVSvtdZkfp2IPeumcOQJg== dependencies: d3-path "^2.0.0" d3-shape "^2.0.0" @@ -28770,17 +28764,17 @@ vega-scenegraph@^4.9.2, vega-scenegraph@^4.9.3, vega-scenegraph@~4.9.3: vega-scale "^7.1.1" vega-util "^1.15.2" -vega-schema-url-parser@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/vega-schema-url-parser/-/vega-schema-url-parser-2.1.0.tgz#847f9cf9f1624f36f8a51abc1adb41ebc6673cb4" - integrity sha512-JHT1PfOyVzOohj89uNunLPirs05Nf59isPT5gnwIkJph96rRgTIBJE7l7yLqndd7fLjr3P8JXHGAryRp74sCaQ== +vega-schema-url-parser@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/vega-schema-url-parser/-/vega-schema-url-parser-2.2.0.tgz#a0d1e02915adfbfcb1fd517c8c2ebe2419985c1e" + integrity sha512-yAtdBnfYOhECv9YC70H2gEiqfIbVkq09aaE4y/9V/ovEFmH9gPKaEgzIZqgT7PSPQjKhsNkb6jk6XvSoboxOBw== -vega-selections@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/vega-selections/-/vega-selections-5.3.0.tgz#810f2e7b7642fa836cf98b2e5dcc151093b1f6a7" - integrity sha512-vC4NPsuN+IffruFXfH0L3i2A51RgG4PqpLv85TvrEAIYnSkyKDE4bf+wVraR3aPdnLLkc3+tYuMi6le5FmThIA== +vega-selections@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/vega-selections/-/vega-selections-5.3.1.tgz#af5c3cc6532a55a5b692eb0fcc2a1d8d521605a4" + integrity sha512-cm4Srw1WHjcLGXX7GpxiUlfESv8XPu5b6Vh3mqMDPU94P2FO91SR9gei+EtRdt+KCFgIjr//MnRUjg/hAWwjkQ== dependencies: - vega-expression "^4.0.1" + vega-expression "^5.0.0" vega-util "^1.16.0" vega-spec-injector@^0.0.2: @@ -28788,10 +28782,10 @@ vega-spec-injector@^0.0.2: resolved "https://registry.yarnpkg.com/vega-spec-injector/-/vega-spec-injector-0.0.2.tgz#f1d990109dd9d845c524738f818baa4b72a60ca6" integrity sha512-wOMMqmpssn0/ZFPW7wl1v26vbseRX7zHPWzEyS9TwNXTRCu1TcjIBIR+X23lCWocxhoBqFxmqyn8UowMhlGtAg== -vega-statistics@^1.7.9, vega-statistics@~1.7.9: - version "1.7.9" - resolved "https://registry.yarnpkg.com/vega-statistics/-/vega-statistics-1.7.9.tgz#feec01d463e1b50593d890d20631f72138fcb65d" - integrity sha512-T0sd2Z08k/mHxr1Vb4ajLWytPluLFYnsYqyk4SIS5czzUs4errpP2gUu63QJ0B7CKNu33vnS9WdOMOo/Eprr/Q== +vega-statistics@^1.7.9, vega-statistics@~1.7.10: + version "1.7.10" + resolved "https://registry.yarnpkg.com/vega-statistics/-/vega-statistics-1.7.10.tgz#4353637402e5e96bff2ebd16bd58e2c15cac3018" + integrity sha512-QLb12gcfpDZ9K5h3TLGrlz4UXDH9wSPyg9LLfOJZacxvvJEPohacUQNrGEAVtFO9ccUCerRfH9cs25ZtHsOZrw== dependencies: d3-array "^2.7.1" @@ -28804,35 +28798,37 @@ vega-time@^2.0.3, vega-time@^2.0.4, vega-time@~2.0.4: d3-time "^2.0.0" vega-util "^1.15.2" -vega-tooltip@^0.25.1: - version "0.25.1" - resolved "https://registry.yarnpkg.com/vega-tooltip/-/vega-tooltip-0.25.1.tgz#cb7e438438649eb46896e7bee6f54e25d25b3c09" - integrity sha512-ugGwGi2/p3OpB8N15xieuzP8DyV5DreqMWcmJ9zpWT8GlkyKtef4dGRXnvHeHQ+iJFmWrq4oZJ+kLTrdiECjAg== +vega-tooltip@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/vega-tooltip/-/vega-tooltip-0.27.0.tgz#e03c150cdec78f68938a0dab5ef67a24e6d685da" + integrity sha512-FRcHNfMNo9D/7an5nZuP6JC2JGEsc85qcGjyMU7VlPpjQj9eBj1P+sZSNbb54Z20g7inVSBRyd8qgNn5EYTxJA== dependencies: vega-util "^1.16.0" -vega-transforms@~4.9.3: - version "4.9.3" - resolved "https://registry.yarnpkg.com/vega-transforms/-/vega-transforms-4.9.3.tgz#40e5234b956a68eaa03eedf489ed03293075bbfb" - integrity sha512-PdqQd5oPlRyD405M2w+Sz9Bo+i7Rwi8o03SVK7RaeQsJC2FffKGJ6acIaSEgOq+yD1Q2k/1SePmCXcmLUlIiEA== +vega-transforms@~4.9.4: + version "4.9.4" + resolved "https://registry.yarnpkg.com/vega-transforms/-/vega-transforms-4.9.4.tgz#5cf6b91bda9f184bbbaba63838be8e5e6a571235" + integrity sha512-JGBhm5Bf6fiGTUSB5Qr5ckw/KU9FJcSV5xIe/y4IobM/i/KNwI1i1fP45LzP4F4yZc0DMTwJod2UvFHGk9plKA== dependencies: d3-array "^2.7.1" - vega-dataflow "^5.7.3" + vega-dataflow "^5.7.4" vega-statistics "^1.7.9" vega-time "^2.0.4" - vega-util "^1.15.2" + vega-util "^1.16.1" -vega-typings@~0.19.2: - version "0.19.2" - resolved "https://registry.yarnpkg.com/vega-typings/-/vega-typings-0.19.2.tgz#374fc1020c1abb263a0be87de28d1a4bd0526c3f" - integrity sha512-YU/S9rDk4d+t4+4eTa9fzuw87PMNteeVtpcL51kUO8H7HvGaoW7ll8RHKLkR0NYBEGPRoFDKUxnoyMvhgjsdYw== +vega-typings@~0.22.0: + version "0.22.1" + resolved "https://registry.yarnpkg.com/vega-typings/-/vega-typings-0.22.1.tgz#287c646cfa93b1822d0fb6ea11d5543632f8b56e" + integrity sha512-88cIrjmoTxo/0nWTf+GuitkFhirHWVWCfymADiCUXt6s9arpQ6XPP5xjrN5KDc0LZd9xr7p4FIiEgADghgLTgw== dependencies: + vega-event-selector "^3.0.0" + vega-expression "^5.0.0" vega-util "^1.15.2" -vega-util@^1.15.2, vega-util@^1.16.0, vega-util@~1.16.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/vega-util/-/vega-util-1.16.0.tgz#77405d8df0a94944d106bdc36015f0d43aa2caa3" - integrity sha512-6mmz6mI+oU4zDMeKjgvE2Fjz0Oh6zo6WGATcvCfxH2gXBzhBHmy5d25uW5Zjnkc6QBXSWPLV9Xa6SiqMsrsKog== +vega-util@^1.15.2, vega-util@^1.16.0, vega-util@^1.16.1, vega-util@~1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/vega-util/-/vega-util-1.17.0.tgz#b72ae0baa97f943bf591f8f5bb27ceadf06834ac" + integrity sha512-HTaydZd9De3yf+8jH66zL4dXJ1d1p5OIFyoBzFiOli4IJbwkL1jrefCKz6AHDm1kYBzDJ0X4bN+CzZSCTvNk1w== vega-view-transforms@~4.5.8: version "4.5.8" @@ -28843,10 +28839,10 @@ vega-view-transforms@~4.5.8: vega-scenegraph "^4.9.2" vega-util "^1.15.2" -vega-view@~5.9.2: - version "5.9.2" - resolved "https://registry.yarnpkg.com/vega-view/-/vega-view-5.9.2.tgz#cb957e481a952abbe7b3a11aa2d58cc728f295e7" - integrity sha512-XAwKWyVjLClR3aCbTLCWdZj7aZozOULNg7078GxJIgVcBJOENCAidceI/H7JieyUZ96p3AiEHLQdWr167InBpg== +vega-view@~5.10.1: + version "5.10.1" + resolved "https://registry.yarnpkg.com/vega-view/-/vega-view-5.10.1.tgz#b69348bb32a9845a1bd341fdd946df98684fadc3" + integrity sha512-4xvQ5KZcgKdZx1Z7jjenCUumvlyr/j4XcHLRf9gyeFrFvvS596dVpL92V8twhV6O++DmS2+fj+rHagO8Di4nMg== dependencies: d3-array "^2.7.1" d3-timer "^2.0.0" @@ -28854,8 +28850,8 @@ vega-view@~5.9.2: vega-format "^1.0.4" vega-functions "^5.10.0" vega-runtime "^6.1.3" - vega-scenegraph "^4.9.2" - vega-util "^1.15.2" + vega-scenegraph "^4.9.4" + vega-util "^1.16.1" vega-voronoi@~4.1.5: version "4.1.5" @@ -28877,35 +28873,35 @@ vega-wordcloud@~4.1.3: vega-statistics "^1.7.9" vega-util "^1.15.2" -vega@^5.19.1: - version "5.19.1" - resolved "https://registry.yarnpkg.com/vega/-/vega-5.19.1.tgz#64c8350740fe1a11d56cc6617ab3a76811fd704c" - integrity sha512-UE6/c9q9kzuz4HULFuU9HscBASoZa+zcXqGKdbQP545Nwmhd078QpcH+wZsq9lYfiTxmFtzLK/a0OH0zhkghvA== +vega@^5.21.0: + version "5.21.0" + resolved "https://registry.yarnpkg.com/vega/-/vega-5.21.0.tgz#f3d858d7544bfe4ffa3d8cd43d9ea978bf7391e8" + integrity sha512-yqqRa9nAqYoAxe7sVhRpsh0b001fly7Yx05klPkXmrvzjxXd07gClW1mOuGgSnVQqo7jTp/LYgbO1bD37FbEig== dependencies: vega-crossfilter "~4.0.5" - vega-dataflow "~5.7.3" + vega-dataflow "~5.7.4" vega-encode "~4.8.3" - vega-event-selector "~2.0.6" - vega-expression "~4.0.1" + vega-event-selector "~3.0.0" + vega-expression "~5.0.0" vega-force "~4.0.7" vega-format "~1.0.4" - vega-functions "~5.12.0" + vega-functions "~5.12.1" vega-geo "~4.3.8" vega-hierarchy "~4.0.9" - vega-label "~1.0.0" - vega-loader "~4.4.0" - vega-parser "~6.1.3" + vega-label "~1.1.0" + vega-loader "~4.4.1" + vega-parser "~6.1.4" vega-projection "~1.4.5" vega-regression "~1.0.9" vega-runtime "~6.1.3" vega-scale "~7.1.1" - vega-scenegraph "~4.9.3" - vega-statistics "~1.7.9" + vega-scenegraph "~4.9.4" + vega-statistics "~1.7.10" vega-time "~2.0.4" - vega-transforms "~4.9.3" - vega-typings "~0.19.2" - vega-util "~1.16.0" - vega-view "~5.9.2" + vega-transforms "~4.9.4" + vega-typings "~0.22.0" + vega-util "~1.17.0" + vega-view "~5.10.1" vega-view-transforms "~4.5.8" vega-voronoi "~4.1.5" vega-wordcloud "~4.1.3" @@ -29881,7 +29877,7 @@ yargs@^15.0.2, yargs@^15.3.1, yargs@^15.4.1: y18n "^4.0.0" yargs-parser "^18.1.2" -yargs@^16.2.0, yargs@~16.2.0: +yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== @@ -29939,6 +29935,19 @@ yargs@^7.1.0: y18n "^3.2.1" yargs-parser "5.0.0-security.0" +yargs@~17.2.1: + version "17.2.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.2.1.tgz#e2c95b9796a0e1f7f3bf4427863b42e0418191ea" + integrity sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"