Skip to content

Conversation

@fhlavac
Copy link
Contributor

@fhlavac fhlavac commented May 6, 2024

finishing #125
closes #94

RHCLOUD-30295

  • added OpenShift Status component
  • fixed CloseButton ID in the docs

image

@patternfly-build
Copy link

patternfly-build commented May 6, 2024

@fhlavac fhlavac marked this pull request as ready for review May 27, 2024 20:50
<Flex title={label} alignItems={{ default: 'alignItemsCenter' }} {...props}>
{ icon && (
<FlexItem className={classes.icon}>
{React.cloneElement(icon, { className: clsx('pf-v5-u-mr-md', icon?.props?.className), title: label, 'data-ouia-component-id': `${ouiaId}-icon` })}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend that the icon be wrapped in a PF Icon component and use the status prop on that component to control color rather than hardcoding a color in the passed icon.

{ !iconOnly && (
<FlexItem>
<Text ouiaId={`${ouiaId}-label`} className={classes.statusLabel}>{label}</Text>
<Text component={TextVariants.small} ouiaId={`${ouiaId}-description`} className={classes.statusDescription}>{description}</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

This should only be rendered if there is a description to display.

<Flex title={label} alignItems={{ default: 'alignItemsCenter' }} {...props}>
{ icon && (
<FlexItem className={classes.icon}>
{React.cloneElement(icon, { className: clsx('pf-v5-u-mr-md', icon?.props?.className), title: label, 'data-ouia-component-id': `${ouiaId}-icon` })}
Copy link
Contributor

Choose a reason for hiding this comment

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

By reusing the label as the icon's title, it causes the screen reader to repeat itself when it reads the icon and then reads the label.

And since the label is marked as optional, when people don't want to display a label, they may leave it blank and leave the icon with no title - thus leaving it inaccessible. I wonder if the icon's title should be an additional field which defaults to the value of the status passed to the Icon component? and the status should be a required field.

Then it should be overridden and given a more descriptive title when using the iconOnly prop. Maybe we could print a message in the console if someone uses iconOnly and then doesn't provide a descriptive Icon title.

@fhlavac
Copy link
Contributor Author

fhlavac commented May 28, 2024

@nicolethoen thank you for reviewing and great comments! All should be addressed now

@fhlavac fhlavac requested a review from nicolethoen May 29, 2024 20:25
Copy link
Contributor

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

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

This LGTM 👍🏻

@fhlavac fhlavac merged commit 68c6bca into patternfly:main Jun 4, 2024
@fhlavac fhlavac deleted the status branch June 4, 2024 04:35
@github-actions
Copy link

github-actions bot commented Jun 4, 2024

🎉 This PR is included in version 5.3.0-prerelease.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

nicolethoen pushed a commit to fhlavac/react-component-groups that referenced this pull request Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Status

4 participants