[O11y Overview] Add code to display/hide UX section when appropriate (#80873)
* Add code to display/hide UX section when appropriate. * Suppress errors with link to dedicated issue. * Fix typo in call to action. * Remove type error suppression.
This commit is contained in:
parent
3a969f4e8f
commit
c11163d004
3 changed files with 5 additions and 3 deletions
|
@ -64,7 +64,7 @@ export function DataSections({ bucketSize, hasData, absoluteTime, relativeTime }
|
||||||
/>
|
/>
|
||||||
</EuiFlexItem>
|
</EuiFlexItem>
|
||||||
)}
|
)}
|
||||||
{hasData?.ux && (
|
{(hasData.ux as UXHasDataResponse).hasData && (
|
||||||
<EuiFlexItem grow={false}>
|
<EuiFlexItem grow={false}>
|
||||||
<UXSection
|
<UXSection
|
||||||
serviceName={(hasData.ux as UXHasDataResponse).serviceName as string}
|
serviceName={(hasData.ux as UXHasDataResponse).serviceName as string}
|
||||||
|
|
|
@ -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.',
|
'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', {
|
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'),
|
href: core.http.basePath.prepend('/app/home#/tutorial/apm'),
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { getEmptySections } from './empty_section';
|
||||||
import { LoadingObservability } from './loading_observability';
|
import { LoadingObservability } from './loading_observability';
|
||||||
import { getNewsFeed } from '../../services/get_news_feed';
|
import { getNewsFeed } from '../../services/get_news_feed';
|
||||||
import { DataSections } from './data_sections';
|
import { DataSections } from './data_sections';
|
||||||
import { useTrackPageview } from '../..';
|
import { useTrackPageview, UXHasDataResponse } from '../..';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
routeParams: RouteParams<'/overview'>;
|
routeParams: RouteParams<'/overview'>;
|
||||||
|
@ -88,6 +88,8 @@ export function OverviewPage({ routeParams }: Props) {
|
||||||
const appEmptySections = getEmptySections({ core }).filter(({ id }) => {
|
const appEmptySections = getEmptySections({ core }).filter(({ id }) => {
|
||||||
if (id === 'alert') {
|
if (id === 'alert') {
|
||||||
return alertStatus !== FETCH_STATUS.FAILURE && !alerts.length;
|
return alertStatus !== FETCH_STATUS.FAILURE && !alerts.length;
|
||||||
|
} else if (id === 'ux') {
|
||||||
|
return !(hasData[id] as UXHasDataResponse).hasData;
|
||||||
}
|
}
|
||||||
return !hasData[id];
|
return !hasData[id];
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue