|
@@ -20,7 +20,6 @@ import {
|
|
|
BREADCRUMB_SORT_LOCALSTORAGE_KEY,
|
|
|
BreadcrumbSort,
|
|
|
} from 'sentry/components/events/interfaces/breadcrumbs';
|
|
|
-import useFeedbackWidget from 'sentry/components/feedback/widget/useFeedbackWidget';
|
|
|
import useDrawer from 'sentry/components/globalDrawer';
|
|
|
import {
|
|
|
IconClock,
|
|
@@ -35,6 +34,7 @@ import type {Event} from 'sentry/types/event';
|
|
|
import type {Group} from 'sentry/types/group';
|
|
|
import type {Project} from 'sentry/types/project';
|
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
|
+import {useFeedbackForm} from 'sentry/utils/useFeedbackForm';
|
|
|
import {useLocalStorageState} from 'sentry/utils/useLocalStorageState';
|
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
|
import {FoldSectionKey} from 'sentry/views/issueDetails/streamline/foldSection';
|
|
@@ -52,6 +52,7 @@ export default function BreadcrumbsDataSection({
|
|
|
project,
|
|
|
}: BreadcrumbsDataSectionProps) {
|
|
|
const viewAllButtonRef = useRef<HTMLButtonElement>(null);
|
|
|
+ const openForm = useFeedbackForm();
|
|
|
const {closeDrawer, isDrawerOpen, openDrawer} = useDrawer();
|
|
|
const organization = useOrganization();
|
|
|
const [timeDisplay, setTimeDisplay] = useLocalStorageState<BreadcrumbTimeDisplay>(
|
|
@@ -121,7 +122,24 @@ export default function BreadcrumbsDataSection({
|
|
|
|
|
|
const actions = (
|
|
|
<ButtonBar gap={1}>
|
|
|
- <BreadcrumbsFeedback />
|
|
|
+ {openForm && (
|
|
|
+ <Button
|
|
|
+ aria-label={t('Give Feedback')}
|
|
|
+ icon={<IconMegaphone />}
|
|
|
+ size={'xs'}
|
|
|
+ onClick={() =>
|
|
|
+ openForm({
|
|
|
+ messagePlaceholder: t('How can we make breadcrumbs more useful to you?'),
|
|
|
+ tags: {
|
|
|
+ ['feedback.source']: 'issue_details_breadcrumbs',
|
|
|
+ ['feedback.owner']: 'issues',
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
+ >
|
|
|
+ {t('Give Feedback')}
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
<Button
|
|
|
aria-label={t('Open Breadcrumb Search')}
|
|
|
icon={<IconSearch size="xs" />}
|
|
@@ -192,29 +210,6 @@ export default function BreadcrumbsDataSection({
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-function BreadcrumbsFeedback() {
|
|
|
- const buttonRef = useRef<HTMLButtonElement>(null);
|
|
|
- const feedback = useFeedbackWidget({
|
|
|
- buttonRef,
|
|
|
- messagePlaceholder: t('How can we make breadcrumbs more useful to you?'),
|
|
|
- });
|
|
|
-
|
|
|
- if (!feedback) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- return (
|
|
|
- <Button
|
|
|
- ref={buttonRef}
|
|
|
- aria-label={t('Give Feedback')}
|
|
|
- icon={<IconMegaphone />}
|
|
|
- size={'xs'}
|
|
|
- >
|
|
|
- {t('Give Feedback')}
|
|
|
- </Button>
|
|
|
- );
|
|
|
-}
|
|
|
-
|
|
|
const ViewAllContainer = styled('div')`
|
|
|
position: relative;
|
|
|
display: grid;
|