From e62426047160226b34f285ac9f82dba3257761f8 Mon Sep 17 00:00:00 2001 From: Andy Terranova <13182778+supernova-at@users.noreply.github.com> Date: Wed, 24 Apr 2019 22:15:44 -0500 Subject: [PATCH 1/2] Passes email, firstname, and lastname to checkout receipt properly (#1153) * Passes email, firstname, and lastname to checkout receipt properly * Reverts change that sourced info from shipping_address. * Now gets first name, last name, and email from billing_address * billing_address still gets this info from shipping_address. Will be addressed in 1154. --- .../src/actions/checkout/__tests__/asyncActions.spec.js | 8 +++----- .../venia-concept/src/actions/checkout/asyncActions.js | 8 ++++---- packages/venia-concept/src/selectors/cart.js | 8 -------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/packages/venia-concept/src/actions/checkout/__tests__/asyncActions.spec.js b/packages/venia-concept/src/actions/checkout/__tests__/asyncActions.spec.js index afdfd88c91..492a1100da 100644 --- a/packages/venia-concept/src/actions/checkout/__tests__/asyncActions.spec.js +++ b/packages/venia-concept/src/actions/checkout/__tests__/asyncActions.spec.js @@ -518,7 +518,7 @@ describe('submitOrder', () => { 2, checkoutReceiptActions.setOrderInformation({ id: response, - billing_address: address + billing_address: expect.any(Object) }) ); expect(dispatch).toHaveBeenNthCalledWith( @@ -547,9 +547,7 @@ describe('submitOrder', () => { user: { isSignedIn: false } }; - getState - .mockImplementationOnce(() => mockState) - .mockImplementationOnce(() => mockState); + getState.mockImplementationOnce(() => mockState); mockGetItem .mockImplementationOnce( @@ -569,7 +567,7 @@ describe('submitOrder', () => { 2, checkoutReceiptActions.setOrderInformation({ id: response, - billing_address: address + billing_address: expect.any(Object) }) ); expect(dispatch).toHaveBeenNthCalledWith( diff --git a/packages/venia-concept/src/actions/checkout/asyncActions.js b/packages/venia-concept/src/actions/checkout/asyncActions.js index be064fdd9d..84980720e0 100644 --- a/packages/venia-concept/src/actions/checkout/asyncActions.js +++ b/packages/venia-concept/src/actions/checkout/asyncActions.js @@ -3,7 +3,6 @@ import { RestApi, Util } from '@magento/peregrine'; import { closeDrawer } from 'src/actions/app'; import { clearCartId, createCart } from 'src/actions/cart'; import { getCountries } from 'src/actions/directory'; -import { getOrderInformation } from 'src/selectors/cart'; import { getAccountInformation } from 'src/selectors/checkoutReceipt'; import checkoutReceiptActions from 'src/actions/checkoutReceipt'; import actions from './actions'; @@ -254,9 +253,10 @@ export const submitOrder = () => }); dispatch( - checkoutReceiptActions.setOrderInformation( - getOrderInformation(getState(), response) - ) + checkoutReceiptActions.setOrderInformation({ + id: response, + billing_address + }) ); // Clear out everything we've saved about this cart from local storage. diff --git a/packages/venia-concept/src/selectors/cart.js b/packages/venia-concept/src/selectors/cart.js index 6dbfbb3059..0965df6348 100644 --- a/packages/venia-concept/src/selectors/cart.js +++ b/packages/venia-concept/src/selectors/cart.js @@ -1,11 +1,3 @@ -export const getOrderInformation = ( - { cart: { details: { billing_address } = {} } }, - orderId -) => ({ - id: orderId, - billing_address -}); - export const isEmptyCartVisible = ({ cart, checkout: { step } }) => step === 'cart' && (!cart.details.items || cart.details.items.length === 0); From 3cc4deb6b027b7cba3c883b4445879e838627898 Mon Sep 17 00:00:00 2001 From: Yogesh Suhagiya <783102+yogeshsuhagiya@users.noreply.github.com> Date: Thu, 25 Apr 2019 19:24:13 +0530 Subject: [PATCH 2/2] Replaced div tag with Fragment (#1103) --- pwa-devdocs/src/peregrine/routing/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pwa-devdocs/src/peregrine/routing/index.md b/pwa-devdocs/src/peregrine/routing/index.md index 269303070c..85366480be 100644 --- a/pwa-devdocs/src/peregrine/routing/index.md +++ b/pwa-devdocs/src/peregrine/routing/index.md @@ -123,14 +123,14 @@ class App extends Component { render(){ ... return ( -