Browse Source

chore: Remove mobile screenshot flags (#41976)

Remove feature flags for mobile screenshot feature now that it's in GA
Shruthi 2 years ago
parent
commit
7fa2d1649d

+ 12 - 41
static/app/components/events/eventEntries.tsx

@@ -6,10 +6,8 @@ import uniq from 'lodash/uniq';
 
 import {addErrorMessage} from 'sentry/actionCreators/indicator';
 import {Client} from 'sentry/api';
-import GuideAnchor from 'sentry/components/assistant/guideAnchor';
 import ErrorBoundary from 'sentry/components/errorBoundary';
 import EventContexts from 'sentry/components/events/contexts';
-import EventContextSummary from 'sentry/components/events/contextSummary';
 import EventDevice from 'sentry/components/events/device';
 import EventErrors, {Error} from 'sentry/components/events/errors';
 import EventAttachments from 'sentry/components/events/eventAttachments';
@@ -17,7 +15,6 @@ import EventCause from 'sentry/components/events/eventCause';
 import EventDataSection from 'sentry/components/events/eventDataSection';
 import EventExtraData from 'sentry/components/events/eventExtraData';
 import {EventSdk} from 'sentry/components/events/eventSdk';
-import {EventTags} from 'sentry/components/events/eventTags';
 import EventGroupingInfo from 'sentry/components/events/groupingInfo';
 import {EventPackageData} from 'sentry/components/events/packageData';
 import RRWebIntegration from 'sentry/components/events/rrwebIntegration';
@@ -322,7 +319,6 @@ const EventEntries = ({
     );
   }
 
-  const hasMobileScreenshotsFeature = orgFeatures.includes('mobile-screenshots');
   const hasContext = !objectIsEmpty(event.user ?? {}) || !objectIsEmpty(event.contexts);
   const hasErrors = !objectIsEmpty(event.errors) || !!proGuardErrors.length;
 
@@ -352,34 +348,18 @@ const EventEntries = ({
           includeBorder={!hasErrors}
         />
       )}
-      {showTagSummary &&
-        (hasMobileScreenshotsFeature ? (
-          <EventTagsAndScreenshot
-            event={event}
-            organization={organization as Organization}
-            projectId={projectSlug}
-            location={location}
-            isShare={isShare}
-            hasContext={hasContext}
-            attachments={attachments}
-            onDeleteScreenshot={handleDeleteAttachment}
-          />
-        ) : (
-          (!!(event.tags ?? []).length || hasContext) && (
-            <StyledEventDataSection
-              title={<GuideAnchor target="tags">{t('Tags')}</GuideAnchor>}
-              type="tags"
-            >
-              {hasContext && <EventContextSummary event={event} />}
-              <EventTags
-                event={event}
-                organization={organization as Organization}
-                projectId={projectSlug}
-                location={location}
-              />
-            </StyledEventDataSection>
-          )
-        ))}
+      {showTagSummary && (
+        <EventTagsAndScreenshot
+          event={event}
+          organization={organization as Organization}
+          projectId={projectSlug}
+          location={location}
+          isShare={isShare}
+          hasContext={hasContext}
+          attachments={attachments}
+          onDeleteScreenshot={handleDeleteAttachment}
+        />
+      )}
       <Entries
         definedEvent={event}
         projectSlug={projectSlug}
@@ -515,15 +495,6 @@ function Entries({
   );
 }
 
-const StyledEventDataSection = styled(EventDataSection)`
-  /* Hiding the top border because of the event section appears at this breakpoint */
-  @media (max-width: 767px) {
-    &:first-of-type {
-      border-top: none;
-    }
-  }
-`;
-
 const LatestEventNotAvailable = styled('div')`
   padding: ${space(2)} ${space(4)};
 `;

+ 3 - 23
static/app/components/events/eventTagsAndScreenshot/index.tsx

@@ -5,7 +5,6 @@ import {openModal} from 'sentry/actionCreators/modal';
 import {DataSection} from 'sentry/components/events/styles';
 import Link from 'sentry/components/links/link';
 import {t, tct, tn} from 'sentry/locale';
-import space from 'sentry/styles/space';
 import {EventAttachment} from 'sentry/types/group';
 import {objectIsEmpty} from 'sentry/utils';
 import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAnalyticsEvent';
@@ -16,7 +15,6 @@ import Modal, {modalCss} from './screenshot/modal';
 import {DataSection as ScreenshotDataSection} from './dataSection';
 import Screenshot from './screenshot';
 import Tags from './tags';
-import TagsHighlight from './tagsHighlight';
 
 type ScreenshotProps = React.ComponentProps<typeof Screenshot>;
 
@@ -119,18 +117,14 @@ function EventTagsAndScreenshots({
 
   return (
     <Wrapper showScreenshot={showScreenshot} showTags={showTags}>
-      <TagWrapper hasEventContext={hasEventContext}>
-        {hasEventContext && (
-          <TagsHighlightWrapper>
-            <TagsHighlight event={event} />
-          </TagsHighlightWrapper>
-        )}
+      <TagWrapper>
         {showTags && (
           <Tags
             organization={organization}
             event={event}
             projectSlug={projectSlug}
             location={location}
+            hasEventContext={hasEventContext}
           />
         )}
       </TagWrapper>
@@ -201,20 +195,6 @@ const ScreenshotWrapper = styled('div')`
   }
 `;
 
-const TagWrapper = styled('div')<{hasEventContext: boolean}>`
-  padding: ${p => (p.hasEventContext ? `${space(2)} 0` : '0')};
+const TagWrapper = styled('div')`
   overflow: hidden;
-
-  @media (min-width: ${p => p.theme.breakpoints.small}) {
-    padding: ${p => (p.hasEventContext ? `${space(2)} 0` : '0')};
-  }
-`;
-
-const TagsHighlightWrapper = styled('div')`
-  overflow: hidden;
-  padding: 0 ${space(2)};
-
-  @media (min-width: ${p => p.theme.breakpoints.medium}) {
-    padding: 0 ${space(4)};
-  }
 `;

+ 1 - 1
static/app/components/events/eventTagsAndScreenshot/screenshot/modal.spec.tsx

@@ -61,7 +61,7 @@ describe('Modals -> ScreenshotModal', function () {
   let getAttachmentsMock;
   beforeEach(() => {
     initialData = initializeOrg({
-      organization: TestStubs.Organization({features: ['mobile-screenshot-gallery']}),
+      organization: TestStubs.Organization(),
       router: {
         params: {orgId: 'org-slug', groupId: 'group-id'},
         location: {query: {types: 'event.screenshot'}},

+ 4 - 1
static/app/components/events/eventTagsAndScreenshot/tags.tsx

@@ -1,6 +1,7 @@
 import styled from '@emotion/styled';
 import type {Location} from 'history';
 
+import EventContextSummary from 'sentry/components/events/contextSummary';
 import {SectionContents} from 'sentry/components/events/eventDataSection';
 import {t} from 'sentry/locale';
 import type {Organization, Project} from 'sentry/types';
@@ -12,18 +13,20 @@ import {DataSection} from './dataSection';
 
 type Props = {
   event: Event;
+  hasEventContext: boolean;
   location: Location;
   organization: Organization;
   projectSlug: Project['slug'];
 };
 
-function Tags({event, organization, projectSlug, location}: Props) {
+function Tags({event, organization, projectSlug, location, hasEventContext}: Props) {
   return (
     <StyledDataSection
       title={t('Tags')}
       description={t('The default and custom tags associated with this event')}
       data-test-id="event-tags"
     >
+      {hasEventContext && <EventContextSummary event={event} />}
       <EventTags
         event={event}
         organization={organization}

+ 1 - 1
static/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachments.spec.tsx

@@ -11,7 +11,7 @@ jest.mock('sentry/actionCreators/modal');
 
 describe('GroupEventAttachments > Screenshots', function () {
   const {organization, routerContext} = initializeOrg({
-    organization: TestStubs.Organization({features: ['mobile-screenshot-gallery']}),
+    organization: TestStubs.Organization(),
     router: {
       params: {orgId: 'org-slug', groupId: 'group-id'},
       location: {query: {types: 'event.screenshot'}},

+ 9 - 13
static/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsFilter.tsx

@@ -9,7 +9,6 @@ import space from 'sentry/styles/space';
 import {Project} from 'sentry/types';
 import {isMobilePlatform} from 'sentry/utils/platform';
 import {useLocation} from 'sentry/utils/useLocation';
-import useOrganization from 'sentry/utils/useOrganization';
 
 const crashReportTypes = ['event.minidump', 'event.applecrashreport'];
 const SCREENSHOT_TYPE = 'event.screenshot';
@@ -28,8 +27,6 @@ const GroupEventAttachmentsFilter = (props: Props) => {
     types: crashReportTypes,
   };
 
-  const organization = useOrganization();
-
   const onlyScreenshotQuery = {
     ...query,
     types: SCREENSHOT_TYPE,
@@ -51,16 +48,15 @@ const GroupEventAttachmentsFilter = (props: Props) => {
         <Button barId="all" size="sm" to={{pathname, query: allAttachmentsQuery}}>
           {t('All Attachments')}
         </Button>
-        {organization.features.includes('mobile-screenshot-gallery') &&
-          isMobilePlatform(project.platform) && (
-            <Button
-              barId="screenshot"
-              size="sm"
-              to={{pathname, query: onlyScreenshotQuery}}
-            >
-              {t('Screenshots')}
-            </Button>
-          )}
+        {isMobilePlatform(project.platform) && (
+          <Button
+            barId="screenshot"
+            size="sm"
+            to={{pathname, query: onlyScreenshotQuery}}
+          >
+            {t('Screenshots')}
+          </Button>
+        )}
         <Button barId="onlyCrash" size="sm" to={{pathname, query: onlyCrashReportsQuery}}>
           {t('Only Crash Reports')}
         </Button>