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

[APM] Fix hidden search bar in error pages while loading #93139

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 @@ -60,6 +60,45 @@ function getShortGroupId(errorGroupId?: string) {
return errorGroupId.slice(0, 5);
}

function ErrorGroupHeader({
groupId,
isUnhandled,
}: {
groupId: string;
isUnhandled?: boolean;
}) {
return (
<>
<ApmHeader>
<EuiFlexGroup alignItems="center">
<EuiFlexItem grow={false}>
<EuiTitle>
<h1>
{i18n.translate('xpack.apm.errorGroupDetails.errorGroupTitle', {
defaultMessage: 'Error group {errorGroupId}',
values: {
errorGroupId: getShortGroupId(groupId),
},
})}
</h1>
</EuiTitle>
</EuiFlexItem>
{isUnhandled && (
<EuiFlexItem grow={false}>
<EuiBadge color="warning">
{i18n.translate('xpack.apm.errorGroupDetails.unhandledLabel', {
defaultMessage: 'Unhandled',
})}
</EuiBadge>
</EuiFlexItem>
)}
</EuiFlexGroup>
</ApmHeader>
<SearchBar />
</>
);
}

type ErrorGroupDetailsProps = RouteComponentProps<{
groupId: string;
serviceName: string;
Expand Down Expand Up @@ -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 <ErrorGroupHeader groupId={groupId} />;
}

// If there are 0 occurrences, show only distribution chart w. empty message
Expand All @@ -114,32 +153,7 @@ export function ErrorGroupDetails({ location, match }: ErrorGroupDetailsProps) {

return (
<>
<ApmHeader>
<EuiFlexGroup alignItems="center">
<EuiFlexItem grow={false}>
<EuiTitle>
<h1>
{i18n.translate('xpack.apm.errorGroupDetails.errorGroupTitle', {
defaultMessage: 'Error group {errorGroupId}',
values: {
errorGroupId: getShortGroupId(groupId),
},
})}
</h1>
</EuiTitle>
</EuiFlexItem>
{isUnhandled && (
<EuiFlexItem grow={false}>
<EuiBadge color="warning">
{i18n.translate('xpack.apm.errorGroupDetails.unhandledLabel', {
defaultMessage: 'Unhandled',
})}
</EuiBadge>
</EuiFlexItem>
)}
</EuiFlexGroup>
</ApmHeader>
<SearchBar />
<ErrorGroupHeader groupId={groupId} isUnhandled={isUnhandled} />
<EuiPage>
<EuiPageBody>
<EuiPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function ErrorGroupOverview({ serviceName }: ErrorGroupOverviewProps) {
useTrackPageview({ app: 'apm', path: 'error_group_overview', delay: 15000 });

if (!errorDistributionData || !errorGroupListData) {
return null;
return <SearchBar />;
}

return (
Expand Down