From 7a87c3615d5ba98f7af371ca89117dc9085a6fd5 Mon Sep 17 00:00:00 2001 From: Brad White Date: Wed, 27 Sep 2023 01:19:11 -0600 Subject: [PATCH] Fix some type issues for APM UI (#167347) ## Summary We're breaking https://github.com/elastic/kibana/pull/166813 up into smaller PRs in the interest of getting PRs through sooner for type fixes. These are the changes for APM UI. --- .../assistant_functions/get_apm_service_summary/index.ts | 1 + .../components/app/custom_logs/install_elastic_agent.tsx | 4 ++-- x-pack/plugins/observability_onboarding/public/index.ts | 2 +- .../public/locators/onboarding_locator/locator_definition.ts | 2 ++ .../public/locators/onboarding_locator/types.ts | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/apm/server/routes/assistant_functions/get_apm_service_summary/index.ts b/x-pack/plugins/apm/server/routes/assistant_functions/get_apm_service_summary/index.ts index 92eafdf0b4ee7..64035f0373cfb 100644 --- a/x-pack/plugins/apm/server/routes/assistant_functions/get_apm_service_summary/index.ts +++ b/x-pack/plugins/apm/server/routes/assistant_functions/get_apm_service_summary/index.ts @@ -275,6 +275,7 @@ export async function getApmServiceSummary({ start, end, serviceName, + environment, }), getAnomalies({ serviceName, diff --git a/x-pack/plugins/observability_onboarding/public/components/app/custom_logs/install_elastic_agent.tsx b/x-pack/plugins/observability_onboarding/public/components/app/custom_logs/install_elastic_agent.tsx index aea68cdd6711c..5b6db7f900b79 100644 --- a/x-pack/plugins/observability_onboarding/public/components/app/custom_logs/install_elastic_agent.tsx +++ b/x-pack/plugins/observability_onboarding/public/components/app/custom_logs/install_elastic_agent.tsx @@ -63,7 +63,7 @@ export function InstallElasticAgent() { useState('linux-tar'); const enforcedDatasetName = - integration === dataset ? dataset : `${integration}.${dataset}`; + (integration === dataset ? dataset : `${integration}.${dataset}`) || ''; async function onContinue() { await singleDatasetLocator!.navigate({ @@ -113,7 +113,7 @@ export function InstallElasticAgent() { return callApi('POST /internal/observability_onboarding/logs/flow', { params: { body: { - name: datasetName, + name: datasetName || '', type: 'logFiles', state: { datasetName, diff --git a/x-pack/plugins/observability_onboarding/public/index.ts b/x-pack/plugins/observability_onboarding/public/index.ts index b83c5b6d5cad0..2b8271bb5c8ed 100644 --- a/x-pack/plugins/observability_onboarding/public/index.ts +++ b/x-pack/plugins/observability_onboarding/public/index.ts @@ -17,7 +17,7 @@ import { ObservabilityOnboardingPluginStart, } from './plugin'; -export { OBSERVABILITY_ONBOARDING_LOCATOR } from './locators/onboarding_locator/locator_definition'; +export type { OBSERVABILITY_ONBOARDING_LOCATOR } from './locators/onboarding_locator/locator_definition'; export type { ObservabilityOnboardingLocatorParams } from './locators/onboarding_locator/types'; export interface ConfigSchema { diff --git a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/locator_definition.ts b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/locator_definition.ts index a4f8965dda5a3..58b506ca4fa04 100644 --- a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/locator_definition.ts +++ b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/locator_definition.ts @@ -11,6 +11,8 @@ import { OBSERVABILITY_ONBOARDING_LOCATOR, } from '@kbn/deeplinks-observability/locators'; +export type { OBSERVABILITY_ONBOARDING_LOCATOR } from '@kbn/deeplinks-observability/locators'; + export class ObservabilityOnboardingLocatorDefinition implements LocatorDefinition { diff --git a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/types.ts b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/types.ts index 61f6d923db49d..5dfe136624d95 100644 --- a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/types.ts +++ b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/types.ts @@ -8,5 +8,6 @@ import type { LocatorPublic } from '@kbn/share-plugin/public'; import type { ObservabilityOnboardingLocatorParams } from '@kbn/deeplinks-observability/locators'; +export type { ObservabilityOnboardingLocatorParams } from '@kbn/deeplinks-observability/locators'; export type ObservabilityOnboardingLocator = LocatorPublic;