-
Notifications
You must be signed in to change notification settings - Fork 397
feat(checkout): CHECKOUT-000 Add spans for product-title, product-item-quantity, product-option-label, and product-option-value #1701
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,9 @@ export interface OrderSummaryItemProps { | |
|
|
||
| export interface OrderSummaryItemOption { | ||
| testId: string; | ||
| content: ReactNode; | ||
| content?: ReactNode; | ||
| optionLabel?: ReactNode; | ||
| optionValue?: ReactNode; | ||
| } | ||
|
|
||
| const OrderSummaryItem: FunctionComponent<OrderSummaryItemProps> = ({ | ||
|
|
@@ -37,7 +39,8 @@ const OrderSummaryItem: FunctionComponent<OrderSummaryItemProps> = ({ | |
| className="product-title optimizedCheckout-contentPrimary" | ||
| data-test="cart-item-product-title" | ||
| > | ||
| {`${quantity} x ${name}`} | ||
| <span className="product-item-quantity">{quantity}</span> | ||
| <span className="product-item-name">{name}</span> | ||
| </h4> | ||
| {productOptions && productOptions.length > 0 && ( | ||
| <ul | ||
|
|
@@ -46,7 +49,8 @@ const OrderSummaryItem: FunctionComponent<OrderSummaryItemProps> = ({ | |
| > | ||
| {productOptions.map((option, index) => ( | ||
| <li className="product-option" data-test={option.testId} key={index}> | ||
| {option.content} | ||
| <span className="product-option-label">{option.optionLabel}</span> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a check here for content, just in case for customisations? Something like
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| <span className="product-option-value">{option.optionValue}</span> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
|
|
||
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.
Do we need to change this?
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.
Technically no. But the community elaborated, and mentioned that it's the same improvement and would be nice to be able to target qty and name separately as well. Enabling dev's to style those individually with CSS without the need to introduce JS to do so