Skip to content

Commit 4b37278

Browse files
committed
fix merge conflicts upon merging with history tab branch
2 parents f2a3c85 + 09fadac commit 4b37278

25 files changed

+166
-101
lines changed

__tests__/composerTests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('GraphQL Composer', () => {
2929
newRequestBody: {
3030
bodyContent: '',
3131
bodyType: 'raw',
32-
rawType: 'Text (text/plain)',
32+
rawType: 'text/plain',
3333
JSONFormatted: true,
3434
bodyVariables: '',
3535
},

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@
122122
"@grpc/grpc-js": "^1.6.7",
123123
"@grpc/proto-loader": "^0.6.9",
124124
"@jest-runner/electron": "^3.0.1",
125-
"@monaco-editor/react": "^4.4.5",
126125
"@mui/icons-material": "^5.6.2",
127126
"@mui/lab": "^5.0.0-alpha.80",
128127
"@mui/material": "^5.6.4",

src/client/components-v2/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import '../../assets/style/App.scss';
1212
import NavBarContainer from './navbar/NavBarContainer';
1313
import WorkspaceContainer from './workspace/WorkspaceContainer';
1414
import MainContainer from './main/MainContainer';
15-
15+
import HistoryOrWorkspaceContainer from './history-workspace-display/HistoryOrWorkspaceContainer';
1616

1717
import { Box, Divider } from '@mui/material';
1818

@@ -38,7 +38,8 @@ const App = () => {
3838
<Divider orientation="horizontal"/>
3939
<Box sx={{ height: '100%', display: 'flex' }}>
4040
{/* New MUI workspace. */}
41-
<WorkspaceContainer currentWorkspaceId={currentWorkspaceId} setWorkspace={setWorkspace} />
41+
{/* <WorkspaceContainer currentWorkspaceId={currentWorkspaceId} setWorkspace={setWorkspace} /> */}
42+
<HistoryOrWorkspaceContainer currentWorkspaceId={currentWorkspaceId} setWorkspace={setWorkspace} />
4243
{/* Legacy workspace. */}
4344
{/* <ContentsContainer /> */}
4445
<Divider orientation="vertical"/>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import * as React from 'react';
2+
import Tabs from '@mui/material/Tabs';
3+
import Tab from '@mui/material/Tab';
4+
import Typography from '@mui/material/Typography';
5+
import Box from '@mui/material/Box';
6+
import WorkspaceContainer from "../workspace/WorkspaceContainer";
7+
import HistoryContainer from '../../components/containers/HistoryContainer';
8+
import AccessTimeIcon from '@mui/icons-material/AccessTime';
9+
import WorkIcon from '@mui/icons-material/Work';
10+
11+
interface TabPanelProps {
12+
children?: React.ReactNode;
13+
index: number;
14+
value: number;
15+
}
16+
17+
function TabPanel(props: TabPanelProps) {
18+
const { children, value, index, ...other } = props;
19+
20+
return (
21+
<div
22+
role="tabpanel"
23+
hidden={value !== index}
24+
id={`simple-tabpanel-${index}`}
25+
aria-labelledby={`simple-tab-${index}`}
26+
{...other}
27+
>
28+
{value === index && (
29+
<Box sx={{ p: 1 }}>
30+
<Box>{children}</Box>
31+
</Box>
32+
)}
33+
</div>
34+
);
35+
}
36+
37+
function a11yProps(index: number) {
38+
return {
39+
id: `simple-tab-${index}`,
40+
'aria-controls': `simple-tabpanel-${index}`,
41+
};
42+
}
43+
44+
export default function HistoryOrWorkspaceContainer(props) {
45+
const [value, setValue] = React.useState(0);
46+
47+
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
48+
setValue(newValue);
49+
};
50+
51+
return (
52+
<Box sx={{ minWidth: '25%', overflow: 'auto', maxHeight: '100%', overflowX: 'auto' }}>
53+
<Box sx={{ borderBottom: 1, borderColor: 'divider', }}>
54+
<Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
55+
<Tab icon={<WorkIcon fontSize='small'/>} {...a11yProps(0)} sx={{fontSize:'10px', overflowWrap: "break-word", maxWidth: '50%'}}/>
56+
<Tab icon={<AccessTimeIcon fontSize='small'/>} {...a11yProps(1)} sx={{fontSize:'10px', overflowWrap: "break-word", maxWidth: '50%'}}/>
57+
</Tabs>
58+
</Box>
59+
<TabPanel value={value} index={0}>
60+
<WorkspaceContainer {...props} />
61+
</TabPanel>
62+
<TabPanel value={value} index={1}>
63+
<HistoryContainer />
64+
</TabPanel>
65+
</Box>
66+
);
67+
}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,17 @@ export default function Http2Composer(props) {
302302
}}
303303
id = "composer-http2"
304304
>
305-
<Http2EndpointForm
305+
{/**
306+
* TODO:
307+
* The two commented components are our attempt to port the entire app to use MaterialUI for consistency.
308+
* The first one...
309+
* ... is an HTTP2Enpoint form with a (1) method select (2) endpoint form (3) send button.
310+
* The second one...
311+
* ... is all of the metadata you would need for an HTTP2 request (parameters, headers, body, cookies)
312+
* These are not tied to the Redux store currently, and thus do not interact with the app yet.
313+
* They are just standalone components that need to be integrated with the logic of the app.
314+
*/}
315+
{/* <Http2EndpointForm
306316
http2Method={http2Method}
307317
setHttp2Method={setHttp2Method}
308318
http2Uri={http2Uri}
@@ -316,7 +326,7 @@ export default function Http2Composer(props) {
316326
cookies={cookies}
317327
setCookies={setCookies}
318328
http2Method={http2Method}
319-
/>
329+
/> */}
320330
<RestMethodAndEndpointEntryForm
321331
newRequestFields={newRequestFields}
322332
newRequestBody={newRequestBody}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ 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 { json } from '@codemirror/lang-json';
87
import { EditorView } from "@codemirror/view"
8+
import { javascript } from '@codemirror/lang-javascript';
9+
910

1011
function EventsContainer({ currentResponse }) {
1112
const { request, response } = currentResponse;

src/client/components-v2/navbar/ProtocolSelect.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@ function ProtocolSelect(props) {
119119
props.setNewRequestBody({
120120
...props.newRequestBody,
121121
bodyType: 'GQL',
122-
bodyContent: `query {
123-
124-
}`,
125122
bodyVariables: '',
126123
});
127124
break;
@@ -260,8 +257,6 @@ function ProtocolSelect(props) {
260257
props.setNewRequestBody({
261258
...props.newRequestBody,
262259
bodyType: 'none',
263-
// vvv need to update this and figure out what we are going to do with it
264-
bodyContent: `We will put our URL here maybe?`,
265260
});
266261
break;
267262
}
@@ -287,7 +282,10 @@ function ProtocolSelect(props) {
287282
key={page.name}
288283
variant="contained"
289284
color="primary"
290-
onClick={() => onProtocolSelect(page.value)}
285+
onClick={() => {
286+
console.log(page.value)
287+
onProtocolSelect(page.value)}
288+
}
291289
sx={{
292290
m: 1
293291
}}>

src/client/components/composer/ComposerContainer.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ const ComposerContainer = (props) => {
9494
props.setNewRequestBody({
9595
...props.newRequestBody,
9696
bodyType: 'GQL',
97-
bodyContent: `query {
97+
// bodyContent: `query {
9898

99-
}`,
99+
// }`,
100100
bodyVariables: '',
101101
});
102102
break;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const BodyTypeSelect = (props) => {
6161
<div className="dropdown-trigger">
6262
<button
6363
className="button is-small is-outlined is-primary mr-3 add-header-or-cookie-button"
64+
id = "body-type-select"
6465
aria-haspopup="true"
6566
aria-controls="dropdown-menu"
6667
onClick={() => setDropdownIsActive(!dropdownIsActive)}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class CookieEntryForm extends Component {
108108
<div className="composer-section-title">Cookies</div>
109109
<button
110110
className={`${this.props.isDark ? 'is-dark-200' : ''} button add-header-gRPC-cookie-button`}
111+
id = "add-cookie"
111112
onClick={() => this.addCookie(this.createDeepCookieCopy())}
112113
style={{height: '3px', width: '3px'}}
113114
>

0 commit comments

Comments
 (0)