-
Notifications
You must be signed in to change notification settings - Fork 203
[NO-JIRA][BpkRating] Fixed the issue where some BpkRating attributes were required #3885
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
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.
Pull Request Overview
This PR fixes an issue with the BpkRating component where two props (ratingScale
and size
) were incorrectly marked as required when they should be optional. The component provides default values for these props, so they don't need to be required in the TypeScript interface.
- Makes
ratingScale
andsize
props optional in the TypeScript interface - Removes redundant
defaultProps
object from tests since defaults are now handled in the component implementation - Simplifies test setup by removing the spread of unnecessary default props
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/bpk-component-rating/src/BpkRating.tsx | Updates Props type to make ratingScale and size optional |
packages/bpk-component-rating/src/BpkRating-test.tsx | Removes defaultProps object and cleans up test props |
Visit https://backpack.github.io/storybook-prs/3885 to see this build running in a browser. |
showScale?: boolean, | ||
size: ValueOf<typeof RATING_SIZES>, | ||
size?: ValueOf<typeof RATING_SIZES>, |
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.
Only two required props. 🙂
https://backpack.github.io/storybook/iframe.html?args=&id=bpk-component-rating--documentation&viewMode=docs
- Mistaken required prop in [KOA-4594] Add ratingScale prop to rating component #2184
- Missed it in [Clov-406][BpkRating] Improve BpkRating component to allow its subtitle text truncation in edge cases #3872 😞
Visit https://backpack.github.io/storybook-prs/3885 to see this build running in a browser. |
The BpkRating only has two required props. However, the previous changes(#2184 and #3872) made two props required by mistake. This PR is to fix this issue.

Props explanation: https://backpack.github.io/storybook/iframe.html?args=&id=bpk-component-rating--documentation&viewMode=docs
Remember to include the following changes:
[Clover-123][BpkButton] Updating the colour
README.md
(If you have created a new component)README.md