Skip to content

Commit 53fa89b

Browse files
authored
Merge pull request #577 from nexB/feature/matched_text
Diff modal for Matched text & Rule text in Matches table
2 parents fcf0c80 + fe48142 commit 53fa89b

File tree

23 files changed

+1006
-297
lines changed

23 files changed

+1006
-297
lines changed

package-lock.json

Lines changed: 36 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@svgr/webpack": "^6.4.0",
3939
"@types/c3": "^0.7.8",
4040
"@types/d3": "^7.4.0",
41+
"@types/diff-match-patch": "^1.0.32",
4142
"@types/jquery": "^3.5.14",
4243
"@types/node": "^18.8.0",
4344
"@types/react": "^18.0.21",
@@ -85,6 +86,8 @@
8586
"aws-sdk": "^2.1358.0",
8687
"bootstrap": "^5.2.1",
8788
"c3": "^0.7.20",
89+
"chart.js": "^4.3.0",
90+
"diff-match-patch": "^1.0.5",
8891
"electron-squirrel-startup": "^1.0.0",
8992
"file-loader": "^6.2.0",
9093
"font-awesome": "^4.7.0",
@@ -94,13 +97,12 @@
9497
"mock-aws-s3": "^4.0.2",
9598
"moment": "^2.29.4",
9699
"nock": "^13.3.0",
97-
"packageurl-js": "^1.0.0",
98100
"pg": "^8.10.0",
99101
"pg-hstore": "^2.3.4",
100102
"rc-tree": "^5.7.0",
101103
"react": "^18.2.0",
102104
"react-bootstrap": "^2.5.0",
103-
"react-chartjs-2": "^4.3.1",
105+
"react-chartjs-2": "^5.2.0",
104106
"react-dom": "^18.2.0",
105107
"react-loader-spinner": "^5.3.4",
106108
"react-pro-sidebar": "^0.7.1",
@@ -110,8 +112,6 @@
110112
"react-tooltip": "^5.10.4",
111113
"sequelize": "^6.23.2",
112114
"sequelize-cli": "^6.5.1",
113-
"spdx-correct": "^3.1.1",
114-
"spdx-license-ids": "^3.0.12",
115115
"sqlite3": "^5.1.6",
116116
"url": "^0.11.0",
117117
"url-loader": "^4.1.1",

