Skip to content

Commit

Permalink
Merge pull request #2522 from woocommerce/update/2489-hide-language-s…
Browse files Browse the repository at this point in the history
…etting-onboarding

Hide the language setting during onboarding
  • Loading branch information
joemcgill authored Aug 22, 2024
2 parents c4bbdf0 + 766e351 commit bfe429d
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 79 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
/**
* External dependencies
*/
import { RadioControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';

/**
* Internal dependencies
*/
import { useAdaptiveFormContext } from '.~/components/adaptive-form';
import AppRadioContentControl from '.~/components/app-radio-content-control';
import AppDocumentationLink from '.~/components/app-documentation-link';
import Section from '.~/wcdl/section';
import Subsection from '.~/wcdl/subsection';
import RadioHelperText from '.~/wcdl/radio-helper-text';
Expand All @@ -23,16 +20,12 @@ import './choose-audience-section.scss';
*
* To be used in onboarding and further editing.
* Does not provide any save strategy, this is to be bound externaly.
*
* @fires gla_documentation_link_click with `{ context: 'setup-mc-audience', link_id: 'site-language', href: 'https://support.google.com/merchants/answer/160637' }`
*/
const ChooseAudienceSection = () => {
const {
values,
getInputProps,
adapter: { renderRequestedValidation },
} = useAdaptiveFormContext();
const { locale, language } = values;

return (
<>
Expand All @@ -50,37 +43,6 @@ const ChooseAudienceSection = () => {
>
<Section.Card>
<Section.Card.Body>
<Subsection>
<Subsection.Title>
{ __( 'Language', 'google-listings-and-ads' ) }
</Subsection.Title>
<Subsection.HelperText className="gla-choose-audience-section__language-helper">
{ createInterpolateElement(
__(
'Listings can only be displayed in your site language. <link>Read more</link>',
'google-listings-and-ads'
),
{
link: (
<AppDocumentationLink
context="setup-mc-audience"
linkId="site-language"
href="https://support.google.com/merchants/answer/160637"
/>
),
}
) }
</Subsection.HelperText>
<RadioControl
selected={ locale }
options={ [
{
label: language,
value: locale,
},
] }
/>
</Subsection>
<Subsection>
<Subsection.Title>
{ __( 'Location', 'google-listings-and-ads' ) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.gla-choose-audience-section {
&__language-helper,
.wcdl-radio-helper-text {
font-style: normal;
color: $gray-700;
}

.wcdl-subsection-helper-text {
Expand Down
1 change: 0 additions & 1 deletion src/Tracking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ When a documentation link is clicked.
`href` | `string` | link's URL
#### Emitters
- [`AppDocumentationLink`](../../js/src/components/app-documentation-link/index.js#L29)
- [`ChooseAudienceSection`](../../js/src/components/free-listings/choose-audience-section/choose-audience-section.js#L29) with `{ context: 'setup-mc-audience', link_id: 'site-language', href: 'https://support.google.com/merchants/answer/160637' }`
- [`ConnectAds`](../../js/src/components/google-ads-account-card/connect-ads/index.js#L42) with `{ context: 'setup-ads-connect-account', link_id: 'connect-sub-account', href: 'https://support.google.com/google-ads/answer/6139186' }`
- [`ConnectGoogleAccountCard`](../../js/src/components/google-account-card/connect-google-account-card.js#L23) with `{ context: 'setup-mc-accounts', link_id: 'required-google-permissions', href: 'https://woocommerce.com/document/google-for-woocommerce/get-started/setup-and-configuration/#required-google-permissions' }`
- [`ContactInformation`](../../js/src/components/contact-information/index.js#L91)
Expand Down
14 changes: 0 additions & 14 deletions tests/e2e/specs/setup-mc/step-2-product-listings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ test.describe( 'Configure product listings', () => {
).toBeVisible();
} );

test( 'should select the default language English', async () => {
const languageRadioRow = productListingsPage.getLanguageRadioRow();
await expect( languageRadioRow ).toBeChecked();
} );

test( 'should see US but should not see UK in the country search box', async () => {
const countrySearchBoxContainer =
getCountryInputSearchBoxContainer( page );
Expand Down Expand Up @@ -371,15 +366,6 @@ test.describe( 'Configure product listings', () => {
await productListingsPage.checkSimpleShippingRateRadioButton();
} );

test( 'should contain the correct URL for "Read more for Language" link', async () => {
const link = productListingsPage.getReadMoreLanguageLink();
await expect( link ).toBeVisible();
await expect( link ).toHaveAttribute(
'href',
'https://support.google.com/merchants/answer/160637'
);
} );

test( 'should contain the correct URL for "Read more for Shipping Rates" link', async () => {
const link = productListingsPage.getReadMoreShippingRatesLink();
await expect( link ).toBeVisible();
Expand Down
24 changes: 0 additions & 24 deletions tests/e2e/utils/pages/setup-mc/step-2-product-listings.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ export default class ProductListingsPage extends MockRequests {
);
}

/**
* Get language radio row.
*
* @return {import('@playwright/test').Locator} Get language radio row.
*/
getLanguageRadioRow() {
return this.page.getByRole( 'radio', {
name: 'English',
exact: true,
} );
}

/**
* Get selected countries only radio row.
*
Expand Down Expand Up @@ -302,18 +290,6 @@ export default class ProductListingsPage extends MockRequests {
} );
}

/**
* Get "Read more" for Language link.
*
* @return {import('@playwright/test').Locator} Get "Read more" for Language link.
*/
getReadMoreLanguageLink() {
return this.getAudienceCard().getByRole( 'link', {
name: 'Read more',
exact: true,
} );
}

/**
* Get "Read more" for Shipping rates link.
*
Expand Down

0 comments on commit bfe429d

Please sign in to comment.