Skip to content

Commit bae4edb

Browse files
authored
Schema/update for output format v3.0.0 (#4)
* Updated schema for header info Signed-off-by: Omkar Phansopkar <[email protected]> * Updated schema & ux for license detections, packages Signed-off-by: Omkar Phansopkar <[email protected]> * License detections explorer menu Signed-off-by: Omkar Phansopkar <[email protected]> * Removed residue columns for older license format Signed-off-by: Omkar Phansopkar <[email protected]> * Merged license keys with URLs in match table Signed-off-by: Omkar Phansopkar <[email protected]> * Testing License keys parser Signed-off-by: Omkar Phansopkar <[email protected]> * Completed license detection match table UI Signed-off-by: Omkar Phansopkar <[email protected]> * Updated UX & schema for latest output LicenseDetections Signed-off-by: Omkar Phansopkar <[email protected]> * Tableview scoped filters, Header-less import, filename in titlebar, format & crash fixes Signed-off-by: Omkar Phansopkar <[email protected]> * Ignored directories when preparing chart data Signed-off-by: Omkar Phansopkar <[email protected]> * Package_data fields, file & package info dashboard, chart empty labels Signed-off-by: Omkar Phansopkar <[email protected]> * Completed all pie charts Signed-off-by: Omkar Phansopkar <[email protected]> * New window, Info dash fixes, Completed matches table, fixed flatFiles, spdx parsing for matches Signed-off-by: Omkar Phansopkar <[email protected]> --------- Signed-off-by: Omkar Phansopkar <[email protected]>
1 parent 687b4e8 commit bae4edb

Some content is hidden

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

76 files changed

+12125
-29548
lines changed

Diff for: .eslintrc.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,12 @@
1212
"plugin:import/electron",
1313
"plugin:import/typescript"
1414
],
15-
"parser": "@typescript-eslint/parser"
15+
"parser": "@typescript-eslint/parser",
16+
"settings": {
17+
"import/resolver": {
18+
"node": {
19+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
20+
}
21+
}
22+
},
1623
}

Diff for: deploy_rsa.enc

-1.64 KB
Binary file not shown.

Diff for: package-lock.json

+9,266-28,326
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+10-4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@types/node": "^18.8.0",
4545
"@types/react": "^18.0.21",
4646
"@types/react-dom": "^18.0.6",
47+
"@types/react-toastify": "^4.1.0",
4748
"@types/sequelize": "^4.28.14",
4849
"@types/sqlite3": "^3.1.8",
4950
"@types/validator": "^13.7.7",
@@ -59,6 +60,7 @@
5960
"eslint": "^8.24.0",
6061
"eslint-plugin-import": "^2.26.0",
6162
"fork-ts-checker-webpack-plugin": "^7.2.13",
63+
"json-loader": "^0.5.7",
6264
"native-ext-loader": "^2.3.0",
6365
"node-loader": "^2.0.0",
6466
"react-scripts": "^5.0.1",
@@ -87,6 +89,7 @@
8789
"font-awesome": "^4.7.0",
8890
"jquery": "^3.6.1",
8991
"JSONStream": "^1.3.5",
92+
"license-expressions": "^0.6.0",
9093
"moment": "^2.29.4",
9194
"packageurl-js": "^1.0.0",
9295
"pg-hstore": "^2.3.4",
@@ -99,8 +102,11 @@
99102
"react-pro-sidebar": "^0.7.1",
100103
"react-router-dom": "^6.4.1",
101104
"react-toastify": "^9.0.8",
105+
"react-tooltip": "^5.10.4",
102106
"sequelize": "^6.23.2",
103107
"sequelize-cli": "^6.5.1",
108+
"spdx-correct": "^3.1.1",
109+
"spdx-license-ids": "^3.0.12",
104110
"sqlite3": "^5.1.2",
105111
"url": "^0.11.0",
106112
"url-loader": "^4.1.1",
@@ -135,9 +141,9 @@
135141
}
136142
],
137143
"plugins": [
138-
[
139-
"@electron-forge/plugin-webpack",
140-
{
144+
{
145+
"name": "@electron-forge/plugin-webpack",
146+
"config": {
141147
"mainConfig": "./webpack.main.config.js",
142148
"renderer": {
143149
"config": "./webpack.renderer.config.js",
@@ -150,7 +156,7 @@
150156
]
151157
}
152158
}
153-
]
159+
}
154160
]
155161
}
156162
}

