Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[O11y Overview] Add code to display/hide UX section when appropriate #80873

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function DataSections({ bucketSize, hasData, absoluteTime, relativeTime }
/>
</EuiFlexItem>
)}
{hasData?.ux && (
{(hasData.ux as UXHasDataResponse).hasData && (
<EuiFlexItem grow={false}>
<UXSection
serviceName={(hasData.ux as UXHasDataResponse).serviceName as string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const getEmptySections = ({ core }: { core: AppMountContext['core'] }): I
'Performance is a distribution. Measure the experiences of all visitors to your web application and understand how to improve the experience for everyone.',
}),
linkTitle: i18n.translate('xpack.observability.emptySection.apps.ux.link', {
defaultMessage: 'Install Rum Agent',
defaultMessage: 'Install RUM Agent',
}),
href: core.http.basePath.prepend('/app/home#/tutorial/apm'),
},
Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/observability/public/pages/overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { getEmptySections } from './empty_section';
import { LoadingObservability } from './loading_observability';
import { getNewsFeed } from '../../services/get_news_feed';
import { DataSections } from './data_sections';
import { useTrackPageview } from '../..';
import { useTrackPageview, UXHasDataResponse } from '../..';

interface Props {
routeParams: RouteParams<'/overview'>;
Expand Down Expand Up @@ -88,6 +88,8 @@ export function OverviewPage({ routeParams }: Props) {
const appEmptySections = getEmptySections({ core }).filter(({ id }) => {
if (id === 'alert') {
return alertStatus !== FETCH_STATUS.FAILURE && !alerts.length;
} else if (id === 'ux') {
return !(hasData[id] as UXHasDataResponse).hasData;
}
return !hasData[id];
});
Expand Down