-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Built Detail, SideNav, NavItem, Result, Question components. Amended …
…Dashboard. Added route for detailed view. Built dummy data. Added home link to header.
- Loading branch information
1 parent
b175e0c
commit bd70588
Showing
10 changed files
with
422 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,55 @@ | ||
import React from 'react'; | ||
import { Card } from '@mui/material'; | ||
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 { RSCResult } from './RSCResult'; | ||
|
||
import { dummyResults } from './dummyData'; | ||
|
||
const results = dummyResults; | ||
|
||
export const RSCDashboard: React.FC = () => { | ||
return ( | ||
<Card> | ||
<h1>Ready Set Cyber Dashboard</h1> | ||
</Card> | ||
<Box sx={{ flexGrow: 1, padding: 2 }}> | ||
<Grid container spacing={2}> | ||
<Grid item xs={4}> | ||
<RSCSideNav /> | ||
</Grid> | ||
<Grid item xs={8}> | ||
<Box sx={{ flexGrow: 1, padding: 2, backgroundColor: 'white' }}> | ||
<Stack> | ||
<h2>Assessment Results</h2> | ||
<Divider /> | ||
<h3>Thank you for completing the ReadySetCyber questionnaire!</h3> | ||
<p> | ||
Below, you’ll find a summary of all completed ReadySetCyber | ||
questionnaires. Selecting a result will allow you to review | ||
areas where you can improve your organization’s cybersecurity | ||
posture, along with recommended resources to help address those | ||
areas. To take further action, contact your regional CISA | ||
Cybersecurity Advisor (CSA) for personalized support. You can | ||
also explore Crossfeed, CISA’s Attack Surface Management | ||
platform, for free vulnerability scanning services to kickstart | ||
or enhance your cybersecurity measures. | ||
</p> | ||
{results.map((result) => ( | ||
<Stack key={result.id} spacing={2}> | ||
<RSCResult | ||
id={result.id} | ||
type={result.type} | ||
date={result.date} | ||
categories={result.categories} | ||
questions={result.questions} | ||
/> | ||
<Divider /> | ||
</Stack> | ||
))} | ||
</Stack> | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from 'react'; | ||
import { useParams } from 'react-router-dom'; | ||
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 Button from '@mui/material/Button'; | ||
import { RSCSideNav } from './RSCSideNav'; | ||
import { RSCQuestion } from './RSCQuestion'; | ||
import { dummyResults } from './dummyData'; | ||
import { Typography } from '@mui/material'; | ||
|
||
export const RSCDetail: React.FC = () => { | ||
const { id } = useParams<{ id: string }>(); | ||
const { questions } = dummyResults.find( | ||
(result) => result.id === parseInt(id) | ||
) || { questions: [] }; | ||
return ( | ||
<Box sx={{ flexGrow: 1, padding: 2 }}> | ||
<Grid container spacing={2}> | ||
<Grid item xs={4}> | ||
<h2>Ready Set Cyber Side Nav</h2> | ||
<RSCSideNav /> | ||
</Grid> | ||
<Grid item xs={8}> | ||
<Box sx={{ flexGrow: 1, padding: 2, backgroundColor: 'white' }}> | ||
<Stack> | ||
<Stack | ||
direction="row" | ||
justifyContent={'space-between'} | ||
alignItems="center" | ||
padding={2} | ||
> | ||
<Typography variant="h5" component="div"> | ||
Summary and Resources | ||
</Typography> | ||
<Button variant="contained" color="success"> | ||
Download PDF | ||
</Button> | ||
</Stack> | ||
<Divider /> | ||
<h3>Thank you for completing the ReadySetCyber questionnaire!</h3> | ||
<p> | ||
Below, you’ll find a full summary of your completed | ||
ReadySetCyber questionnaire. Please note the areas where you can | ||
improve your organization’s cybersecurity posture, along with | ||
the recommended resources to help you address these areas. To | ||
take further action, contact your regional CISA Cybersecurity | ||
Advisor (CSA) for personalized support. You can also explore | ||
Crossfeed, CISA’s Attack Surface Management platform, for free | ||
vulnerability scanning services to kickstart or enhance your | ||
cybersecurity measures. | ||
</p> | ||
{questions.map((question) => ( | ||
<RSCQuestion key={question.id} question={question} /> | ||
))} | ||
</Stack> | ||
</Box> | ||
</Grid> | ||
</Grid> | ||
</Box> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Divider, ListItem } from '@mui/material'; | ||
import React from 'react'; | ||
|
||
interface Props { | ||
name: string; | ||
} | ||
export const RSCNavItem: React.FC<Props> = (props) => { | ||
const { name } = props; | ||
return ( | ||
<> | ||
<ListItem>{name}</ListItem> | ||
<Divider component="li" /> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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 { | ||
question: { | ||
id: number; | ||
title: string; | ||
answers: { | ||
id: number; | ||
name: string; | ||
selected: boolean; | ||
}[]; | ||
}; | ||
} | ||
|
||
export const RSCQuestion: React.FC<Props> = (props) => { | ||
const question = props.question; | ||
const answers = props.question.answers; | ||
return ( | ||
<div> | ||
<Box sx={{ width: '100%', bgcolor: 'grey', padding: 2 }}> | ||
<Typography variant="h6" gutterBottom component="div"> | ||
Question {question.id} | ||
</Typography> | ||
<Typography variant="h6" gutterBottom component="div"> | ||
{question.title} | ||
</Typography> | ||
<Stack direction="row" spacing={2} padding={2}> | ||
{answers.map((answer) => ( | ||
<Button key={answer.id} variant="contained" color="primary"> | ||
{answer.name}{' '} | ||
</Button> | ||
))} | ||
</Stack> | ||
<Box sx={{ width: '100%', bgcolor: 'background.paper', padding: 2 }}> | ||
<h3>Recommended Resources</h3> | ||
<h4>Resource Type</h4> | ||
<h5>Resource Title</h5> | ||
<p>Resource Description</p> | ||
</Box> | ||
</Box> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import Card from '@mui/material/Card'; | ||
import Box from '@mui/material/Box'; | ||
import Stack from '@mui/material/Stack'; | ||
import { Typography } from '@mui/material'; | ||
import { useHistory } from 'react-router-dom'; | ||
|
||
interface Props { | ||
id: number; | ||
type: string; | ||
date: string; | ||
categories: { | ||
id: number; | ||
name: string; | ||
}[]; | ||
questions: { | ||
id: number; | ||
title: string; | ||
answers: { | ||
id: number; | ||
name: string; | ||
selected: boolean; | ||
}[]; | ||
}[]; | ||
} | ||
|
||
export const RSCResult: React.FC<Props> = (props) => { | ||
const { id, type, date } = props; | ||
const history = useHistory(); | ||
const handleClick = () => { | ||
history.push(`/readysetcyber/result/${id}`); | ||
}; | ||
return ( | ||
<Card onClick={handleClick}> | ||
<Box sx={{ width: '100%', bgcolor: 'background.paper', p: 2 }}> | ||
<Stack | ||
direction="row" | ||
justifyContent={'space-between'} | ||
alignItems="center" | ||
> | ||
<Typography variant="h5" component="div"> | ||
{type} | ||
</Typography> | ||
<Typography variant="h5">{date}</Typography> | ||
</Stack> | ||
</Box> | ||
</Card> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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'; | ||
import { RSCNavItem } from './RSCNavItem'; | ||
import { dummyResults } from './dummyData'; | ||
|
||
export const RSCSideNav: React.FC = () => { | ||
const { id } = useParams<{ id: string }>(); | ||
|
||
const categories = | ||
dummyResults.find((result) => result.id === parseInt(id))?.categories || []; | ||
|
||
return ( | ||
<div> | ||
<Box sx={{ width: '100%', maxWidth: 360, bgcolor: 'background.paper' }}> | ||
<List> | ||
<ListItem>Welcome User</ListItem> | ||
<Divider component="li" /> | ||
{categories.map((category) => ( | ||
<RSCNavItem key={category.id} name={category.name} /> | ||
))} | ||
<ListItem>Take Questionnaire Again</ListItem> | ||
<Divider component="li" /> | ||
<ListItem>Logout</ListItem> | ||
</List> | ||
</Box> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.