11import React from "react" ;
2+ import { Button , OverlayTrigger , Popover , Table } from "react-bootstrap" ;
3+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
4+ import { faInfoCircle } from "@fortawesome/free-solid-svg-icons" ;
25import {
36 LicenseClueMatch ,
47 LicenseDetectionMatch ,
58} from "../../services/importedJsonTypes" ;
6- import { Button , OverlayTrigger , Popover , Table } from "react-bootstrap" ;
79import MatchedTextRenderer from "./LicenseMatchCells/MatchedText" ;
810import MatchLicenseExpressionRenderer from "./LicenseMatchCells/MatchLicenseExpression" ;
911import { MatchedTextProvider } from "./MatchedTextContext" ;
1012import MatchRuleDetails from "./MatchRuleDetails" ;
11- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
12- import { faInfoCircle } from "@fortawesome/free-solid-svg-icons" ;
1313import CoreLink from "../CoreLink/CoreLink" ;
14+ import { useWorkbenchDB } from "../../contexts/dbContext" ;
1415
1516interface LicenseMatchProps {
1617 showLIcenseText ?: boolean ;
1718 matches : LicenseClueMatch [ ] | LicenseDetectionMatch [ ] ;
1819}
1920const LicenseMatchesTable = ( props : LicenseMatchProps ) => {
2021 const { matches, showLIcenseText } = props ;
22+ const { goToFileInTableView } = useWorkbenchDB ( ) ;
2123
2224 return (
2325 < MatchedTextProvider >
@@ -40,7 +42,7 @@ const LicenseMatchesTable = (props: LicenseMatchProps) => {
4042 />
4143 </ td >
4244 </ tr >
43- { match . license_expression_spdx && (
45+ { match . spdx_license_expression && (
4446 < tr >
4547 < td colSpan = { 2 } > License Expression SPDX</ td >
4648 < td colSpan = { 7 } >
@@ -53,6 +55,18 @@ const LicenseMatchesTable = (props: LicenseMatchProps) => {
5355 </ td >
5456 </ tr >
5557 ) }
58+ { match . from_file && (
59+ < tr >
60+ < td colSpan = { 2 } > Matched file</ td >
61+ < td colSpan = { 7 } >
62+ < CoreLink
63+ onClick = { ( ) => goToFileInTableView ( match . from_file ) }
64+ >
65+ { match . from_file }
66+ </ CoreLink >
67+ </ td >
68+ </ tr >
69+ ) }
5670 { showLIcenseText && (
5771 < tr className = "matched-text-row" >
5872 < td colSpan = { 2 } > Matched Text</ td >
@@ -66,6 +80,12 @@ const LicenseMatchesTable = (props: LicenseMatchProps) => {
6680 </ td >
6781 </ tr >
6882 ) }
83+ < tr >
84+ < td colSpan = { 2 } > Start Line</ td >
85+ < td colSpan = { 3 } > { match . start_line } </ td >
86+ < td colSpan = { 2 } > End Line</ td >
87+ < td colSpan = { 2 } > { match . end_line } </ td >
88+ </ tr >
6989 < tr >
7090 < td colSpan = { 2 } > Matched length</ td >
7191 < td colSpan = { 3 } > { match . matched_length } </ td >
0 commit comments