Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide the language setting during onboarding #2522

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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">
eason9487 marked this conversation as resolved.
Show resolved Hide resolved
{ 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"
eason9487 marked this conversation as resolved.
Show resolved Hide resolved
/>
),
}
) }
</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
7 changes: 3 additions & 4 deletions 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-listings-and-ads/#required-google-permissions' }`
- [`ContactInformation`](../../js/src/components/contact-information/index.js#L91)
Expand Down Expand Up @@ -565,10 +564,10 @@ Clicking on the button to connect an existing Google Merchant Center account.
#### Emitters
- [`ConnectMC`](../../js/src/components/google-mc-account-card/connect-mc/index.js#L42)

### [`gla_mc_account_connect_different_account_button_click`](../../js/src/components/google-mc-account-card/connected-google-mc-account-card.js#L21)
### [`gla_mc_account_connect_different_account_button_click`](../../js/src/components/google-mc-account-card/connected-google-mc-account-card.js#L29)
Clicking on the "connect to a different Google Merchant Center account" button.
#### Emitters
- [`ConnectedGoogleMCAccountCard`](../../js/src/components/google-mc-account-card/connected-google-mc-account-card.js#L36)
- [`ConnectedGoogleMCAccountCard`](../../js/src/components/google-mc-account-card/connected-google-mc-account-card.js#L45)

### [`gla_mc_account_create_button_click`](../../js/src/components/google-mc-account-card/terms-modal/index.js#L16)
Clicking on the button to create a new Google Merchant Center account, after agreeing to the terms and conditions.
Expand Down Expand Up @@ -629,7 +628,7 @@ A modal is closed.
`action` | `string` | Indicates the modal is closed by what action (e.g. `maybe-later`\|`dismiss` \| `create-another-campaign`) - `maybe-later` is used when the "Maybe later" button on the modal is clicked - `dismiss` is used when the modal is dismissed by clicking on "X" icon, overlay, generic "Cancel" button, or pressing ESC - `create-another-campaign` is used when the button "Create another campaign" is clicked - `create-paid-campaign` is used when the button "Create paid campaign" is clicked - `confirm` is used when the button "Confirm", "Save" or similar generic "Accept" button is clicked
#### Emitters
- [`AttributeMappingTable`](../../js/src/attribute-mapping/attribute-mapping-table.js#L59) When any of the modals is closed
- [`Dashboard`](../../js/src/dashboard/index.js#L33) when CES modal is closed.
- [`Dashboard`](../../js/src/dashboard/index.js#L34) when CES modal is closed.
- [`ReviewRequest`](../../js/src/product-feed/review-request/index.js#L31) with `action: 'request-review-success' | 'maybe-later' | 'dismiss', context: REQUEST_REVIEW`
- [`SubmissionSuccessGuide`](../../js/src/product-feed/submission-success-guide/index.js#L159) with `action: 'create-paid-campaign' | 'maybe-later' | 'view-product-feed' | 'dismiss'`

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();
eason9487 marked this conversation as resolved.
Show resolved Hide resolved
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();
eason9487 marked this conversation as resolved.
Show resolved Hide resolved
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