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 5b6db7f900b79..922736ea107e5 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 @@ -41,6 +41,8 @@ import { BackButton } from './back_button'; import { WindowsInstallStep } from '../../shared/windows_install_step'; import { TroubleshootingLink } from '../../shared/troubleshooting_link'; +const defaultDatasetName = ''; + export function InstallElasticAgent() { const { services: { share }, @@ -63,7 +65,8 @@ export function InstallElasticAgent() { useState('linux-tar'); const enforcedDatasetName = - (integration === dataset ? dataset : `${integration}.${dataset}`) || ''; + (integration === dataset ? dataset : `${integration}.${dataset}`) ?? + defaultDatasetName; async function onContinue() { await singleDatasetLocator!.navigate({ @@ -109,11 +112,15 @@ export function InstallElasticAgent() { customConfigurations, logFilePaths, } = getState(); - if (!hasAlreadySavedFlow(getState()) && monitoringRole?.hasPrivileges) { + if ( + !hasAlreadySavedFlow(getState()) && + monitoringRole?.hasPrivileges && + datasetName + ) { 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 2b8271bb5c8ed..9454626e80dc8 100644 --- a/x-pack/plugins/observability_onboarding/public/index.ts +++ b/x-pack/plugins/observability_onboarding/public/index.ts @@ -17,9 +17,6 @@ import { ObservabilityOnboardingPluginStart, } from './plugin'; -export type { OBSERVABILITY_ONBOARDING_LOCATOR } from './locators/onboarding_locator/locator_definition'; -export type { ObservabilityOnboardingLocatorParams } from './locators/onboarding_locator/types'; - export interface ConfigSchema { ui: { enabled: boolean; diff --git a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/get_location.ts b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/get_location.ts index 93bb3861740cd..9ebd263847f36 100644 --- a/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/get_location.ts +++ b/x-pack/plugins/observability_onboarding/public/locators/onboarding_locator/get_location.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ObservabilityOnboardingLocatorParams } from './types'; +import type { ObservabilityOnboardingLocatorParams } from '@kbn/deeplinks-observability/locators'; import { PLUGIN_ID } from '../../../common'; export function getLocation(params: ObservabilityOnboardingLocatorParams) {