Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(events-v2) Remove group prop from many interface components #13422

Merged
merged 1 commit into from
May 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/sentry/static/sentry/app/components/events/device.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -29,7 +28,6 @@ class DeviceInterface extends React.Component {

return (
<GroupEventDataSection
group={group}
event={event}
type="device"
title={t('Device')}
Expand Down
8 changes: 1 addition & 7 deletions src/sentry/static/sentry/app/components/events/errors.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const MAX_ERRORS = 100;

class EventErrors extends React.Component {
static propTypes = {
group: SentryTypes.Group.isRequired,
event: SentryTypes.Event.isRequired,
};

Expand Down Expand Up @@ -44,12 +43,7 @@ class EventErrors extends React.Component {
const numErrors = errors.length;
const isOpen = this.state.isOpen;
return (
<EventDataSection
group={this.props.group}
event={this.props.event}
type="errors"
className="errors"
>
<EventDataSection event={this.props.event} type="errors" className="errors">
<span className="icon icon-alert" />
<p>
<a className="pull-right errors-toggle" onClick={this.toggle}>
Expand Down
28 changes: 10 additions & 18 deletions src/sentry/static/sentry/app/components/events/eventEntries.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -112,7 +112,7 @@ class EventEntries extends React.Component {
return (
<Component
key={'entry-' + entryIdx}
group={group}
projectId={project.slug}
event={event}
type={entry.type}
data={entry.data}
Expand All @@ -123,7 +123,7 @@ class EventEntries extends React.Component {
logException(ex);
return (
<EventDataSection
group={group}
projectId={project.slug}
event={event}
type={entry.type}
title={entry.type}
Expand Down Expand Up @@ -153,9 +153,7 @@ class EventEntries extends React.Component {

return (
<div className="entries">
{!utils.objectIsEmpty(event.errors) && (
<EventErrors group={group} event={event} />
)}{' '}
{!utils.objectIsEmpty(event.errors) && <EventErrors event={event} />}{' '}
{!isShare && !!group.firstRelease && (
<EventCause event={event} orgId={orgId} projectId={project.slug} />
)}
Expand All @@ -167,7 +165,7 @@ class EventEntries extends React.Component {
issueId={group.id}
/>
)}
{hasContext && <EventContextSummary group={group} event={event} />}
{hasContext && <EventContextSummary event={event} />}
<EventTags
organization={organization}
group={group}
Expand All @@ -177,19 +175,13 @@ class EventEntries extends React.Component {
/>
{this.renderEntries()}
{hasContext && <EventContexts group={group} event={event} />}
{!utils.objectIsEmpty(event.context) && (
<EventExtraData group={group} event={event} />
)}
{!utils.objectIsEmpty(event.packages) && (
<EventPackageData group={group} event={event} />
)}
{!utils.objectIsEmpty(event.device) && (
<EventDevice group={group} event={event} />
)}
{!utils.objectIsEmpty(event.context) && <EventExtraData event={event} />}
{!utils.objectIsEmpty(event.packages) && <EventPackageData event={event} />}
{!utils.objectIsEmpty(event.device) && <EventDevice event={event} />}
{!isShare && features.has('event-attachments') && (
<EventAttachments event={event} orgId={orgId} projectId={project.slug} />
)}
{!utils.objectIsEmpty(event.sdk) && <EventSdk group={group} event={event} />}
{!utils.objectIsEmpty(event.sdk) && <EventSdk event={event} />}
{!utils.objectIsEmpty(event.sdk) && event.sdk.upstream.isNewer && (
<div className="alert-block alert-info box">
<span className="icon-exclamation" />
Expand All @@ -205,7 +197,7 @@ class EventEntries extends React.Component {
</div>
)}{' '}
{!isShare && features.has('grouping-info') && (
<EventGroupingInfo group={group} event={event} />
<EventGroupingInfo projectId={project.slug} event={event} />
)}
</div>
);
Expand Down
2 changes: 0 additions & 2 deletions src/sentry/static/sentry/app/components/events/extraData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import SentryTypes from 'app/sentryTypes';

class EventExtraData extends React.Component {
static propTypes = {
group: SentryTypes.Group.isRequired,
event: SentryTypes.Event.isRequired,
};

Expand All @@ -35,7 +34,6 @@ class EventExtraData extends React.Component {
return (
<div className="extra-data">
<EventDataSection
group={this.props.group}
event={this.props.event}
type="extra"
title={t('Additional Data')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,14 @@ class EventGroupingInfo extends AsyncComponent {
api: PropTypes.object,
organization: SentryTypes.Organization.isRequired,
group: SentryTypes.Group.isRequired,
projectId: PropTypes.string.isRequired,
event: SentryTypes.Event.isRequired,
};

getEndpoints() {
const {organization, group, event} = this.props;
const {organization, event, projectId} = this.props;

let path = `/projects/${organization.slug}/${group.project.slug}/events/${
let path = `/projects/${organization.slug}/${projectId}/events/${
event.id
}/grouping-info/`;
if (this.state && this.state.configOverride) {
Expand Down Expand Up @@ -350,7 +351,6 @@ class EventGroupingInfo extends AsyncComponent {
const isOpen = this.state.isOpen;
return (
<EventDataSection
group={this.props.group}
event={this.props.event}
type="grouping-info"
className="grouping-info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function moduleToCategory(module) {

class BreadcrumbsInterface extends React.Component {
static propTypes = {
group: SentryTypes.Group.isRequired,
event: SentryTypes.Event.isRequired,
type: PropTypes.string.isRequired,
data: PropTypes.object.isRequired,
Expand Down Expand Up @@ -170,7 +169,6 @@ class BreadcrumbsInterface extends React.Component {
};

render() {
const group = this.props.group;
const evt = this.props.event;
const data = this.props.data;

Expand Down Expand Up @@ -215,7 +213,6 @@ class BreadcrumbsInterface extends React.Component {
return (
<GroupEventDataSection
className="breadcrumb-box"
group={group}
event={evt}
type={this.props.type}
title={title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ class CrashContent extends React.Component {
static propTypes = {
event: SentryTypes.Event.isRequired,
stackView: PropTypes.string.isRequired,
stackType: PropTypes.string,
projectId: PropTypes.string.isRequired,
newestFirst: PropTypes.bool.isRequired,
stackType: PropTypes.string,
exception: PropTypes.object,
stacktrace: PropTypes.object,
group: SentryTypes.Group,
};

renderException = () => {
const {event, stackView, stackType, newestFirst, exception, group} = this.props;
const {event, stackView, stackType, newestFirst, exception, projectId} = this.props;
return stackView === 'raw' ? (
<RawExceptionContent
eventId={event.id}
projectId={group.project.slug}
projectId={projectId}
type={stackType}
values={exception.values}
platform={event.platform}
Expand All @@ -33,7 +33,6 @@ class CrashContent extends React.Component {
<ExceptionContent
type={stackType}
view={stackView}
group={group}
values={exception.values}
platform={event.platform}
newestFirst={newestFirst}
Expand All @@ -42,7 +41,7 @@ class CrashContent extends React.Component {
};

renderStacktrace = () => {
const {event, stackView, newestFirst, stacktrace, group} = this.props;
const {event, stackView, newestFirst, stacktrace} = this.props;
return stackView === 'raw' ? (
<pre className="traceback plain">
{rawStacktraceContent(stacktrace, event.platform)}
Expand All @@ -54,7 +53,6 @@ class CrashContent extends React.Component {
includeSystemFrames={stackView === 'full'}
platform={event.platform}
newestFirst={newestFirst}
group={group}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -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 = (
<div>
Expand Down Expand Up @@ -78,13 +77,7 @@ export default class CspInterface extends React.Component {
const children = getView(view, data);

return (
<GroupEventDataSection
group={group}
event={event}
type="csp"
title={title}
wrapTitle={false}
>
<GroupEventDataSection event={event} type="csp" title={title} wrapTitle={false}>
{children}
</GroupEventDataSection>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -42,7 +41,6 @@ class DebugMetaInterface extends React.Component {
return (
<div>
<EventDataSection
group={this.props.group}
event={this.props.event}
type="packages"
title={t('Images Loaded')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import CrashContent from 'app/components/events/interfaces/crashContent';

class ExceptionInterface extends React.Component {
static propTypes = {
group: SentryTypes.Group.isRequired,
event: SentryTypes.Event.isRequired,
type: PropTypes.string.isRequired,
data: PropTypes.object.isRequired,
projectId: PropTypes.string.isRequired,
};

constructor(...args) {
Expand All @@ -29,12 +29,8 @@ class ExceptionInterface extends React.Component {
};

render() {
const group = this.props.group;
const event = this.props.event;
const data = this.props.data;
const stackView = this.state.stackView;
const stackType = this.state.stackType;
const newestFirst = this.state.newestFirst;
const {projectId, event, data, type} = this.props;
const {stackView, stackType, newestFirst} = this.state;

// in case there are threads in the event data, we don't render the
// exception block. Instead the exception is contained within the
Expand All @@ -45,7 +41,6 @@ class ExceptionInterface extends React.Component {

const title = (
<CrashHeader
group={group}
title={t('Exception')}
platform={event.platform}
exception={data}
Expand All @@ -59,15 +54,9 @@ class ExceptionInterface extends React.Component {
);

return (
<GroupEventDataSection
group={group}
event={event}
type={this.props.type}
title={title}
wrapTitle={false}
>
<GroupEventDataSection event={event} type={type} title={title} wrapTitle={false}>
<CrashContent
group={group}
projectId={projectId}
event={event}
stackType={stackType}
stackView={stackView}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import PropTypes from 'prop-types';
import SentryTypes from 'app/sentryTypes';
import React from 'react';

import {defined} from 'app/utils';
Expand All @@ -14,13 +13,11 @@ class ExceptionContent extends React.Component {
view: PropTypes.string.isRequired,
platform: PropTypes.string,
newestFirst: PropTypes.bool,
group: SentryTypes.Group,
};

render() {
const stackView = this.props.view;
const newestFirst = this.props.newestFirst;
const group = this.props.group;
const children = this.props.values.map((exc, excIdx) => {
return (
<div key={excIdx} className="exception">
Expand Down Expand Up @@ -50,7 +47,6 @@ class ExceptionContent extends React.Component {
includeSystemFrames={stackView === 'full'}
platform={this.props.platform}
newestFirst={newestFirst}
group={group}
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = (
<div>
Expand All @@ -67,13 +66,7 @@ export default class GenericInterface extends Component {
const children = getView(view, data);

return (
<GroupEventDataSection
group={group}
event={event}
type={type}
title={title}
wrapTitle={false}
>
<GroupEventDataSection event={event} type={type} title={title} wrapTitle={false}>
{children}
</GroupEventDataSection>
);
Expand Down
Loading