Skip to content

Commit 3a01464

Browse files
committed
merged dev
2 parents a7e47fd + 5da561d commit 3a01464

File tree

128 files changed

+20979
-16400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+20979
-16400
lines changed

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# JS Project-Specific #
22
#######################
33
# node_modules
4-
dist
5-
build
4+
/dist
5+
/build
66
release-builds
77
coverage
88
__tests__/**/__snapshots__
99
.env
10-
users.json
11-
test_users.json
10+
databases.txt
1211

1312
# Compiled source #
1413
###################
@@ -48,3 +47,5 @@ test_users.json
4847
ehthumbs.db
4948
Thumbs.db
5049
node_modules
50+
51+
out/

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "File",
8+
"skipFiles": [
9+
"<node_internals>/**",
10+
],
11+
"program": "${file}"
12+
},
413
{
514
"type": "node",
615
"request": "launch",

__tests__/test_settings.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
{"setupRequired":false,"services":[["chronosDB","MongoDB","mongodb+srv://jj289:[email protected]/chronosDB?retryWrites=true&w=majority","","Dec 13, 2022 2:58 PM"],["test","MongoDB","mongodb+srv://troyprejusa:[email protected]/test?retryWrites=true&w=majority","","Dec 13, 2022 5:14 PM"]],"mode":"light mode","splash":true,"landingPage":"dashBoard"}
1+
{
2+
"services": [
3+
[
4+
"chronosDB",
5+
"MongoDB",
6+
"mongodb+srv://troyprejusa:[email protected]/test?retryWrites=true&w=majority",
7+
"",
8+
"Dec 19, 2022 4:50 PM"
9+
]
10+
],
11+
"mode": "light",
12+
"splash": true,
13+
"landingPage": "dashBoard"
14+
}

app/App.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ import DashboardContainer from './containers/DashboardContainer';
44
import './stylesheets/scrollBar.scss';
55

66
const App: React.FC = React.memo(() => {
7-
return <DashboardContainer />;
7+
return (
8+
<>
9+
<Splash />
10+
<DashboardContainer />
11+
</>
12+
13+
)
814
});
915

1016
export default App;

app/charts/RouteChart.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const RouteChart = React.memo(() => {
160160
// },
161161
// };
162162

163-
if (communicationsData[0].endpoint !== '/') {
163+
if (communicationsData.length > 0 && communicationsData[0].endpoint !== '/') {
164164
return (
165165
<div className="traceContainer">
166166
<span id="tracesTitle">Route Traces</span>

app/components/About.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const About: React.FC = React.memo(() => {
77
const { mode } = useContext(DashboardContext.DashboardContext);
88

99
const currentMode =
10-
mode === 'light mode' ? lightAndDark.lightModeText : lightAndDark.darkModeText;
10+
mode === 'light' ? lightAndDark.lightModeText : lightAndDark.darkModeText;
1111

1212
return (
1313
<div className="about">

app/components/Contact.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const Contact = React.memo(() => {
88
const { mode } = useContext(DashboardContext);
99

1010
const currentMode =
11-
mode === 'light mode' ? lightAndDark.lightModeText : lightAndDark.darkModeText;
11+
mode === 'light' ? lightAndDark.lightModeText : lightAndDark.darkModeText;
1212

1313
return (
1414
<div className="contact">

app/components/Copyright.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import '../stylesheets/Applications.scss';
55

66
export interface CopyrightProps {}
77

8-
const Copyright: React.SFC = React.memo(() => {
8+
const Copyright: React.FC = React.memo(() => {
99
const useStyles = makeStyles(theme => ({
1010
copyright: {
1111
fontFamily: 'Roboto',

app/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const Header: React.FC<HeaderProps> = React.memo(({ app, service, setLive, live
5858
};
5959

6060
const currentModeCSS =
61-
mode === 'light mode' ? lightAndDark.lightModeHeader : lightAndDark.darkModeHeader;
61+
mode === 'light' ? lightAndDark.lightModeHeader : lightAndDark.darkModeHeader;
6262

6363
return (
6464
<div className="microservice-header" style={currentModeCSS} data-testid="Header">

app/components/Login.tsx

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { ipcRenderer } = window.require('electron');
77

88
const Login = React.memo(() => {
99
const navigate = useNavigate();
10-
const { updateLandingPage, setAuth, setUser } = useContext(DashboardContext);
10+
const { setUser, setMode } = useContext(DashboardContext);
1111
const [failedAuth, setFailedAuthState] = useState<JSX.Element>(<></>);
1212

1313
/** From Version 5.2 Team:
@@ -18,26 +18,18 @@ const Login = React.memo(() => {
1818
const handleSubmit = (e: any) => {
1919
e.preventDefault();
2020
const inputFields: HTMLInputElement[] = e.currentTarget.querySelectorAll('input');
21-
const email = inputFields[0].value;
21+
const username = inputFields[0].value;
2222
const password = inputFields[1].value;
2323
// eslint-disable-next-line no-return-assign
2424
inputFields.forEach(input => (input.value = ''));
25-
const validLogin:
26-
| boolean
27-
| string
28-
| {
29-
email: string;
30-
username: string;
31-
password: string;
32-
admin: boolean;
33-
awaitingApproval: boolean;
34-
} = ipcRenderer.sendSync('verifyUser', { email, password });
35-
if (typeof validLogin === 'object') {
36-
setUser(validLogin);
37-
setAuth(true);
38-
navigate('/applications');
39-
} else if (validLogin === 'awaitingApproval') navigate('/awaitingApproval');
40-
else setFailedAuthState(<p>Sorry your authentication failed please try again.</p>);
25+
const response: boolean | string = ipcRenderer.sendSync('login', { username, password });
26+
if (typeof(response) === 'string') {
27+
setUser(username);
28+
setMode(response);
29+
navigate('/');
30+
} else {
31+
setFailedAuthState(<p>Sorry your authentication failed please try again.</p>);
32+
}
4133
};
4234

4335
return (
@@ -46,17 +38,17 @@ const Login = React.memo(() => {
4638
<h1>Welcome to Chronos!</h1>
4739
<h2>Please enter your credentials to login.</h2>
4840
<form className="form" onSubmit={handleSubmit}>
49-
<label className="email">
50-
<input type="email" name="email" id="email" placeholder="[email protected]" />
41+
<label htmlFor='username'>
42+
<input type="text" name="username" id="username" placeholder="username" />
5143
</label>
52-
<label className="password">
53-
<input type="password" name="password" id="password" placeholder="enter password" />
44+
<label htmlFor='password'>
45+
<input type="password" name="password" id="password" placeholder="password" />
5446
</label>
5547
{failedAuth}
5648
<button className="link" id="submitBtn" type="submit">
5749
Login
5850
</button>
59-
<button className="link needAccount" onClick={() => updateLandingPage('signUp')}>
51+
<button className="link needAccount" onClick={() => navigate('/signup')}>
6052
Need an account?
6153
</button>
6254
</form>

0 commit comments

Comments
 (0)