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

RSC-1772: Vulnerability Indicator and Vulnerability Indicator Legend #1199

Open
wants to merge 83 commits into
base: FEATURE_VULNERABILITY_COMPONENTS
Choose a base branch
from

Conversation

expect(vulnerabilityIndicator).toBeInTheDocument();
});

it('takes precedence of severityLevel if both props are provided', async function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something's wrong if this is passing; the prop is called severityRating

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed tests for NxVulnerabilityIndicator here: 3be4a99

});

it('sets the accessible name based on the severity level', async function() {
const el = quickRender({ score: '9.0', severityLevel: 'low' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

level -> rating

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in: bcf6d2d

return tooltip.textContent;
};

describe('when vulnerabilityScore prop is provided', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fewer tests of values in the middle of each range, more tests of values at the edges of each range.

});
});

describe('when vulnerabilitySeverityLevel prop is provided', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rating.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in: bcf6d2d

@use '../../scss-shared/nx-dark-mode-helpers';

.nx-vulnerability-indicator-legend {
$max-grid-columns: 6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be 5 now

Comment on lines 30 to 40
const {
critical,
high,
medium,
low,
none,
vertical,
header,
className,
...attrs
} = props;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in: 39456a8

$-vertical-alignment: -0.1em;

.nx-vulnerability-indicator {
font-size: var(--nx-font-size-s);
Copy link
Contributor

@rpokorny rpokorny Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visible shape of this fontawesome icon doesn't take up the full height of its <svg> box: the <svg> is 14px tall but the visible square is only 12.5px tall whereas it's supposed to be 14px. As it happens, this can be fixed by using the regular 16px font size, causing the visible square to come out to the desired 14px. And then, since the "font size" of the icon is the same as that of the adjacent text, we don't have to use a custom vertical-align.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants