Skip to content

Commit

Permalink
Merge branch 'develop' into SQS-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aloftus23 committed Apr 30, 2024
2 parents 69f265a + 708a7ba commit ee574c4
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 27 deletions.
10 changes: 10 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"react-select": "^5.5.9",
"react-simple-maps": "^3.0.0",
"react-table": "^7.8.0",
"react-to-print": "^2.15.1",
"resolve-url-loader": "^5.0.0",
"universal-cookie": "^4.0.4",
"uswds": "^2.13.3",
Expand Down
78 changes: 52 additions & 26 deletions frontend/src/components/ReadySetCyber/RSCDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,43 +34,69 @@ export const RSCDashboard: React.FC = () => {
fetchResults();
}, [fetchResults]);

console.log(results);

return (
<Box sx={{ flexGrow: 1, padding: 2 }}>
<Grid container spacing={2}>
<Grid item sm={4} sx={{ display: { xs: 'none', sm: 'grid' } }}>
<RSCDefaultSideNav />
</Grid>
<Grid item xs={12} sm={8}>
<Box sx={{ flexGrow: 1, padding: 2, backgroundColor: 'white' }}>
<Stack>
<h2>Assessment Results</h2>
{results.length === 0 ? (
<Box sx={{ flexGrow: 1, padding: 2, backgroundColor: 'white' }}>
<h2>Welcome to ReadySetCyber Dashboard</h2>
<Divider />
<h3>Thank you for completing the ReadySetCyber questionnaire!</h3>
<h3>Thank you for registering with RSC Dashboard!</h3>
<p>
It appears you have not completed the ReadySetCyber
questionnaire yet or your assessment is still processing.
</p>
<p>
If you have not completed the questionnaire, please look to the
menu to your left and click on &quot;Take Questionnaire
Again&quot;. This will redirect you to ReadySetCyber where you
can complete a questionnaire.
</p>
<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.
If you have already completed the questionnaire, please check
back later to view your assessment.
</p>
<Stack spacing={2}>
{results.map((result) => (
<RSCResult
key={result.id}
id={result.id}
type={result.type}
createdAt={result.createdAt}
updatedAt={result.updatedAt}
rscID={result.rscID}
/>
))}
</Box>
) : (
<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>
<Stack spacing={2}>
{results.map((result) => (
<RSCResult
key={result.id}
id={result.id}
type={result.type}
createdAt={result.createdAt}
updatedAt={result.updatedAt}
rscID={result.rscID}
/>
))}
</Stack>
</Stack>
</Stack>
</Box>
</Box>
)}
</Grid>
</Grid>
</Box>
Expand Down
12 changes: 11 additions & 1 deletion frontend/src/components/ReadySetCyber/RSCDefaultSideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import { useAuthContext } from 'context';
import { ListItemButton } from '@mui/material';

export const RSCDefaultSideNav: React.FC = () => {
const handleRSCredirect = () => {
window.open(
'https://cisaexdev.servicenowservices.com/rsc?id=rsc_welcome',
'_blank'
);
};

const { user, logout } = useAuthContext();

return (
Expand All @@ -21,7 +28,10 @@ export const RSCDefaultSideNav: React.FC = () => {
<List>
<ListItem>Welcome, {user?.fullName ?? 'Guest'}</ListItem>
<Divider component="li" />
<ListItemButton style={{ outline: 'none' }}>
<ListItemButton
onClick={handleRSCredirect}
style={{ cursor: 'pointer' }}
>
Take Questionnaire Again
</ListItemButton>
<Divider component="li" />
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/ReadySetCyber/RSCDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { RSCNextSteps } from './RSCNextSteps';
import { RSCAccordionNav } from './RSCAccordionNav';
import { FloatingNav } from './FloatingNav';
import { ScrollTop } from './ScrollTop';
import { useReactToPrint } from 'react-to-print';

export const RSCDetail: React.FC = () => {
const { apiGet } = useAuthContext();
Expand Down Expand Up @@ -45,6 +46,13 @@ export const RSCDetail: React.FC = () => {
fetchResult();
}, [fetchResult]);

const printRef = React.useRef<HTMLDivElement>(null);

const handleDownloadPDF = useReactToPrint({
content: () => printRef.current,
documentTitle: `ReadySetCyber Summary ${new Date().toLocaleDateString()}`
});

return (
<>
<Box sx={{ flexGrow: 1, padding: 2 }}>
Expand Down

0 comments on commit ee574c4

Please sign in to comment.