Skip to content

Commit

Permalink
Set metadata tab as default and display Stack Trace tab only if stack…
Browse files Browse the repository at this point in the history
…frames exist (#128598)
  • Loading branch information
gbamparop authored Mar 29, 2022
1 parent e628ae5 commit 52f0bf0
Showing 1 changed file with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { Fragment } from 'react';
import { isEmpty } from 'lodash';
import { CompositeSpanDurationSummaryItem } from '../../../../../../shared/summary/composite_span_duration_summary_item';
import { euiStyled } from '../../../../../../../../../../../src/plugins/kibana_react/common';
import { Span } from '../../../../../../../../typings/es_schemas/ui/span';
Expand Down Expand Up @@ -216,24 +217,6 @@ export function SpanFlyout({
<SpanDatabase spanDb={spanDb} />
<EuiTabbedContent
tabs={[
{
id: 'stack-trace',
name: i18n.translate(
'xpack.apm.transactionDetails.spanFlyout.stackTraceTabLabel',
{
defaultMessage: 'Stack Trace',
}
),
content: (
<Fragment>
<EuiSpacer size="l" />
<Stacktrace
stackframes={stackframes}
codeLanguage={codeLanguage}
/>
</Fragment>
),
},
{
id: 'metadata',
name: i18n.translate(
Expand All @@ -249,6 +232,28 @@ export function SpanFlyout({
</Fragment>
),
},
...(!isEmpty(stackframes)
? [
{
id: 'stack-trace',
name: i18n.translate(
'xpack.apm.transactionDetails.spanFlyout.stackTraceTabLabel',
{
defaultMessage: 'Stack Trace',
}
),
content: (
<Fragment>
<EuiSpacer size="l" />
<Stacktrace
stackframes={stackframes}
codeLanguage={codeLanguage}
/>
</Fragment>
),
},
]
: []),
]}
/>
</EuiFlyoutBody>
Expand Down

0 comments on commit 52f0bf0

Please sign in to comment.