-
Notifications
You must be signed in to change notification settings - Fork 30
feat(severity): Convert Battery to Severity Component #365
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
Conversation
1a48783 to
e355442
Compare
|
@andrew-ronaldson Can you review the styling. I'm not sure it's correct. I put an extra small space between the icon and the label. Thanks. |
9f225a9 to
3b0bd24
Compare
...ges/module/patternfly-docs/content/extensions/component-groups/examples/Severity/Severity.md
Show resolved
Hide resolved
...rnfly-docs/content/extensions/component-groups/examples/Severity/SeverityCriticalExample.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably focus more on cypress tests than RTL ones, can you please add them?
I tried to put some draft together:
import React from 'react';
import Severity, { SeverityType } from '../../packages/module/dist/dynamic/Severity';
const severities = [
{ type: SeverityType.critical, label: 'Critical severity', ouiaId: 'Severity-critical' },
{ type: SeverityType.important, label: 'Important severity', ouiaId: 'Severity-important' },
{ type: SeverityType.moderate, label: 'Moderate severity', ouiaId: 'Severity-moderate' },
{ type: SeverityType.minor, label: 'Minor severity', ouiaId: 'Severity-minor' },
{ type: SeverityType.none, label: 'No severity', ouiaId: 'Severity-none' },
{ type: SeverityType.undefined, label: 'Undefined severity', ouiaId: 'Severity-undefined' }
];
describe('Severity', () => {
severities.map(({ type, label, ouiaId }) => {
it(`renders Severity with ${type} severity`, () => {
cy.mount(<Severity severity={type} label={label} ouiaId={ouiaId} />);
cy.get(`[data-ouia-component-id="${ouiaId}"]`).should('exist');
cy.get(`[data-ouia-component-id="${ouiaId}"]`).should('have.attr', 'title', label);
cy.get('span').contains(label);
});
});
});
87a6f71 to
eb1ba5d
Compare
|
There is a docs change here to update the table to severity info insteead of battery levels. This link shows the classes for each severity color token. Some are showing up as the default icon color |
|
@dlabaj Everything is looking pretty good. Just a few things, if you could please update the color tokens to match their respective severity level. undefined severity = --pf-t--global--icon--color--severity--undefined--default
The introduction description body text still says battery, that'll need swapped to say severity as well. Example: "The severity component generates a severity, which corresponds to a level low, medium, high or critical. Each level corresponds with a severity level and respective color:" The body text below will also need update to this:" To specify the severity of the severity risk level, you can pass a predefined enum or text value into the severity property that corresponds to the appropriate severity level" |
andrew-ronaldson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates! looks grand!
9180af9 to
fcf5dd9
Compare
fix: Updated to migrate Battery component to Severity component.
fcf5dd9 to
f3b4f36
Compare
| <React.Fragment> | ||
| <Flex spaceItems={{ default: 'spaceItemsSm' }}> | ||
| <FlexItem> | ||
| {/* eslint-disable-next-line react/no-unknown-property */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed?
fhlavac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
fix: Updated to migrate Battery component to Severity component.


Closes issue #222 by converting the battery component to the new severity compoent.