From 5d7cd8533d3a0551f7a9dabc9f13ebf087022b02 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 28 May 2019 11:37:56 -0400 Subject: [PATCH] ref(events-v2) Remove group prop from many interface components Many of the event interface ui components had `group` as a required prop but it isn't used other than to pass onto EventDataSection which also doesn't use the prop. By removing all these redundant props I can fix numerous prop type warnings that are blocking the modal for events-v2. Refs SEN-697 --- .../sentry/app/components/events/device.jsx | 4 +- .../sentry/app/components/events/errors.jsx | 8 +- .../app/components/events/eventEntries.jsx | 28 +-- .../app/components/events/extraData.jsx | 2 - .../app/components/events/groupingInfo.jsx | 6 +- .../events/interfaces/breadcrumbs.jsx | 3 - .../events/interfaces/crashContent.jsx | 12 +- .../app/components/events/interfaces/csp.jsx | 11 +- .../events/interfaces/debugmeta.jsx | 2 - .../events/interfaces/exception.jsx | 21 +- .../events/interfaces/exceptionContent.jsx | 4 - .../components/events/interfaces/generic.jsx | 11 +- .../components/events/interfaces/message.jsx | 5 +- .../components/events/interfaces/request.jsx | 10 +- .../events/interfaces/stacktrace.jsx | 19 +- .../events/interfaces/stacktraceContent.jsx | 4 - .../components/events/interfaces/template.jsx | 2 - .../components/events/interfaces/threads.jsx | 8 - .../app/components/events/packageData.jsx | 8 +- .../sentry/app/components/events/sdk.jsx | 11 +- .../__snapshots__/crashContent.spec.jsx.snap | 1 + .../components/events/crashContent.spec.jsx | 1 + .../breadcrumbComponents/breadcrumbs.spec.jsx | 3 - .../__snapshots__/index.spec.jsx.snap | 189 +----------------- 24 files changed, 47 insertions(+), 326 deletions(-) diff --git a/src/sentry/static/sentry/app/components/events/device.jsx b/src/sentry/static/sentry/app/components/events/device.jsx index fdb43819ecdcfe..cd9042a5ac3d0a 100644 --- a/src/sentry/static/sentry/app/components/events/device.jsx +++ b/src/sentry/static/sentry/app/components/events/device.jsx @@ -8,12 +8,11 @@ import ContextData from 'app/components/contextData'; // TODO(hazat): Is this interface used somewhere? If not delete it? class DeviceInterface extends React.Component { static propTypes = { - group: SentryTypes.Group.isRequired, event: SentryTypes.Event.isRequired, }; render() { - const {group, event} = this.props; + const {event} = this.props; const data = event.device; const extras = Object.keys(data.data || {}).map(key => { const value = data.data[key]; @@ -29,7 +28,6 @@ class DeviceInterface extends React.Component { return ( +

diff --git a/src/sentry/static/sentry/app/components/events/eventEntries.jsx b/src/sentry/static/sentry/app/components/events/eventEntries.jsx index afef2734732999..c57d5131a2d51b 100644 --- a/src/sentry/static/sentry/app/components/events/eventEntries.jsx +++ b/src/sentry/static/sentry/app/components/events/eventEntries.jsx @@ -97,7 +97,7 @@ class EventEntries extends React.Component { } renderEntries() { - const {event, group, isShare} = this.props; + const {event, project, isShare} = this.props; return event.entries.map((entry, entryIdx) => { try { @@ -112,7 +112,7 @@ class EventEntries extends React.Component { return ( - {!utils.objectIsEmpty(event.errors) && ( - - )}{' '} + {!utils.objectIsEmpty(event.errors) && }{' '} {!isShare && !!group.firstRelease && ( )} @@ -167,7 +165,7 @@ class EventEntries extends React.Component { issueId={group.id} /> )} - {hasContext && } + {hasContext && } {this.renderEntries()} {hasContext && } - {!utils.objectIsEmpty(event.context) && ( - - )} - {!utils.objectIsEmpty(event.packages) && ( - - )} - {!utils.objectIsEmpty(event.device) && ( - - )} + {!utils.objectIsEmpty(event.context) && } + {!utils.objectIsEmpty(event.packages) && } + {!utils.objectIsEmpty(event.device) && } {!isShare && features.has('event-attachments') && ( )} - {!utils.objectIsEmpty(event.sdk) && } + {!utils.objectIsEmpty(event.sdk) && } {!utils.objectIsEmpty(event.sdk) && event.sdk.upstream.isNewer && (

@@ -205,7 +197,7 @@ class EventEntries extends React.Component {
)}{' '} {!isShare && features.has('grouping-info') && ( - + )} ); diff --git a/src/sentry/static/sentry/app/components/events/extraData.jsx b/src/sentry/static/sentry/app/components/events/extraData.jsx index d66977cf56e924..b818ea72b84980 100644 --- a/src/sentry/static/sentry/app/components/events/extraData.jsx +++ b/src/sentry/static/sentry/app/components/events/extraData.jsx @@ -9,7 +9,6 @@ import SentryTypes from 'app/sentryTypes'; class EventExtraData extends React.Component { static propTypes = { - group: SentryTypes.Group.isRequired, event: SentryTypes.Event.isRequired, }; @@ -35,7 +34,6 @@ class EventExtraData extends React.Component { return (
{ - const {event, stackView, stackType, newestFirst, exception, group} = this.props; + const {event, stackView, stackType, newestFirst, exception, projectId} = this.props; return stackView === 'raw' ? ( { - const {event, stackView, newestFirst, stacktrace, group} = this.props; + const {event, stackView, newestFirst, stacktrace} = this.props; return stackView === 'raw' ? (
         {rawStacktraceContent(stacktrace, event.platform)}
@@ -54,7 +53,6 @@ class CrashContent extends React.Component {
         includeSystemFrames={stackView === 'full'}
         platform={event.platform}
         newestFirst={newestFirst}
-        group={group}
       />
     );
   };
diff --git a/src/sentry/static/sentry/app/components/events/interfaces/csp.jsx b/src/sentry/static/sentry/app/components/events/interfaces/csp.jsx
index 0b27844f608c7f..f9282822d9837d 100644
--- a/src/sentry/static/sentry/app/components/events/interfaces/csp.jsx
+++ b/src/sentry/static/sentry/app/components/events/interfaces/csp.jsx
@@ -22,7 +22,6 @@ function getView(view, data) {
 
 export default class CspInterface extends React.Component {
   static propTypes = {
-    group: SentryTypes.Group.isRequired,
     event: SentryTypes.Event.isRequired,
     data: PropTypes.object.isRequired,
   };
@@ -47,7 +46,7 @@ export default class CspInterface extends React.Component {
 
   render() {
     const {view, data} = this.state;
-    const {group, event} = this.props;
+    const {event} = this.props;
 
     const title = (
       
@@ -78,13 +77,7 @@ export default class CspInterface extends React.Component { const children = getView(view, data); return ( - + {children} ); diff --git a/src/sentry/static/sentry/app/components/events/interfaces/debugmeta.jsx b/src/sentry/static/sentry/app/components/events/interfaces/debugmeta.jsx index 03737ded7052a5..7ab69318195cce 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/debugmeta.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/debugmeta.jsx @@ -8,7 +8,6 @@ import {t} from 'app/locale'; class DebugMetaInterface extends React.Component { static propTypes = { - group: SentryTypes.Group.isRequired, event: SentryTypes.Event.isRequired, data: PropTypes.object.isRequired, }; @@ -42,7 +41,6 @@ class DebugMetaInterface extends React.Component { return (
+ { return (
@@ -50,7 +47,6 @@ class ExceptionContent extends React.Component { includeSystemFrames={stackView === 'full'} platform={this.props.platform} newestFirst={newestFirst} - group={group} /> )}
diff --git a/src/sentry/static/sentry/app/components/events/interfaces/generic.jsx b/src/sentry/static/sentry/app/components/events/interfaces/generic.jsx index d6f7f174f57718..738d5bb59c671d 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/generic.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/generic.jsx @@ -19,7 +19,6 @@ function getView(view, data) { } export default class GenericInterface extends Component { static propTypes = { - group: SentryTypes.Group.isRequired, event: SentryTypes.Event.isRequired, type: PropTypes.string.isRequired, data: PropTypes.object.isRequired, @@ -42,7 +41,7 @@ export default class GenericInterface extends Component { render() { const {view, data} = this.state; - const {group, event, type} = this.props; + const {event, type} = this.props; const title = (
@@ -67,13 +66,7 @@ export default class GenericInterface extends Component { const children = getView(view, data); return ( - + {children} ); diff --git a/src/sentry/static/sentry/app/components/events/interfaces/message.jsx b/src/sentry/static/sentry/app/components/events/interfaces/message.jsx index 25117ef7b990b7..3c398f30eb2c0c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/message.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/message.jsx @@ -10,7 +10,6 @@ import {objectIsEmpty} from 'app/utils'; class MessageInterface extends React.Component { static propTypes = { - group: SentryTypes.Group.isRequired, event: SentryTypes.Event.isRequired, data: PropTypes.object.isRequired, }; @@ -34,10 +33,10 @@ class MessageInterface extends React.Component { } render() { - const {data, group, event} = this.props; + const {data, event} = this.props; return ( - +
           
         
diff --git a/src/sentry/static/sentry/app/components/events/interfaces/request.jsx b/src/sentry/static/sentry/app/components/events/interfaces/request.jsx index 8270454340a51e..178e30cc1fa824 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/request.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/request.jsx @@ -12,7 +12,6 @@ import Truncate from 'app/components/truncate'; class RequestInterface extends React.Component { static propTypes = { - group: SentryTypes.Group.isRequired, event: SentryTypes.Event.isRequired, type: PropTypes.string.isRequired, data: PropTypes.object.isRequired, @@ -44,9 +43,7 @@ class RequestInterface extends React.Component { }; render() { - const group = this.props.group; - const evt = this.props.event; - const data = this.props.data; + const {event, data, type} = this.props; const view = this.state.view; let fullUrl = getFullUrl(data); @@ -111,9 +108,8 @@ class RequestInterface extends React.Component { return ( ); } diff --git a/src/sentry/static/sentry/app/components/events/interfaces/template.jsx b/src/sentry/static/sentry/app/components/events/interfaces/template.jsx index 47ce7b15a6981e..2cf4f6929d8a2c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/template.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/template.jsx @@ -7,7 +7,6 @@ import {t} from 'app/locale'; class TemplateInterface extends React.Component { static propTypes = { - group: SentryTypes.Group.isRequired, event: SentryTypes.Event.isRequired, type: PropTypes.string.isRequired, data: PropTypes.object.isRequired, @@ -16,7 +15,6 @@ class TemplateInterface extends React.Component { render() { return ( {t('Template')}
} diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads.jsx b/src/sentry/static/sentry/app/components/events/interfaces/threads.jsx index c268aaeeb4f71d..8950a99a741349 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads.jsx @@ -126,7 +126,6 @@ function findBestThread(threads) { class Thread extends React.Component { static propTypes = { - group: SentryTypes.Group.isRequired, event: SentryTypes.Event.isRequired, data: PropTypes.object.isRequired, stackView: PropTypes.string, @@ -160,7 +159,6 @@ class Thread extends React.Component { render() { const { data, - group, event, stackView, stackType, @@ -182,7 +180,6 @@ class Thread extends React.Component { this.renderMissingStacktrace() ) : ( + diff --git a/src/sentry/static/sentry/app/components/events/sdk.jsx b/src/sentry/static/sentry/app/components/events/sdk.jsx index 834226c6d04ca9..8402776f7721bc 100644 --- a/src/sentry/static/sentry/app/components/events/sdk.jsx +++ b/src/sentry/static/sentry/app/components/events/sdk.jsx @@ -6,22 +6,15 @@ import {t} from 'app/locale'; class EventSdk extends React.Component { static propTypes = { - group: SentryTypes.Group.isRequired, event: SentryTypes.Event.isRequired, }; render() { - const {group, event} = this.props; + const {event} = this.props; const data = event.sdk; return ( - + diff --git a/tests/js/spec/components/events/__snapshots__/crashContent.spec.jsx.snap b/tests/js/spec/components/events/__snapshots__/crashContent.spec.jsx.snap index 5b343a12893d58..37be76cb7c29a6 100644 --- a/tests/js/spec/components/events/__snapshots__/crashContent.spec.jsx.snap +++ b/tests/js/spec/components/events/__snapshots__/crashContent.spec.jsx.snap @@ -27,6 +27,7 @@ exports[`CrashContent renders with meta data 1`] = ` } } newestFirst={true} + projectId="sentry" stackType="original" stackView="full" > diff --git a/tests/js/spec/components/events/crashContent.spec.jsx b/tests/js/spec/components/events/crashContent.spec.jsx index dd9d7bd14e6a25..cc5ab1da16516d 100644 --- a/tests/js/spec/components/events/crashContent.spec.jsx +++ b/tests/js/spec/components/events/crashContent.spec.jsx @@ -13,6 +13,7 @@ describe('CrashContent', function() { it('renders with meta data', function() { const wrapper = mount( { PROPS = { - group: { - id: '1', - }, event: { entries: [], id: '4', diff --git a/tests/js/spec/views/sharedGroupDetails/__snapshots__/index.spec.jsx.snap b/tests/js/spec/views/sharedGroupDetails/__snapshots__/index.spec.jsx.snap index 202c6cb8cd98b7..e11d2ad7044a7a 100644 --- a/tests/js/spec/views/sharedGroupDetails/__snapshots__/index.spec.jsx.snap +++ b/tests/js/spec/views/sharedGroupDetails/__snapshots__/index.spec.jsx.snap @@ -813,102 +813,9 @@ exports[`SharedGroupDetails renders 1`] = ` "tags": Array [], } } - group={ - Object { - "activity": Array [], - "annotations": Array [], - "assignedTo": null, - "count": "327482", - "culprit": "fetchData(app/components/group/suggestedOwners)", - "firstRelease": null, - "firstSeen": "2019-04-05T19:44:05.963Z", - "hasSeen": false, - "id": "1", - "isBookmarked": false, - "isPublic": false, - "isSubscribed": false, - "lastRelease": null, - "lastSeen": "2019-04-11T01:08:59Z", - "latestEvent": Object { - "dateCreated": "2019-05-21T18:01:48.762Z", - "entries": Array [ - Object { - "data": Object { - "formatted": "Blocked script", - }, - "id": "1", - "type": "message", - }, - ], - "eventID": "12345678901234567890123456789012", - "groupID": "1", - "id": "1", - "message": "ApiException", - "tags": Array [], - }, - "level": "warning", - "logger": null, - "metadata": Object { - "function": "fetchData", - "type": "RequestError", - }, - "numComments": 0, - "participants": Array [], - "permalink": "https://foo.io/organizations/foo/issues/1234/", - "platform": "javascript", - "pluginActions": Array [], - "pluginContexts": Array [], - "pluginIssues": Array [], - "project": Object { - "environments": Array [], - "hasAccess": true, - "id": "2", - "isBookmarked": false, - "isMember": true, - "name": "Project Name", - "organization": Object { - "slug": "test-org", - }, - "slug": "project-slug", - "teams": Array [], - }, - "seenBy": Array [], - "shareId": null, - "shortId": "JAVASCRIPT-6QS", - "stats": Object { - "24h": Array [ - Array [ - 1517281200, - 2, - ], - Array [ - 1517310000, - 1, - ], - ], - "30d": Array [ - Array [ - 1514764800, - 1, - ], - Array [ - 1515024000, - 122, - ], - ], - }, - "status": "unresolved", - "statusDetails": Object {}, - "subscriptionDetails": null, - "tags": Array [], - "title": "ZeroDivisionError", - "type": "error", - "userCount": 35097, - "userReportCount": 0, - } - } isShare={true} key="entry-0" + projectId="project-slug" type="message" >