Skip to content

Commit 55cdab1

Browse files
committed
Merge branch 'dev' into stephenfeature
2 parents 0403094 + fce0ca1 commit 55cdab1

File tree

40 files changed

+438
-496
lines changed

40 files changed

+438
-496
lines changed

app/charts/LogsTable.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ import { useTable, useGroupBy, useExpanded } from 'react-table';
99

1010
import { CommsContext } from '../context/CommsContext';
1111

12+
1213
/**
1314
* Styling for the Logs Table
1415
*/
1516

1617
const Styles = styled.div`
1718
padding: 1rem;
19+
1820
1921
table {
2022
border-spacing: 0;
2123
border: 1px solid black;
24+
background-color: #D7D7DC;
25+
2226
2327
tr {
2428
:last-child {
@@ -158,10 +162,10 @@ const LogsTable = () => {
158162
);
159163

160164
const data = useContext(CommsContext).commsData;
161-
165+
162166
return (
163-
<Styles>
164-
<Table columns={columns} data={data} />
167+
<Styles >
168+
<Table columns={columns} data={data} />
165169
</Styles>
166170
);
167171
};

app/components/About/About.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@ import React from 'react';
22
import './styles.scss';
33
import TeamMembers from './TeamMembers';
44
import PastContributors from './PastContributors';
5-
import { useStylingContext } from './StylingContext';
6-
5+
// import { useStylingContext } from './StylingContext';
6+
import { useContext } from 'react';
7+
import lightAndDark from '../Styling';
8+
import { DashboardContext } from '../../context/DashboardContext';
79

810
const About: React.FC = React.memo(() => {
9-
const currentMode = useStylingContext();
11+
const { mode } = useContext(DashboardContext);
1012

13+
const currentMode = mode === 'light' ? lightAndDark.lightModeText : lightAndDark.darkModeText;
14+
const currentStyle = mode === 'light' ? lightAndDark.lightModeData : lightAndDark.darkModeData;
1115
return (
12-
<div className="about">
13-
<div className="blurb" data-testid="aboutPage">
14-
<h3 style={currentMode} className="mainTitle">About</h3>
15-
<p style={currentMode} className="text" >
16+
17+
18+
<div className="about" >
19+
<div className="blurb" data-testid="aboutPage" style={currentStyle}>
20+
<h3 style={currentStyle} className="mainTitle">About</h3>
21+
<p style={currentStyle} className="text" >
1622
The Chronos Team has a passion for building tools that are powerful, beautifully
1723
designed, and easy to use. Chronos was conceived as an Open Source endeavor that directly benefits the developer
1824
community. It can also monitor applications deployed using AWS, EC2, and ECS from Amazon.

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 & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +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,applications } = 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-
//dynamic refs
21-
// const delRef = useRef<any>([]);
22-
23-
const navigate = useNavigate();
9+
interface ApplicationCardProps {
10+
application: any[];
11+
i: number;
12+
setModal: (modalState: { isOpen: boolean; type: string }) => void;
13+
classes: any;
14+
}
2415

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

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

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

6723
return (
6824
<div className="card" key={`card-${i}`} id={`card-${application[1]}`}>
@@ -73,8 +29,7 @@ const ApplicationsCard = (props) => {
7329
onClick={() => handleClick(application[0], application[3], i)}
7430
>
7531
<div className="databaseIconContainer">
76-
<div className="databaseIconHeader">
77-
</div>
32+
<div className="databaseIconHeader"></div>
7833
</div>
7934

8035
<CardHeader
@@ -84,11 +39,9 @@ const ApplicationsCard = (props) => {
8439
className={classes.iconbutton}
8540
aria-label="Delete"
8641
onClick={event => confirmDelete(event, i)}
87-
size="large">
88-
<HighlightOffIcon
89-
className={classes.btnStyle}
90-
id="deleteIcon"
91-
/>
42+
size="large"
43+
>
44+
<HighlightOffIcon className={classes.btnStyle} id="deleteIcon" />
9245
</IconButton>
9346
}
9447
/>
@@ -110,6 +63,6 @@ const ApplicationsCard = (props) => {
11063
</Card>
11164
</div>
11265
);
113-
}
66+
};
11467

115-
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ const Contact: React.FC = React.memo(() => {
88
const { mode } = useContext(DashboardContext);
99

1010
const currentMode = mode === 'light' ? lightAndDark.lightModeText : lightAndDark.darkModeText;
11+
const currentStyle = mode === 'light' ? lightAndDark.lightModeData : lightAndDark.darkModeData;
1112

1213
return (
1314
<div className="contact" style={currentMode}>
14-
<div className="contact-border" data-testid="contactPage">
15+
<div className="contact-border" data-testid="contactPage" style={currentStyle}>
1516
<div className="contact-container">
1617
<div className="contact-blurb">
1718
<h1>Contact Us</h1>
1819
<br />
1920
<p>Please feel free to provide any feedback, concerns, or comments.</p>
20-
<p>You can find issues the team is currently working on
21+
<p>You can find issues the team is currently working on <span></span>
2122
<a id="issueLink" href="https://github.com/open-source-labs/Chronos/issues" target="_blank" rel="noreferrer">
2223
here
2324
</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+
}

0 commit comments

Comments
 (0)