groupEventDetailsContent.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. import {Fragment, lazy, useMemo, useRef} from 'react';
  2. import styled from '@emotion/styled';
  3. import {usePrompt} from 'sentry/actionCreators/prompts';
  4. import Feature from 'sentry/components/acl/feature';
  5. import {Button} from 'sentry/components/button';
  6. import {CommitRow} from 'sentry/components/commitRow';
  7. import ErrorBoundary from 'sentry/components/errorBoundary';
  8. import BreadcrumbsDataSection from 'sentry/components/events/breadcrumbs/breadcrumbsDataSection';
  9. import {EventContexts} from 'sentry/components/events/contexts';
  10. import {EventDevice} from 'sentry/components/events/device';
  11. import {EventAttachments} from 'sentry/components/events/eventAttachments';
  12. import {EventDataSection} from 'sentry/components/events/eventDataSection';
  13. import {EventEvidence} from 'sentry/components/events/eventEvidence';
  14. import {EventExtraData} from 'sentry/components/events/eventExtraData';
  15. import EventHydrationDiff from 'sentry/components/events/eventHydrationDiff';
  16. import {EventProcessingErrors} from 'sentry/components/events/eventProcessingErrors';
  17. import EventReplay from 'sentry/components/events/eventReplay';
  18. import {EventSdk} from 'sentry/components/events/eventSdk';
  19. import AggregateSpanDiff from 'sentry/components/events/eventStatisticalDetector/aggregateSpanDiff';
  20. import EventBreakpointChart from 'sentry/components/events/eventStatisticalDetector/breakpointChart';
  21. import {EventAffectedTransactions} from 'sentry/components/events/eventStatisticalDetector/eventAffectedTransactions';
  22. import EventComparison from 'sentry/components/events/eventStatisticalDetector/eventComparison';
  23. import {EventDifferentialFlamegraph} from 'sentry/components/events/eventStatisticalDetector/eventDifferentialFlamegraph';
  24. import {EventFunctionComparisonList} from 'sentry/components/events/eventStatisticalDetector/eventFunctionComparisonList';
  25. import {EventRegressionSummary} from 'sentry/components/events/eventStatisticalDetector/eventRegressionSummary';
  26. import {EventFunctionBreakpointChart} from 'sentry/components/events/eventStatisticalDetector/functionBreakpointChart';
  27. import {TransactionsDeltaProvider} from 'sentry/components/events/eventStatisticalDetector/transactionsDeltaProvider';
  28. import {EventTagsAndScreenshot} from 'sentry/components/events/eventTagsAndScreenshot';
  29. import {ScreenshotDataSection} from 'sentry/components/events/eventTagsAndScreenshot/screenshot/screenshotDataSection';
  30. import EventTagsDataSection from 'sentry/components/events/eventTagsAndScreenshot/tags';
  31. import {EventViewHierarchy} from 'sentry/components/events/eventViewHierarchy';
  32. import {EventFeatureFlagList} from 'sentry/components/events/featureFlags/eventFeatureFlagList';
  33. import {EventGroupingInfoSection} from 'sentry/components/events/groupingInfo/groupingInfoSection';
  34. import HighlightsDataSection from 'sentry/components/events/highlights/highlightsDataSection';
  35. import {HighlightsIconSummary} from 'sentry/components/events/highlights/highlightsIconSummary';
  36. import {ActionableItems} from 'sentry/components/events/interfaces/crashContent/exception/actionableItems';
  37. import {actionableItemsEnabled} from 'sentry/components/events/interfaces/crashContent/exception/useActionableItems';
  38. import {CronTimelineSection} from 'sentry/components/events/interfaces/crons/cronTimelineSection';
  39. import {Csp} from 'sentry/components/events/interfaces/csp';
  40. import {DebugMeta} from 'sentry/components/events/interfaces/debugMeta';
  41. import {Exception} from 'sentry/components/events/interfaces/exception';
  42. import {Generic} from 'sentry/components/events/interfaces/generic';
  43. import {Message} from 'sentry/components/events/interfaces/message';
  44. import {AnrRootCause} from 'sentry/components/events/interfaces/performance/anrRootCause';
  45. import {EventTraceView} from 'sentry/components/events/interfaces/performance/eventTraceView';
  46. import {SpanEvidenceSection} from 'sentry/components/events/interfaces/performance/spanEvidence';
  47. import {Request} from 'sentry/components/events/interfaces/request';
  48. import {StackTrace} from 'sentry/components/events/interfaces/stackTrace';
  49. import {Template} from 'sentry/components/events/interfaces/template';
  50. import {Threads} from 'sentry/components/events/interfaces/threads';
  51. import {UptimeDataSection} from 'sentry/components/events/interfaces/uptime/uptimeDataSection';
  52. import {EventPackageData} from 'sentry/components/events/packageData';
  53. import {EventRRWebIntegration} from 'sentry/components/events/rrwebIntegration';
  54. import {DataSection} from 'sentry/components/events/styles';
  55. import {SuspectCommits} from 'sentry/components/events/suspectCommits';
  56. import {EventUserFeedback} from 'sentry/components/events/userFeedback';
  57. import {GroupSummary} from 'sentry/components/group/groupSummary';
  58. import LazyLoad from 'sentry/components/lazyLoad';
  59. import Placeholder from 'sentry/components/placeholder';
  60. import {IconChevron} from 'sentry/icons';
  61. import {t} from 'sentry/locale';
  62. import {space} from 'sentry/styles/space';
  63. import type {Entry, EntryException, Event, EventTransaction} from 'sentry/types/event';
  64. import {EntryType, EventOrGroupType} from 'sentry/types/event';
  65. import type {Group} from 'sentry/types/group';
  66. import {IssueCategory, IssueType} from 'sentry/types/group';
  67. import type {Project} from 'sentry/types/project';
  68. import {defined} from 'sentry/utils';
  69. import {
  70. getConfigForIssueType,
  71. shouldShowCustomErrorResourceConfig,
  72. } from 'sentry/utils/issueTypeConfig';
  73. import {QuickTraceContext} from 'sentry/utils/performance/quickTrace/quickTraceContext';
  74. import QuickTraceQuery from 'sentry/utils/performance/quickTrace/quickTraceQuery';
  75. import {getReplayIdFromEvent} from 'sentry/utils/replays/getReplayIdFromEvent';
  76. import {useLocation} from 'sentry/utils/useLocation';
  77. import useOrganization from 'sentry/utils/useOrganization';
  78. import {ResourcesAndPossibleSolutions} from 'sentry/views/issueDetails/resourcesAndPossibleSolutions';
  79. import {SectionKey} from 'sentry/views/issueDetails/streamline/context';
  80. import {EventDetails} from 'sentry/views/issueDetails/streamline/eventDetails';
  81. import {InterimSection} from 'sentry/views/issueDetails/streamline/interimSection';
  82. import {TraceDataSection} from 'sentry/views/issueDetails/traceDataSection';
  83. import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';
  84. const LLMMonitoringSection = lazy(
  85. () => import('sentry/components/events/interfaces/llm-monitoring/llmMonitoringSection')
  86. );
  87. export interface EventDetailsContentProps {
  88. group: Group;
  89. project: Project;
  90. event?: Event;
  91. }
  92. export function EventDetailsContent({
  93. group,
  94. event,
  95. project,
  96. }: Required<EventDetailsContentProps>) {
  97. const organization = useOrganization();
  98. const location = useLocation();
  99. const hasStreamlinedUI = useHasStreamlinedUI();
  100. const tagsRef = useRef<HTMLDivElement>(null);
  101. const eventEntries = useMemo(() => {
  102. const {entries = []} = event;
  103. return entries.reduce<{[key in EntryType]?: Entry}>((entryMap, entry) => {
  104. entryMap[entry.type] = entry;
  105. return entryMap;
  106. }, {});
  107. }, [event]);
  108. const projectSlug = project.slug;
  109. const hasReplay = Boolean(getReplayIdFromEvent(event));
  110. const mechanism = event.tags?.find(({key}) => key === 'mechanism')?.value;
  111. const isANR = mechanism === 'ANR' || mechanism === 'AppExitInfo';
  112. const showPossibleSolutionsHigher = shouldShowCustomErrorResourceConfig(group, project);
  113. const groupingCurrentLevel = group?.metadata?.current_level;
  114. const hasFeatureFlagSection = organization.features.includes('feature-flag-ui');
  115. const hasActionableItems = actionableItemsEnabled({
  116. eventId: event.id,
  117. organization,
  118. projectSlug,
  119. });
  120. const {
  121. isLoading: promptLoading,
  122. isError: promptError,
  123. isPromptDismissed,
  124. dismissPrompt,
  125. showPrompt,
  126. } = usePrompt({
  127. feature: 'issue_feedback_hidden',
  128. organization,
  129. projectId: project.id,
  130. });
  131. // default to show on error or isPromptDismissed === undefined
  132. const showFeedback = !isPromptDismissed || promptError || hasStreamlinedUI;
  133. const issueTypeConfig = getConfigForIssueType(group, group.project);
  134. return (
  135. <Fragment>
  136. {hasStreamlinedUI && <HighlightsIconSummary event={event} group={group} />}
  137. {hasActionableItems && !hasStreamlinedUI && (
  138. <ActionableItems event={event} project={project} isShare={false} />
  139. )}
  140. <StyledDataSection>
  141. {!hasStreamlinedUI && (
  142. <Feature features={['organizations:ai-summary']}>
  143. <GroupSummary groupId={group.id} groupCategory={group.issueCategory} />
  144. </Feature>
  145. )}
  146. {!hasStreamlinedUI && <TraceDataSection event={event} />}
  147. {!hasStreamlinedUI && (
  148. <SuspectCommits
  149. projectSlug={project.slug}
  150. eventId={event.id}
  151. group={group}
  152. commitRow={CommitRow}
  153. />
  154. )}
  155. </StyledDataSection>
  156. {event.userReport && (
  157. <InterimSection
  158. title={t('User Feedback')}
  159. type={SectionKey.USER_FEEDBACK}
  160. actions={
  161. hasStreamlinedUI ? null : (
  162. <ErrorBoundary mini>
  163. <Button
  164. size="xs"
  165. icon={<IconChevron direction={showFeedback ? 'up' : 'down'} />}
  166. onClick={showFeedback ? dismissPrompt : showPrompt}
  167. title={
  168. showFeedback
  169. ? t('Hide feedback on all issue details')
  170. : t('Unhide feedback on all issue details')
  171. }
  172. disabled={promptError}
  173. busy={promptLoading}
  174. >
  175. {showFeedback ? t('Hide') : t('Show')}
  176. </Button>
  177. </ErrorBoundary>
  178. )
  179. }
  180. >
  181. {promptLoading ? (
  182. <Placeholder />
  183. ) : showFeedback ? (
  184. <EventUserFeedback
  185. report={event.userReport}
  186. orgSlug={organization.slug}
  187. issueId={group.id}
  188. showEventLink={false}
  189. />
  190. ) : null}
  191. </InterimSection>
  192. )}
  193. {event.type === EventOrGroupType.ERROR &&
  194. organization.features.includes('insights-addon-modules') &&
  195. event?.entries
  196. ?.filter((x): x is EntryException => x.type === EntryType.EXCEPTION)
  197. .flatMap(x => x.data.values ?? [])
  198. .some(({value}) => {
  199. const lowerText = value?.toLowerCase();
  200. return (
  201. lowerText &&
  202. (lowerText.includes('api key') || lowerText.includes('429')) &&
  203. (lowerText.includes('openai') ||
  204. lowerText.includes('anthropic') ||
  205. lowerText.includes('cohere') ||
  206. lowerText.includes('langchain'))
  207. );
  208. }) ? (
  209. <LazyLoad
  210. LazyComponent={LLMMonitoringSection}
  211. event={event}
  212. organization={organization}
  213. />
  214. ) : null}
  215. {group.issueCategory === IssueCategory.UPTIME && (
  216. <UptimeDataSection event={event} project={project} group={group} />
  217. )}
  218. {group.issueCategory === IssueCategory.CRON && (
  219. <CronTimelineSection
  220. event={event}
  221. organization={organization}
  222. project={project}
  223. />
  224. )}
  225. {!hasStreamlinedUI && (
  226. <HighlightsDataSection event={event} project={project} viewAllRef={tagsRef} />
  227. )}
  228. {showPossibleSolutionsHigher && (
  229. <ResourcesAndPossibleSolutionsIssueDetailsContent
  230. event={event}
  231. project={project}
  232. group={group}
  233. />
  234. )}
  235. <EventEvidence event={event} group={group} project={project} />
  236. {defined(eventEntries[EntryType.MESSAGE]) && (
  237. <EntryErrorBoundary type={EntryType.MESSAGE}>
  238. <Message event={event} data={eventEntries[EntryType.MESSAGE].data} />
  239. </EntryErrorBoundary>
  240. )}
  241. {defined(eventEntries[EntryType.EXCEPTION]) && (
  242. <EntryErrorBoundary type={EntryType.EXCEPTION}>
  243. <Exception
  244. event={event}
  245. data={eventEntries[EntryType.EXCEPTION].data}
  246. projectSlug={project.slug}
  247. group={group}
  248. groupingCurrentLevel={groupingCurrentLevel}
  249. />
  250. </EntryErrorBoundary>
  251. )}
  252. {defined(eventEntries[EntryType.STACKTRACE]) && (
  253. <EntryErrorBoundary type={EntryType.STACKTRACE}>
  254. <StackTrace
  255. event={event}
  256. data={eventEntries[EntryType.STACKTRACE].data}
  257. projectSlug={projectSlug}
  258. groupingCurrentLevel={groupingCurrentLevel}
  259. />
  260. </EntryErrorBoundary>
  261. )}
  262. {defined(eventEntries[EntryType.THREADS]) && (
  263. <EntryErrorBoundary type={EntryType.THREADS}>
  264. <Threads
  265. event={event}
  266. data={eventEntries[EntryType.THREADS].data}
  267. projectSlug={project.slug}
  268. groupingCurrentLevel={groupingCurrentLevel}
  269. group={group}
  270. />
  271. </EntryErrorBoundary>
  272. )}
  273. {hasStreamlinedUI && (
  274. <ScreenshotDataSection event={event} projectSlug={project.slug} />
  275. )}
  276. {isANR && (
  277. <QuickTraceQuery
  278. event={event}
  279. location={location}
  280. orgSlug={organization.slug}
  281. type={'spans'}
  282. skipLight
  283. >
  284. {results => {
  285. return (
  286. <QuickTraceContext.Provider value={results}>
  287. <AnrRootCause event={event} organization={organization} />
  288. </QuickTraceContext.Provider>
  289. );
  290. }}
  291. </QuickTraceQuery>
  292. )}
  293. {group.issueCategory === IssueCategory.PERFORMANCE && (
  294. <SpanEvidenceSection
  295. event={event as EventTransaction}
  296. organization={organization}
  297. projectSlug={project.slug}
  298. />
  299. )}
  300. <EventHydrationDiff event={event} group={group} />
  301. {issueTypeConfig.replays.enabled && (
  302. <EventReplay event={event} group={group} projectSlug={project.slug} />
  303. )}
  304. {defined(eventEntries[EntryType.HPKP]) && (
  305. <EntryErrorBoundary type={EntryType.HPKP}>
  306. <Generic
  307. type={EntryType.HPKP}
  308. data={eventEntries[EntryType.HPKP].data}
  309. meta={event._meta?.hpkp ?? {}}
  310. />
  311. </EntryErrorBoundary>
  312. )}
  313. {defined(eventEntries[EntryType.CSP]) && (
  314. <EntryErrorBoundary type={EntryType.CSP}>
  315. <Csp event={event} data={eventEntries[EntryType.CSP].data} />
  316. </EntryErrorBoundary>
  317. )}
  318. {defined(eventEntries[EntryType.EXPECTCT]) && (
  319. <EntryErrorBoundary type={EntryType.EXPECTCT}>
  320. <Generic
  321. type={EntryType.EXPECTCT}
  322. data={eventEntries[EntryType.EXPECTCT].data}
  323. />
  324. </EntryErrorBoundary>
  325. )}
  326. {defined(eventEntries[EntryType.EXPECTSTAPLE]) && (
  327. <EntryErrorBoundary type={EntryType.EXPECTSTAPLE}>
  328. <Generic
  329. type={EntryType.EXPECTSTAPLE}
  330. data={eventEntries[EntryType.EXPECTSTAPLE].data}
  331. />
  332. </EntryErrorBoundary>
  333. )}
  334. {defined(eventEntries[EntryType.TEMPLATE]) && (
  335. <EntryErrorBoundary type={EntryType.TEMPLATE}>
  336. <Template event={event} data={eventEntries[EntryType.TEMPLATE].data} />
  337. </EntryErrorBoundary>
  338. )}
  339. <BreadcrumbsDataSection event={event} group={group} project={project} />
  340. {hasStreamlinedUI && (
  341. <EventTraceView group={group} event={event} organization={organization} />
  342. )}
  343. {!showPossibleSolutionsHigher && (
  344. <ResourcesAndPossibleSolutionsIssueDetailsContent
  345. event={event}
  346. project={project}
  347. group={group}
  348. />
  349. )}
  350. {defined(eventEntries[EntryType.DEBUGMETA]) && (
  351. <EntryErrorBoundary type={EntryType.DEBUGMETA}>
  352. <DebugMeta
  353. event={event}
  354. projectSlug={projectSlug}
  355. groupId={group?.id}
  356. data={eventEntries[EntryType.DEBUGMETA].data}
  357. />
  358. </EntryErrorBoundary>
  359. )}
  360. {defined(eventEntries[EntryType.REQUEST]) && (
  361. <EntryErrorBoundary type={EntryType.REQUEST}>
  362. <Request event={event} data={eventEntries[EntryType.REQUEST].data} />
  363. </EntryErrorBoundary>
  364. )}
  365. {hasStreamlinedUI ? (
  366. <Fragment>
  367. <HighlightsDataSection event={event} project={project} viewAllRef={tagsRef} />
  368. <EventTagsDataSection event={event} projectSlug={project.slug} ref={tagsRef} />
  369. </Fragment>
  370. ) : (
  371. <div ref={tagsRef}>
  372. <EventTagsAndScreenshot event={event} projectSlug={project.slug} />
  373. </div>
  374. )}
  375. <EventContexts group={group} event={event} />
  376. {hasFeatureFlagSection && (
  377. <EventFeatureFlagList group={group} project={project} event={event} />
  378. )}
  379. <EventExtraData event={event} />
  380. <EventPackageData event={event} />
  381. <EventDevice event={event} />
  382. <EventViewHierarchy event={event} project={project} />
  383. <EventAttachments event={event} project={project} group={group} />
  384. <EventSdk sdk={event.sdk} meta={event._meta?.sdk} />
  385. {hasStreamlinedUI && (
  386. <EventProcessingErrors event={event} project={project} isShare={false} />
  387. )}
  388. {event.groupID && (
  389. <EventGroupingInfoSection
  390. projectSlug={project.slug}
  391. event={event}
  392. showGroupingConfig={
  393. organization.features.includes('set-grouping-config') &&
  394. 'groupingConfig' in event
  395. }
  396. group={group}
  397. />
  398. )}
  399. {!hasReplay && (
  400. <EventRRWebIntegration
  401. event={event}
  402. orgId={organization.slug}
  403. projectSlug={project.slug}
  404. />
  405. )}
  406. </Fragment>
  407. );
  408. }
  409. function ResourcesAndPossibleSolutionsIssueDetailsContent({
  410. event,
  411. project,
  412. group,
  413. }: Required<EventDetailsContentProps>) {
  414. return (
  415. <ErrorBoundary mini>
  416. <ResourcesAndPossibleSolutions event={event} project={project} group={group} />
  417. </ErrorBoundary>
  418. );
  419. }
  420. const GroupContent = styled('div')`
  421. border: 1px solid ${p => p.theme.translucentBorder};
  422. background: ${p => p.theme.background};
  423. border-radius: ${p => p.theme.borderRadius};
  424. position: relative;
  425. `;
  426. const GroupContentPadding = styled('div')`
  427. padding: ${space(1)} ${space(1.5)};
  428. `;
  429. // TODO: Merge regression issues with the other event details
  430. function RegressionEventContainer({children}: {children: React.ReactNode}) {
  431. const hasStreamlinedUI = useHasStreamlinedUI();
  432. if (!hasStreamlinedUI) {
  433. return children;
  434. }
  435. return (
  436. <GroupContent>
  437. <GroupContentPadding>{children}</GroupContentPadding>
  438. </GroupContent>
  439. );
  440. }
  441. function PerformanceDurationRegressionIssueDetailsContent({
  442. group,
  443. event,
  444. project,
  445. }: Required<EventDetailsContentProps>) {
  446. return (
  447. <RegressionEventContainer>
  448. <ErrorBoundary mini>
  449. <EventRegressionSummary event={event} group={group} />
  450. </ErrorBoundary>
  451. <ErrorBoundary mini>
  452. <EventBreakpointChart event={event} />
  453. </ErrorBoundary>
  454. <ErrorBoundary mini>
  455. <AggregateSpanDiff event={event} project={project} />
  456. </ErrorBoundary>
  457. <ErrorBoundary mini>
  458. <EventComparison event={event} project={project} />
  459. </ErrorBoundary>
  460. </RegressionEventContainer>
  461. );
  462. }
  463. function ProfilingDurationRegressionIssueDetailsContent({
  464. group,
  465. event,
  466. project,
  467. }: Required<EventDetailsContentProps>) {
  468. return (
  469. <RegressionEventContainer>
  470. <TransactionsDeltaProvider event={event} project={project}>
  471. <Fragment>
  472. <ErrorBoundary mini>
  473. <EventRegressionSummary event={event} group={group} />
  474. </ErrorBoundary>
  475. <ErrorBoundary mini>
  476. <EventFunctionBreakpointChart event={event} />
  477. </ErrorBoundary>
  478. <ErrorBoundary mini>
  479. <EventAffectedTransactions event={event} group={group} project={project} />
  480. </ErrorBoundary>
  481. <ErrorBoundary mini>
  482. <InterimSection
  483. type={SectionKey.REGRESSION_FLAMEGRAPH}
  484. title={t('Regression Flamegraph')}
  485. >
  486. <b>{t('Largest Changes in Call Stack Frequency')}</b>
  487. <p>
  488. {t(`See which functions changed the most before and after the regression. The
  489. frame with the largest increase in call stack population likely
  490. contributed to the cause for the duration regression.`)}
  491. </p>
  492. <EventDifferentialFlamegraph event={event} />
  493. </InterimSection>
  494. </ErrorBoundary>
  495. <ErrorBoundary mini>
  496. <EventFunctionComparisonList event={event} group={group} project={project} />
  497. </ErrorBoundary>
  498. </Fragment>
  499. </TransactionsDeltaProvider>
  500. </RegressionEventContainer>
  501. );
  502. }
  503. export default function GroupEventDetailsContent({
  504. group,
  505. event,
  506. project,
  507. }: EventDetailsContentProps) {
  508. const hasStreamlinedUI = useHasStreamlinedUI();
  509. if (!event) {
  510. return (
  511. <NotFoundMessage>
  512. <h3>{t('Latest event not available')}</h3>
  513. </NotFoundMessage>
  514. );
  515. }
  516. switch (group.issueType) {
  517. case IssueType.PERFORMANCE_DURATION_REGRESSION:
  518. case IssueType.PERFORMANCE_ENDPOINT_REGRESSION: {
  519. return (
  520. <PerformanceDurationRegressionIssueDetailsContent
  521. group={group}
  522. event={event}
  523. project={project}
  524. />
  525. );
  526. }
  527. case IssueType.PROFILE_FUNCTION_REGRESSION_EXPERIMENTAL:
  528. case IssueType.PROFILE_FUNCTION_REGRESSION: {
  529. return (
  530. <ProfilingDurationRegressionIssueDetailsContent
  531. group={group}
  532. event={event}
  533. project={project}
  534. />
  535. );
  536. }
  537. default: {
  538. return hasStreamlinedUI ? (
  539. <EventDetails event={event} group={group} project={project} />
  540. ) : (
  541. <EventDetailsContent group={group} event={event} project={project} />
  542. );
  543. }
  544. }
  545. }
  546. /**
  547. * This component is only necessary while the streamlined UI is not in place.
  548. * The FoldSection by default wraps its children with an ErrorBoundary, preventing content
  549. * from crashing the whole page if an error occurs, but EventDataSection does not do this.
  550. */
  551. function EntryErrorBoundary({
  552. children,
  553. type,
  554. }: {
  555. children: React.ReactNode;
  556. type: EntryType;
  557. }) {
  558. return (
  559. <ErrorBoundary
  560. customComponent={
  561. <EventDataSection type={type} title={type}>
  562. <p>{t('There was an error rendering this data.')}</p>
  563. </EventDataSection>
  564. }
  565. >
  566. {children}
  567. </ErrorBoundary>
  568. );
  569. }
  570. const NotFoundMessage = styled('div')`
  571. padding: ${space(2)} ${space(4)};
  572. `;
  573. const StyledDataSection = styled(DataSection)`
  574. padding: ${space(0.5)} ${space(2)};
  575. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  576. padding: ${space(1)} ${space(4)};
  577. }
  578. &:empty {
  579. display: none;
  580. }
  581. `;