Skip to content

Commit

Permalink
Remove unused code from pre launch checklist.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvinb committed Sep 4, 2024
1 parent c21b1b5 commit d78738a
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 198 deletions.
16 changes: 1 addition & 15 deletions js/src/components/free-listings/setup-free-listings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,7 @@ const targetAudienceFields = [ 'locale', 'language', 'location', 'countries' ];
*
* If we are adding a new settings field, it should be added into this array.
*/
const settingsFieldNames = [
'shipping_rate',
'shipping_time',
'tax_rate',
'website_live',
'checkout_process_secure',
'payment_methods_visible',
'refund_tos_visible',
'contact_info_visible',
];
const settingsFieldNames = [ 'shipping_rate', 'shipping_time', 'tax_rate' ];

/**
* Get settings object from Form values.
Expand Down Expand Up @@ -214,11 +205,6 @@ const SetupFreeListings = ( {
shipping_rate: settings.shipping_rate,
shipping_time: settings.shipping_time,
tax_rate: settings.tax_rate,
website_live: settings.website_live,
checkout_process_secure: settings.checkout_process_secure,
payment_methods_visible: settings.payment_methods_visible,
refund_tos_visible: settings.refund_tos_visible,
contact_info_visible: settings.contact_info_visible,
// This is used in UI only, not used in API.
offer_free_shipping:
getOfferFreeShippingInitialValue( shippingRates ),
Expand Down
74 changes: 0 additions & 74 deletions js/src/components/pre-launch-check-item/index.js

This file was deleted.

17 changes: 0 additions & 17 deletions js/src/components/pre-launch-check-item/index.scss

This file was deleted.

5 changes: 0 additions & 5 deletions js/src/data/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ import { isWCIos, isWCAndroid } from '.~/utils/isMobileApp';
* @property {'automatic'|'flat'|'manual'} [shipping_rate] Type of the shipping rate.
* @property {'flat'|'manual'} [shipping_time] Type of the shipping time.
* @property {string|null} [tax_rate] Type of tax rate, There are two possible values if US is selected: 'destination' and 'manual' otherwise will be null.
* @property {boolean} [website_live] Whether the store website is live.
* @property {boolean} [checkout_process_secure] Whether the checkout process is complete and secure.
* @property {boolean} [payment_methods_visible] Whether the payment methods are visible on the website.
* @property {boolean} [refund_tos_visible] Whether the refund policy and terms of service are visible on the website.
* @property {boolean} [contact_info_visible] Whether the phone number, email, and/or address are visible on the website.
*/

/**
Expand Down
21 changes: 1 addition & 20 deletions js/src/setup-mc/setup-stepper/store-requirements/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import StepContentHeader from '.~/components/stepper/step-content-header';
import StepContentActions from '.~/components/stepper/step-content-actions';
import StepContentFooter from '.~/components/stepper/step-content-footer';
import AdaptiveForm from '.~/components/adaptive-form';
import ValidationErrors from '.~/components/validation-errors';
import ContactInformation from '.~/components/contact-information';
import AppButton from '.~/components/app-button';

Expand Down Expand Up @@ -51,21 +50,6 @@ export default function StoreRequirements( { onContinue } ) {
}
};

const extendAdapter = ( formContext ) => {
return {
renderRequestedValidation( key ) {
if ( formContext.adapter.requestedShowValidation ) {
return (
<ValidationErrors
messages={ formContext.errors[ key ] }
/>
);
}
return null;
},
};
};

return (
<StepContent>
<StepContentHeader
Expand All @@ -78,10 +62,7 @@ export default function StoreRequirements( { onContinue } ) {
'google-listings-and-ads'
) }
/>
<AdaptiveForm
extendAdapter={ extendAdapter }
onSubmit={ handleSubmitCallback }
>
<AdaptiveForm onSubmit={ handleSubmitCallback }>
{ ( formContext ) => {
const { handleSubmit, adapter } = formContext;

Expand Down
5 changes: 0 additions & 5 deletions tests/e2e/specs/setup-mc/step-2-product-listings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ test.describe( 'Configure product listings', () => {
productListingsPage.fulfillSettings(
{
shipping_rate: 'automatic',
website_live: false,
checkout_process_secure: false,
payment_methods_visible: false,
refund_tos_visible: false,
contact_info_visible: false,
},
200,
[ 'GET' ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ export default class StoreRequirements extends MockRequests {
return this.page.locator( '.gla-store-address-card' );
}

/**
* Get checklist card.
*
* @return {import('@playwright/test').Locator} Get checklist card.
*/
getChecklistCard() {
return this.page.locator( '.gla-pre-launch-checklist' );
}

/**
* Get phone number description text.
*
Expand Down Expand Up @@ -167,24 +158,6 @@ export default class StoreRequirements extends MockRequests {
} );
}

/**
* Get pre-launch checklist checkboxes.
*
* @return {import('@playwright/test').Locator} Get pre-launch checklist checkboxes.
*/
getPrelaunchChecklistCheckboxes() {
return this.getChecklistCard().getByRole( 'checkbox' );
}

/**
* Get pre-launch checklist panels.
*
* @return {import('@playwright/test').Locator} Get pre-launch checklist panels.
*/
getPrelaunchChecklistPanels() {
return this.getChecklistCard().locator( '.components-panel__body' );
}

/**
* Get Continue button.
*
Expand Down Expand Up @@ -218,18 +191,6 @@ export default class StoreRequirements extends MockRequests {
} );
}

/**
* Get read google merchant center requirements link.
*
* @return {import('@playwright/test').Locator} Get read google merchant center requirements link.
*/
getReadGoogleMerchantCenterRequirementsLink() {
return this.page.getByRole( 'link', {
name: 'Read Google Merchant Center requirements',
exact: true,
} );
}

/**
* Get WooCommerce settings link.
*
Expand All @@ -242,29 +203,6 @@ export default class StoreRequirements extends MockRequests {
} );
}

/**
* Register settings request when the confirm button or checkbox in pre-lauch checklist is checked.
*
* @param {Array} settings
* @return {Promise<import('@playwright/test').Request[]>} The requests.
*/
registerPrelaunchChecklistConfirmCheckedRequest( settings = [] ) {
const promises = [];

for ( const setting of settings ) {
promises.push(
this.page.waitForRequest(
( request ) =>
request.url().includes( '/gla/mc/settings' ) &&
request.method() === 'POST' &&
request.postDataJSON()[ setting ] === true
)
);
}

return Promise.all( promises );
}

/**
* Fill country code.
*
Expand Down

0 comments on commit d78738a

Please sign in to comment.