@salesforce/retail-react-app 1.1.0-dev.2 → 1.1.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,18 @@
1
+ ## v1.1.0-preview.0
2
+
3
+ - Fix price display when a discounted price is zero [#1361](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1361)
4
+ - Fix price adjustments of a line item when more than one is present [#1362](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1362)
5
+
1
6
  ## v1.1.0-dev (June 15, 2023)
7
+
8
+ - Registered user checkout should set order with an email [#1363](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1363)
9
+
2
10
  ## v1.0.0 (June 15, 2023)
3
11
 
4
- - First public release of package on npm under `@salesforce/retail-react-app`
5
- - Upgrade React v18, React DOM v18, React-hook-form v7, and Chakra 2 libraries [#1166](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1166)
6
- - Add app `above-header` and product-list `above-page-header` convenience components [#1183](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1183)
7
- - Migration to "hooks" / `@salesforce/commerce-sdk-react` integration follow the [upgrade guide](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-to-v3.html) and [view the diff](https://github.com/SalesforceCommerceCloud/pwa-kit/compare/release-2.7.x...release-3.0.x?diff=unified#files_bucket)
12
+ - First public release of package on npm under `@salesforce/retail-react-app`
13
+ - Upgrade React v18, React DOM v18, React-hook-form v7, and Chakra 2 libraries [#1166](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1166)
14
+ - Add app `above-header` and product-list `above-page-header` convenience components [#1183](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1183)
15
+ - Migration to "hooks" / `@salesforce/commerce-sdk-react` integration follow the [upgrade guide](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-to-v3.html) and [view the diff](https://github.com/SalesforceCommerceCloud/pwa-kit/compare/release-2.7.x...release-3.0.x?diff=unified#files_bucket)
8
16
 
9
17
  ## Older Versions Without Namespace
10
18
 
@@ -12,168 +20,168 @@ The older versions below were published without the `@salesforce` namespace.
12
20
 
13
21
  ## v2.7.1 (May 11, 2023)
14
22
 
15
- - Replace invalid row value with nowrap [#1179](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1179)
16
- - Add a redirect to login page after user signs out from checkout page [#1172](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1172)
17
- - PWA Kit should have a mechanism for replacing the access token when a SFRA login state is changed [#1171](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1171)
18
- - Added session bridge call to login for phased launch [#1159](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1159)
19
- - Fix Page Designer ImageWithText Link component [#1092](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1092)
20
- - Remove site alias and locale from location.state.directedFrom path [#1065)](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1065)
21
- - Product list refinements [#957](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/957)
22
- - Prevent modal to open when it fails to add an item to cart [#1053](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1053)
23
- - Make `mergeBasket` conditional more robust [#1048](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1048)
24
- - Fix addresses not having preferred address first. [#1051](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1051)
25
- - Changed type of the phone number field to bring up numberic keyboard on mobile devices - W-9871940 [#1016)](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1016)
23
+ - Replace invalid row value with nowrap [#1179](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1179)
24
+ - Add a redirect to login page after user signs out from checkout page [#1172](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1172)
25
+ - PWA Kit should have a mechanism for replacing the access token when a SFRA login state is changed [#1171](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1171)
26
+ - Added session bridge call to login for phased launch [#1159](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1159)
27
+ - Fix Page Designer ImageWithText Link component [#1092](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1092)
28
+ - Remove site alias and locale from location.state.directedFrom path [#1065)](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1065)
29
+ - Product list refinements [#957](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/957)
30
+ - Prevent modal to open when it fails to add an item to cart [#1053](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1053)
31
+ - Make `mergeBasket` conditional more robust [#1048](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1048)
32
+ - Fix addresses not having preferred address first. [#1051](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1051)
33
+ - Changed type of the phone number field to bring up numberic keyboard on mobile devices - W-9871940 [#1016)](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1016)
26
34
 
27
35
  ## v2.7.0 (Mar 03, 2023)
28
36
 
29
- - Add Page Designer ImageTile component [#967](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/967)
30
- - Add Page Designer ImageWithText component [#991](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/991)
31
- - Add Page Designer carousel component [#977](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/977)
32
- - Add Page Designer layout components [#993](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/993)
33
- - Support the product-set type [#1019](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1019)
37
+ - Add Page Designer ImageTile component [#967](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/967)
38
+ - Add Page Designer ImageWithText component [#991](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/991)
39
+ - Add Page Designer carousel component [#977](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/977)
40
+ - Add Page Designer layout components [#993](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/993)
41
+ - Support the product-set type [#1019](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1019)
34
42
 
35
43
  ## v2.6.0 (Jan 25, 2023)
36
44
 
37
- - Mega menu fixes [#875](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/875) and [#910](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/910)
38
- - Cache SLAS callback using request processor [#884](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/884)
39
- - Fix padding of footer drawer component [#899](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/899)
40
- - Update createOrder to send SLAS USID [#920](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/920)
41
- - Fix PropTypes [#924](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/924)
42
- - Remove unnecessary map statement [#929](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/929)
45
+ - Mega menu fixes [#875](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/875) and [#910](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/910)
46
+ - Cache SLAS callback using request processor [#884](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/884)
47
+ - Fix padding of footer drawer component [#899](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/899)
48
+ - Update createOrder to send SLAS USID [#920](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/920)
49
+ - Fix PropTypes [#924](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/924)
50
+ - Remove unnecessary map statement [#929](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/929)
43
51
 
44
52
  ## v2.5.0 (Jan 5, 2023)
45
53
 
46
- - Add instanceType to Einstein activity body [#858](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/858)
47
- - Do not use a proxy to call Einstein [#857](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/857)
48
- - Einstein handle variants [#867](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/867)
49
- - Fix cc exp year [#874](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/874)
54
+ - Add instanceType to Einstein activity body [#858](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/858)
55
+ - Do not use a proxy to call Einstein [#857](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/857)
56
+ - Einstein handle variants [#867](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/867)
57
+ - Fix cc exp year [#874](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/874)
50
58
 
51
59
  ## v2.4.0 (Dec 1, 2022)
52
60
 
53
- - Dynamic footer Copyright date [#741](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/741)
54
- - Footer copyright: remove the remaining hardcoded year [#760](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/760)
55
- - ImageGallery uses image.link when DIS is not set [#786](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/786)
56
- - Use default locale as target if none is specified [#788](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/788)
57
- - Password change bug fix [#803](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/803)
58
- - pwa-kit-dev command for tailing logs [#789](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/789)
59
- - Update usages of zzrf-001 ODS instance to the new short URL format [#816](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/816)
61
+ - Dynamic footer Copyright date [#741](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/741)
62
+ - Footer copyright: remove the remaining hardcoded year [#760](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/760)
63
+ - ImageGallery uses image.link when DIS is not set [#786](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/786)
64
+ - Use default locale as target if none is specified [#788](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/788)
65
+ - Password change bug fix [#803](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/803)
66
+ - pwa-kit-dev command for tailing logs [#789](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/789)
67
+ - Update usages of zzrf-001 ODS instance to the new short URL format [#816](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/816)
60
68
 
61
69
  ## v2.3.0 (Oct 27, 2022)
62
70
 
63
- - Fix locale `alias` by including `locale` object inside the MultiSite Context. [#716](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/716)
64
- - Updated translations. [#725](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/725)
65
- - Add new Einstein API activities. [#714](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/714)
66
- - Fix search field to recognize `“&”` character. [#736](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/736)
67
- - Fix filters on search results page. [#742](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/742)
68
- - Dynamic footer copyright date. [#741](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/741)
69
- - Bugfix: image gallery thumbnails not working without DIS [#786](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/786)
70
- - Ensure that a valid target locale is use if none is provided [#788](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/788)
71
+ - Fix locale `alias` by including `locale` object inside the MultiSite Context. [#716](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/716)
72
+ - Updated translations. [#725](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/725)
73
+ - Add new Einstein API activities. [#714](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/714)
74
+ - Fix search field to recognize `“&”` character. [#736](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/736)
75
+ - Fix filters on search results page. [#742](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/742)
76
+ - Dynamic footer copyright date. [#741](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/741)
77
+ - Bugfix: image gallery thumbnails not working without DIS [#786](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/786)
78
+ - Ensure that a valid target locale is use if none is provided [#788](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/788)
71
79
 
72
80
  ## v2.2.0 (Aug 25, 2022)
73
81
 
74
- - Update zzrf-001 url [#694](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/694)
75
- - Optimize Server-side performance [#667](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/667)
76
- - Remove references to session bridging [#684](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/684)
82
+ - Update zzrf-001 url [#694](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/694)
83
+ - Optimize Server-side performance [#667](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/667)
84
+ - Remove references to session bridging [#684](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/684)
77
85
 
78
86
  ## v2.1.0 (Jul 05, 2022)
79
87
 
80
- - Update translations [#643](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/643)
81
- - Update translations [#653](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/653)
82
- - Add bundlesize test back into CI [#652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/652)
83
- - Fix UI bug on notifications badge [#620](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/620)
88
+ - Update translations [#643](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/643)
89
+ - Update translations [#653](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/653)
90
+ - Add bundlesize test back into CI [#652](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/652)
91
+ - Fix UI bug on notifications badge [#620](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/620)
84
92
 
85
93
  ## v2.0.0 (May 16, 2022)
86
94
 
87
- - Update translation docs [#570](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/570)
88
- - Fixed loading correct amount of skeletons [#576] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/576)
89
- - Remove manifest path [#582](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/582)
90
- - Fix Verbose ShellJS Command [#588](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/588)
91
- - Drop node 12 support for [#589](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/589)
92
- - Multi-site, Fix the case when no site aliases is set [#551](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/551)
93
- - Fix invalid refresh token [#528](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/528)
94
- - Add valid token check before using refresh token on login [#533](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/533)
95
- - Fix localization scripts to output to the correct default locale [#539](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/539)
96
- - Merge guest cart and registered cart [#540](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/540)
97
- - Move retail react app jest setup out from pwa-kit-dev [#545](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/545)
98
- - Remove legacy remote proxy, which allowed remote environments to use proxy configs in package.json [#425](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/425)
99
- - Rename 'pwa' directory into 'template-retail-react-app' [#485](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/485)
100
- - Optimize visibility-off.svg [#512](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/512)
101
- - Support Multi-site implementation using dynamic config [#469](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/469)
102
- - Service worker loading for dev server [#464](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/464)
103
- - Environment Specific Configuration Support [#477](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/447)
95
+ - Update translation docs [#570](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/570)
96
+ - Fixed loading correct amount of skeletons [#576] (<https://github.com/SalesforceCommerceCloud/pwa-kit/pull/576>)
97
+ - Remove manifest path [#582](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/582)
98
+ - Fix Verbose ShellJS Command [#588](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/588)
99
+ - Drop node 12 support for [#589](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/589)
100
+ - Multi-site, Fix the case when no site aliases is set [#551](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/551)
101
+ - Fix invalid refresh token [#528](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/528)
102
+ - Add valid token check before using refresh token on login [#533](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/533)
103
+ - Fix localization scripts to output to the correct default locale [#539](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/539)
104
+ - Merge guest cart and registered cart [#540](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/540)
105
+ - Move retail react app jest setup out from pwa-kit-dev [#545](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/545)
106
+ - Remove legacy remote proxy, which allowed remote environments to use proxy configs in package.json [#425](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/425)
107
+ - Rename 'pwa' directory into 'template-retail-react-app' [#485](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/485)
108
+ - Optimize visibility-off.svg [#512](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/512)
109
+ - Support Multi-site implementation using dynamic config [#469](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/469)
110
+ - Service worker loading for dev server [#464](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/464)
111
+ - Environment Specific Configuration Support [#477](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/447)
104
112
 
105
113
  ## v1.5.0 (Mar 17, 2022)
106
114
 
107
- - Support storing authentication tokens in cookie [#429](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/429)
108
- - Make sure the forgot-password modal also shows up in the checkout flow [#373](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/373)
109
- - On Windows, the locale selector dropdown in the footer now showing all of the options properly [#381](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/381)
110
- - Import cross-fetch to make OCAPI client isomorphic [#382](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/382)
111
- - Multi-site implementation for Retail React App [#391](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/391)
115
+ - Support storing authentication tokens in cookie [#429](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/429)
116
+ - Make sure the forgot-password modal also shows up in the checkout flow [#373](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/373)
117
+ - On Windows, the locale selector dropdown in the footer now showing all of the options properly [#381](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/381)
118
+ - Import cross-fetch to make OCAPI client isomorphic [#382](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/382)
119
+ - Multi-site implementation for Retail React App [#391](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/391)
112
120
 
113
121
  ## v1.4.0 (Jan 27, 2022)
114
122
 
115
- - Do not send HSTS header during local development [#288](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/288)
116
- - Add constants for `<meta>` tags `theme-color` and `apple-mobile-web-app-title` [#287](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/287)
117
- - Upgrade to React 17 [#278](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/278)
118
- - Import preliminary translations [#324](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/324)
119
- - Remove old dependencies that are no longer used [#317](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/317)
123
+ - Do not send HSTS header during local development [#288](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/288)
124
+ - Add constants for `<meta>` tags `theme-color` and `apple-mobile-web-app-title` [#287](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/287)
125
+ - Upgrade to React 17 [#278](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/278)
126
+ - Import preliminary translations [#324](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/324)
127
+ - Remove old dependencies that are no longer used [#317](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/317)
120
128
 
121
129
  ## v1.3.0 (Jan 06, 2022)
122
130
 
123
- - Remove Einstein from home page [#208](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/208)
124
- - Add git2gus config to allow git2gus integration [210](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/210)
125
- - Set common HTTP security headers [#263](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/263)
126
- - Add message ids to all the translated text, so they provide context for the translators [#239](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/239) [#207](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/207) [#195](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/195)
127
- - Minor translation fixes [260](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/260) [#252](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/252)
128
- - Provide Url Customization for the Retail React App [#228](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/228/files)
129
- - Add an image component to allow for easier-implementation of responsive images [#186](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/186)
130
- - Add shop Products section with products from the Catalog [#216](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/216)
131
- - Remove `upgrade-insecure-requests` for local development [#270](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/270)
132
- - Fix the missing out-of-stock message on mobile screens [#231](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/231)
133
- - Fix order summary prices on the check out page misaligned on mobile [#233](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/233)
134
- - Skip irrelevant jobs on CI on forked PR [#237](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/237) [#240](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/240)
135
- - Add webpack plugin [#255](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/255)
136
- - Combine config files [#256](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/256)
137
- - Improve unsupported locale error message [#225](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/225)
138
- - Add github template [#226](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/226)
139
- - Fix shipping method description overflows the price section [#232](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/232)
140
- - Fix show applied promotion codes case sensitive issue [#224](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/224)
141
- - Fix section subtitle incorrect prop warning [#282](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/282)
131
+ - Remove Einstein from home page [#208](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/208)
132
+ - Add git2gus config to allow git2gus integration [210](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/210)
133
+ - Set common HTTP security headers [#263](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/263)
134
+ - Add message ids to all the translated text, so they provide context for the translators [#239](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/239) [#207](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/207) [#195](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/195)
135
+ - Minor translation fixes [260](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/260) [#252](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/252)
136
+ - Provide Url Customization for the Retail React App [#228](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/228/files)
137
+ - Add an image component to allow for easier-implementation of responsive images [#186](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/186)
138
+ - Add shop Products section with products from the Catalog [#216](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/216)
139
+ - Remove `upgrade-insecure-requests` for local development [#270](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/270)
140
+ - Fix the missing out-of-stock message on mobile screens [#231](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/231)
141
+ - Fix order summary prices on the check out page misaligned on mobile [#233](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/233)
142
+ - Skip irrelevant jobs on CI on forked PR [#237](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/237) [#240](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/240)
143
+ - Add webpack plugin [#255](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/255)
144
+ - Combine config files [#256](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/256)
145
+ - Improve unsupported locale error message [#225](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/225)
146
+ - Add github template [#226](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/226)
147
+ - Fix shipping method description overflows the price section [#232](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/232)
148
+ - Fix show applied promotion codes case sensitive issue [#224](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/224)
149
+ - Fix section subtitle incorrect prop warning [#282](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/282)
142
150
 
143
151
  ## v1.2.0 (Nov 18, 2021)
144
152
 
145
- - Simplify homepage for Retail React App [#201](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/201)
146
- - Ensure `cookieId` value is sent always for Einstein recommendations [#179](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/179)
147
- - Remove `x-powered-by` HTTP response header [#165](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/165)
148
- - For search engine crawlers, add `hreflang` links to the current page's html [#137](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/137)
149
- - Use the preferred currency when switching locales. [#105](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/105)
150
- - Integrate wishlist with einstein recommended products. [#131](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/131)
151
- - When adding a new locale, minimize configuring the locale selector UI by having a list of commonly-used locales [#175](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/175)
152
- - Enable adding wishlist item to the cart. [#158](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/158)
153
- - Rename CartItemVariant to ItemVariantProvider [#155](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/155)
154
- - Enabling pseudo locale now affects only the loading of the translation messages. The rest of the app still knows about English and the other locales. [#177](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/177)
155
- - Allow individual Commerce API calls to pass in a different locale/currency and override the global value. [#177](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/177)
156
- - Fix regression with loading the correct translation file [#193](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/193)
157
- - Upgrade `chakra-ui/react` to `^1.7.1` version. [#204](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/204)
158
- - Rename the `extract-messages` and `compile-messages` commands to `extract-default-translations` and `compile-translations` [#160](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/160)
159
- - Enable favourite icons on product tiles for guest users [#173](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/173)
160
- - Fix Missing Locale Param for Commerce API Calls [#174](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/174)
161
- - Add cache control header to product details page [#172](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/172)
162
- - Clear SLAS tokens when OID is changed [#178](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/178)
153
+ - Simplify homepage for Retail React App [#201](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/201)
154
+ - Ensure `cookieId` value is sent always for Einstein recommendations [#179](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/179)
155
+ - Remove `x-powered-by` HTTP response header [#165](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/165)
156
+ - For search engine crawlers, add `hreflang` links to the current page's html [#137](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/137)
157
+ - Use the preferred currency when switching locales. [#105](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/105)
158
+ - Integrate wishlist with einstein recommended products. [#131](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/131)
159
+ - When adding a new locale, minimize configuring the locale selector UI by having a list of commonly-used locales [#175](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/175)
160
+ - Enable adding wishlist item to the cart. [#158](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/158)
161
+ - Rename CartItemVariant to ItemVariantProvider [#155](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/155)
162
+ - Enabling pseudo locale now affects only the loading of the translation messages. The rest of the app still knows about English and the other locales. [#177](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/177)
163
+ - Allow individual Commerce API calls to pass in a different locale/currency and override the global value. [#177](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/177)
164
+ - Fix regression with loading the correct translation file [#193](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/193)
165
+ - Upgrade `chakra-ui/react` to `^1.7.1` version. [#204](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/204)
166
+ - Rename the `extract-messages` and `compile-messages` commands to `extract-default-translations` and `compile-translations` [#160](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/160)
167
+ - Enable favourite icons on product tiles for guest users [#173](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/173)
168
+ - Fix Missing Locale Param for Commerce API Calls [#174](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/174)
169
+ - Add cache control header to product details page [#172](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/172)
170
+ - Clear SLAS tokens when OID is changed [#178](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/178)
163
171
 
164
172
  ## v1.1.0 (Sep 27, 2021)
165
173
 
166
- - Fix wishlist bugs and provide better hooks for wishlist features. [#64](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/64)
167
- - Lazy load Popover component. [#134](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/134)
168
- - Fix pseudo local command to use `en-XB`. [#101](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/101)
169
- - Ensure generated projects ship with a working .gitignore file. [#95](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/95)
170
- - Remove eslint rule which check for Salesforce copyright. [#104](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/104)
171
- - Improve error page design. [#74](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/74)
172
- - Localize cart and checkout messages. [#106](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/106)
173
- - Add default cache control header to home page. [#103](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/103)
174
- - Security - `inquirer` package upgrade. [#121](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/121)
175
- - New quantity picker. [#102](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/102)
174
+ - Fix wishlist bugs and provide better hooks for wishlist features. [#64](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/64)
175
+ - Lazy load Popover component. [#134](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/134)
176
+ - Fix pseudo local command to use `en-XB`. [#101](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/101)
177
+ - Ensure generated projects ship with a working .gitignore file. [#95](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/95)
178
+ - Remove eslint rule which check for Salesforce copyright. [#104](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/104)
179
+ - Improve error page design. [#74](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/74)
180
+ - Localize cart and checkout messages. [#106](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/106)
181
+ - Add default cache control header to home page. [#103](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/103)
182
+ - Security - `inquirer` package upgrade. [#121](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/121)
183
+ - New quantity picker. [#102](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/102)
176
184
 
177
185
  ## v1.0.0 (Sep 08, 2021)
178
186
 
179
- - PWA Kit General Availability and open source. 🎉
187
+ - PWA Kit General Availability and open source. 🎉
@@ -50,6 +50,7 @@ import {AuthModal, useAuthModal} from '@salesforce/retail-react-app/app/hooks/us
50
50
  import {AddToCartModalProvider} from '@salesforce/retail-react-app/app/hooks/use-add-to-cart-modal'
51
51
  import useMultiSite from '@salesforce/retail-react-app/app/hooks/use-multi-site'
52
52
  import {useCurrentCustomer} from '@salesforce/retail-react-app/app/hooks/use-current-customer'
53
+ import {useCurrentBasket} from '@salesforce/retail-react-app/app/hooks/use-current-basket'
53
54
 
54
55
  // Localization
55
56
  import {IntlProvider} from 'react-intl'
@@ -87,7 +88,7 @@ const useLazyLoadCategories = () => {
87
88
  parameters: {id: CAT_MENU_DEFAULT_ROOT_CATEGORY, levels: CAT_MENU_DEFAULT_NAV_SSR_DEPTH}
88
89
  })
89
90
 
90
- const ids = levelZeroCategoriesQuery.data?.[itemsKey].map((category) => category.id)
91
+ const ids = levelZeroCategoriesQuery.data?.[itemsKey]?.map((category) => category.id)
91
92
  const queries = useCategoryBulk(ids, {
92
93
  enabled: onClient && ids?.length > 0
93
94
  })
@@ -177,8 +178,11 @@ const App = (props) => {
177
178
  {parameters: {customerId: customer.customerId}},
178
179
  {enabled: !!customer.customerId && !isServer}
179
180
  )
181
+ const {data: basket} = useCurrentBasket()
182
+
180
183
  const createBasket = useShopperBasketsMutation('createBasket')
181
184
  const updateBasket = useShopperBasketsMutation('updateBasket')
185
+ const updateCustomerForBasket = useShopperBasketsMutation('updateCustomerForBasket')
182
186
 
183
187
  useEffect(() => {
184
188
  // Create a new basket if the current customer doesn't have one.
@@ -187,14 +191,34 @@ const App = (props) => {
187
191
  body: {}
188
192
  })
189
193
  }
194
+ }, [baskets])
195
+
196
+ useEffect(() => {
190
197
  // update the basket currency if it doesn't match the current locale currency
191
- if (baskets?.baskets?.[0]?.currency && baskets.baskets[0].currency !== currency) {
198
+ if (basket?.currency && basket?.currency !== currency) {
192
199
  updateBasket.mutate({
193
- parameters: {basketId: baskets.baskets[0].basketId},
200
+ parameters: {basketId: basket.basketId},
194
201
  body: {currency}
195
202
  })
196
203
  }
197
- }, [baskets])
204
+ }, [basket?.currency])
205
+
206
+ useEffect(() => {
207
+ // update the basket customer email
208
+ if (
209
+ basket &&
210
+ customer?.isRegistered &&
211
+ customer?.email &&
212
+ customer?.email !== basket?.customerInfo?.email
213
+ ) {
214
+ updateCustomerForBasket.mutate({
215
+ parameters: {basketId: basket.basketId},
216
+ body: {
217
+ email: customer.email
218
+ }
219
+ })
220
+ }
221
+ }, [customer?.isRegistered, customer?.email, basket?.customerInfo?.email])
198
222
 
199
223
  useEffect(() => {
200
224
  // Listen for online status changes.
@@ -5,8 +5,9 @@
5
5
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
6
  */
7
7
  import React from 'react'
8
- import {screen} from '@testing-library/react'
8
+ import {screen, waitFor} from '@testing-library/react'
9
9
  import {Helmet} from 'react-helmet'
10
+ import {rest} from 'msw'
10
11
 
11
12
  import App from '@salesforce/retail-react-app/app/components/_app/index.jsx'
12
13
  import {renderWithProviders} from '@salesforce/retail-react-app/app/utils/test-utils'
@@ -14,7 +15,9 @@ import {DEFAULT_LOCALE} from '@salesforce/retail-react-app/app/utils/test-utils'
14
15
  import useMultiSite from '@salesforce/retail-react-app/app/hooks/use-multi-site'
15
16
  import messages from '@salesforce/retail-react-app/app/static/translations/compiled/en-GB.json'
16
17
  import mockConfig from '@salesforce/retail-react-app/config/mocks/default'
18
+
17
19
  jest.mock('../../hooks/use-multi-site', () => jest.fn())
20
+
18
21
  let windowSpy
19
22
  beforeAll(() => {
20
23
  jest.spyOn(console, 'log').mockImplementation(jest.fn())
@@ -60,7 +63,6 @@ describe('App', () => {
60
63
  <p>Any children here</p>
61
64
  </App>
62
65
  )
63
- screen.debug()
64
66
  expect(screen.getByRole('main')).toBeInTheDocument()
65
67
  expect(screen.getByText('Any children here')).toBeInTheDocument()
66
68
  })
@@ -82,4 +84,63 @@ describe('App', () => {
82
84
  expect(hreflangLinks.some((link) => hasGeneralLocale(link))).toBe(true)
83
85
  expect(hreflangLinks.some((link) => link.hrefLang === 'x-default')).toBe(true)
84
86
  })
87
+
88
+ test('App component updates the basket with correct currency and customer email', async () => {
89
+ const customerEmail = 'email@test.com'
90
+
91
+ // Test basket. _app will be manipulating this basket's currency and customerInfo.email for this test
92
+ const basket = {
93
+ basketId: 'basket_id',
94
+ currency: 'CAD',
95
+ customerInfo: {
96
+ customerId: 'customer_id',
97
+ email: ''
98
+ }
99
+ }
100
+
101
+ jest.mock('../../hooks/use-current-customer', () => {
102
+ return {
103
+ useCurrentCustomer: jest.fn().mockImplementation(() => {
104
+ return {data: basket, derivedData: {hasBasket: true, totalItems: 0}}
105
+ })
106
+ }
107
+ })
108
+
109
+ jest.mock('../../hooks/use-current-basket', () => {
110
+ return {
111
+ useCurrentBasket: jest.fn().mockImplementation(() => {
112
+ return {
113
+ data: basket,
114
+ derivedData: {
115
+ hasBasket: true,
116
+ totalItems: 0
117
+ }
118
+ }
119
+ })
120
+ }
121
+ })
122
+
123
+ global.server.use(
124
+ // mock updating basket currency
125
+ rest.patch('*/baskets/:basketId', (req, res, ctx) => {
126
+ basket.currency = 'GBP'
127
+ return res(ctx.json(basket))
128
+ }),
129
+ // mock adding guest email to basket
130
+ rest.put('*/baskets/:basketId/customer', (req, res, ctx) => {
131
+ basket.customerInfo.email = customerEmail
132
+ return res(ctx.json(basket))
133
+ })
134
+ )
135
+
136
+ useMultiSite.mockImplementation(() => resultUseMultiSite)
137
+ renderWithProviders(
138
+ <App targetLocale={DEFAULT_LOCALE} defaultLocale={DEFAULT_LOCALE} messages={messages} />
139
+ )
140
+
141
+ await waitFor(() => {
142
+ expect(basket.currency).toBe('GBP')
143
+ expect(basket.customerInfo.email).toBe(customerEmail)
144
+ })
145
+ })
85
146
  })
@@ -80,7 +80,10 @@ const ItemAttributes = ({includeQuantity, currency, ...props}) => {
80
80
  <FormattedNumber
81
81
  style="currency"
82
82
  currency={currency || basket?.currency || activeCurrency}
83
- value={variant.priceAdjustments[0].price}
83
+ value={variant.priceAdjustments.reduce(
84
+ (acc, adj) => acc + (adj.price ?? 0),
85
+ 0
86
+ )}
84
87
  />
85
88
  </Text>
86
89
  </Text>
@@ -50,7 +50,8 @@ const ItemPrice = ({currency, align = 'right', baseDirection = 'column', ...prop
50
50
  const {price, basePrice, priceAfterItemDiscount} = variant
51
51
  const isProductASet = variant?.type?.set
52
52
 
53
- const displayPrice = priceAfterItemDiscount ? Math.min(price, priceAfterItemDiscount) : price
53
+ const displayPrice =
54
+ typeof priceAfterItemDiscount === 'number' ? Math.min(price, priceAfterItemDiscount) : price
54
55
 
55
56
  const hasDiscount = displayPrice !== price
56
57
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/retail-react-app",
3
- "version": "1.1.0-dev.2",
3
+ "version": "1.1.0-preview.0",
4
4
  "license": "See license in LICENSE",
5
5
  "author": "cc-pwa-kit@salesforce.com",
6
6
  "ccExtensibility": {
@@ -45,10 +45,10 @@
45
45
  "@lhci/cli": "^0.11.0",
46
46
  "@loadable/component": "^5.15.3",
47
47
  "@peculiar/webcrypto": "^1.4.2",
48
- "@salesforce/commerce-sdk-react": "1.1.0-dev.2",
49
- "@salesforce/pwa-kit-dev": "3.1.0-preview.3",
50
- "@salesforce/pwa-kit-react-sdk": "3.1.0-preview.3",
51
- "@salesforce/pwa-kit-runtime": "3.1.0-preview.3",
48
+ "@salesforce/commerce-sdk-react": "1.0.1-preview.0",
49
+ "@salesforce/pwa-kit-dev": "3.1.0-preview.4",
50
+ "@salesforce/pwa-kit-react-sdk": "3.1.0-preview.4",
51
+ "@salesforce/pwa-kit-runtime": "3.1.0-preview.4",
52
52
  "@tanstack/react-query": "^4.28.0",
53
53
  "@tanstack/react-query-devtools": "^4.29.1",
54
54
  "@testing-library/dom": "^9.0.1",
@@ -103,5 +103,5 @@
103
103
  "overrides": {
104
104
  "nwsapi": "2.2.2"
105
105
  },
106
- "gitHead": "3840c85ad3a5526ff6a54eb0bf65327d3aa72797"
106
+ "gitHead": "8ef8310dabf77dfdc50b76fbe2464f771c6a69c0"
107
107
  }