Skip to content

Commit 40001bb

Browse files
Merge pull request #13 from oslabs-beta/tsv2
Typescript
2 parents c73ed08 + 74a7841 commit 40001bb

File tree

16 files changed

+112
-97
lines changed

16 files changed

+112
-97
lines changed

.DS_Store

-8 KB
Binary file not shown.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
DS_Store
1+
.DS_Store
2+
build/
23
dist/
34
node_modules/
45
security/
@@ -13,4 +14,3 @@ src/components/display/.StoppedContainers.js.icloud
1314
src/database/docketeerdb
1415
.env
1516
yarn.lock
16-
/security

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ npm run test
225225
- Ricardo Cortez [@Github](https://github.com/rcortez88) [@LinkedIn](https://www.linkedin.com/in/rcortez88/)
226226
- Emma Czech [@Github](https://github.com/emczech) [@LinkedIn](https://https://www.linkedin.com/in/emczech/)
227227
- Brent Speight [@Github](https://github.com/brentspeight) [@LinkedIn](https://www.linkedin.com/in/brent-speight/)
228+
- Eric Lee [@Github](https://github.com/errc-lee)
229+
- Kristine Aguda [@Github](https://github.com/kaguda)
230+
- Dylan Feldman [@Github](https://github.com/dfeldman24)
231+
- Tre Hultzen [@Github](https://github.com/THultz)
232+
- Kenneth Hui [@Github](https://github.com/kennethhui121)
228233

229234
## ⭐ Show your support
230235

build/background.png

-18.8 KB
Binary file not shown.

build/icon.png

-64.5 KB
Binary file not shown.

package.json

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,21 @@
55
"description": "A Docker Visualizer",
66
"author": "Team Docketeer",
77
"proxy": "http://localhost:3000",
8-
"main": "./src/main/main.js",
8+
"main": "src/main/index.js",
99
"scripts": {
1010
"dev": "cross-env NODE_ENV=development concurrently 'electron-webpack dev' 'nodemon server/server.js'",
11-
"compile": "electron-webpack",
11+
"compile": "electron-webpack && tsc",
1212
"dist": "npm run compile && electron-builder",
1313
"dist-win": "npm run compile && electron-builder --win --x64",
1414
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null",
1515
"test": "jest --verbose",
1616
"temp": "webpack-dev-server --open --mode development"
1717
},
18-
"jest": {
19-
"verbose": true,
20-
"transform": {
21-
"^.+\\.jsx?$": "babel-jest"
22-
},
23-
"moduleNameMapper": {
24-
"\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.js"
25-
}
26-
},
2718
"dependencies": {
28-
"@babel/plugin-transform-runtime": "^7.11.5",
2919
"@material-ui/core": "^4.11.0",
3020
"@material-ui/icons": "^4.9.1",
21+
"@types/react-dom": "^17.0.9",
22+
"@types/react-router-dom": "^5.3.0",
3123
"axios": "^0.21.1",
3224
"bcryptjs": "^2.4.3",
3325
"body-parser": "^1.19.0",
@@ -36,16 +28,10 @@
3628
"clsx": "^1.1.1",
3729
"cors": "^2.8.5",
3830
"cross-env": "^7.0.2",
39-
"css-loader": "^4.2.2",
4031
"electron-chartjs": "^1.0.0",
41-
"electron-devtools-installer": "^3.2.0",
4232
"electron-fetch": "^1.7.3",
43-
"enzyme": "^3.11.0",
44-
"enzyme-adapter-react-16": "^1.15.4",
45-
"enzyme-to-json": "^3.5.0",
4633
"express": "^4.17.1",
4734
"fix-path": "^3.0.0",
48-
"jest": "^26.4.2",
4935
"node-fetch": "^2.6.1",
5036
"nodemailer": "^6.6.2",
5137
"parse": "^3.3.0",
@@ -58,37 +44,44 @@
5844
"react-redux": "^7.2.1",
5945
"react-router": "^5.2.0",
6046
"react-router-dom": "^5.2.0",
47+
"redux-thunk": "^2.3.0",
6148
"redux": "^4.0.5",
62-
"sass-loader": "^10.0.2",
6349
"source-map-support": "^0.5.19",
6450
"style-loader": "^1.2.1",
65-
"twilio": "^3.50.0",
66-
"webpack-cli": "^3.3.12",
67-
"webpack-dev-server": "^3.11.0"
51+
"twilio": "^3.50.0"
6852
},
6953
"devDependencies": {
7054
"@babel/cli": "^7.12.1",
7155
"@babel/core": "^7.12.3",
7256
"@babel/node": "^7.12.1",
57+
"@babel/plugin-transform-runtime": "^7.15.0",
7358
"@babel/preset-env": "^7.12.1",
7459
"@babel/preset-react": "^7.10.4",
7560
"babel-loader": "^8.2.1",
7661
"babel-polyfill": "^6.26.0",
7762
"concurrently": "^6.2.0",
63+
"css-loader": "^4.3.0",
7864
"electron": "^10.4.7",
7965
"electron-builder": "^22.4.1",
66+
"electron-devtools-installer": "^3.2.0",
8067
"electron-webpack": "^2.8.2",
68+
"electron-webpack-ts": "^4.0.1",
69+
"enzyme": "^3.11.0",
8170
"enzyme-adapter-react-16": "^1.15.4",
8271
"enzyme-to-json": "^3.5.0",
8372
"eslint": "^7.28.0",
8473
"eslint-plugin-import": "^2.23.4",
8574
"eslint-plugin-jsx-a11y": "^6.4.1",
8675
"eslint-plugin-react": "^7.24.0",
8776
"eslint-plugin-react-hooks": "^4.2.0",
77+
"jest": "^26.6.3",
8878
"nodemon": "^2.0.7",
8979
"react-test-renderer": "^16.13.1",
90-
"redux-thunk": "^2.3.0",
91-
"webpack": "^4.44.1"
80+
"sass-loader": "^10.2.0",
81+
"typescript": "^3.8.3",
82+
"webpack": "^4.44.1",
83+
"webpack-cli": "^3.3.12",
84+
"webpack-dev-server": "^3.11.2"
9285
},
9386
"electronWebpack": {
9487
"whiteListedModules": [
@@ -106,6 +99,15 @@
10699
"type": "git",
107100
"url": "git+https://github.com/oslabs-beta/docketeer.git"
108101
},
102+
"jest": {
103+
"verbose": true,
104+
"transform": {
105+
"^.+\\.jsx?$": "babel-jest"
106+
},
107+
"moduleNameMapper": {
108+
"\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.js"
109+
}
110+
},
109111
"build": {
110112
"extraResources": [
111113
{

src/components/App.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const App = (props) => {
2121
</div>
2222
);
2323
}
24-
2524
else {
2625
return (
2726
<div>

src/components/display/LineChartDisplay.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ const Metrics = (props) => {
5252
const queryStringEnd = `AND created_at >= now() - interval '${timePeriod} hour' ORDER BY "created_at" ASC`;
5353

5454
const containerNamesArr = Object.keys(activeContainers);
55-
5655
if (containerNamesArr.length === 1) {
5756
queryString += ')' + queryStringEnd;
5857
const result = await query(queryString, containerNamesArr);

src/components/helper/notificationsRequester.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,19 @@ const constructNotificationMessage = (
5858
) => {
5959
let message = '';
6060
switch (notificationType) {
61+
6162
case categories.STOPPED:
6263
message = `Container with ID of ${containerId} has stopped`;
6364
break;
6465
case categories.CPU || categories.MEMORY:
65-
message = `${notificationType} alert for container with ID of ${containerId}. Current Value: ${stat}; Alert Setting: ${triggeringValue}`;
66+
message = `${notificationType} alert for container with ID of ${containerId}.
67+
Current Value: ${stat};
68+
Alert Setting: ${triggeringValue}`;
6669
break;
6770
default:
68-
message = `${notificationType} alert for container with ID of ${containerId}. Current Value: ${stat}; Alert Setting: ${triggeringValue}`;
71+
message = `${notificationType} alert for container with ID of ${containerId}.
72+
Current Value: ${stat};
73+
Alert Setting: ${triggeringValue}`;
6974
break;
7075
}
7176

@@ -179,15 +184,20 @@ const checkForNotifications = (
179184
containerObject,
180185
);
181186
console.log(
182-
`** Notification SENT. ${notificationType} containerId: ${containerId} stat: ${stat} triggeringValue: ${triggeringValue} spentTime: ${spentTime}`
187+
`** Notification SENT. ${notificationType}
188+
containerId: ${containerId}
189+
stat: ${stat}
190+
triggeringValue: ${triggeringValue}
191+
spentTime: ${spentTime}`
183192
);
184193
console.log('sentNofications: ', sentNotifications);
185194

186195
// update date.now in object that stores sent notifications
187196
sentNotifications[notificationType][containerId] = Date.now();
188197
} else {
189198
console.log(
190-
`** Resend Interval Not Met. ${notificationType} is at ${stat}.\nLast sent notification time: ${notificationLastSent}`
199+
`** Resend Interval Not Met. ${notificationType} is at ${stat}.\n
200+
Last sent notification time: ${notificationLastSent}`
191201
);
192202
}
193203
} else {
@@ -201,7 +211,10 @@ const checkForNotifications = (
201211
memoryNotification();
202212
cpuNotification();
203213
console.log(
204-
`** Notification SENT. ${notificationType} containerId: ${containerId} stat: ${stat} triggeringValue: ${triggeringValue}`
214+
`** Notification SENT. ${notificationType}
215+
containerId: ${containerId}
216+
stat: ${stat}
217+
triggeringValue: ${triggeringValue}`
205218
);
206219
}
207220
} else {

src/components/tabs/VolumeHistory.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
import React, { useEffect, useState } from 'react';
33

44
/**
5-
*
6-
* @param {*} props
75
* Render Volume History
6+
* @param {*} props
7+
*
8+
* May need to be refactored to render the correct container to history
89
*/
910
const volumeHistory = (props) => {
10-
// set state for volume history cards
1111
const [volumeName, setVolumeName] = useState('');
1212
const [volumeList, setVolumeList] = useState(props.arrayOfVolumeNames);
1313

0 commit comments

Comments
 (0)