Skip to content

Commit 3c12ab5

Browse files
sf-shikhar-prasoonsf-cboscencovcua-mobifysf-xingquan-jinsf-emmyzhang
authored
Merge Choice of Bonus Product feature branch into develop (#3292)
* Manual bonus products port from v4 * @W-19265242@ Configurable base paths for /mobify routes (PWA Kit 3.12 version) (#2892) (#3173) * Initial restore of base path PR * Rename path functions * Update commerce-sdk-react callbacks and slas private proxy endpoint * Big update * Replace getAppOrigin calls with useAppOrigin * WIP - Filter the base path from all incoming requests to the server * Remove base path from proxied requests + cleanup * Use functions for proxy pathRewrite * A bit of PR cleanup * Lint cleanup * More cleanup * Fix tests * Fix issues found by CI * Lint for override asset * Turn off slas private proxy * Cleanup comments * Update changelog entries * Fix config * Limit base path removal to /mobify or express route * Adjust express filter * Lint * Fix dependency in generated apps * Comment cleanup * use envBasePath as a feature toggle for enabling the base path middleware * Enable basepath removal middlware to handle express routes defined as regexes * Apply suggestions * Adjust app config template * Use pathToRegexp rather than having manual regex interpretation * escape the base path to not allow regex * refactor * Remove ?* from callback url * Handle ? characters in express route * Cache express regexes * Handle properly formatted ()? express groups * Comment cleanup * Apply suggestions to reduce use of regex * Add base path to social login redirectUri * Lint * Update comments and test * Update test with more realistic scenario * Remove path-to-regexp * Refine convertExpressRouteToRegex further * Move express route to regex logic to separate file * Adjust logger and lock file * Revert package-lock changes --------- Signed-off-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> * fix quality issue * remove accidental bug.patch file * address review comments and add tests * lint fixes * @W-19398239 Bonus Product Selection grid changes (#3255) * remove counter on modal. add tests * update 3 modals' appearnance to match * add wishlist toggle icon, add NEW/SALE tag * add more tests * Return to the bonus selection modal if there are more available bonus products * Added tests, fixed linting errors * fix error page and add toast message * More fixes for linting errors * labels * revert last commit * add default message in js code and en-XA * test * Fixed the cart page rendering bonus products outside of the qualifying product tile * Hide the select bonus procuct tile when the qualifying product does not have bonus products * fix modal position, add header title, back to seletion on close * translation * fix intial load error * keep close button unchanged and add a new back to selection button, and tests * add scroll and tests (#3273) * @W-19398462 Fix Cart Page appearance (#3279) * add scroll and tests * cart page appearance * fix quality issue and reuse exsting cancel label * @ W-19398462 Bug- combine line items (#3282) * merge lineItems, add qtys * add tests * refactor tests. use template * @W-19605924 Fit and Finish Bonus Products Pt.1 : Change "Back to Selection" button acc. to feedback from UX (#3291) * change backToSele btn acc to UX feedback * fix todos. fix lint * fix mobile view * fix button groups blocks content( add to cart / cancel) * fix buttons should not need scrolling * fix pdp modal mobile view --------- Co-authored-by: sf-xingquan-jin <xingquan.jin@salesforce.com> * fix via bonusDiscountLineItemId, add+update tests * bug fix- bulk remove bonus items + tests + fade & disable (#3305) * update changelog (#3308) * @W-19627517 Fit & Finish `feature/manual-bonus-products-v3` branch (#3309) * changes from npm run lint:fix * fix all tests * fix bug. qty selector on pdp * sentencecase modal heading: on doc suggestion * left align name & price on BonusProductItem * add back, wishlist and NEW/SALE tag: BonusProductItem component * fix tests * fix lint * remove background blur & fix findAvailableBonusDiscountLineItemIds * remove horizontal rule for last bonus product:cart page * @W-19649287 Fix Bundle Size Limit, Fix (unrelated) TFs (#3314) * increase bundle size limit * fix TFs due to changes from develop * @W-19649287 refactor and improve code quality (`feature/manual-bonus-products-v3` branch) (#3315) * refactored bonus-product-utils.js * implement modal reducer. use-bonus-product-selection-modal.js was too large (675 lines) * update bundle size limit * group bonus-product utils in a folder * restructure util files. all small size. theme for every file * T/cc sharks/w 19670468/mobile view back to selection/main (#3323) * move back btn, only for mobile * add tests * Enable add to wishlist for bonus products on the cart page. * @W-19679519 bug fix: Wrong variant image in bonus product selection modal (#3326) * fix image shown in selection modal, add tests * update bundle size limit * address comments from #3292 (#3332) * ignore tests failing due to import resolution issues in test environment * fix lint and tests --------- Signed-off-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: cboscenco <cboscenco@salesforce.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: sf-xingquan-jin <xingquan.jin@salesforce.com> Co-authored-by: emmyzhang <emmyzhang@salesforce.com>
1 parent 886166d commit 3c12ab5

File tree

62 files changed

+8094
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+8094
-150
lines changed

packages/template-retail-react-app/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Added warning modal for guest users when toggling between multi ship and ship to one address. [3280] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3280) [3302] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3302)
55
- Enhanced the shopping assistant that integrates Salesforce Embedded Messaging Service with PWA Kit applications, adding comprehensive context support, localization capabilities, and improved user experience features. [#3259](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3259)
66
- [Breaking] Removed domainUrl, locale, basetId properties as part off the ShopperAgent during initialization. [#3259](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3259)
7+
- Added support for Choice of Bonus Products feature. Users can now select from available bonus products when they qualify for the associated promotion. The bonus product selection flow can be entered from either the "Item Added to Cart" modal (when adding the qualifying product to the cart) or from the cart page. [#3292] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3292)
78

89
## v8.0.0 (Sep 04, 2025)
910
- Add support for environment level base paths on /mobify routes [#2892](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2892)
@@ -34,7 +35,7 @@
3435
- Support saving default shipping address on user registration from order confirmation [#2706](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2706)
3536
- Minor updates to support BOPIS E2E tests [#2716](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2716)
3637
- Provide conditional support for partial hydration (feature flag `PARTIAL_HYDRATION_ENABLED`) [#2696](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2696) [#2846](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2846)
37-
- Show Automatic Bonus Products on Cart Page [#2704](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2704) [#2760](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2760) [#2815](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2815)
38+
- Show Automatic Bonus Products on Cart Page [#2704](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2704) [#2760](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2760) [#2815](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2815)
3839
- [Breaking] Support Standard Products [2697](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2697)
3940
- Introduce store locator [#2542](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2542)
4041
- Fix passwordless race conditions in form submission [#2758](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2758)

packages/template-retail-react-app/app/components/_app/index.jsx

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import {
5858
useDntNotification
5959
} from '@salesforce/retail-react-app/app/hooks/use-dnt-notification'
6060
import {AddToCartModalProvider} from '@salesforce/retail-react-app/app/hooks/use-add-to-cart-modal'
61+
import {BonusProductSelectionModalProvider} from '@salesforce/retail-react-app/app/hooks/use-bonus-product-selection-modal'
6162
import useMultiSite from '@salesforce/retail-react-app/app/hooks/use-multi-site'
6263
import {useCurrentCustomer} from '@salesforce/retail-react-app/app/hooks/use-current-customer'
6364
import {useCurrentBasket} from '@salesforce/retail-react-app/app/hooks/use-current-basket'
@@ -430,34 +431,36 @@ const App = (props) => {
430431
</Island>
431432
{!isOnline && <OfflineBanner />}
432433
<AddToCartModalProvider>
433-
<SkipNavContent
434-
style={{
435-
display: 'flex',
436-
flexDirection: 'column',
437-
flex: 1,
438-
outline: 0
439-
}}
440-
>
441-
<Box
442-
as="main"
443-
id="app-main"
444-
role="main"
445-
display="flex"
446-
flexDirection="column"
447-
flex="1"
434+
<BonusProductSelectionModalProvider>
435+
<SkipNavContent
436+
style={{
437+
display: 'flex',
438+
flexDirection: 'column',
439+
flex: 1,
440+
outline: 0
441+
}}
448442
>
449-
<OfflineBoundary isOnline={false}>
450-
{children}
451-
</OfflineBoundary>
452-
</Box>
453-
</SkipNavContent>
454-
455-
<Island hydrateOn={'visible'}>
456-
{!isCheckout ? <Footer /> : <CheckoutFooter />}
457-
</Island>
458-
459-
<AuthModal {...authModal} />
460-
<DntNotification {...dntNotification} />
443+
<Box
444+
as="main"
445+
id="app-main"
446+
role="main"
447+
display="flex"
448+
flexDirection="column"
449+
flex="1"
450+
>
451+
<OfflineBoundary isOnline={false}>
452+
{children}
453+
</OfflineBoundary>
454+
</Box>
455+
</SkipNavContent>
456+
457+
<Island hydrateOn={'visible'}>
458+
{!isCheckout ? <Footer /> : <CheckoutFooter />}
459+
</Island>
460+
461+
<AuthModal {...authModal} />
462+
<DntNotification {...dntNotification} />
463+
</BonusProductSelectionModalProvider>
461464
</AddToCartModalProvider>
462465
</Box>
463466
</CurrencyProvider>

0 commit comments

Comments
 (0)