Skip to content

Commit ab7c825

Browse files
committed
Merge pull request #2210 from getsentry/request
Don't show extra buttons in Request interface for partial interfaces.
2 parents 71f0e0c + f528a2c commit ab7c825

File tree

1 file changed

+24
-8
lines changed
  • src/sentry/static/sentry/app/components/events/interfaces

1 file changed

+24
-8
lines changed

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

Lines changed: 24 additions & 8 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
@@ -50,27 +57,36 @@ var RequestInterface = React.createClass({
5057
var parsedUrl = document.createElement("a");
5158
parsedUrl.href = fullUrl;
5259

53-
var title = (
54-
<div>
60+
var children = [];
61+
62+
if (!this.isPartial()) {
63+
children.push(
5564
<div className="pull-right">
5665
{!this.props.isShare &&
5766
<RequestActions organization={this.context.organization}
5867
project={this.context.project}
5968
group={group}
6069
event={evt} />
6170
}
62-
</div>
71+
</div>,
6372
<div className="btn-group">
6473
<a className={(view === "rich" ? "active" : "") + " btn btn-default btn-sm"}
6574
onClick={this.toggleView.bind(this, "rich")}>Rich</a>
6675
<a className={(view === "curl" ? "active" : "") + " btn btn-default btn-sm"}
6776
onClick={this.toggleView.bind(this, "curl")}><code>curl</code></a>
6877
</div>
69-
<h3>
70-
<strong>{data.method || 'GET'} <a href={fullUrl}>{parsedUrl.pathname}</a></strong>
71-
<small style={{marginLeft: 20}}>{parsedUrl.hostname}</small>
72-
</h3>
73-
</div>
78+
);
79+
}
80+
81+
children.push(
82+
<h3>
83+
<strong>{data.method || 'GET'} <a href={fullUrl}>{parsedUrl.pathname}</a></strong>
84+
<small style={{marginLeft: 20}}>{parsedUrl.hostname}</small>
85+
</h3>
86+
);
87+
88+
var title = (
89+
<div>{children}</div>
7490
);
7591

7692
return (

0 commit comments

Comments
 (0)