Skip to content

Commit

Permalink
Merge branch 'feature/unittests' into feature/license-review-status
Browse files Browse the repository at this point in the history
  • Loading branch information
OmkarPh committed Oct 23, 2023
2 parents 1545ce5 + 4afe992 commit e498e4c
Show file tree
Hide file tree
Showing 19 changed files with 283 additions and 193 deletions.
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
modulePathIgnorePatterns: ["test-old"]
modulePathIgnorePatterns: ["test-old", "dist"],
testPathIgnorePatterns: ["node_modules", "dist", "test-old"]
};
24 changes: 12 additions & 12 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"nock": "^13.3.0",
"pg": "^8.10.0",
"pg-hstore": "^2.3.4",
"rc-tree": "^5.7.0",
"rc-tree": "^5.7.12",
"react": "^18.2.0",
"react-bootstrap": "^2.5.0",
"react-chartjs-2": "^5.2.0",
Expand Down
22 changes: 13 additions & 9 deletions src/components/LicenseEntity/LicenseEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,34 +112,38 @@ const LicenseEntity = (props: LicenseDetectionEntityProps) => {
: LicenseClueMatchCols
}
onGridReady={(params) => setMatchesTableColumnApi(params.columnApi)}
className="ag-theme-alpine ag-grid-customClass matches-table"
className="ag-theme-alpine ag-grid-customClass entity-table"
ensureDomOrder
enableCellTextSelection
pagination={false}
defaultColDef={DEFAULT_MATCHES_COL_DEF}
/>
</MatchedTextProvider>
<br />
<br />
File regions
<AgGridReact
rowData={file_regions}
columnDefs={DetectionFileRegionCols}
onGridReady={(params) => params.api.sizeColumnsToFit()}
onGridSizeChanged={(params) => params.api.sizeColumnsToFit()}
className="ag-theme-alpine ag-grid-customClass file-regions-table"
className="ag-theme-alpine ag-grid-customClass entity-table"
ensureDomOrder
suppressHorizontalScroll
enableCellTextSelection
pagination={false}
defaultColDef={DEFAULT_FILE_REGION_COL_DEF}
/>
<br />
Raw license {activeLicenseEntity.type}
<ReactJson
src={activeLicenseEntity.license}
enableClipboard={false}
displayDataTypes={false}
collapsed={0}
/>
<div className="raw-info-section">
Raw license {activeLicenseEntity.type}
<ReactJson
src={activeLicenseEntity.license}
enableClipboard={false}
displayDataTypes={false}
collapsed={0}
/>
</div>
</div>
);
};
Expand Down
2 changes: 2 additions & 0 deletions src/components/LicenseEntity/MatchedTextContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
import { ScanOptionKeys } from "../../utils/parsers";
import { SYNTHETIC_RULE_PREFIXES } from "../../constants/licenseRules";

import "./matchedText.css";

interface MatchedTextContextProperties {
showDiffWindow: boolean;
openDiffWindow: (
Expand Down
70 changes: 0 additions & 70 deletions src/components/LicenseEntity/licenseEntity.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,73 +15,3 @@
margin-right: 5px;
}

.matches-table,
.file-regions-table {
max-height: 30vh;
}

.matched-text-diff-modal {
overflow: auto;
max-height: calc(100vh - 120px);
}

.matched-text-diff-modal .row {
padding: 5px;
}

.matched-text-diff-modal .rule-text-section {
background-color: #f6feff;
padding: 0;
}

.matched-text-diff-modal .matched-text-section {
background-color: #f9fffc;
padding: 0;
}

.matched-text-diff-modal .diff-table {
table-layout: fixed;
width: 100%;
}

.matched-text-diff-modal .diff-table th {
padding: 15px;
padding-left: 10px;
font-weight: 500;
background-color: #fafbfc;
}

.matched-text-diff-modal .diff-line {
display: table-row-group;
margin: 0;
vertical-align: top;
white-space: pre;
overflow-wrap: anywhere;
}

.matched-text-diff-modal .line-number {
margin-right: 15px;
padding-left: 10px;
padding-right: 10px;
opacity: 0.9;
}

.matched-text-diff-modal .line-content {
padding-left: 10px;
padding-right: 10px;
}

.matched-text-diff-modal .diff-line .line-content .line-text {
margin: 0;
display: inline-block;
white-space: pre-wrap;
line-height: 20px;
}

.matched-text-diff-modal .diff-line .line-content .removed-snippet {
background-color: #fdb8c0;
}

.matched-text-diff-modal .diff-line .line-content .added-snippet {
background-color: #acf2bd;
}
62 changes: 62 additions & 0 deletions src/components/LicenseEntity/matchedText.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.matched-text-diff-modal .row {
padding: 5px;
max-height: calc(100vh - 20vh);
overflow: auto;
}

.matched-text-diff-modal .rule-text-section {
background-color: #f6feff;
padding: 0;
}

.matched-text-diff-modal .matched-text-section {
background-color: #f9fffc;
padding: 0;
}

.matched-text-diff-modal .diff-table {
table-layout: fixed;
width: 100%;
}

.matched-text-diff-modal .diff-table th {
padding: 15px;
padding-left: 10px;
font-weight: 500;
background-color: #fafbfc;
}

.matched-text-diff-modal .diff-line {
display: table-row-group;
margin: 0;
vertical-align: top;
white-space: pre;
overflow-wrap: anywhere;
}

.matched-text-diff-modal .line-number {
margin-right: 15px;
padding-left: 10px;
padding-right: 10px;
opacity: 0.9;
}

.matched-text-diff-modal .line-content {
padding-left: 10px;
padding-right: 10px;
}

.matched-text-diff-modal .diff-line .line-content .line-text {
margin: 0;
display: inline-block;
white-space: pre-wrap;
line-height: 20px;
}

.matched-text-diff-modal .diff-line .line-content .removed-snippet {
background-color: #fdb8c0;
}

.matched-text-diff-modal .diff-line .line-content .added-snippet {
background-color: #acf2bd;
}
12 changes: 6 additions & 6 deletions src/components/PackagesEntityDetails/DependenciesTableCols.ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,36 @@ export const DependenciesTableCols: DepsColDef[] = [
{
headerName: "Scope",
field: "scope",
width: 130,
width: 160,
},
{
headerName: "Resolved",
field: "is_resolved",
cellRenderer: TickRenderer,
maxWidth: 95,
maxWidth: 92,
},
{
headerName: "Runtime",
field: "is_runtime",
cellRenderer: TickRenderer,
maxWidth: 95,
maxWidth: 92,
},
{
headerName: "Optional",
field: "is_optional",
cellRenderer: TickRenderer,
maxWidth: 95,
maxWidth: 92,
},
{
headerName: "Data source ID",
field: "datasource_id",
width: 130,
width: 165,
},
{
headerName: "Data file",
field: "datafile_path",
cellRenderer: FilePathRenderer,
width: 200,
width: 400,
},
{
headerName: "Extracted requirement",
Expand Down
17 changes: 9 additions & 8 deletions src/components/PackagesEntityDetails/DependencyEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,15 @@ const DependencyEntity = (props: DependencyEntityProps) => {
/>
</div>
)}
<br />
Raw dependency:
<ReactJson
src={dependency || {}}
enableClipboard={false}
displayDataTypes={false}
collapsed={0}
/>
<div className="raw-info-section">
Raw dependency:
<ReactJson
src={dependency || {}}
enableClipboard={false}
displayDataTypes={false}
collapsed={0}
/>
</div>
</div>
);
};
Expand Down
Loading

0 comments on commit e498e4c

Please sign in to comment.