Browse Source

ref(feedback): add link back to new feedback from old page (#59745)

cc @jas-kas 


https://github.com/getsentry/sentry/assets/56095982/370a50d1-faf5-4282-b3d3-3edfeb14ecc7
Michelle Zhang 1 year ago
parent
commit
39e99ac57f
1 changed files with 30 additions and 0 deletions
  1. 30 0
      static/app/views/userFeedback/index.tsx

+ 30 - 0
static/app/views/userFeedback/index.tsx

@@ -3,6 +3,7 @@ import styled from '@emotion/styled';
 import {withProfiler} from '@sentry/react';
 import omit from 'lodash/omit';
 
+import {Button} from 'sentry/components/button';
 import {EventUserFeedback} from 'sentry/components/events/userFeedback';
 import CompactIssue from 'sentry/components/issues/compactIssue';
 import * as Layout from 'sentry/components/layouts/thirds';
@@ -17,9 +18,11 @@ import {PageHeadingQuestionTooltip} from 'sentry/components/pageHeadingQuestionT
 import Pagination from 'sentry/components/pagination';
 import Panel from 'sentry/components/panels/panel';
 import {SegmentedControl} from 'sentry/components/segmentedControl';
+import {Tooltip} from 'sentry/components/tooltip';
 import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
 import {Organization, UserReport} from 'sentry/types';
+import {normalizeUrl} from 'sentry/utils/withDomainRequired';
 import withOrganization from 'sentry/utils/withOrganization';
 import DeprecatedAsyncView, {AsyncViewState} from 'sentry/views/deprecatedAsyncView';
 
@@ -122,6 +125,7 @@ class OrganizationUserFeedback extends DeprecatedAsyncView<Props, State> {
 
     const unresolvedQuery = omit(query, 'status');
     const allIssuesQuery = {...query, status: ''};
+    const hasNewFeedback = organization.features.includes('user-feedback-ui');
 
     return (
       <PageFiltersContainer>
@@ -138,6 +142,32 @@ class OrganizationUserFeedback extends DeprecatedAsyncView<Props, State> {
                 />
               </Layout.Title>
             </Layout.HeaderContent>
+            {hasNewFeedback && (
+              <Layout.HeaderActions>
+                <Tooltip
+                  title={t('Go back to the new feedback layout.')}
+                  position="left"
+                  isHoverable
+                >
+                  <Button
+                    size="sm"
+                    priority="default"
+                    to={{
+                      pathname: normalizeUrl(
+                        `/organizations/${organization.slug}/feedback/`
+                      ),
+                      query: {
+                        ...location.query,
+                        query: undefined,
+                        cursor: undefined,
+                      },
+                    }}
+                  >
+                    {t('Go to New User Feedback')}
+                  </Button>
+                </Tooltip>
+              </Layout.HeaderActions>
+            )}
           </Layout.Header>
           <Layout.Body data-test-id="user-feedback">
             <Layout.Main fullWidth>