Skip to content

Commit 1decd1e

Browse files
committed
feat: add show more expandable for long descriptions
Signed-off-by: Ruben Romero Montes <[email protected]>
1 parent 1d09832 commit 1decd1e

File tree

9 files changed

+7108
-4572
lines changed

9 files changed

+7108
-4572
lines changed

src/main/resources/freemarker/templates/generated/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/freemarker/templates/generated/vendor.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/freemarker/templates/generated/vendor.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/resources/__files/osvnvd/maven_report.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@
436436
"aliases": ["GHSA-jjjh-jjxp-wpff"],
437437
"cveId": "CVE-2022-42003",
438438
"created": "2024-01-15T21:37:47.413+00:00",
439-
"summary": "Uncontrolled Resource Consumption in Jackson-databind",
440439
"description": "In FasterXML jackson-databind 2.4.0-rc1 until 2.12.7.1 and in 2.13.x before 2.13.4.2 resource exhaustion can occur because of a lack of a check in primitive value deserializers to avoid deep wrapper array nesting, when the UNWRAP_SINGLE_VALUE_ARRAYS feature is enabled. This was patched in 2.12.7.1, 2.13.4.2, and 2.14.0.",
441440
"affected": [
442441
{
@@ -875,7 +874,6 @@
875874
"aliases": ["GHSA-3fhx-3vvg-2j84"],
876875
"cveId": "CVE-2023-2974",
877876
"created": "2024-01-15T21:37:49.155+00:00",
878-
"summary": "quarkus-core vulnerable to client driven TLS cipher downgrading",
879877
"description": "A vulnerability was found in quarkus-core. This vulnerability occurs because the TLS protocol configured with quarkus.http.ssl.protocols is not enforced, and the client can force the selection of the weaker supported TLS protocol.",
880878
"affected": [
881879
{

src/test/resources/__files/reports/report_all_token.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
"issues": [
216216
{
217217
"id": "CVE-2023-2974",
218-
"title": "quarkus-core vulnerable to client driven TLS cipher downgrading",
218+
"title": "A vulnerability was found in quarkus-core. This vulnerability occurs because the TLS protocol configured with quarkus.http.ssl.protocols is not enforced, and the client can force the selection of the weaker supported TLS protocol.",
219219
"source": "osv-nvd",
220220
"cvss": {
221221
"attackVector": "Network",
@@ -248,7 +248,7 @@
248248
],
249249
"highestVulnerability": {
250250
"id": "CVE-2023-2974",
251-
"title": "quarkus-core vulnerable to client driven TLS cipher downgrading",
251+
"title": "A vulnerability was found in quarkus-core. This vulnerability occurs because the TLS protocol configured with quarkus.http.ssl.protocols is not enforced, and the client can force the selection of the weaker supported TLS protocol.",
252252
"source": "osv-nvd",
253253
"cvss": {
254254
"attackVector": "Network",
@@ -284,7 +284,7 @@
284284
"issues": [
285285
{
286286
"id": "CVE-2022-42003",
287-
"title": "Uncontrolled Resource Consumption in Jackson-databind",
287+
"title": "In FasterXML jackson-databind 2.4.0-rc1 until 2.12.7.1 and in 2.13.x before 2.13.4.2 resource exhaustion can occur because of a lack of a check in primitive value deserializers to avoid deep wrapper array nesting, when the UNWRAP_SINGLE_VALUE_ARRAYS feature is enabled. This was patched in 2.12.7.1, 2.13.4.2, and 2.14.0.",
288288
"source": "osv-nvd",
289289
"cvss": {
290290
"attackVector": "Network",
@@ -372,7 +372,7 @@
372372
],
373373
"highestVulnerability": {
374374
"id": "CVE-2022-42003",
375-
"title": "Uncontrolled Resource Consumption in Jackson-databind",
375+
"title": "In FasterXML jackson-databind 2.4.0-rc1 until 2.12.7.1 and in 2.13.x before 2.13.4.2 resource exhaustion can occur because of a lack of a check in primitive value deserializers to avoid deep wrapper array nesting, when the UNWRAP_SINGLE_VALUE_ARRAYS feature is enabled. This was patched in 2.12.7.1, 2.13.4.2, and 2.14.0.",
376376
"source": "osv-nvd",
377377
"cvss": {
378378
"attackVector": "Network",
@@ -403,7 +403,7 @@
403403
"recommendation": "pkg:maven/io.quarkus/[email protected]?repository_url=https%3A%2F%2Fmaven.repository.redhat.com%2Fga%2F&type=jar",
404404
"highestVulnerability": {
405405
"id": "CVE-2023-2974",
406-
"title": "quarkus-core vulnerable to client driven TLS cipher downgrading",
406+
"title": "A vulnerability was found in quarkus-core. This vulnerability occurs because the TLS protocol configured with quarkus.http.ssl.protocols is not enforced, and the client can force the selection of the weaker supported TLS protocol.",
407407
"source": "osv-nvd",
408408
"cvss": {
409409
"attackVector": "Network",

src/test/resources/__files/reports/v3/report_all_token.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
"issues": [
181181
{
182182
"id": "CVE-2023-2974",
183-
"title": "quarkus-core vulnerable to client driven TLS cipher downgrading",
183+
"title": "A vulnerability was found in quarkus-core. This vulnerability occurs because the TLS protocol configured with quarkus.http.ssl.protocols is not enforced, and the client can force the selection of the weaker supported TLS protocol.",
184184
"source": "osv-nvd",
185185
"cvss": {
186186
"attackVector": "Network",
@@ -210,7 +210,7 @@
210210
},
211211
"highestVulnerability": {
212212
"id": "CVE-2023-2974",
213-
"title": "quarkus-core vulnerable to client driven TLS cipher downgrading",
213+
"title": "A vulnerability was found in quarkus-core. This vulnerability occurs because the TLS protocol configured with quarkus.http.ssl.protocols is not enforced, and the client can force the selection of the weaker supported TLS protocol.",
214214
"source": "osv-nvd",
215215
"cvss": {
216216
"attackVector": "Network",
@@ -236,7 +236,7 @@
236236
"issues": [
237237
{
238238
"id": "CVE-2022-42003",
239-
"title": "Uncontrolled Resource Consumption in Jackson-databind",
239+
"title": "In FasterXML jackson-databind 2.4.0-rc1 until 2.12.7.1 and in 2.13.x before 2.13.4.2 resource exhaustion can occur because of a lack of a check in primitive value deserializers to avoid deep wrapper array nesting, when the UNWRAP_SINGLE_VALUE_ARRAYS feature is enabled. This was patched in 2.12.7.1, 2.13.4.2, and 2.14.0.",
240240
"source": "osv-nvd",
241241
"cvss": {
242242
"attackVector": "Network",
@@ -308,7 +308,7 @@
308308
},
309309
"highestVulnerability": {
310310
"id": "CVE-2022-42003",
311-
"title": "Uncontrolled Resource Consumption in Jackson-databind",
311+
"title": "In FasterXML jackson-databind 2.4.0-rc1 until 2.12.7.1 and in 2.13.x before 2.13.4.2 resource exhaustion can occur because of a lack of a check in primitive value deserializers to avoid deep wrapper array nesting, when the UNWRAP_SINGLE_VALUE_ARRAYS feature is enabled. This was patched in 2.12.7.1, 2.13.4.2, and 2.14.0.",
312312
"source": "osv-nvd",
313313
"cvss": {
314314
"attackVector": "Network",
@@ -333,7 +333,7 @@
333333
"recommendation": "pkg:maven/io.quarkus/[email protected]?repository_url=https%3A%2F%2Fmaven.repository.redhat.com%2Fga%2F&type=jar",
334334
"highestVulnerability": {
335335
"id": "CVE-2023-2974",
336-
"title": "quarkus-core vulnerable to client driven TLS cipher downgrading",
336+
"title": "A vulnerability was found in quarkus-core. This vulnerability occurs because the TLS protocol configured with quarkus.http.ssl.protocols is not enforced, and the client can force the selection of the weaker supported TLS protocol.",
337337
"source": "osv-nvd",
338338
"cvss": {
339339
"attackVector": "Network",

ui/src/components/VulnerabilityRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { usePrivateIssueHelper } from "../hooks/usePrivateDataHelper";
88
import { hasRemediations, VulnerabilityItem } from "../api/report";
99
import { useAppContext } from '../App';
1010
import { VulnerabilityIdLink } from './VulnerabilityIdLink';
11+
import { VulnerabilityTitle } from './VulnerabilityTitle';
1112

1213
interface VulnerabilityRowProps {
1314
item: VulnerabilityItem;
@@ -42,7 +43,7 @@ export const VulnerabilityRow: React.FC<VulnerabilityRowProps> = ({item, provide
4243
<p key={index}><VulnerabilityIdLink id={id}/></p>
4344
))}
4445
</Td>
45-
<Td>{item.vulnerability.title}</Td>
46+
<Td><VulnerabilityTitle title={item.vulnerability.title}/></Td>
4647
<Td noPadding>
4748
<VulnerabilitySeverityLabel vulnerability={item.vulnerability}/>
4849
</Td>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Button, Truncate } from '@patternfly/react-core';
2+
import React from 'react';
3+
4+
export const VulnerabilityTitle = ({ title }: { title: string }) => {
5+
6+
const [isExpanded, setIsExpanded] = React.useState(false);
7+
8+
if(title.length < 100) {
9+
return <p>{title}</p>;
10+
}
11+
if(isExpanded) {
12+
return (
13+
<>
14+
<p>{title}</p>
15+
<Button variant='link' isInline onClick={() => setIsExpanded(!isExpanded)}>Show less</Button>
16+
</>
17+
)
18+
}
19+
return (
20+
<>
21+
<Truncate content={title}/>
22+
<Button variant='link' isInline onClick={() => setIsExpanded(!isExpanded)}>Show more</Button>
23+
</>
24+
);
25+
};

0 commit comments

Comments
 (0)