Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
47 changes: 47 additions & 0 deletions application/frontend/src/pages/MyOpenCRE/MyOpenCRE.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from 'react';
import { Button, Container, Header } from 'semantic-ui-react';

import { useEnvironment } from '../../hooks';

export const MyOpenCRE = () => {
const { apiUrl } = useEnvironment();

const downloadTemplate = () => {
const headers = ['standard_name', 'standard_section', 'cre_id', 'notes'];

const csvContent = headers.join(',') + '\n';

const blob = new Blob([csvContent], {
type: 'text/csv;charset=utf-8;',
});

const url = URL.createObjectURL(blob);
const link = document.createElement('a');

link.href = url;
link.setAttribute('download', 'myopencre_mapping_template.csv');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};

return (
<Container style={{ marginTop: '3rem' }}>
<Header as="h1">MyOpenCRE</Header>

<p>
MyOpenCRE allows you to map your own security standard (e.g. SOC2) to OpenCRE Common Requirements
using a CSV spreadsheet.
</p>

<p>
Start by downloading the mapping template below, fill it with your standard’s controls, and map them
to CRE IDs.
</p>

<Button primary onClick={downloadTemplate}>
Download Mapping Template (CSV)
</Button>
</Container>
);
};
7 changes: 7 additions & 0 deletions application/frontend/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ExplorerCircles } from './pages/Explorer/visuals/circles/circles';
import { ExplorerForceGraph } from './pages/Explorer/visuals/force-graph/forceGraph';
import { GapAnalysis } from './pages/GapAnalysis/GapAnalysis';
import { MembershipRequired } from './pages/MembershipRequired/MembershipRequired';
import { MyOpenCRE } from './pages/MyOpenCRE/MyOpenCRE';
import { SearchName } from './pages/Search/SearchName';
import { StandardSection } from './pages/Standard/StandardSection';

Expand All @@ -31,6 +32,12 @@ export interface IRoute {
}

export const ROUTES: IRoute[] = [
{
path: '/myopencre',
component: MyOpenCRE,
showFilter: false,
},

{
path: INDEX,
component: SearchPage,
Expand Down
14 changes: 14 additions & 0 deletions application/frontend/src/scaffolding/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Button } from 'semantic-ui-react';

import { ClearFilterButton } from '../../components/FilterButton/FilterButton';
import { useLocationFromOutsideRoute } from '../../hooks/useLocationFromOutsideRoute';
import { MyOpenCRE } from '../../pages/MyOpenCRE/MyOpenCRE';
import { SearchBar } from '../../pages/Search/components/SearchBar';

export const Header = () => {
Expand Down Expand Up @@ -68,6 +69,10 @@ export const Header = () => {
<NavLink to="/explorer" className="nav-link" activeClassName="nav-link--active">
Explorer
</NavLink>

<NavLink to="/myopencre" className="nav-link" activeClassName="nav-link--active">
MyOpenCRE
</NavLink>
</div>

<div>
Expand Down Expand Up @@ -186,6 +191,15 @@ export const Header = () => {
>
Explorer
</NavLink>

<NavLink
to="/myopencre"
className="nav-link"
activeClassName="nav-link--active"
onClick={closeMobileMenu}
>
MyOpenCRE
</NavLink>
</div>

<div className="mobile-auth">
Expand Down