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

@W-15714251: Show badges on product tile #1791

Merged
merged 22 commits into from
May 22, 2024

Conversation

unandyala
Copy link
Collaborator

@unandyala unandyala commented May 16, 2024

Description

Enhance product tile to show product badges.

  • Badges are shown based on the product custom properties. Default/out-of-the-box badges that are available are New and Sale which are based on the custom properties c_isSale and c_isNew

  • Users can also pass other boolean custom properties to display as badges. For example we can add a new custom property isCloseout and pass it as a badgeLabels to the ProductTile component. (Example: <ProductTile badgeLabels={[{label: 'Closeout', color: 'red'}]} )

  • BadgeGroup (it is a group because more than one badge can be displayed) is built as a separate component. It includes all the required data as properties (including product). The intention is that it makes it easy for users to override/extend the implementation

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

Render badges on product tile based on the product custom attributes

How to Test-Drive This PR

  • Checkout code and run npm run start
  • Search for "striped", you should see some of the tiles rendered with badge "SALE" & "NEW"

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@unandyala unandyala changed the base branch from develop to v3/product-tile-revamp May 16, 2024 15:00
@unandyala unandyala marked this pull request as ready for review May 20, 2024 21:59
@unandyala unandyala requested a review from a team as a code owner May 20, 2024 21:59
@unandyala unandyala merged commit e4287d4 into v3/product-tile-revamp May 22, 2024
28 checks passed
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.

6 participants