From ec98a5994df40e6828091f56706d2916616f0882 Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Fri, 28 Feb 2025 13:48:55 +0700 Subject: [PATCH] update: Change WooPayments "Channel" to "Sales Channel" and other channel names (#10437) --- changelog/fix-10245-update-texts | 4 ++ .../test/__snapshots__/index.test.tsx.snap | 4 +- .../__snapshots__/index.test.js.snap | 46 +++++++++---------- client/payment-details/summary/index.tsx | 2 +- .../test/__snapshots__/index.test.tsx.snap | 4 +- client/transactions/filters/config.ts | 25 +++++----- .../filters/test/__snapshots__/index.tsx.snap | 7 ++- client/transactions/filters/test/index.tsx | 11 ++--- client/transactions/list/index.tsx | 4 +- .../list/test/__snapshots__/index.tsx.snap | 46 +++++++++---------- client/transactions/strings.ts | 3 +- client/utils/charge/index.ts | 13 +++--- client/utils/charge/test/index.js | 12 ++--- 13 files changed, 96 insertions(+), 85 deletions(-) create mode 100644 changelog/fix-10245-update-texts diff --git a/changelog/fix-10245-update-texts b/changelog/fix-10245-update-texts new file mode 100644 index 00000000000..7571eb8b155 --- /dev/null +++ b/changelog/fix-10245-update-texts @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Change wording for Sales Channel, Online Store, In-Person, and In-Person (POS) diff --git a/client/payment-details/order-details/test/__snapshots__/index.test.tsx.snap b/client/payment-details/order-details/test/__snapshots__/index.test.tsx.snap index c47c8a24cf1..a47a9d9bc8e 100644 --- a/client/payment-details/order-details/test/__snapshots__/index.test.tsx.snap +++ b/client/payment-details/order-details/test/__snapshots__/index.test.tsx.snap @@ -143,13 +143,13 @@ exports[`Order details page should match the snapshot - Charge without payment i - Channel + Sales channel - Online + Online store diff --git a/client/payment-details/summary/__tests__/__snapshots__/index.test.js.snap b/client/payment-details/summary/__tests__/__snapshots__/index.test.js.snap index bef8e47cc0d..e68d58a2673 100644 --- a/client/payment-details/summary/__tests__/__snapshots__/index.test.js.snap +++ b/client/payment-details/summary/__tests__/__snapshots__/index.test.js.snap @@ -152,13 +152,13 @@ exports[`PaymentDetailsSummary capture notification and fraud buttons renders ca - Channel + Sales channel - Online + Online store @@ -508,13 +508,13 @@ exports[`PaymentDetailsSummary capture notification and fraud buttons renders th - Channel + Sales channel - Online + Online store @@ -868,13 +868,13 @@ exports[`PaymentDetailsSummary correctly renders a charge 1`] = ` - Channel + Sales channel - Online + Online store @@ -1179,13 +1179,13 @@ exports[`PaymentDetailsSummary correctly renders when payment intent is missing - Channel + Sales channel - Online + Online store @@ -1504,13 +1504,13 @@ exports[`PaymentDetailsSummary order missing notice does not render notice if or - Channel + Sales channel - Online + Online store @@ -1829,13 +1829,13 @@ exports[`PaymentDetailsSummary order missing notice renders notice if order miss - Channel + Sales channel - Online + Online store @@ -2177,13 +2177,13 @@ exports[`PaymentDetailsSummary renders a charge with subscriptions 1`] = ` - Channel + Sales channel - Online + Online store @@ -2506,13 +2506,13 @@ exports[`PaymentDetailsSummary renders fully refunded information for a charge 1 - Channel + Sales channel - Online + Online store @@ -2774,13 +2774,13 @@ exports[`PaymentDetailsSummary renders loading state 1`] = ` - Channel + Sales channel - Online + Online store @@ -3078,13 +3078,13 @@ exports[`PaymentDetailsSummary renders partially refunded information for a char - Channel + Sales channel - Online + Online store @@ -3403,7 +3403,7 @@ exports[`PaymentDetailsSummary renders the Tap to Pay channel from metadata 1`] - Channel + Sales channel - Channel + Sales channel - Online + Online store diff --git a/client/payment-details/summary/index.tsx b/client/payment-details/summary/index.tsx index 6525acbba08..4b2844f519a 100644 --- a/client/payment-details/summary/index.tsx +++ b/client/payment-details/summary/index.tsx @@ -120,7 +120,7 @@ const composePaymentSummaryItems = ( { : '–', }, { - title: __( 'Channel', 'woocommerce-payments' ), + title: __( 'Sales channel', 'woocommerce-payments' ), content: ( { isTapToPay( metadata?.reader_model ) diff --git a/client/payment-details/test/__snapshots__/index.test.tsx.snap b/client/payment-details/test/__snapshots__/index.test.tsx.snap index 09c09a45eaa..d0b0d4eb721 100644 --- a/client/payment-details/test/__snapshots__/index.test.tsx.snap +++ b/client/payment-details/test/__snapshots__/index.test.tsx.snap @@ -656,13 +656,13 @@ exports[`Payment details page should match the snapshot - Payment Intent query p - Channel + Sales channel - Online + Online store diff --git a/client/transactions/filters/config.ts b/client/transactions/filters/config.ts index 8485dbe771d..45a53ca2859 100644 --- a/client/transactions/filters/config.ts +++ b/client/transactions/filters/config.ts @@ -442,43 +442,46 @@ export const getAdvancedFilters = ( }, channel: { labels: { - add: __( 'Channel', 'woocommerce-payments' ), + add: __( 'Sales channel', 'woocommerce-payments' ), remove: __( - 'Remove transaction channel filter', + 'Remove transaction sales channel filter', 'woocommerce-payments' ), rule: __( - 'Select a transaction channel filter match', + 'Select a transaction sales channel filter match', 'woocommerce-payments' ), - /* translators: A sentence describing a Transaction Channel filter. */ title: wooCommerceVersion < 7.8 ? __( - '{{title}}Channel{{/title}} {{rule /}} {{filter /}}', + '{{title}}Sales channel{{/title}} {{rule /}} {{filter /}}', 'woocommerce-payments' ) : __( - 'Channel ', + 'Sales channel ', 'woocommerce-payments' ), filter: __( - 'Select a transaction channel', + 'Select a transaction sales channel', 'woocommerce-payments' ), }, rules: [ { value: 'is', - /* translators: Sentence fragment, logical, "Is" refers to searching for transactions matching a chosen transaction channel type. */ - label: _x( 'Is', 'Channel', 'woocommerce-payments' ), + /* translators: Sentence fragment, logical, "Is" refers to searching for transactions matching a chosen transaction sales channel type. */ + label: _x( + 'Is', + 'Sales channel', + 'woocommerce-payments' + ), }, { value: 'is_not', - /* translators: Sentence fragment, logical, "Is not" refers to searching for transactions that don\'t match a chosen transaction channel type. */ + /* translators: Sentence fragment, logical, "Is not" refers to searching for transactions that don\'t match a chosen transaction sales channel type. */ label: _x( 'Is not', - 'Channel', + 'Sales channel', 'woocommerce-payments' ), }, diff --git a/client/transactions/filters/test/__snapshots__/index.tsx.snap b/client/transactions/filters/test/__snapshots__/index.tsx.snap index 7feb3c5bb55..61210139d09 100644 --- a/client/transactions/filters/test/__snapshots__/index.tsx.snap +++ b/client/transactions/filters/test/__snapshots__/index.tsx.snap @@ -5,13 +5,18 @@ HTMLOptionsCollection [ , , + , ] `; diff --git a/client/transactions/filters/test/index.tsx b/client/transactions/filters/test/index.tsx index a958629edca..cd5779f3744 100644 --- a/client/transactions/filters/test/index.tsx +++ b/client/transactions/filters/test/index.tsx @@ -356,15 +356,15 @@ describe( 'Transactions filters', () => { let ruleSelector: HTMLElement; beforeEach( () => { - addAdvancedFilter( 'Channel' ); + addAdvancedFilter( 'Sales channel' ); ruleSelector = screen.getByRole( 'combobox', { - name: /transaction channel filter/i, + name: /transaction sales channel filter/i, } ); } ); test( 'should render all types', () => { const typeSelect = screen.getByRole( 'combobox', { - name: /transaction channel$/i, + name: /transaction sales channel$/i, } ) as HTMLSelectElement; expect( typeSelect.options ).toMatchSnapshot(); } ); @@ -372,10 +372,9 @@ describe( 'Transactions filters', () => { test( 'should filter by is', () => { user.selectOptions( ruleSelector, 'is' ); - // need to include $ in name, otherwise "Select a transaction type filter" is also matched. user.selectOptions( screen.getByRole( 'combobox', { - name: /transaction channel$/i, + name: /transaction sales channel$/i, } ), 'online' ); @@ -390,7 +389,7 @@ describe( 'Transactions filters', () => { // need to include $ in name, otherwise "Select a transaction type filter" is also matched. user.selectOptions( screen.getByRole( 'combobox', { - name: /transaction channel$/i, + name: /transaction sales channel$/i, } ), 'in_person' ); diff --git a/client/transactions/list/index.tsx b/client/transactions/list/index.tsx index eefa7cf183c..acd9ee7b530 100644 --- a/client/transactions/list/index.tsx +++ b/client/transactions/list/index.tsx @@ -159,8 +159,8 @@ const getColumns = ( }, { key: 'channel', - label: __( 'Channel', 'woocommerce-payments' ), - screenReaderLabel: __( 'Channel', 'woocommerce-payments' ), + label: __( 'Sales channel', 'woocommerce-payments' ), + screenReaderLabel: __( 'Sales channel', 'woocommerce-payments' ), required: true, isLeftAligned: true, }, diff --git a/client/transactions/list/test/__snapshots__/index.tsx.snap b/client/transactions/list/test/__snapshots__/index.tsx.snap index 755d4e59383..76920851ef5 100644 --- a/client/transactions/list/test/__snapshots__/index.tsx.snap +++ b/client/transactions/list/test/__snapshots__/index.tsx.snap @@ -291,12 +291,12 @@ exports[`Transactions list renders correctly when can filter by several currenci - Channel + Sales channel - Online + Online store - Online + Online store - Channel + Sales channel - Channel + Sales channel - Online + Online store - Online + Online store - Channel + Sales channel - Channel + Sales channel - Online + Online store - Channel + Sales channel - Channel + Sales channel - Online + Online store - Online + Online store - Channel + Sales channel - Channel + Sales channel - Online + Online store - Online + Online store - Channel + Sales channel - Channel + Sales channel - Online + Online store - Online + Online store { }; /** - * Displays the transaction's channel: Online | In-Person | In-Person (POS). + * Displays the transaction's sales channel: Online store | In-Person | In-Person (POS). * This method is called on the list of transactions page. * * In the list of transactions, the type holds the brand of the payment method, so we aren't passing it. * Instead, we pass the transaction.channel directly, which might be in_person|in_person_pos|online. * * @param {string} channel The transaction channel. - * @return {string} Online, In-Person, or In-Person (POS). + * @return {string} Online store, In-Person, or In-Person (POS). */ export const getTransactionChannel = ( channel: string ): string => { switch ( channel ) { @@ -189,12 +189,12 @@ export const getTransactionChannel = ( channel: string ): string => { case 'in_person_pos': return __( 'In-Person (POS)', 'woocommerce-payments' ); default: - return __( 'Online', 'woocommerce-payments' ); + return __( 'Online store', 'woocommerce-payments' ); } }; /** - * Displays the channel based on the charge data from Stripe and metadata for a transaction: Online | In-Person | In-Person (POS). + * Displays the sales channel based on the charge data from Stripe and metadata for a transaction: Online store | In-Person | In-Person (POS). * This method is called in the individual transaction page. * * In the individual transaction page, we are getting the data from Stripe, so we pass the charge.type @@ -204,8 +204,7 @@ export const getTransactionChannel = ( channel: string ): string => { * * @param {string} type The transaction charge type, which can be card_present or interac_present for In-Person payments. * @param {Record} metadata The transaction metadata, which may include ipp_channel indicating the channel source. - * @return {string} Returns 'Online', 'In-Person', or 'In-Person (POS)' based on the transaction type and metadata. - * + * @return {string} Returns 'Online store', 'In-Person', or 'In-Person (POS)' based on the transaction type and metadata. */ export const getChargeChannel = ( type: string, @@ -218,5 +217,5 @@ export const getChargeChannel = ( return __( 'In-Person', 'woocommerce-payments' ); } - return __( 'Online', 'woocommerce-payments' ); + return __( 'Online store', 'woocommerce-payments' ); }; diff --git a/client/utils/charge/test/index.js b/client/utils/charge/test/index.js index 07b7f64f312..a0fbd6b2913 100755 --- a/client/utils/charge/test/index.js +++ b/client/utils/charge/test/index.js @@ -499,14 +499,14 @@ describe( 'Charge utilities / get channel string', () => { expect( result ).toBe( 'In-Person' ); } ); - test( 'should return "Online" for online channel', () => { + test( 'should return "Online store" for online channel', () => { const result = utils.getTransactionChannel( 'online' ); - expect( result ).toBe( 'Online' ); + expect( result ).toBe( 'Online store' ); } ); - test( 'should return "Online" for null channel', () => { + test( 'should return "Online store" for null channel', () => { const result = utils.getTransactionChannel( null ); - expect( result ).toBe( 'Online' ); + expect( result ).toBe( 'Online store' ); } ); } ); @@ -530,11 +530,11 @@ describe( 'Charge utilities / get channel string', () => { expect( result ).toBe( 'In-Person' ); } ); - test( 'should return "Online" for online type', () => { + test( 'should return "Online store" for online type', () => { const result = utils.getChargeChannel( 'online', { ipp_channel: 'mobile_pos', } ); - expect( result ).toBe( 'Online' ); + expect( result ).toBe( 'Online store' ); } ); } ); } );