Diff for: src/App.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ import './fontawesome';
2727
import 'rc-tree/assets/index.css';
2828
import 'react-toastify/dist/ReactToastify.css';
2929
import 'bootstrap/dist/css/bootstrap.min.css';
30+
import 'react-tooltip/dist/react-tooltip.css'
3031

3132
import './app.css';
3233
import './dashStyles.css';
3334
import './customFaColors.css';
35+
import LicenseDetections from './pages/LicenseDetections/LicenseDetections';
3436

3537
const App = () => {
3638
return (
@@ -46,6 +48,7 @@ const App = () => {
4648
<Route path={ROUTES.FILE_DASHBOARD} element={<FileInfoDash />} />
4749
<Route path={ROUTES.LICENSE_DASHBOARD} element={<LicenseInfoDash />} />
4850
<Route path={ROUTES.PACKAGE_DASHBOARD} element={<PackageInfoDash />} />
51+
<Route path={ROUTES.LICENSE_DETECTIONS} element={<LicenseDetections />} />
4952
<Route path={ROUTES.PACKAGES} element={<Packages />} />
5053
<Route path={ROUTES.CHART_SUMMARY} element={<ChartView />} />
5154
<Route path={ROUTES.SCAN_INFO} element={<ScanInfo />} />

Diff for: src/app.css

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ a, a:not([href]), a:not([href]):not([class]) {
1515
a:hover, a:not([href]):hover, a:not([href]):not([class]):hover {
1616
color: #0a58ca;
1717
}
18+
img {
19+
-webkit-user-select: none;
20+
-webkit-user-drag: none;
21+
-webkit-app-region: no-drag;
22+
user-select: none;
23+
}
1824

1925

2026
/*---------------------------------------

Diff for: src/components/EllipticLoader.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface EllipticLoaderProps {
99
ariaLabel?: string,
1010
wrapperClass?: string,
1111
}
12+
1213
const EllipticLoader = (props: EllipticLoaderProps) => {
1314
return (
1415
<ThreeDots

Diff for: src/components/FileTree/FileTree.tsx

+44-42
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,52 @@
1-
import RcTree from 'rc-tree';
2-
import { DataNode } from 'rc-tree/lib/interface';
3-
import React, { useEffect, useState } from 'react';
1+
import RcTree from "rc-tree";
2+
import { DataNode } from "rc-tree/lib/interface";
3+
import React, { useEffect, useState } from "react";
44

5-
import EllipticLoader from '../EllipticLoader';
6-
import { useWorkbenchDB } from '../../contexts/workbenchContext';
5+
import EllipticLoader from "../EllipticLoader";
6+
import { PathType, useWorkbenchDB } from "../../contexts/workbenchContext";
77

8-
import SwitcherIcon from './SwitcherIcon';
8+
import SwitcherIcon from "./SwitcherIcon";
99

10-
import './FileTree.css';
10+
import "./FileTree.css";
1111

1212
const FileTree = (props: React.HTMLProps<HTMLDivElement>) => {
1313
const workbenchDB = useWorkbenchDB();
14-
const { db, initialized, importedSqliteFilePath, updateCurrentPath } = workbenchDB;
14+
const {
15+
db,
16+
initialized,
17+
importedSqliteFilePath,
18+
currentPath,
19+
currentPathType,
20+
updateCurrentPath,
21+
} = workbenchDB;
1522

1623
const [treeData, setTreeData] = useState<DataNode[] | null>(null);
1724

1825
useEffect(() => {
19-
if(!initialized || !db || !importedSqliteFilePath)
20-
return;
21-
22-
db.sync
23-
.then(() => {
24-
db.findAllJSTree()
25-
.then((treeData) => {
26-
setTreeData(treeData as unknown as DataNode[]);
27-
});
28-
})
26+
if (!initialized || !db || !importedSqliteFilePath) return;
27+
28+
db.sync.then(() => {
29+
db.findAllJSTree().then((treeData) => {
30+
setTreeData(treeData as unknown as DataNode[]);
31+
});
32+
});
2933
}, [importedSqliteFilePath]);
3034

31-
function selectPath(path: string){
32-
if(!initialized)
33-
return;
35+
function selectPath(path: string, pathType: PathType) {
36+
if (!initialized) return;
3437
// console.log("FileTree: selected path:", path);
35-
updateCurrentPath(path);
38+
updateCurrentPath(path, pathType);
3639
}
3740

38-
if(!treeData){
41+
// console.log("Current path & type", currentPath, currentPathType);
42+
43+
if (!treeData) {
3944
return (
40-
<div className='file-tree-loader'>
45+
<div className="file-tree-loader">
4146
<div>
4247
Processing File Tree
43-
<br/>
44-
<EllipticLoader
45-
radius={1}
46-
wrapperClass="loader"
47-
/>
48+
<br />
49+
<EllipticLoader radius={1} wrapperClass="loader" />
4850
</div>
4951
</div>
5052
);
@@ -56,26 +58,26 @@ const FileTree = (props: React.HTMLProps<HTMLDivElement>) => {
5658
showLine
5759
treeData={treeData}
5860
switcherIcon={SwitcherIcon}
59-
onActiveChange={selectPath}
60-
onSelect={keys => {
61-
if(keys && keys[0])
62-
selectPath(keys[0].toString())
61+
onSelect={(keys, info) => {
62+
if (keys && keys[0])
63+
selectPath(
64+
keys[0].toString(),
65+
(info.node as any).dataValues.type
66+
);
6367
}}
64-
65-
// For UI testing with dummy data
66-
defaultExpandedKeys={['0', '0-0', '0-0-0', '0-0-0-0']}
67-
6868
motion={{
69-
motionName: 'node-motion',
69+
motionName: "node-motion",
7070
motionAppear: false,
7171
onAppearStart: () => ({ height: 0 }),
72-
onAppearActive: (node: HTMLElement) => ({ height: node.scrollHeight }),
72+
onAppearActive: (node: HTMLElement) => ({
73+
height: node.scrollHeight,
74+
}),
7375
onLeaveStart: (node: HTMLElement) => ({ height: node.offsetHeight }),
7476
onLeaveActive: () => ({ height: 0 }),
7577
}}
7678
/>
7779
</div>
78-
)
79-
}
80+
);
81+
};
8082

81-
export default FileTree
83+
export default FileTree;

Diff for: src/components/ImportFallback/ImportFallback.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const ImportFallback = () => {
1010
return (
1111
<div className='import-fallback'>
1212
<Link to={ROUTES.HOME}>
13-
<img src={AddFileImage} draggable={false} />
13+
<img src={AddFileImage} draggable={false} onDragStart={() => false} />
1414
</Link>
1515
<br/>
1616
<h2>

Diff for: src/components/Layout/layout.css

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33
height: 100vh !important;
44
}
55

6-
/* .pane-container .content-pane {
7-
8-
} */
9-
106
.file-tree-pane {
117
border: 0;
128
box-shadow: rgb(177 177 177) 1px 0px 18px -3px;
139
overflow: overlay !important;
1410
}
1511
.content-pane {
16-
overflow: overlay !important;
12+
overflow-y: overlay !important;
1713
}
1814
.content-container {
1915
padding: 10px;
2016
padding-top: 5px;
2117
padding-bottom: 5px;
22-
min-height: 100%;
18+
min-height: 95%;
2319
}
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { ColDef } from "ag-grid-community";
2+
3+
const MINI_FIELD_WIDTH = 90;
4+
5+
export const DEFAULT_FILE_REGION_COL_DEF: ColDef = {
6+
sortable: true,
7+
resizable: true,
8+
filter: true,
9+
wrapText: true,
10+
autoHeight: true,
11+
wrapHeaderText: true,
12+
flex: 1,
13+
cellStyle: { "whiteSpace": "normal" },
14+
}
15+
16+
export const DetectionFileRegionCols: ColDef[] = [
17+
{
18+
headerName: 'Path',
19+
field: 'path',
20+
width: 270,
21+
},
22+
{
23+
headerName: 'Start line',
24+
field: 'start_line',
25+
width: MINI_FIELD_WIDTH,
26+
},
27+
{
28+
headerName: 'End line',
29+
field: 'end_line',
30+
width: MINI_FIELD_WIDTH,
31+
},
32+
]

0 commit comments

Comments
 (0)