src/app.css

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,30 @@ body {
77
width: 100%;
88
position: absolute;
99
}
10-
a, a:not([href]), a:not([href]):not([class]) {
10+
11+
a,
12+
a:not([href]),
13+
a:not([href]):not([class]) {
1114
color: #0d6efd;
1215
cursor: pointer;
1316
text-decoration: none;
1417
}
15-
a:hover, a:not([href]):hover, a:not([href]):not([class]):hover {
18+
19+
a:hover,
20+
a:not([href]):hover,
21+
a:not([href]):not([class]):hover {
1622
color: #0a58ca;
1723
}
24+
25+
button:focus:not(:focus-visible) {
26+
outline: none;
27+
box-shadow: none;
28+
}
29+
1830
img {
19-
-webkit-user-select: none;
20-
-webkit-user-drag: none;
21-
-webkit-app-region: no-drag;
31+
-webkit-user-select: none;
32+
-webkit-user-drag: none;
33+
-webkit-app-region: no-drag;
2234
user-select: none;
2335
}
2436

@@ -32,7 +44,7 @@ img {
3244
font-weight: 400;
3345
src: url('./lib/css/fonts/Raleway-Regular.ttf');
3446
src: local('?'),
35-
url('./lib/css/fonts/Raleway-Regular.ttf') format('truetype');
47+
url('./lib/css/fonts/Raleway-Regular.ttf') format('truetype');
3648
}
3749

3850
@font-face {
@@ -41,7 +53,7 @@ img {
4153
font-weight: 800;
4254
src: url('./lib/css/fonts/Raleway-Black.ttf');
4355
src: local('?'),
44-
url('./lib/css/fonts/Raleway-Black.ttf') format('truetype');
56+
url('./lib/css/fonts/Raleway-Black.ttf') format('truetype');
4557
}
4658

4759
@font-face {
@@ -50,7 +62,7 @@ img {
5062
font-weight: 400;
5163
src: url('./lib/css/fonts/Lato-Regular.ttf');
5264
src: local('?'),
53-
url('./lib/css/fonts/Lato-Regular.ttf') format('truetype');
65+
url('./lib/css/fonts/Lato-Regular.ttf') format('truetype');
5466
}
5567

5668

@@ -59,27 +71,29 @@ img {
5971
padding: 5px;
6072
padding-right: 18px;
6173
}
74+
6275
.card {
6376
border-radius: 2px;
6477
box-shadow: 1px 0 8px -3px #b1b1b1;
6578
background-color: #FFFFFF;
6679
margin-bottom: 30px;
6780
}
81+
6882
img {
6983
-webkit-user-drag: none;
7084
}
7185

72-
.card > .content {
86+
.card>.content {
7387
text-align: center;
7488
padding: 15px 15px 0;
7589
}
7690

77-
.card > .header {
91+
.card>.header {
7892
text-align: center;
7993
padding: 15px 15px;
8094
}
8195

82-
.card > .value {
96+
.card>.value {
8397
margin: 0;
8498
margin-left: auto;
8599
margin-right: auto;

src/components/FileTree/FileTree.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import RcTree from "rc-tree";
22
import { DataNode, Key } from "rc-tree/lib/interface";
33
import React, { useEffect, useState } from "react";
4-
import { Element, scroller } from "react-scroll";
4+
import { Element } from "react-scroll";
55

66
import EllipticLoader from "../EllipticLoader";
77
import { PathType, useWorkbenchDB } from "../../contexts/dbContext";
88

99
import SwitcherIcon from "./SwitcherIcon";
10-
import { scrollToDomElement } from "../../utils/dom";
1110

1211
import "./FileTree.css";
1312

@@ -26,29 +25,18 @@ const FileTree = (props: React.HTMLProps<HTMLDivElement>) => {
2625

2726
useEffect(() => {
2827
setExpandedKeys((keys) => {
29-
console.log(
30-
"Adding",
31-
currentPath.substring(0, currentPath.lastIndexOf("/")),
32-
[...keys, currentPath.substring(0, currentPath.lastIndexOf("/"))]
33-
);
3428
return [...keys, currentPath.substring(0, currentPath.lastIndexOf("/"))];
3529
});
3630
if (currentPath.length) {
3731
setTimeout(() => {
3832
const targetNode = document.getElementsByName(currentPath)[0];
3933
if (targetNode) {
40-
// scrollToDomElement(targetNode, { yOffset: -50 });
4134
targetNode.scrollIntoView({
4235
behavior: "smooth",
4336
block: "start",
4437
inline: "start",
4538
});
4639
}
47-
// scroller.scrollTo(currentPath, {
48-
// duration: 0,
49-
// delay: 30,
50-
// smooth: "easeInOutQuart",
51-
// });
5240
}, 500);
5341
}
5442
}, [currentPath]);
@@ -64,13 +52,8 @@ const FileTree = (props: React.HTMLProps<HTMLDivElement>) => {
6452
function wrapNode(node: DataNode) {
6553
const key = String(node.key);
6654
node.title = (
67-
<Element
68-
key={key}
69-
name={key}
70-
className="filetree-node-wrapper"
71-
>
55+
<Element key={key} name={key} className="filetree-node-wrapper">
7256
<span>{String(node.title)}</span>
73-
{/* <span id={key}>{String(node.title)}</span> */}
7457
</Element>
7558
);
7659
node.children?.forEach(wrapNode);
@@ -98,12 +81,6 @@ const FileTree = (props: React.HTMLProps<HTMLDivElement>) => {
9881
);
9982
}
10083

101-
// console.log("Filetree", {
102-
// currentPath,
103-
// selectedKeys: [currentPath],
104-
// defaultExpanded: [currentPath.substring(0, currentPath.lastIndexOf("/"))],
105-
// });
106-
10784
return (
10885
<div className="file-tree-container" {...props}>
10986
<RcTree
@@ -118,10 +95,8 @@ const FileTree = (props: React.HTMLProps<HTMLDivElement>) => {
11895
const newKeys = keys.filter(
11996
(key) => !String(key).startsWith(String(node.key))
12097
);
121-
console.log("On collapse keys", newKeys);
12298
setExpandedKeys(newKeys);
12399
} else {
124-
console.log("New expanded", keys);
125100
setExpandedKeys(keys);
126101
}
127102
}}

0 commit comments

Comments
 (0)