|
@@ -1,5 +1,4 @@
|
|
|
import {useCallback, useMemo, useRef, useState} from 'react';
|
|
|
-import {ClassNames} from '@emotion/react';
|
|
|
import styled from '@emotion/styled';
|
|
|
|
|
|
import GuideAnchor from 'sentry/components/assistant/guideAnchor';
|
|
@@ -152,48 +151,47 @@ export default function BreadcrumbsDataSection({
|
|
|
const hasViewAll = summaryCrumbs.length !== enhancedCrumbs.length;
|
|
|
|
|
|
return (
|
|
|
- <FullWidthGuideAnchor target="breadcrumbs" position="top">
|
|
|
- <InterimSection
|
|
|
- key="breadcrumbs"
|
|
|
- type={SectionKey.BREADCRUMBS}
|
|
|
- title={t('Breadcrumbs')}
|
|
|
- data-test-id="breadcrumbs-data-section"
|
|
|
- actions={actions}
|
|
|
- >
|
|
|
- <ErrorBoundary
|
|
|
- mini
|
|
|
- message={t('There was an error loading the event breadcrumbs')}
|
|
|
- >
|
|
|
- <div ref={setContainer}>
|
|
|
- <BreadcrumbsTimeline
|
|
|
- breadcrumbs={summaryCrumbs}
|
|
|
- startTimeString={startTimeString}
|
|
|
- // We want the timeline to appear connected to the 'View All' button
|
|
|
- showLastLine={hasViewAll}
|
|
|
- fullyExpanded={false}
|
|
|
- containerElement={container}
|
|
|
- />
|
|
|
- </div>
|
|
|
- {hasViewAll && (
|
|
|
- <ViewAllContainer>
|
|
|
- <VerticalEllipsis />
|
|
|
- <div>
|
|
|
- <ViewAllButton
|
|
|
- size="sm"
|
|
|
- // Since we've disabled the button as an 'outside click' for the drawer we can change
|
|
|
- // the operation based on the drawer state.
|
|
|
- onClick={() => (isDrawerOpen ? closeDrawer() : onViewAllBreadcrumbs())}
|
|
|
- aria-label={t('View All Breadcrumbs')}
|
|
|
- ref={viewAllButtonRef}
|
|
|
- >
|
|
|
- {t('View All')}
|
|
|
- </ViewAllButton>
|
|
|
- </div>
|
|
|
- </ViewAllContainer>
|
|
|
- )}
|
|
|
- </ErrorBoundary>
|
|
|
- </InterimSection>
|
|
|
- </FullWidthGuideAnchor>
|
|
|
+ <InterimSection
|
|
|
+ key="breadcrumbs"
|
|
|
+ type={SectionKey.BREADCRUMBS}
|
|
|
+ title={
|
|
|
+ <GuideAnchor target="breadcrumbs" position="top">
|
|
|
+ {t('Breadcrumbs')}
|
|
|
+ </GuideAnchor>
|
|
|
+ }
|
|
|
+ data-test-id="breadcrumbs-data-section"
|
|
|
+ actions={actions}
|
|
|
+ >
|
|
|
+ <ErrorBoundary mini message={t('There was an error loading the event breadcrumbs')}>
|
|
|
+ <div ref={setContainer}>
|
|
|
+ <BreadcrumbsTimeline
|
|
|
+ breadcrumbs={summaryCrumbs}
|
|
|
+ startTimeString={startTimeString}
|
|
|
+ // We want the timeline to appear connected to the 'View All' button
|
|
|
+ showLastLine={hasViewAll}
|
|
|
+ fullyExpanded={false}
|
|
|
+ containerElement={container}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ {hasViewAll && (
|
|
|
+ <ViewAllContainer>
|
|
|
+ <VerticalEllipsis />
|
|
|
+ <div>
|
|
|
+ <ViewAllButton
|
|
|
+ size="sm"
|
|
|
+ // Since we've disabled the button as an 'outside click' for the drawer we can change
|
|
|
+ // the operation based on the drawer state.
|
|
|
+ onClick={() => (isDrawerOpen ? closeDrawer() : onViewAllBreadcrumbs())}
|
|
|
+ aria-label={t('View All Breadcrumbs')}
|
|
|
+ ref={viewAllButtonRef}
|
|
|
+ >
|
|
|
+ {t('View All')}
|
|
|
+ </ViewAllButton>
|
|
|
+ </div>
|
|
|
+ </ViewAllContainer>
|
|
|
+ )}
|
|
|
+ </ErrorBoundary>
|
|
|
+ </InterimSection>
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -223,18 +221,3 @@ const VerticalEllipsis = styled(IconEllipsis)`
|
|
|
const ViewAllButton = styled(Button)`
|
|
|
padding: ${space(0.75)} ${space(1)};
|
|
|
`;
|
|
|
-
|
|
|
-function FullWidthGuideAnchor(props: React.ComponentProps<typeof GuideAnchor>) {
|
|
|
- return (
|
|
|
- <ClassNames>
|
|
|
- {({css: classNamesCss}) => (
|
|
|
- <GuideAnchor
|
|
|
- {...props}
|
|
|
- containerClassName={classNamesCss`
|
|
|
- width: 100%;
|
|
|
- `}
|
|
|
- />
|
|
|
- )}
|
|
|
- </ClassNames>
|
|
|
- );
|
|
|
-}
|