From 6897a4ac0b0484ba079d83b971f6f2da13084f0a Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Mon, 1 Mar 2021 21:39:32 -0500 Subject: [PATCH] [APM] Fix hidden search bar in error pages while loading (#84476) (#93139) --- .../app/ErrorGroupDetails/index.tsx | 68 +++++++++++-------- .../app/error_group_overview/index.tsx | 2 +- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/x-pack/plugins/apm/public/components/app/ErrorGroupDetails/index.tsx b/x-pack/plugins/apm/public/components/app/ErrorGroupDetails/index.tsx index 4b8d8ddc6f746b..5fcd2914f2225c 100644 --- a/x-pack/plugins/apm/public/components/app/ErrorGroupDetails/index.tsx +++ b/x-pack/plugins/apm/public/components/app/ErrorGroupDetails/index.tsx @@ -60,6 +60,45 @@ function getShortGroupId(errorGroupId?: string) { return errorGroupId.slice(0, 5); } +function ErrorGroupHeader({ + groupId, + isUnhandled, +}: { + groupId: string; + isUnhandled?: boolean; +}) { + return ( + <> + + + + +

+ {i18n.translate('xpack.apm.errorGroupDetails.errorGroupTitle', { + defaultMessage: 'Error group {errorGroupId}', + values: { + errorGroupId: getShortGroupId(groupId), + }, + })} +

+
+
+ {isUnhandled && ( + + + {i18n.translate('xpack.apm.errorGroupDetails.unhandledLabel', { + defaultMessage: 'Unhandled', + })} + + + )} +
+
+ + + ); +} + type ErrorGroupDetailsProps = RouteComponentProps<{ groupId: string; serviceName: string; @@ -101,7 +140,7 @@ export function ErrorGroupDetails({ location, match }: ErrorGroupDetailsProps) { useTrackPageview({ app: 'apm', path: 'error_group_details', delay: 15000 }); if (!errorGroupData || !errorDistributionData) { - return null; + return ; } // If there are 0 occurrences, show only distribution chart w. empty message @@ -114,32 +153,7 @@ export function ErrorGroupDetails({ location, match }: ErrorGroupDetailsProps) { return ( <> - - - - -

- {i18n.translate('xpack.apm.errorGroupDetails.errorGroupTitle', { - defaultMessage: 'Error group {errorGroupId}', - values: { - errorGroupId: getShortGroupId(groupId), - }, - })} -

-
-
- {isUnhandled && ( - - - {i18n.translate('xpack.apm.errorGroupDetails.unhandledLabel', { - defaultMessage: 'Unhandled', - })} - - - )} -
-
- + diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx index 49e1cc44f92553..96657bcfb47349 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx @@ -68,7 +68,7 @@ export function ErrorGroupOverview({ serviceName }: ErrorGroupOverviewProps) { useTrackPageview({ app: 'apm', path: 'error_group_overview', delay: 15000 }); if (!errorDistributionData || !errorGroupListData) { - return null; + return ; } return (