From 195716f353757743657647a15f649f6e14268a7b Mon Sep 17 00:00:00 2001 From: Matt Robenolt Date: Mon, 19 Oct 2015 14:19:40 -0700 Subject: [PATCH 1/2] 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. --- .../components/events/interfaces/request.jsx | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) 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 bced0f1a12ec72..faa03ccd470817 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/request.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/request.jsx @@ -26,6 +26,13 @@ var RequestInterface = React.createClass({ }; }, + isPartial() { + // We assume we only have a partial interface is we're missing + // an HTTP method. This means we don't have enough information + // to reliably construct a full HTTP request. + return !this.props.data.method; + }, + toggleView(value) { this.setState({ view: value @@ -52,20 +59,24 @@ var RequestInterface = React.createClass({ var title = (
-
- {!this.props.isShare && - - } -
-
- Rich - curl -
+ {!this.isPartial() && +
+
+ {!this.props.isShare && + + } +
+
+ Rich + curl +
+
+ }

{data.method || 'GET'} {parsedUrl.pathname} {parsedUrl.hostname} From f528a2c46791f27c09c61e80d0796cf8c39633cd Mon Sep 17 00:00:00 2001 From: Matt Robenolt Date: Mon, 19 Oct 2015 14:33:38 -0700 Subject: [PATCH 2/2] Use a list of elements, instead of wrapping in a useless div --- .../components/events/interfaces/request.jsx | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) 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 faa03ccd470817..72ddce59935a14 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/request.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/request.jsx @@ -57,31 +57,36 @@ var RequestInterface = React.createClass({ var parsedUrl = document.createElement("a"); parsedUrl.href = fullUrl; + var children = []; + + if (!this.isPartial()) { + children.push( +
+ {!this.props.isShare && + + } +
, +
+ Rich + curl +
+ ); + } + + children.push( +

+ {data.method || 'GET'} {parsedUrl.pathname} + {parsedUrl.hostname} +

+ ); + var title = ( -
- {!this.isPartial() && -
-
- {!this.props.isShare && - - } -
-
- Rich - curl -
-
- } -

- {data.method || 'GET'} {parsedUrl.pathname} - {parsedUrl.hostname} -

-
+
{children}
); return (