Skip to content

Commit

Permalink
[Observability Onboarding] Update links for integration buttons in ob…
Browse files Browse the repository at this point in the history
…servability solutions (elastic#184477)

## Summary

Continuation of elastic#184164.

Changes the integration links for metrics and logs to link to the new
onboarding flow.
  • Loading branch information
justinkambic authored Jun 6, 2024
1 parent 4ddec38 commit 5f2e0c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React, { useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { OBSERVABILITY_ONBOARDING_LOCATOR } from '@kbn/deeplinks-observability';
import { NoDataConfig } from '@kbn/shared-ux-page-kibana-template';
import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';

Expand All @@ -29,13 +29,13 @@ export const LogsPageTemplate: React.FC<LogsPageTemplateProps> = ({
observabilityShared: {
navigation: { PageTemplate },
},
share,
docLinks,
},
} = useKibanaContextForPlugin();

const { http } = useKibana().services;
const basePath = http!.basePath.get();

const onboardingLocator = share.url.locators.get(OBSERVABILITY_ONBOARDING_LOCATOR);
const href = onboardingLocator?.getRedirectUrl({ category: 'logs' });
const { setScreenContext } = observabilityAIAssistant?.service || {};

useEffect(() => {
Expand Down Expand Up @@ -79,7 +79,7 @@ export const LogsPageTemplate: React.FC<LogsPageTemplateProps> = ({
defaultMessage:
'Use the Elastic Agent or Beats to send logs to Elasticsearch. We make it easy with integrations for many popular systems and apps.',
}),
href: basePath + `/app/integrations/browse`,
href,
},
},
docsLink: docLinks.links.observability.guide,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { OBSERVABILITY_ONBOARDING_LOCATOR } from '@kbn/deeplinks-observability';
import { i18n } from '@kbn/i18n';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template';
Expand All @@ -30,10 +31,13 @@ export const MetricsPageTemplate: React.FC<LazyObservabilityPageTemplateProps> =
observabilityShared: {
navigation: { PageTemplate },
},
share,
docLinks,
},
} = useKibanaContextForPlugin();

const onboardingLocator = share.url.locators.get(OBSERVABILITY_ONBOARDING_LOCATOR);
const href = onboardingLocator?.getRedirectUrl({ category: 'infra' });
const { source, error: sourceError, loadSource, isLoading } = useSourceContext();
const { error: dataViewLoadError, refetch: loadDataView } = useMetricsDataViewContext();
const { remoteClustersExist, metricIndicesExist } = source?.status ?? {};
Expand All @@ -48,6 +52,7 @@ export const MetricsPageTemplate: React.FC<LazyObservabilityPageTemplateProps> =
beats: {
title: noMetricIndicesPromptPrimaryActionTitle,
description: noMetricIndicesPromptDescription,
href,
},
},
docsLink: docLinks.links.observability.guide,
Expand Down

0 comments on commit 5f2e0c6

Please sign in to comment.