Skip to content

Commit

Permalink
(#3289) This PR adds a product wrapper class by repurposing the exist…
Browse files Browse the repository at this point in the history
…ing product-info class and migrating product-update specific logic out of the VariantSelects class. A product wrapper enables children to more trivially perform global updates by providing a heirarchical "namespace"--i.e. child publishes event, parent captures and declaratively updates other children VS child updates siblings. By extracting the VariantSelects onChange logic to use this pattern, VariantSelects is able to be a single-purpose class, it is easier to understand why siblings are updated, and we were able to eliminate some really gross logic that handled variant change updates differently depending on the wrapping context.

Refetch entire page on product swap

Remove unused unsubscriber function

Stability improvements for quick-add modal

PR feedback - fixed padding + minor tweaks

Un-privatize class methods for consistency with the rest of Dawn

Move css to be in section-main-product.css
  • Loading branch information
lhoffbeck committed May 28, 2024
1 parent aa4353a commit cfaa10c
Show file tree
Hide file tree
Showing 13 changed files with 427 additions and 431 deletions.
2 changes: 1 addition & 1 deletion assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,7 @@ input[type='checkbox'] {
position: relative;
}

product-info .loading__spinner:not(.hidden) ~ *,
.product__info-container .loading__spinner:not(.hidden) ~ *,
.quantity__rules-cart .loading__spinner:not(.hidden) ~ * {
visibility: hidden;
}
Expand Down
1 change: 1 addition & 0 deletions assets/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const ON_CHANGE_DEBOUNCE_TIMER = 300;
const PUB_SUB_EVENTS = {
cartUpdate: 'cart-update',
quantityUpdate: 'quantity-update',
variantChangeStart: 'variant-change-start',
variantChange: 'variant-change',
cartError: 'cart-error',
sectionRefreshed: 'section-refreshed',
Expand Down
Loading

0 comments on commit cfaa10c

Please sign in to comment.