Skip to content

Commit fd55e8e

Browse files
authored
Merge pull request #613 from reactioncommerce/release-v2.9.0
release v2.9.0
2 parents 0651bc2 + 751f701 commit fd55e8e

File tree

26 files changed

+96
-106
lines changed

26 files changed

+96
-106
lines changed

.circleci/config.yml

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,14 @@ version: 2
1010
# typing. See http://yaml.org/type/merge.html for details.
1111
defaults: &defaults
1212
environment:
13-
CI_SCRIPTS: 'npx --quiet --package @reactioncommerce/[email protected]'
14-
DOCKER_REPOSITORY: "reactioncommerce/example-storefront"
15-
DOCKER_NAMESPACE: "reactioncommerce"
16-
DOCKER_NAME: "example-storefront"
17-
GLOBAL_CACHE_VERSION: "v3"
18-
KUSTOMIZE_VERSION: "3.2.1"
19-
HUB_VERSION: "2.12.8"
20-
GH_USERNAME: "rc-circleci"
21-
GH_EMAIL: "[email protected]"
22-
REACTION_GITOPS_REVIEWERS: "griggheo"
13+
- CI_SCRIPTS: "npx --quiet --package @reactioncommerce/[email protected]"
14+
- DOCKER_REPOSITORY: "reactioncommerce/example-storefront"
15+
- DOCKER_NAME: "example-storefront"
16+
- GLOBAL_CACHE_VERSION: “v3”
17+
- SERVICE: "reaction-storefront"
18+
- REACTION_GITOPS_REVIEWERS: "wistonk,griggheo"
2319
docker:
24-
- image: circleci/node:12.11.1-stretch
20+
- image: circleci/node:12-stretch
2521

2622
jobs:
2723
install-dependencies:
@@ -94,35 +90,7 @@ jobs:
9490
- run:
9591
name: Clone reaction-gitops repo and create PR
9692
command: |
97-
# Download kustomize
98-
cd /tmp
99-
wget https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_kustomize.v${KUSTOMIZE_VERSION}_linux_amd64
100-
sudo mv kustomize_kustomize.v${KUSTOMIZE_VERSION}_linux_amd64 /usr/local/bin/kustomize
101-
sudo chmod +x /usr/local/bin/kustomize
102-
# Download hub
103-
wget https://github.com/github/hub/releases/download/v${HUB_VERSION}/hub-linux-amd64-${HUB_VERSION}.tgz
104-
tar xfz hub-linux-amd64-${HUB_VERSION}.tgz
105-
sudo mv hub-linux-amd64-${HUB_VERSION}/bin/hub /usr/local/bin/hub
106-
sudo chmod +x /usr/local/bin/hub
107-
# Clone reaction-gitops repo and configure username and email for signing off commits
108-
export GITHUB_TOKEN="${REACTION_GITOPS_GH_TOKEN}"
109-
/usr/local/bin/hub clone https://${GITHUB_TOKEN}@github.com/reactioncommerce/reaction-gitops.git
110-
cd reaction-gitops
111-
/usr/local/bin/hub config user.name "${GH_USERNAME}"
112-
/usr/local/bin/hub config user.email "${GH_EMAIL}"
113-
cd kustomize/reaction-storefront/overlays/staging
114-
# Create new branch
115-
/usr/local/bin/hub checkout -b update-image-reaction-storefront-${CIRCLE_SHA1}
116-
# Modify image tag in kustomization.yaml by calling 'kustomize edit set image'
117-
/usr/local/bin/kustomize edit set image docker.io/${DOCKER_REPOSITORY}:${CIRCLE_SHA1}
118-
/usr/local/bin/hub add kustomization.yaml
119-
# Commit with sign-off
120-
/usr/local/bin/hub commit -s -m "changed reaction-storefront image tag to ${CIRCLE_SHA1}"
121-
# Push branch to origin
122-
/usr/local/bin/hub push --set-upstream origin update-image-reaction-storefront-${CIRCLE_SHA1}
123-
# Create PR
124-
/usr/local/bin/hub pull-request --no-edit -r ${REACTION_GITOPS_REVIEWERS}
125-
93+
${CI_SCRIPTS} automate-gitops-pull-request
12694
workflows:
12795
version: 2
12896
build_and_test:
@@ -144,6 +112,7 @@ workflows:
144112
- eslint
145113
- test-unit
146114
- create-gitops-pull-request:
115+
context: reaction-gitops
147116
requires:
148117
- docker-build-push
149118
filters:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v2.9.0
2+
3+
Example Storefront v2.9.0 is a minor update to keep this project in sync with [Reaction v2.9.0](https://github.com/reactioncommerce/reaction) and [reaction-hydra v2.9.0](https://github.com/reactioncommerce/reaction-hydra)
4+
15
# v2.8.1
26

37
Example Storefront v2.8.1 is a patch update to keep this project in sync with [Reaction v2.8.1](https://github.com/reactioncommerce/reaction) and [reaction-hydra v2.8.1](https://github.com/reactioncommerce/reaction-hydra)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "example-storefront",
3-
"version": "2.8.1",
3+
"version": "2.9.0",
44
"description": "The Example Storefront serves as a reference for implementing a web based storefront using the Reaction Commerce GraphQL API.",
55
"main": "./src/server.js",
66
"keywords": [],

src/components/CartPopover/CartPopover.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ class CartPopover extends Component {
9090
*/
9191
value: PropTypes.string
9292
})),
93-
/**
94-
* Current stock quantity of item
95-
*/
96-
currentQuantity: PropTypes.number,
9793
/**
9894
* Image url of chosen item
9995
*/

