Skip to content

Commit 9f4cca5

Browse files
author
Matej Groman
committed
2 parents 9233b36 + 0e7d67e commit 9f4cca5

63 files changed

Lines changed: 20488 additions & 831 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docker-compose-azure.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ services:
4646
REDIS_PASSWORD: ${REDIS_PASSWORD:?error}
4747
NEXT_PUBLIC_SONATYPE_OSS_AUTH: ${SONATYPE_OSS_AUTH}
4848
NEXT_PUBLIC_SERVER_URI: ${NEXT_PUBLIC_SERVER_URI:-http://localhost:3000}
49+
NEXT_PUBLIC_GRAPH_EXCLUDED_REGEX: ${GRAPH_EXCLUDED_REGEX:-" "}
4950
VULN_DB: ${VULN_DB:-Sonatype}
5051
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
5152
volumes:

docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ services:
77
- 7474:7474
88
- 7687:7687
99
volumes:
10-
- ./runtime/data:/data
11-
- ./runtime/logs:/logs
12-
- ./runtime/plugins:/var/lib/neo4j/plugins
10+
- neo4j:/data
1311
restart: unless-stopped
1412
environment:
1513
- NEO4J_AUTH=neo4j/${NEO4J_PASSWORD:?error}
@@ -48,7 +46,11 @@ services:
4846
NEXT_PUBLIC_SONATYPE_OSS_AUTH: ${SONATYPE_OSS_AUTH}
4947
NEXT_PUBLIC_SERVER_URI: ${NEXT_PUBLIC_SERVER_URI:-http://localhost:3000}
5048
VULN_DB: ${VULN_DB:-Sonatype}
49+
NEXT_PUBLIC_GRAPH_EXCLUDED_REGEX: ${GRAPH_EXCLUDED_REGEX:-" "}
5150
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
5251
volumes:
5352
cache:
5453
driver: local
54+
neo4j:
55+
driver: local
56+

src/depvis-next/apollo/ApolloClient.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
import {
2-
ApolloClient,
3-
createHttpLink,
4-
InMemoryCache,
5-
NormalizedCacheObject,
6-
} from "@apollo/client";
7-
import { GraphQLUri } from "./ApolloServer";
1+
import { ApolloClient, createHttpLink, InMemoryCache } from "@apollo/client";
82
import { useMemo } from "react";
93
import urlJoin from "url-join";
4+
import { GraphQLUri } from "./ApolloServer";
105

116
let httpApolloClient;
127
let ssrApolloClient;
@@ -26,7 +21,6 @@ const httpLink = createHttpLink({
2621
});
2722

2823
const createHttpApolloClient = (ssr: boolean = false) => {
29-
const link = ssr ? ssrHttpLink : httpLink;
3024
console.log("Creating new Apollo Client (ssr: %s)", ssr);
3125
return new ApolloClient({
3226
ssrMode: ssr,

src/depvis-next/apollo/ApolloServer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { Driver } from "neo4j-driver";
1+
import neo4j, { Driver } from "neo4j-driver";
22
import { env } from "process";
3-
import neo4j from "neo4j-driver";
43

54
export const GraphQLUri = "/api/graphql";
65

src/depvis-next/components/Details/DescriptionList.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
import { OverlayTrigger, Stack, Tooltip } from "react-bootstrap";
22

3+
/**
4+
* DataItem Wrapper
5+
* @param props React children
6+
* @returns
7+
*/
38
const DL = (props) => {
49
return <dl>{props.children}</dl>;
510
};
611

12+
/**
13+
* Data Item which creates a text with label component
14+
* @param props a props object containing label, value, alwaysShow, tooltipText, horizontal attributes
15+
* @returns
16+
*/
717
const DLItem = (props) => {
818
const { label, value, alwaysShow, tooltipText, horizontal } = props;
919
if (!label || (!alwaysShow && !value)) return;

src/depvis-next/components/Details/Details.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
import { useState } from "react";
2-
import {
3-
Button,
4-
Col,
5-
Collapse,
6-
Container,
7-
Row,
8-
Stack,
9-
Table,
10-
} from "react-bootstrap";
2+
import { Button, Collapse, Stack, Table } from "react-bootstrap";
113

124
export default function Details(props) {
135
const [open, setOpen] = useState(false);

src/depvis-next/components/Details/VulnerabilityDetails.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { gql, useQuery } from "@apollo/client";
2-
import Link from "next/link";
32
import { Badge, Container } from "react-bootstrap";
4-
import urlJoin from "url-join";
53
import { vulnerabilityColorByCVSS } from "../../helpers/GraphHelper";
64
import Loading from "../Loading/Loading";
75
import { DL, DLItem } from "./DescriptionList";

src/depvis-next/components/Dropdown/Dropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from "react";
1+
import { useState } from "react";
22
import { Container, Form } from "react-bootstrap";
33

44
export type DropdownItem = {
@@ -19,7 +19,7 @@ export default function Dropdown(props) {
1919
<Form>
2020
{title && <Form.Label>{title}</Form.Label>}
2121
<Form.Select
22-
value={selectedId && selectedId}
22+
value={selectedId}
2323
disabled={disabled}
2424
onChange={(e) => {
2525
setSelectedId(e.target.value);

src/depvis-next/components/Error/GenericError.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import Link from 'next/link';
2-
import { useRouter } from 'next/router';
3-
import { Container } from 'react-bootstrap';
1+
import Link from "next/link";
2+
import { Container } from "react-bootstrap";
43

54
export default function GenericError(props) {
6-
const router = useRouter();
75
return (
86
<Container className="mx-auto my-5 text-center">
9-
<p className="fs-4 fw-bold">{props.error.message || 'Error occured!'}</p>
7+
<p className="fs-4 fw-bold">{props.error.message || "Error occured!"}</p>
108
<pre>{JSON.stringify(props.error)}</pre>
119
<Link href="/">Go to homepage</Link>
1210
</Container>

src/depvis-next/components/Error/NoProjectFoundError.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Link from "next/link";
22
import { Button, Container } from "react-bootstrap";
33

4-
export default function NoProjectFoundError(props) {
4+
export default function NoProjectFoundError() {
55
return (
66
<Container className="mx-auto my-5 text-center">
77
<p className="fs-4 fw-bold">No project found!</p>

0 commit comments

Comments
 (0)