Skip to content

Commit 8287cf7

Browse files
authored
Merge pull request #43 from oslabs-beta/codemirrorFix/Ethan
Codemirror fix/ethan
2 parents 2d19ad7 + 3c15635 commit 8287cf7

18 files changed

+51
-74
lines changed

src/client/components-v2/main/GRPCComposer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ export default function GRPCComposer(props) {
176176
};
177177

178178
return(
179-
<Box>
180-
<div className="is-flex is-flex-direction-column is-justify-content-space-between is-tall">
179+
<Box className="is-flex is-flex-direction-column is-justify-content-space-between is-tall" id = "composer-grpc">
181180
<div
182181
className="is-flex-grow-3 add-vertical-scroll"
183182
style={{ overflowX: 'hidden' }}
@@ -217,7 +216,6 @@ export default function GRPCComposer(props) {
217216
<div className="is-3rem-footer is-clickable is-margin-top-auto">
218217
<NewRequestButton onClick={addNewRequest} />
219218
</div>
220-
</div>
221219
</Box>
222220
)
223221

src/client/components-v2/main/GraphQLComposer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ export default function GraphQLComposer(props) {
236236
};
237237

238238
return(
239-
<Box>
240-
<div className="is-flex is-flex-direction-column is-justify-content-space-between is-tall">
239+
<Box className="is-flex is-flex-direction-column is-justify-content-space-between is-tall" id = "composer-graphql">
241240
<div
242241
className="is-flex-grow-3 add-vertical-scroll"
243242
style={{ overflowX: 'hidden' }}
@@ -290,7 +289,6 @@ export default function GraphQLComposer(props) {
290289
<div className="is-3rem-footer is-clickable is-margin-top-auto">
291290
<NewRequestButton onClick={addNewRequest} />
292291
</div>
293-
</div>
294292
</Box>
295293
);
296294
}

src/client/components-v2/main/Http2Composer.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,9 @@ export default function Http2Composer(props) {
263263
};
264264

265265
return(
266-
<Box>
267-
<div
268-
className="is-flex-grow-3 add-vertical-scroll"
269-
style={{ overflowX: 'hidden' }}
270-
>
266+
<Box className="is-flex-grow-3 add-vertical-scroll"
267+
style={{ overflowX: 'hidden' }}
268+
id = "composer-http2">
271269
<RestMethodAndEndpointEntryForm
272270
newRequestFields={newRequestFields}
273271
newRequestBody={newRequestBody}
@@ -328,7 +326,6 @@ export default function Http2Composer(props) {
328326
setNewTestContent={setNewTestContent}
329327
testContent={testContent}
330328
/>
331-
</div>
332329
</Box>
333330
)
334331
}

src/client/components-v2/main/OpenAPIComposer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ export default function OpenAPIComposer(props) {
120120
};
121121

122122
return(
123-
<Box>
124-
<div className="is-flex is-flex-direction-column is-justify-content-space-between is-tall">
123+
<Box className="is-flex is-flex-direction-column is-justify-content-space-between is-tall" id= "composer-openapi">
125124
<div
126125
className="is-flex-grow-3 add-vertical-scroll"
127126
style={{ overflowX: 'hidden' }}
@@ -159,7 +158,6 @@ export default function OpenAPIComposer(props) {
159158
<div className="is-3rem-footer is-clickable is-margin-top-auto">
160159
<NewRequestButton onClick={addNewRequest} />
161160
</div>
162-
</div>
163161
</Box>
164162
)
165163

src/client/components-v2/main/WebRTCComposer.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ export default function WebRTCComposer(props) {
107107
};
108108

109109
return(
110-
<Box>
111-
<div className="is-flex is-flex-direction-column is-justify-content-space-between is-tall">
112-
<div
110+
<Box className="is-flex is-flex-direction-column is-justify-content-space-between is-tall"
111+
id = "composer-webrtc"> <div
113112
className="is-flex-grow-3 add-vertical-scroll"
114113
style={{ overflowX: 'hidden' }}
115114
>
@@ -143,7 +142,6 @@ export default function WebRTCComposer(props) {
143142
<div className="is-3rem-footer is-clickable is-margin-top-auto">
144143
<NewRequestButton onClick={addNewRequest} />
145144
</div>
146-
</div>
147145
</Box>
148146
)
149147
}

src/client/components-v2/main/WebSocketComposer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ export default function WebSocketComposer(props) {
103103
};
104104

105105
return(
106-
<Box>
107-
<div className="is-flex is-flex-direction-column is-justify-content-space-between is-tall">
106+
<Box className="is-flex is-flex-direction-column is-justify-content-space-between is-tall" id = "composer-websocket">
108107
<div
109108
className="is-flex-grow-3 add-vertical-scroll"
110109
style={{ overflowX: 'hidden' }}
@@ -123,7 +122,6 @@ export default function WebSocketComposer(props) {
123122
<div className="is-3rem-footer is-clickable is-margin-top-auto">
124123
<NewRequestButton onClick={addNewRequest} />
125124
</div>
126-
</div>
127125
</Box>
128126
)
129127
}

src/client/components-v2/main/WebhookComposer.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ export default function WebhookComposer(props) {
157157
};
158158

159159
return(
160-
<Box>
161-
<div className='mr-2 is-flex is-justify-content-center'
162-
style={{padding: '10px'}}>
160+
<Box className='mr-2 is-flex is-justify-content-center'
161+
style={{padding: '10px'}}
162+
id = "composer-webhook">
163163
<button
164164
className={`button ${
165165
serverStatus ? 'is-wh' : 'is-wh-on'
@@ -182,7 +182,6 @@ export default function WebhookComposer(props) {
182182
Copy URL
183183
</button>
184184
</div>
185-
</div>
186185
</Box>
187186
)
188187
}

src/client/components-v2/main/response/EventsContainer.jsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import CodeMirror from '@uiw/react-codemirror';
44
// import { UnControlled as CodeMirror } from 'react-codemirror2';
55
import EmptyState from '../../../components/display/EmptyState';
66
import EventPreview from '../../../components/display/EventPreview';
7-
import 'codemirror/theme/neo.css';
7+
import { json } from '@codemirror/lang-json';
8+
import { EditorView } from "@codemirror/view"
89

910
function EventsContainer({ currentResponse }) {
1011
const { request, response } = currentResponse;
@@ -60,14 +61,12 @@ function EventsContainer({ currentResponse }) {
6061
<CodeMirror
6162
className="overflow-event-child-container"
6263
value={responseBody}
63-
options={{
64-
mode: 'application/json',
65-
theme: 'neo responsebody',
66-
lineNumbers: true,
67-
tabSize: 4,
68-
lineWrapping: true,
69-
readOnly: true,
70-
}}
64+
theme = "dark"
65+
readOnly = {true}
66+
extensions={[
67+
javascript(),
68+
EditorView.lineWrapping,
69+
]}
7170
/>
7271
</div>
7372
</div>

src/client/components/composer/NewRequest/BodyEntryForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const BodyEntryForm = (props) => {
4343
<TextCodeArea
4444
mode={newRequestBody.rawType}
4545
value={newRequestBody.bodyContent}
46-
onChange={(editor, data, value) => {
46+
onChange={(value, viewUpdate) => {
4747
setNewRequestBody({
4848
...newRequestBody,
4949
bodyContent: value,

src/client/components/composer/NewRequest/GRPCBodyStream.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const GRPCBodyStream = (props) => {
4141
<TextCodeArea
4242
value={`${streamContentID || ''}`}
4343
mode="application/json"
44-
onChange={(editor, data, value) =>
44+
onChange={(value, viewUpdate) =>
4545
props.changeHandler(props.stream.id, value)
4646
}
4747
/>

0 commit comments

Comments
 (0)