Skip to content

Commit 195716f

Browse files
committed
Don't show extra buttons in Request interface for partial interfaces.
This removes the confusing UI for 'curl' and 'replay' when we don't have enough information to reliably construct this.
1 parent f3deac0 commit 195716f

File tree

1 file changed

+25
-14
lines changed
  • src/sentry/static/sentry/app/components/events/interfaces

1 file changed

+25
-14
lines changed

src/sentry/static/sentry/app/components/events/interfaces/request.jsx

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ var RequestInterface = React.createClass({
2626
};
2727
},
2828

29+
isPartial() {
30+
// We assume we only have a partial interface is we're missing
31+
// an HTTP method. This means we don't have enough information
32+
// to reliably construct a full HTTP request.
33+
return !this.props.data.method;
34+
},
35+
2936
toggleView(value) {
3037
this.setState({
3138
view: value
@@ -52,20 +59,24 @@ var RequestInterface = React.createClass({
5259

5360
var title = (
5461
<div>
55-
<div className="pull-right">
56-
{!this.props.isShare &&
57-
<RequestActions organization={this.context.organization}
58-
project={this.context.project}
59-
group={group}
60-
event={evt} />
61-
}
62-
</div>
63-
<div className="btn-group">
64-
<a className={(view === "rich" ? "active" : "") + " btn btn-default btn-sm"}
65-
onClick={this.toggleView.bind(this, "rich")}>Rich</a>
66-
<a className={(view === "curl" ? "active" : "") + " btn btn-default btn-sm"}
67-
onClick={this.toggleView.bind(this, "curl")}><code>curl</code></a>
68-
</div>
62+
{!this.isPartial() &&
63+
<div>
64+
<div className="pull-right">
65+
{!this.props.isShare &&
66+
<RequestActions organization={this.context.organization}
67+
project={this.context.project}
68+
group={group}
69+
event={evt} />
70+
}
71+
</div>
72+
<div className="btn-group">
73+
<a className={(view === "rich" ? "active" : "") + " btn btn-default btn-sm"}
74+
onClick={this.toggleView.bind(this, "rich")}>Rich</a>
75+
<a className={(view === "curl" ? "active" : "") + " btn btn-default btn-sm"}
76+
onClick={this.toggleView.bind(this, "curl")}><code>curl</code></a>
77+
</div>
78+
</div>
79+
}
6980
<h3>
7081
<strong>{data.method || 'GET'} <a href={fullUrl}>{parsedUrl.pathname}</a></strong>
7182
<small style={{marginLeft: 20}}>{parsedUrl.hostname}</small>

0 commit comments

Comments
 (0)