src/components/CartPopover/CartPopover.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const cartItem = {
1616
value: "Summer"
1717
}
1818
],
19-
currentQuantity: 10,
2019
imageUrl: "//placehold.it/100",
2120
isLowInventoryQuantity: false,
2221
price: {

src/components/CheckoutSummary/CheckoutSummary.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ const testCart = {
2828
compareAtPrice: {
2929
displayAmount: "$45.00"
3030
},
31-
currentQuantity: 3,
3231
imageURLs: {
3332
small: "//placehold.it/150",
3433
thumbnail: "//placehold.it/100"
3534
},
35+
currentQuantity: 3,
3636
isLowQuantity: true,
3737
price: {
3838
displayAmount: "$20.00"
@@ -48,11 +48,11 @@ const testCart = {
4848
{ label: "Color", value: "Black" },
4949
{ label: "Size", value: "10" }
5050
],
51-
currentQuantity: 500,
5251
imageURLs: {
5352
small: "//placehold.it/150",
5453
thumbnail: "//placehold.it/100"
5554
},
55+
currentQuantity: 30,
5656
isLowQuantity: false,
5757
price: {
5858
displayAmount: "$78.00"

src/components/MediaGallery/MediaGallery.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import MediaGallery from "./MediaGallery";
44

55
const mediaItems = [
66
{
7-
toGrid: 1,
87
priority: 0,
98
productId: "cmVhY3Rpb24vcHJvZHVjdDpCQ1RNWjZIVHhGU3BwSkVTaw==",
109
variantId: "cmVhY3Rpb24vcHJvZHVjdDo2cWlxUHdCa2VKZHRkUWM0Rw==",
@@ -17,7 +16,6 @@ const mediaItems = [
1716
}
1817
},
1918
{
20-
toGrid: 1,
2119
priority: 0,
2220
productId: "cmVhY3Rpb24vcHJvZHVjdDpCQ1RNWjZIVHhGU3BwSkVTaw==",
2321
variantId: "cmVhY3Rpb24vcHJvZHVjdDo2cWlxUHdCa2VKZHRkUWM0Rw==",

src/components/MediaGalleryItem/MediaGalleryItem.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import renderer from "react-test-renderer";
33
import MediaGalleryItem from "./MediaGalleryItem";
44

55
const media = {
6-
toGrid: 1,
76
priority: 0,
87
productId: "cmVhY3Rpb24vcHJvZHVjdDpCQ1RNWjZIVHhGU3BwSkVTaw==",
98
variantId: "cmVhY3Rpb24vcHJvZHVjdDo2cWlxUHdCa2VKZHRkUWM0Rw==",

src/components/OrderCard/OrderCard.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ const order = {
3333
compareAtPrice: {
3434
displayAmount: "$45.00"
3535
},
36-
currentQuantity: 3,
3736
imageURLs: {
3837
small: "//placehold.it/150",
3938
thumbnail: "//placehold.it/100"
4039
},
40+
inventoryAvailableToSell: 3,
4141
isLowQuantity: true,
4242
price: {
4343
displayAmount: "$20.00"
@@ -50,11 +50,11 @@ const order = {
5050
{
5151
_id: "456",
5252
attributes: [{ label: "Color", value: "Black" }, { label: "Size", value: "10" }],
53-
currentQuantity: 500,
5453
imageURLs: {
5554
small: "//placehold.it/150",
5655
thumbnail: "//placehold.it/100"
5756
},
57+
inventoryAvailableToSell: 30,
5858
isLowQuantity: false,
5959
price: {
6060
displayAmount: "$78.00"

src/components/OrderCardFulfillmentGroup/OrderCardFulfillmentGroup.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,19 @@ class OrderCardFulfillmentGroup extends Component {
7070
const { classes, fulfillmentGroup } = this.props;
7171

7272
if (fulfillmentGroup && Array.isArray(fulfillmentGroup.items.nodes)) {
73+
const items = fulfillmentGroup.items.nodes.map((item) => ({
74+
...item,
75+
// Backwards compatibility until all component library components are updated
76+
// to accept `inventoryAvailableToSell`.
77+
currentQuantity: item.currentQuantity || item.inventoryAvailableToSell
78+
}));
79+
7380
return (
7481
<Grid className={classes.fulfillmentGroupDetails} item xs={12} md={12}>
7582
<CartItems
7683
isMiniCart
7784
isReadOnly
78-
items={fulfillmentGroup.items.nodes}
85+
items={items}
7986
/>
8087
</Grid>
8188
);

0 commit comments

Comments
 (0)