From 5bbc10f44f353726debea82fd5b45bb3ee3e1efe Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Mon, 7 Aug 2023 13:12:45 +0530 Subject: [PATCH 1/5] Remove Tax Step --- src/OnboardingSPA/components/App/index.js | 17 +-------------- .../data/routes/ecommerce-flow.js | 21 +------------------ .../Steps/Ecommerce/StepAddress/index.js | 2 +- 3 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/OnboardingSPA/components/App/index.js b/src/OnboardingSPA/components/App/index.js index f4274d4ff..1fcb3c35c 100644 --- a/src/OnboardingSPA/components/App/index.js +++ b/src/OnboardingSPA/components/App/index.js @@ -80,28 +80,13 @@ const App = () => { } async function syncStoreDetails() { - const { address, tax } = currentData.storeDetails; + const { address } = currentData.storeDetails; let payload = {}; if ( address !== undefined ) { delete address.country; delete address.state; payload = address; } - if ( tax !== undefined ) { - // const option = tax.option; - // const isStoreDetailsFilled = tax.isStoreDetailsFilled; - delete tax.option; - delete tax.isStoreDetailsFilled; - // No Auto-calculate taxes for MMP - // if (option === "1") { - // if (isStoreDetailsFilled) { - // payload = { ...payload, ...tax }; - // } - // } else { - // payload = { ...payload, ...tax }; - // } - payload = { ...payload, ...tax }; - } if ( ! isEmpty( payload ) ) { await updateWPSettings( payload ); } diff --git a/src/OnboardingSPA/data/routes/ecommerce-flow.js b/src/OnboardingSPA/data/routes/ecommerce-flow.js index a9678969b..0daef9dfd 100644 --- a/src/OnboardingSPA/data/routes/ecommerce-flow.js +++ b/src/OnboardingSPA/data/routes/ecommerce-flow.js @@ -1,5 +1,5 @@ import { __ } from '@wordpress/i18n'; -import { store, institution, shipping } from '@wordpress/icons'; +import { store, shipping } from '@wordpress/icons'; import { lazy } from '@wordpress/element'; // eslint-disable-next-line import/no-extraneous-dependencies import { orderBy, filter } from 'lodash'; @@ -19,11 +19,6 @@ const StepAddressLearnMoreSidebar = lazy( () => import( '../../pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/' ) ); -const StepTax = lazy( () => import( '../../pages/Steps/Ecommerce/StepTax' ) ); -const StepTaxLearnMoreSidebar = lazy( () => - import( '../../pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/' ) -); - const StepProducts = lazy( () => import( '../../pages/Steps/Ecommerce/StepProducts' ) ); @@ -48,20 +43,6 @@ export const ecommerceSteps = [ }, }, }, - { - path: '/ecommerce/step/tax', - title: __( 'Tax Info', 'wp-module-onboarding' ), - tooltipText: __( 'Tax Info', 'wp-module-onboarding' ), - Component: StepTax, - Icon: institution, - priority: 90, - VIEW: VIEW_NAV_ECOMMERCE_STORE_INFO, - sidebars: { - LearnMore: { - SidebarComponents: [ StepTaxLearnMoreSidebar ], - }, - }, - }, { path: '/ecommerce/step/products', title: __( 'Product Info', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js index 2b8279f7f..2fd6fdff3 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js @@ -226,7 +226,7 @@ const StepAddress = () => { // ? '/ecommerce/step/tax' // : '/ecommerce/step/products' // ); - navigate( '/ecommerce/step/tax' ); + navigate( '/ecommerce/step/products' ); } } style={ { display: 'grid', From ac5e9f7952030e0ba8d44226eff07ebdc97a296b Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Mon, 7 Aug 2023 13:57:39 +0530 Subject: [PATCH 2/5] Commenting Code --- .../data/routes/ecommerce-flow.js | 19 +++++++++++++++++++ .../Steps/Ecommerce/StepAddress/index.js | 12 +++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/OnboardingSPA/data/routes/ecommerce-flow.js b/src/OnboardingSPA/data/routes/ecommerce-flow.js index 0daef9dfd..2fe4e4d4b 100644 --- a/src/OnboardingSPA/data/routes/ecommerce-flow.js +++ b/src/OnboardingSPA/data/routes/ecommerce-flow.js @@ -19,6 +19,11 @@ const StepAddressLearnMoreSidebar = lazy( () => import( '../../pages/Steps/Ecommerce/StepAddress/Sidebar/LearnMore/' ) ); +// const StepTax = lazy( () => import( '../../pages/Steps/Ecommerce/StepTax' ) ); +// const StepTaxLearnMoreSidebar = lazy( () => +// import( '../../pages/Steps/Ecommerce/StepTax/Sidebar/LearnMore/' ) +// ); + const StepProducts = lazy( () => import( '../../pages/Steps/Ecommerce/StepProducts' ) ); @@ -43,6 +48,20 @@ export const ecommerceSteps = [ }, }, }, + // { + // path: '/ecommerce/step/tax', + // title: __( 'Tax Info', 'wp-module-onboarding' ), + // tooltipText: __( 'Tax Info', 'wp-module-onboarding' ), + // Component: StepTax, + // Icon: institution, + // priority: 90, + // VIEW: VIEW_NAV_ECOMMERCE_STORE_INFO, + // sidebars: { + // LearnMore: { + // SidebarComponents: [ StepTaxLearnMoreSidebar ], + // }, + // }, + // }, { path: '/ecommerce/step/products', title: __( 'Product Info', 'wp-module-onboarding' ), diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js index 2fd6fdff3..ec1cb53c7 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js @@ -16,6 +16,7 @@ import currencies from '../currencies.json'; import { useWPSettings as getWPSettings } from '../useWPSettings'; import Animate from '../../../../components/Animate'; import getContents from './contents'; +import NavCardButton from '../../../../components/Button/NavCardButton'; const StepAddress = () => { const [ settings, setSettings ] = useState(); @@ -226,7 +227,7 @@ const StepAddress = () => { // ? '/ecommerce/step/tax' // : '/ecommerce/step/products' // ); - navigate( '/ecommerce/step/products' ); + // navigate( '/ecommerce/step/products' ); } } style={ { display: 'grid', @@ -418,13 +419,10 @@ const StepAddress = () => { - + /> From 7cd579abae669d3a02806dcd3ba7ab851a08f7c9 Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Mon, 7 Aug 2023 13:59:25 +0530 Subject: [PATCH 3/5] Update index.js --- src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js index ec1cb53c7..a234a724e 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js @@ -1,7 +1,6 @@ import { useViewportMatch } from '@wordpress/compose'; import { useDispatch, useSelect } from '@wordpress/data'; import { useEffect, useState } from '@wordpress/element'; -import { useNavigate } from 'react-router-dom'; import { SIDEBAR_LEARN_MORE, VIEW_NAV_ECOMMERCE_STORE_INFO, @@ -20,7 +19,6 @@ import NavCardButton from '../../../../components/Button/NavCardButton'; const StepAddress = () => { const [ settings, setSettings ] = useState(); - const navigate = useNavigate(); const isLargeViewport = useViewportMatch( 'medium' ); const { setDrawerActiveView, From cc212a8f852823b79a0b3beadb76c329e382569e Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Mon, 7 Aug 2023 17:20:44 +0530 Subject: [PATCH 4/5] Update index.js --- src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js index a234a724e..5b7c7df7b 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js @@ -225,7 +225,6 @@ const StepAddress = () => { // ? '/ecommerce/step/tax' // : '/ecommerce/step/products' // ); - // navigate( '/ecommerce/step/products' ); } } style={ { display: 'grid', From f2806b35814eb7d7e518431669556c13f5565763 Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Tue, 8 Aug 2023 11:26:57 +0530 Subject: [PATCH 5/5] Fix Lint and remove unused code --- .../pages/Steps/Ecommerce/StepAddress/index.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js index 5b7c7df7b..104900390 100644 --- a/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js +++ b/src/OnboardingSPA/pages/Steps/Ecommerce/StepAddress/index.js @@ -209,23 +209,6 @@ const StepAddress = () => {
{ - event.preventDefault(); - event.stopPropagation(); - //Commented as auto-calculate tax option is removed for MMP - - // let selectedTaxOption = content.stepTaxOptions.find((option) => - // Object.entries(option.data).every( - // ([optionName, requiredValue]) => - // settings?.[optionName] === requiredValue - // ) - // ); - // navigate( - // selectedTaxOption === undefined - // ? '/ecommerce/step/tax' - // : '/ecommerce/step/products' - // ); - } } style={ { display: 'grid', justifyItems: 'center',