1
1
import * as React from "react" ;
2
2
import { Pivot , PivotItem } from "@fluentui/react" ;
3
3
import { join , scopedLogger } from "@hpcc-js/util" ;
4
- import { SizeMe } from "react-sizeme" ;
5
4
import nlsHPCC from "src/nlsHPCC" ;
6
5
import * as ESPQuery from "src/ESPQuery" ;
7
6
import * as WsTopology from "src/WsTopology" ;
8
7
import { useWorkunitResults } from "../hooks/workunit" ;
9
- import { pivotItemStyle } from "../layouts/pivot" ;
10
8
import { IFrame } from "./IFrame" ;
11
9
import { pushUrl } from "../util/history" ;
12
10
import { XMLSourceEditor } from "./SourceEditor" ;
@@ -19,6 +17,8 @@ const buildFrameUrl = (url, suffix) => {
19
17
return urlParts [ 0 ] + "&src=" + encodeURIComponent ( join ( src , suffix ) ) ;
20
18
} ;
21
19
20
+ const frameStyle = { position : "absolute" , zIndex : 0 , padding : 4 , overflow : "none" , inset : "44px 0 4px 0" } as React . CSSProperties ;
21
+
22
22
interface QueryTestsProps {
23
23
querySet : string ;
24
24
queryId : string ;
@@ -99,43 +99,41 @@ export const QueryTests: React.FunctionComponent<QueryTestsProps> = ({
99
99
setResultNames ( names ) ;
100
100
} , [ wuResults ] ) ;
101
101
102
- return < SizeMe monitorHeight > { ( { size } ) =>
103
- < Pivot
104
- overflowBehavior = "menu" style = { { height : "100%" } } selectedKey = { tab }
105
- onLinkClick = { evt => {
106
- pushUrl ( `/queries/${ querySet } /${ queryId } /testPages/${ evt . props . itemKey } ` ) ;
107
- } }
108
- >
109
- < PivotItem headerText = { nlsHPCC . Form } itemKey = "form" style = { pivotItemStyle ( size , 0 ) } >
110
- < IFrame src = { formUrl } height = "99%" />
111
- </ PivotItem >
112
- < PivotItem headerText = { nlsHPCC . SOAP } itemKey = "soap" style = { pivotItemStyle ( size ) } >
113
- < IFrame src = { soapUrl } height = "99%" />
114
- </ PivotItem >
115
- < PivotItem headerText = { nlsHPCC . JSON } itemKey = "json" style = { pivotItemStyle ( size , 0 ) } >
116
- < IFrame src = { jsonUrl } height = "99%" />
117
- </ PivotItem >
118
- < PivotItem headerText = { nlsHPCC . WSDL } itemKey = "wsdl" style = { pivotItemStyle ( size , 0 ) } >
119
- < IFrame src = { wsdlUrl } height = "99%" />
120
- </ PivotItem >
121
- < PivotItem headerText = { nlsHPCC . RequestSchema } itemKey = "requestSchema" style = { pivotItemStyle ( size , 0 ) } >
122
- < IFrame src = { requestSchemaUrl } height = "99%" />
123
- </ PivotItem >
124
- < PivotItem headerText = { nlsHPCC . ResponseSchema } itemKey = "responseSchema" style = { pivotItemStyle ( size , 0 ) } >
125
- { responseSchemas . map ( ( schema , idx ) => < XMLSourceEditor key = { `responseSchema_${ idx } ` } text = { schema } readonly = { true } /> ) }
126
- </ PivotItem >
127
- < PivotItem headerText = { nlsHPCC . SampleRequest } itemKey = "sampleRequest" style = { pivotItemStyle ( size , 0 ) } >
128
- < IFrame src = { exampleRequestUrl } height = "99%" />
129
- </ PivotItem >
130
- < PivotItem headerText = { nlsHPCC . SampleResponse } itemKey = "sampleResponse" style = { pivotItemStyle ( size , 0 ) } >
131
- < IFrame src = { exampleResponseUrl } height = "99%" />
132
- </ PivotItem >
133
- < PivotItem headerText = { nlsHPCC . ParameterXML } itemKey = "parameterXml" style = { pivotItemStyle ( size , 0 ) } >
134
- < IFrame src = { parameterXmlUrl } height = "99%" />
135
- </ PivotItem >
136
- < PivotItem headerText = { nlsHPCC . Links } itemKey = "links" style = { pivotItemStyle ( size , 0 ) } >
137
- < IFrame src = { linksUrl } height = "99%" />
138
- </ PivotItem >
139
- </ Pivot >
140
- } </ SizeMe > ;
102
+ return < Pivot
103
+ overflowBehavior = "menu" style = { { height : "100%" } } selectedKey = { tab }
104
+ onLinkClick = { evt => {
105
+ pushUrl ( `/queries/${ querySet } /${ queryId } /testPages/${ evt . props . itemKey } ` ) ;
106
+ } }
107
+ >
108
+ < PivotItem headerText = { nlsHPCC . Form } itemKey = "form" style = { frameStyle } >
109
+ < IFrame src = { formUrl } />
110
+ </ PivotItem >
111
+ < PivotItem headerText = { nlsHPCC . SOAP } itemKey = "soap" style = { frameStyle } >
112
+ < IFrame src = { soapUrl } />
113
+ </ PivotItem >
114
+ < PivotItem headerText = { nlsHPCC . JSON } itemKey = "json" style = { frameStyle } >
115
+ < IFrame src = { jsonUrl } />
116
+ </ PivotItem >
117
+ < PivotItem headerText = { nlsHPCC . WSDL } itemKey = "wsdl" style = { frameStyle } >
118
+ < IFrame src = { wsdlUrl } />
119
+ </ PivotItem >
120
+ < PivotItem headerText = { nlsHPCC . RequestSchema } itemKey = "requestSchema" style = { frameStyle } >
121
+ < IFrame src = { requestSchemaUrl } />
122
+ </ PivotItem >
123
+ < PivotItem headerText = { nlsHPCC . ResponseSchema } itemKey = "responseSchema" style = { frameStyle } >
124
+ { responseSchemas . map ( ( schema , idx ) => < XMLSourceEditor key = { `responseSchema_${ idx } ` } text = { schema } readonly = { true } /> ) }
125
+ </ PivotItem >
126
+ < PivotItem headerText = { nlsHPCC . SampleRequest } itemKey = "sampleRequest" style = { frameStyle } >
127
+ < IFrame src = { exampleRequestUrl } />
128
+ </ PivotItem >
129
+ < PivotItem headerText = { nlsHPCC . SampleResponse } itemKey = "sampleResponse" style = { frameStyle } >
130
+ < IFrame src = { exampleResponseUrl } />
131
+ </ PivotItem >
132
+ < PivotItem headerText = { nlsHPCC . ParameterXML } itemKey = "parameterXml" style = { frameStyle } >
133
+ < IFrame src = { parameterXmlUrl } />
134
+ </ PivotItem >
135
+ < PivotItem headerText = { nlsHPCC . Links } itemKey = "links" style = { frameStyle } >
136
+ < IFrame src = { linksUrl } />
137
+ </ PivotItem >
138
+ </ Pivot > ;
141
139
} ;
0 commit comments