Skip to content

Commit 6aae402

Browse files
committed
merged
2 parents 425d078 + 6d0656e commit 6aae402

34 files changed

+1811
-697
lines changed

main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
const extraca = require("fs").readFileSync(process.env.NODE_EXTRA_CA_CERTS);
88
}catch(e){
99
return;
10-
}
11-
10+
}
11+
1212
const NativeSecureContext = process.binding('crypto').SecureContext;
1313
const oldaddRootCerts = NativeSecureContext.prototype.addRootCerts;
1414
NativeSecureContext.prototype.addRootCerts = function(){
@@ -226,7 +226,7 @@ const sendStatusToWindow = (text) => {
226226
ipcMain.on('login-via-github', async () => {
227227
const url = `http://github.com/login/oauth/authorize?scope=repo&redirect_uri=http://localhost:3000/signup/github/callback/&client_id=6e9d37a09ab8bda68d50` // ${process.env.GITHUB_CLIENT_ID};
228228
await shell.openExternal(url, { activate: true });
229-
229+
230230
})
231231

232232
ipcMain.on('check-for-update', () => {
@@ -319,7 +319,7 @@ ipcMain.on('import-from-github', async (event, args) => {
319319

320320
console.log('main.js import-from-github args', args);
321321

322-
// requiring typescript type Workspace makes sanitation uncessesary
322+
// requiring typescript type Workspace makes sanitation uncessesary
323323
const ids = {};
324324
let index = 0;
325325
const newCollectionArr = []

package.json

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"main_process/main_testingController.js",
5858
"preload.js"
5959
],
60-
"nodeVersion": "12.14.1",
60+
"nodeVersion": "16.15.0",
6161
"nsis": {
6262
"createDesktopShortcut": "always"
6363
},
@@ -106,28 +106,18 @@
106106
},
107107
"dependencies": {
108108
"@apollo/client": "^3.5.0",
109-
"@babel/cli": "^7.17.6",
110-
"@babel/eslint-parser": "^7.17.0",
111-
"@babel/runtime": "^7.17.9",
112109
"@codemirror/lang-html": "^0.20.0",
113110
"@codemirror/lang-javascript": "^0.20.0",
114111
"@codemirror/lang-json": "^0.20.0",
115112
"@codemirror/lang-xml": "^0.20.0",
116113
"@codemirror/language": "^0.20.0",
117-
"@doyensec/electronegativity": "^1.9.1",
118-
"@emotion/react": "^11.9.0",
119-
"@emotion/styled": "^11.8.1",
120114
"@fortawesome/fontawesome-free": "^6.1.1",
121115
"@graphql-tools/schema": "^8.3.10",
122116
"@grpc/grpc-js": "^1.6.7",
123117
"@grpc/proto-loader": "^0.6.9",
124118
"@jest-runner/electron": "^3.0.1",
125-
"@mui/icons-material": "^5.6.2",
126-
"@mui/lab": "^5.0.0-alpha.80",
127-
"@mui/material": "^5.6.4",
128119
"@redux-devtools/extension": "^3.2.2",
129120
"@reduxjs/toolkit": "^1.8.1",
130-
"@testing-library/react": "^13.2.0",
131121
"@uiw/react-codemirror": "^4.7.0",
132122
"apollo-server-express": "^3.6.7",
133123
"axios": "^0.27.1",
@@ -160,15 +150,11 @@
160150
"graphql-tag": "^2.12.6",
161151
"graphql-ws": "^5.8.1",
162152
"highland": "^2.13.5",
163-
"istanbul": "^0.4.5",
164153
"js-beautify": "^1.14.3",
165154
"js-cookie": "^3.0.1",
166155
"mali": "^0.46.1",
167-
"mongoose": "^6.3.1",
168156
"ngrok": "^4.3.1",
169-
"nodemon": "^2.0.15",
170157
"npm": "^8.7.0",
171-
"nyc": "^15.1.0",
172158
"octokit": "^1.7.1",
173159
"patch-package": "^6.4.7",
174160
"path": "^0.12.7",
@@ -190,19 +176,24 @@
190176
"subscriptions-transport-ws": "^0.11.0",
191177
"uuid": "^8.3.2",
192178
"vm2": "^3.9.9",
193-
"webpack-merge": "^5.8.0",
194179
"websocket": "^1.0.34",
195180
"ws": "^8.5.0",
196181
"yamljs": "^0.3.0"
197182
},
198183
"devDependencies": {
184+
"@babel/cli": "^7.17.6",
199185
"@babel/core": "^7.17.9",
186+
"@babel/eslint-parser": "^7.17.0",
200187
"@babel/plugin-proposal-class-properties": "^7.16.7",
201188
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
202189
"@babel/plugin-transform-runtime": "^7.17.0",
203190
"@babel/preset-env": "^7.16.11",
204191
"@babel/preset-react": "^7.16.7",
205192
"@babel/preset-typescript": "^7.16.7",
193+
"@babel/runtime": "^7.17.9",
194+
"@mui/icons-material": "^5.6.2",
195+
"@mui/lab": "^5.0.0-alpha.80",
196+
"@mui/material": "^5.6.4",
206197
"@playwright/test": "^1.21.1",
207198
"@testing-library/jest-dom": "^5.16.4",
208199
"@types/cookie": "^0.5.1",
@@ -227,9 +218,12 @@
227218
"eslint-config-airbnb": "^19.0.4",
228219
"fake-indexeddb": "^3.1.7",
229220
"html-webpack-plugin": "^5.5.0",
221+
"istanbul": "^0.4.5",
230222
"jest": "26.0.1",
231223
"mini-css-extract-plugin": "^2.6.0",
232224
"mocha": "^9.2.2",
225+
"nodemon": "^2.0.15",
226+
"nyc": "^15.1.0",
233227
"playwright": "^1.21.1",
234228
"postcss-cssnext": "^3.1.0",
235229
"postcss-import": "^14.1.0",
@@ -248,6 +242,7 @@
248242
"webpack-bundle-analyzer": "^4.5.0",
249243
"webpack-cli": "^4.9.2",
250244
"webpack-dev-server": "^4.8.1",
245+
"webpack-merge": "^5.8.0",
251246
"webpack-node-externals": "^3.0.0"
252247
},
253248
"author": {

src/client/components-v2/App.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const { api } = window as unknown as WindowExt;
2222
const App = () => {
2323
const [message, setMessage] = useState(null);
2424

25+
// currentWorkspace is the current Workspace's UUID. It is only altered in WorkspaceSelect.tsx, which is rendered by CurrentWorskpaceDisplay.tsx
26+
const [currentWorkspaceId, setWorkspace] = React.useState('');
27+
2528
useEffect(() => {
2629
api.send('check-for-update');
2730
historyController.getHistory();
@@ -35,12 +38,13 @@ const App = () => {
3538
<Divider orientation="horizontal"/>
3639
<Box sx={{ height: '100%', display: 'flex' }}>
3740
{/* New MUI workspace. */}
38-
<HistoryOrWorkspaceContainer />
41+
{/* <WorkspaceContainer currentWorkspaceId={currentWorkspaceId} setWorkspace={setWorkspace} /> */}
42+
<HistoryOrWorkspaceContainer currentWorkspaceId={currentWorkspaceId} setWorkspace={setWorkspace} />
3943
{/* Legacy workspace. */}
40-
<ContentsContainer />
44+
{/* <ContentsContainer /> */}
4145
<Divider orientation="vertical"/>
4246
{/* New MUI main container. */}
43-
<MainContainer />
47+
<MainContainer currentWorkspaceId={currentWorkspaceId} />
4448
{/* Legacy main container */}
4549
{/* <div className="tile is-vertical add-vertical-scroll">
4650
<SidebarContainer />
Lines changed: 103 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,103 @@
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: 3 }}>
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() {
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 />} label="Current Workspace" {...a11yProps(0)} sx={{fontSize:'10px', overflowWrap: "break-word", maxWidth: '50%'}}/>
56-
<Tab icon={<AccessTimeIcon />} label='View History' {...a11yProps(1)} sx={{fontSize:'10px', overflowWrap: "break-word", maxWidth: '50%'}}/>
57-
</Tabs>
58-
</Box>
59-
<TabPanel value={value} index={0}>
60-
<WorkspaceContainer />
61-
</TabPanel>
62-
<TabPanel value={value} index={1}>
63-
<HistoryContainer />
64-
</TabPanel>
65-
</Box>
66-
);
67-
}
1+
import * as React from 'react';
2+
import { useSelector, useDispatch } from 'react-redux';
3+
import Tabs from '@mui/material/Tabs';
4+
import Tab from '@mui/material/Tab';
5+
import Typography from '@mui/material/Typography';
6+
import Button from '@mui/material/Button';
7+
import Box from '@mui/material/Box';
8+
import BarGraph from '../../components/display/BarGraph';
9+
import ScheduleContainer from '../../components/containers/ScheduleContainer';
10+
import WorkspaceContainer from "../workspace/WorkspaceContainer";
11+
import HistoryContainer from '../../components/containers/HistoryContainer';
12+
import AccessTimeIcon from '@mui/icons-material/AccessTime';
13+
import WorkIcon from '@mui/icons-material/Work';
14+
import ScheduleSendRoundedIcon from '@mui/icons-material/ScheduleSendRounded';
15+
16+
interface TabPanelProps {
17+
children?: React.ReactNode;
18+
index: number;
19+
value: number;
20+
}
21+
22+
function TabPanel(props: TabPanelProps) {
23+
const { children, value, index, ...other } = props;
24+
25+
return (
26+
<div
27+
role="tabpanel"
28+
hidden={value !== index}
29+
id={`simple-tabpanel-${index}`}
30+
aria-labelledby={`simple-tab-${index}`}
31+
{...other}
32+
>
33+
{value === index && (
34+
<Box sx={{ p: 1 }}>
35+
<Box>{children}</Box>
36+
</Box>
37+
)}
38+
</div>
39+
);
40+
}
41+
42+
function a11yProps(index: number) {
43+
return {
44+
id: `simple-tab-${index}`,
45+
'aria-controls': `simple-tabpanel-${index}`,
46+
};
47+
}
48+
49+
export default function HistoryOrWorkspaceContainer(props) {
50+
const [showGraph, setShowGraph] = React.useState(false);
51+
const [value, setValue] = React.useState(0);
52+
53+
const currentResponse = useSelector((store: any) => store.business.currentResponse);
54+
55+
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
56+
setValue(newValue);
57+
};
58+
59+
return (
60+
<Box sx={{ minWidth: '25%', overflow: 'auto', maxHeight: '100%', overflowX: 'auto', overflowY: 'scroll' }}>
61+
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
62+
<Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
63+
<Tab icon={<WorkIcon fontSize='small'/>} {...a11yProps(0)} sx={{fontSize:'10px', overflowWrap: "break-word", maxWidth: '50%'}}/>
64+
<Tab icon={<ScheduleSendRoundedIcon fontSize='small'/>} {...a11yProps(1)} sx={{fontSize:'10px', overflowWrap: "break-word", maxWidth: '50%'}}/>
65+
<Tab icon={<AccessTimeIcon fontSize='small'/>} {...a11yProps(2)} sx={{fontSize:'10px', overflowWrap: "break-word", maxWidth: '50%'}}/>
66+
</Tabs>
67+
</Box>
68+
{value === 1 && (<Box
69+
sx={{
70+
display: 'flex',
71+
flexDirection: 'column',
72+
px: 1,
73+
py: 1
74+
}}
75+
>
76+
<Button
77+
className={`is-flex is-align-items-center is-justify-content-center is-graph-footer is-clickable`}
78+
variant='outlined'
79+
onClick={() => setShowGraph(showGraph === false)}
80+
>
81+
{showGraph && 'Hide Response Metrics'}
82+
{!showGraph && 'View Response Metrics'}
83+
</Button>
84+
{( showGraph && <Box sx={{
85+
py: 1
86+
}}>
87+
<BarGraph />
88+
</Box>
89+
)}
90+
</Box>
91+
)}
92+
<TabPanel value={value} index={0}>
93+
<WorkspaceContainer {...props} />
94+
</TabPanel>
95+
<TabPanel value={value} index={1}>
96+
<ScheduleContainer />
97+
</TabPanel>
98+
<TabPanel value={value} index={2}>
99+
<HistoryContainer />
100+
</TabPanel>
101+
</Box>
102+
);
103+
}

0 commit comments

Comments
 (0)