@@ -26,6 +26,13 @@ var RequestInterface = React.createClass({
26
26
} ;
27
27
} ,
28
28
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
+
29
36
toggleView ( value ) {
30
37
this . setState ( {
31
38
view : value
@@ -52,20 +59,24 @@ var RequestInterface = React.createClass({
52
59
53
60
var title = (
54
61
< 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
+ }
69
80
< h3 >
70
81
< strong > { data . method || 'GET' } < a href = { fullUrl } > { parsedUrl . pathname } </ a > </ strong >
71
82
< small style = { { marginLeft : 20 } } > { parsedUrl . hostname } </ small >
0 commit comments