Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CVSS popover): Fix misalignment of CVSS popover #2185

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ exports[`CVEDetailsPageSidebar component should render correctly 1`] = `
<div
class="pf-v5-c-content"
>
<div
style="display: contents;"
<span
class="vuln-label "
style="font-size: medium; display: block;"
>
<span
class="vuln-label pf-v5-u-mb-xs pointer"
style="font-size: medium; display: block;"
CVSS 3.0 base score
<div
style="display: contents;"
>
CVSS 3.0 base score
<span
class="pf-v5-c-icon"
>
Expand All @@ -163,11 +163,12 @@ exports[`CVEDetailsPageSidebar component should render correctly 1`] = `
>
<svg
aria-hidden="true"
class="pf-v5-svg pf-v5-u-ml-xs"
class="pf-v5-svg pf-v5-u-ml-xs pointer"
color="var(--pf-v5-global--secondary-color--100)"
fill="currentColor"
height="1em"
role="img"
style="vertical-align: -2px;"
viewBox="0 0 512 512"
width="1em"
>
Expand All @@ -177,8 +178,8 @@ exports[`CVEDetailsPageSidebar component should render correctly 1`] = `
</svg>
</span>
</span>
</span>
</div>
</div>
</span>
<span
class="pf-v5-u-mr-md"
>
Expand Down
70 changes: 39 additions & 31 deletions src/Components/PresentationalComponents/CvssVector/CvssVector.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,42 +43,50 @@ const CvssVector = ({ cvss2_metrics: CVSS2Vector, cvss3_metrics: CVSS3Vector, sc
<CVEPageContext.Consumer>
{context => (
<TextContent>
<Popover
id="popover-cvss"
position="bottom"
maxWidth="100%"
enableFlip
headerContent={`${cvssVer} ${intl.formatMessage(messages.cvssVectorPopoverTitle)}`}
bodyContent={
<WithLoader isLoading={context.isLoading} colSize={2} rowSize={8} variant={LoaderType.compactTable}>
{cvssVector ?
(<Table
aria-label="Metric breakdown"
variant={TableVariant.compact}
gridBreakPoint=""
cells={
[intl.formatMessage(messages.cvssVectorMetric),
intl.formatMessage(messages.cvssVectorValue)]
}
rows={Object.entries(parsedVector)}
>
<TableHeader />
<TableBody />
</Table>
) : (notAvailable)}
</WithLoader>
}
>
<Label isLarge className="pf-v5-u-mb-xs pointer">
{cvssVer} {intl.formatMessage(messages.cvssVectorVectorString)}
<Label isLarge>
{cvssVer} {intl.formatMessage(messages.cvssVectorVectorString)}
<Popover
id="popover-cvss"
position="bottom"
maxWidth="100%"
enableFlip
headerContent={`${cvssVer} ${intl.formatMessage(messages.cvssVectorPopoverTitle)}`}
bodyContent={
<WithLoader
isLoading={context.isLoading}
colSize={2}
rowSize={8}
variant={LoaderType.compactTable}
>
{cvssVector ?
(<Table
aria-label="Metric breakdown"
variant={TableVariant.compact}
gridBreakPoint=""
cells={
[
intl.formatMessage(messages.cvssVectorMetric),
intl.formatMessage(messages.cvssVectorValue)
]
}
rows={Object.entries(parsedVector)}
>
<TableHeader />
<TableBody />
</Table>
) : (notAvailable)}
</WithLoader>
}
>
<Icon>
<OutlinedQuestionCircleIcon
color="var(--pf-v5-global--secondary-color--100)"
className="pf-v5-u-ml-xs"
className="pf-v5-u-ml-xs pointer"
style={{ verticalAlign: -2 }}
/>
</Icon>
</Label>
</Popover>
</Popover>
</Label>

<WithLoader isLoading={context.isLoading} style={{ width: '320px' }}>
<span className="pf-v5-u-mr-md">{score}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,14 @@ exports[`CVE details: Should render match snapshot 1`] = `
<div
class="pf-v5-c-content"
>
<div
style="display: contents;"
<span
class="vuln-label "
style="font-size: medium; display: block;"
>
<span
class="vuln-label pf-v5-u-mb-xs pointer"
style="font-size: medium; display: block;"
CVSS 3.0 base score
<div
style="display: contents;"
>
CVSS 3.0 base score
<span
class="pf-v5-c-icon"
>
Expand All @@ -358,11 +358,12 @@ exports[`CVE details: Should render match snapshot 1`] = `
>
<svg
aria-hidden="true"
class="pf-v5-svg pf-v5-u-ml-xs"
class="pf-v5-svg pf-v5-u-ml-xs pointer"
color="var(--pf-v5-global--secondary-color--100)"
fill="currentColor"
height="1em"
role="img"
style="vertical-align: -2px;"
viewBox="0 0 512 512"
width="1em"
>
Expand All @@ -372,8 +373,8 @@ exports[`CVE details: Should render match snapshot 1`] = `
</svg>
</span>
</span>
</span>
</div>
</div>
</span>
<span
class="pf-v5-u-mr-md"
>
Expand Down
Loading