-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sort by description functionality in vulnerability report (#41)
* Fix description sorting Signed-off-by: Dan Luhring <dan.luhring@anchore.com> * Prepare changelog for new release Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
- Loading branch information
Showing
3 changed files
with
58 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React = require("react"); | ||
|
||
export function Description(props: IProps): JSX.Element { | ||
const { text, location, openFile } = props; | ||
|
||
return ( | ||
<span> | ||
{text} Found in: | ||
{linkLocation(location, openFile)} | ||
</span> | ||
); | ||
} | ||
|
||
interface IProps { | ||
text: string; | ||
location: string; | ||
openFile(uri: string): void; | ||
} | ||
|
||
function linkLocation( | ||
location: string, | ||
openFile: (uri: string) => void | ||
): JSX.Element { | ||
return ( | ||
<a href={"#"} onClick={() => openFile(location)}> | ||
{location} | ||
</a> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters