Skip to content

Commit

Permalink
[Observability Onboarding] Link all “Add data” buttons in observabili…
Browse files Browse the repository at this point in the history
…ty to onboarding landing page (#179459)

Resolves [#178944](#178944)

## 📓 Summary

All "Add data" links within Observability link to
`/app/observabilityOnboarding` when on serverless observability.

## ✔️ Acceptance criteria
All "Add data" links within Observability link to
`/app/observabilityOnboarding` when on serverless observability:
- Infrastructure > Inventory
- Infrastructure > Hosts
  • Loading branch information
thomheymann committed Mar 27, 2024
1 parent 3760983 commit 4b5c5a1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const LogsPageContent: React.FunctionComponent = () => {
</EuiHeaderLink>
<LazyAlertDropdownWrapper />
<EuiHeaderLink
href={getUrlForApp('/integrations/browse')}
href={getUrlForApp('/observabilityOnboarding')}
color="primary"
iconType="indexOpen"
>
Expand All @@ -104,7 +104,15 @@ export const LogsPageContent: React.FunctionComponent = () => {
<RedirectWithQueryParams from={'/analysis'} to={anomaliesTab.pathname} exact />
<RedirectWithQueryParams from={'/log-rate'} to={anomaliesTab.pathname} exact />
<RedirectWithQueryParams from={'/'} to={streamTab.pathname} exact />
<Route render={() => <NotFoundPage title="Logs" />} />
<Route
render={() => (
<NotFoundPage
title={i18n.translate('xpack.infra.logs.index.logsLabel', {
defaultMessage: 'Logs',
})}
/>
)}
/>
</Routes>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ export const InfrastructurePage = () => {
<MetricsAlertDropdown />
)}
<EuiHeaderLink
href={kibana.services?.application?.getUrlForApp('/integrations/browse')}
href={kibana.services?.application?.getUrlForApp(
'/observabilityOnboarding'
)}
color="primary"
iconType="indexOpen"
>
Expand Down Expand Up @@ -144,7 +146,15 @@ export const InfrastructurePage = () => {
<RedirectWithQueryParams from="/metrics-explorer" exact to="/explorer" />
<RedirectWithQueryParams from="/" exact to="/inventory" />

<Route render={() => <NotFoundPage title="Infrastructure" />} />
<Route
render={() => (
<NotFoundPage
title={i18n.translate('xpack.infra.header.infrastructureLabel', {
defaultMessage: 'Infrastructure',
})}
/>
)}
/>
</Routes>
</InfraMLCapabilitiesProvider>
</AlertPrefillProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
EuiFlexGrid,
EuiAvatar,
useEuiTheme,
useGeneratedHtmlId,
} from '@elastic/eui';

interface UseCaseOption {
Expand Down Expand Up @@ -159,6 +160,7 @@ export const OnboardingFlowForm: FunctionComponent = () => {
},
];

const radioGroupId = useGeneratedHtmlId({ prefix: 'onboardingUseCase' });
const [selectedId, setSelectedId] = useState<string>();
const [hoveredId, setHoveredId] = useState<string>();

Expand Down Expand Up @@ -194,7 +196,8 @@ export const OnboardingFlowForm: FunctionComponent = () => {
{/* Using EuiSpacer instead of EuiFlexGroup to ensure spacing is part of hit area for mouse hover effect */}
{index > 0 && <EuiSpacer size="m" />}
<EuiCheckableCard
id={option.id}
id={`${radioGroupId}_${option.id}`}
name={radioGroupId}
label={option.label}
checked={selectedId === option.id}
onChange={() => setSelectedId(option.id)}
Expand Down

0 comments on commit 4b5c5a1

Please sign in to comment.