From 456359aa903e13c706219404869c46f434d2a3c5 Mon Sep 17 00:00:00 2001 From: Thomas Johnson <123108455+hawkishpolicy@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:27:52 -0400 Subject: [PATCH 1/4] amended backend/dockerfile to fix node-gyp error during npm start --- backend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index a45d7240..24b89bee 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,7 +1,7 @@ FROM node:18-alpine3.17 USER root -RUN apk update && apk upgrade +RUN apk update && apk upgrade && apk add g++ make py3-pip WORKDIR /app COPY ./package* ./ From fc66de220c879e6c9273628abbf34c8c0867a835 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 18 Apr 2024 15:44:55 -0400 Subject: [PATCH 2/4] Removed commented out code from RSCHeader.tsx --- .../components/ReadySetCyber/RSCHeader.tsx | 159 ------------------ 1 file changed, 159 deletions(-) diff --git a/frontend/src/components/ReadySetCyber/RSCHeader.tsx b/frontend/src/components/ReadySetCyber/RSCHeader.tsx index b06a200c..91b333f1 100644 --- a/frontend/src/components/ReadySetCyber/RSCHeader.tsx +++ b/frontend/src/components/ReadySetCyber/RSCHeader.tsx @@ -187,162 +187,3 @@ export const RSCHeader: React.FC = () => { ); }; - -// import React from 'react'; -// import { AppBar, Box, Container, Tooltip, IconButton, Menu, MenuItem } from '@mui/material'; -// import { Toolbar } from '@mui/material'; -// import { Typography } from '@mui/material'; -// import { useHistory } from 'react-router-dom'; -// import { useAuthContext } from 'context'; -// import RSCLogo from '../../assets/ReadySetCyberLogo.png'; - -// export const RSCHeader: React.FC = () => { -// const history = useHistory(); -// const handleNavHome = () => { -// history.push('/readysetcyber'); -// }; - -// const { user, logout } = useAuthContext(); -// return ( -// -// -// -// -// -// -// Ready Set Cyber Logo -// -// -// -// Dashboard -// -// -// -// -// Ready Set Cyber Logo -// -// -// -// {user && ( -// <> -// -// -// -// -// -// {' '} -// Welcome, user -// -// -// Dashboard -// -// -// {' '} -// Take Questionnaire Again{' '} -// -// -// Logout -// -// -// -// )} -// {user && ( -// -// -// -// -// -// -// -// -// Logout -// -// -// -// )} -// -// -// -// -// ); -// }; From ce6ec0adb324dc25c2a901e56ede6293d6c1a14f Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 18 Apr 2024 16:23:54 -0400 Subject: [PATCH 3/4] Removed unused imports and variables. Added dependency array for useEffect in RSCDashboard.tsx --- frontend/src/components/ReadySetCyber/RSCDashboard.tsx | 7 +++---- .../src/components/ReadySetCyber/RSCDefaultSideNav.tsx | 3 --- frontend/src/components/ReadySetCyber/RSCQuestion.tsx | 1 - frontend/src/components/ReadySetCyber/RSCSideNav.tsx | 3 --- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/ReadySetCyber/RSCDashboard.tsx b/frontend/src/components/ReadySetCyber/RSCDashboard.tsx index 6f6d4cfa..72cad5d4 100644 --- a/frontend/src/components/ReadySetCyber/RSCDashboard.tsx +++ b/frontend/src/components/ReadySetCyber/RSCDashboard.tsx @@ -1,15 +1,14 @@ -import React, { useEffect, useCallback, useState } from 'react'; +import React, { useEffect, useCallback } from 'react'; import Box from '@mui/material/Box'; import Grid from '@mui/material/Grid'; import Stack from '@mui/material/Stack'; import Divider from '@mui/material/Divider'; -import { RSCSideNav } from './RSCSideNav'; import { RSCDefaultSideNav } from './RSCDefaultSideNav'; import { RSCResult } from './RSCResult'; import { useAuthContext } from 'context'; export const RSCDashboard: React.FC = () => { - const { user, apiGet } = useAuthContext(); + const { apiGet } = useAuthContext(); const [results, setResults] = React.useState< { @@ -33,7 +32,7 @@ export const RSCDashboard: React.FC = () => { useEffect(() => { fetchResults(); - }, []); + }, [fetchResults]); return ( diff --git a/frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx b/frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx index 64ea6e37..237eb495 100644 --- a/frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx +++ b/frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx @@ -1,13 +1,10 @@ import React from 'react'; -import { useParams } from 'react-router-dom'; import Box from '@mui/material/Box'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import Divider from '@mui/material/Divider'; export const RSCDefaultSideNav: React.FC = () => { - const { id } = useParams<{ id: string }>(); - return (
diff --git a/frontend/src/components/ReadySetCyber/RSCQuestion.tsx b/frontend/src/components/ReadySetCyber/RSCQuestion.tsx index e7143bd0..2780d339 100644 --- a/frontend/src/components/ReadySetCyber/RSCQuestion.tsx +++ b/frontend/src/components/ReadySetCyber/RSCQuestion.tsx @@ -1,7 +1,6 @@ import React from 'react'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; -import Stack from '@mui/material/Stack'; import Button from '@mui/material/Button'; interface Props { diff --git a/frontend/src/components/ReadySetCyber/RSCSideNav.tsx b/frontend/src/components/ReadySetCyber/RSCSideNav.tsx index 821fee12..71c760eb 100644 --- a/frontend/src/components/ReadySetCyber/RSCSideNav.tsx +++ b/frontend/src/components/ReadySetCyber/RSCSideNav.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { useParams } from 'react-router-dom'; import Box from '@mui/material/Box'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; @@ -14,8 +13,6 @@ export interface Category { name: string; } export const RSCSideNav: React.FC = ({ categories }) => { - const { id } = useParams<{ id: string }>(); - return (
From a5f504aa4b4c1573b6601195a6955c5e588c45bd Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 19 Apr 2024 13:45:00 -0400 Subject: [PATCH 4/4] Removed snippet for M1 chips in backend/Dockerfile --- backend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index b1be91bb..a45d7240 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,7 +1,7 @@ FROM node:18-alpine3.17 USER root -RUN apk update && apk upgrade && apk add --no-cache g++ make py3-pip +RUN apk update && apk upgrade WORKDIR /app COPY ./package* ./