Skip to content

Commit 1142b44

Browse files
committed
merge from dev
1 parent 0858a89 commit 1142b44

22 files changed

Lines changed: 178 additions & 369 deletions

File tree

app/components/About/PastContributors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { useStylingContext } from './StylingContext';
33

44
const contributors = [
5-
'Snow', 'Taylor', 'Tim', 'Roberto', 'Nachiket', 'Tiffany', 'Bruno', 'Danny', 'Vince',
5+
'Haoyu', 'Eisha', 'Edwin', 'Tyler', 'Snow', 'Taylor', 'Tim', 'Roberto', 'Nachiket', 'Tiffany', 'Bruno', 'Danny', 'Vince',
66
'Matt', 'Derek', 'Kit', 'Grace', 'Jen', 'Patty', 'Stella', 'Michael', 'Ronelle', 'Todd',
77
'Greg', 'Brianna', 'Brian', 'Alon', 'Alan', 'Ousman', 'Ben', 'Chris', 'Jenae', 'Tim',
88
'Kirk', 'Jess', 'William', 'Alexander', 'Elisa', 'Josh', 'Troy', 'Gahl', 'Brisa', 'Kelsi',

app/components/About/TeamMembers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { useStylingContext } from './StylingContext';
33

4-
const names = ['Haoyu', 'Eisha', 'Edwin', 'Tyler'];
4+
const names = ['Mike', 'Stephen', 'Ted', 'Sofia'];
55

66
const TeamMembers: React.FC = () => {
77
const currentMode = useStylingContext();

app/components/About/styles.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
.about {
44
min-width: 421px;
55
max-width: 600px;
6-
margin: auto 20px;
6+
margin: auto;
77
display: flex;
88
justify-content: center;
99
align-items: center;
10-
width: 90%;
10+
width: 100%;
1111
height: 100%;
1212
}
1313

@@ -33,7 +33,7 @@
3333
font-size: 20px;
3434
color: $background;
3535
text-align: left;
36-
font-weight: 200;
36+
font-weight: 300;
3737
}
3838

3939
.blurb {
Lines changed: 19 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,24 @@
11

2-
import React, { useContext, useRef } from "react";
3-
import { useNavigate } from 'react-router-dom';
2+
import React from "react";
43
import { Card,CardHeader,IconButton,CardContent,Typography } from "@mui/material";
5-
import { DashboardContext } from "../../context/DashboardContext";
6-
import { ApplicationContext } from "../../context/ApplicationContext";
74
import HighlightOffIcon from '@mui/icons-material/HighlightOff';
85
import UpdateIcon from '@mui/icons-material/Update';
9-
import './styles.scss'
10-
11-
type ClickEvent = React.MouseEvent<HTMLElement>;
12-
13-
const ApplicationsCard = (props) => {
14-
15-
const { application, i, setModal, classes } = props
16-
const { deleteApp,user } = useContext(DashboardContext)
17-
const { setAppIndex, setApp, setServicesData, app,example,connectToDB,setChart } = useContext(ApplicationContext)
18-
const [ cardName,dbType,dbURI,description,serviceType ] = application
6+
import './styles.scss';
7+
import { getEventHandlers } from './EventHandlers';
198

20-
const navigate = useNavigate();
9+
interface ApplicationCardProps {
10+
application: any[];
11+
i: number;
12+
setModal: (modalState: { isOpen: boolean; type: string }) => void;
13+
classes: any;
14+
}
2115

22-
// Handle clicks on Application cards
23-
// v10 info: when card is clicked (not on the delete button) if the service is an AWS instance,
24-
// you are redirected to AWSGraphsContainer passing in the state object containing typeOfService
25-
const handleClick = (
26-
selectedApp: string,
27-
selectedService: string,
28-
i: number
29-
) => {
30-
const services = ['auth','client','event-bus','items','inventory','orders']
31-
// if (delRef.current[i] && !delRef.current[i].contains(event.target)) {
32-
setAppIndex(i);
33-
setApp(selectedApp);
34-
if (
35-
selectedService === 'AWS' ||
36-
selectedService === 'AWS/EC2' ||
37-
selectedService === 'AWS/ECS' ||
38-
selectedService === 'AWS/EKS'
39-
) {
40-
navigate(`/aws/:${app}`, { state: { typeOfService: selectedService } });
41-
}
42-
else if(example) {
43-
setServicesData([]);
44-
setChart('all')
16+
import './styles.scss'
4517

46-
connectToDB(user, i, app, dbURI, dbType)
47-
navigate(`/applications/example/${services.join(' ')}`)
48-
}
49-
else {
50-
setServicesData([]);
51-
//When we open the service modal a connection is made to the db in a useEffect inside of the service modal component
52-
setModal({isOpen:true,type:'serviceModal'})
53-
}
54-
// }
55-
};
18+
const ApplicationsCard:React.FC<ApplicationCardProps> = (props) => {
5619

57-
// Asks user to confirm deletion
58-
const confirmDelete = (event: ClickEvent, i: number) => {
59-
event.stopPropagation()
60-
const message = `The application '${app}' will be permanently deleted. Continue?`;
61-
if (confirm(message)) deleteApp(i,"");
62-
};
20+
const { application, i, setModal, classes } = props
21+
const { handleClick, confirmDelete } = getEventHandlers({ application, setModal });
6322

6423
return (
6524
<div className="card" key={`card-${i}`} id={`card-${application[1]}`}>
@@ -70,8 +29,7 @@ const ApplicationsCard = (props) => {
7029
onClick={() => handleClick(application[0], application[3], i)}
7130
>
7231
<div className="databaseIconContainer">
73-
<div className="databaseIconHeader">
74-
</div>
32+
<div className="databaseIconHeader"></div>
7533
</div>
7634

7735
<CardHeader
@@ -81,11 +39,9 @@ const ApplicationsCard = (props) => {
8139
className={classes.iconbutton}
8240
aria-label="Delete"
8341
onClick={event => confirmDelete(event, i)}
84-
size="large">
85-
<HighlightOffIcon
86-
className={classes.btnStyle}
87-
id="deleteIcon"
88-
/>
42+
size="large"
43+
>
44+
<HighlightOffIcon className={classes.btnStyle} id="deleteIcon" />
8945
</IconButton>
9046
}
9147
/>
@@ -107,6 +63,6 @@ const ApplicationsCard = (props) => {
10763
</Card>
10864
</div>
10965
);
110-
}
66+
};
11167

112-
export default ApplicationsCard
68+
export default ApplicationsCard;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { useContext } from 'react';
2+
import { useNavigate } from 'react-router-dom';
3+
import { DashboardContext } from '../../context/DashboardContext';
4+
import { ApplicationContext } from '../../context/ApplicationContext';
5+
6+
type ClickEvent = React.MouseEvent<HTMLElement>;
7+
8+
interface EventHandlersProps {
9+
application: any[];
10+
setModal: (modalState: { isOpen: boolean; type: string }) => void;
11+
}
12+
13+
export const getEventHandlers = ({ application, setModal }: EventHandlersProps) => {
14+
const { deleteApp, user } = useContext(DashboardContext);
15+
const { setAppIndex, setApp, setServicesData, app, example, connectToDB, setChart } =
16+
useContext(ApplicationContext);
17+
const navigate = useNavigate();
18+
19+
const handleClick = (selectedApp: string, selectedService: string, i: number) => {
20+
const services = ['auth', 'client', 'event-bus', 'items', 'inventory', 'orders'];
21+
setAppIndex(i);
22+
setApp(selectedApp);
23+
if (['AWS', 'AWS/EC2', 'AWS/ECS', 'AWS/EKS'].includes(selectedService)) {
24+
navigate(`/aws/:${app}`, { state: { typeOfService: selectedService } });
25+
} else if (example) {
26+
setServicesData([]);
27+
setChart('communications');
28+
connectToDB(user, i, app, application[2], application[1]);
29+
navigate(`/applications/example/${services.join(' ')}`);
30+
} else {
31+
setServicesData([]);
32+
setModal({ isOpen: true, type: 'serviceModal' });
33+
}
34+
};
35+
36+
const confirmDelete = (event: ClickEvent, i: number) => {
37+
event.stopPropagation();
38+
const message = `The application '${app}' will be permanently deleted. Continue?`;
39+
if (confirm(message)) deleteApp(i, '');
40+
};
41+
42+
return { handleClick, confirmDelete };
43+
};

app/components/Contact/Contact.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Contact: React.FC = React.memo(() => {
1717
<h1>Contact Us</h1>
1818
<br />
1919
<p>Please feel free to provide any feedback, concerns, or comments.</p>
20-
<p>You can find issues the team is currently working on
20+
<p>You can find issues the team is currently working on <span></span>
2121
<a id="issueLink" href="https://github.com/open-source-labs/Chronos/issues" target="_blank" rel="noreferrer">
2222
here
2323
</a>.

app/components/Contact/ContactForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const ContactForm = ({ currentMode }) => {
2626
};
2727

2828
const FormInput: React.FC<FormInputProps> = ({ label, name, placeholder, type = "text", isTextarea = false, accept }) => (
29-
<label htmlFor={name}>
29+
<label htmlFor={name} style={{ fontWeight: 300 }}>
3030
{label}:
3131
{isTextarea ? (
3232
<textarea id={name} name={name} placeholder={placeholder} />

app/components/Contact/styles.scss

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
justify-content: center;
1717
align-items: center;
1818
color: $background;
19+
1920
}
2021
.contact-border {
2122
display: flex;
@@ -102,12 +103,12 @@
102103

103104
#myfile {
104105
font-size: 16px;
105-
color: $background;
106+
color: $header;
106107
}
107108

108109
#contact-submit {
109110
border: none;
110-
color: $background;
111+
color: $header;
111112

112113
&:hover {
113114
border: none;
@@ -147,9 +148,9 @@ input[type='file'] {
147148
margin-top: 20px;
148149
margin-left: -4px;
149150
padding: 10px;
150-
border: 1px dotted $background;
151+
border: 1px dotted $header;
151152
outline: none;
152-
color: $background;
153+
color: $header;
153154
background-color: transparent;
154155
border-radius: 8px;
155156
&:hover {
@@ -165,3 +166,7 @@ input[type='file'] {
165166
color: blue !important;
166167
}
167168
}
169+
170+
.contact-blurb p{
171+
font-weight: 300;
172+
}

app/components/GraphNavBar/GraphNavBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ const GraphNavBar = (props) => {
108108
}}
109109
/>
110110
&emsp;Inspect
111-
</Link> */}
112-
<button onClick={() => { setInspect(!inspect) }}>Inspect</button>
111+
</Link>
112+
<button onClick={() => { setInspect(!inspect) }}>Inspect</button> */}
113113
</nav>
114114
)
115115
}

app/components/Occupied/helpers/muiHelper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11

22
import { makeStyles } from '@mui/styles';
3-
// import { BaseCSSProperties } from '@mui/system';
43

54
// Conditional Rendering of UI Modals for Light and Dark Mode
6-
// Theme, StyleProps
5+
// StyleProps
76

87
export const useStylesDark = makeStyles(theme => ({
98
// ALL CARDS

0 commit comments

Comments
 (0)