Skip to content

Commit

Permalink
[CLD-6487] Replace 'Country' with 'Country/Region' in country selecto…
Browse files Browse the repository at this point in the history
…rs (#25977)

* Replace 'Country' with 'Country/Region' in countr selectors

* Fix linteR

* Update snapshots
  • Loading branch information
nickmisasi committed Jan 22, 2024
1 parent 16d80e6 commit 09b7012
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
3 changes: 1 addition & 2 deletions webapp/channels/src/actions/cloud.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// See LICENSE.txt for license information.

import type {Stripe} from '@stripe/stripe-js';
import {getCode} from 'country-list';

import type {Address, CloudCustomerPatch, Feedback, WorkspaceDeletionRequest} from '@mattermost/types/cloud';

Expand Down Expand Up @@ -48,7 +47,7 @@ export function completeStripeAddPaymentMethod(
line2: billingDetails.address2,
city: billingDetails.city,
state: billingDetails.state,
country: getCode(billingDetails.country),
country: billingDetails.country,
postal_code: billingDetails.postalCode,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const CountrySelector = (props: CountrySelectorProps) => {
}))}
legend={formatMessage({
id: 'payment_form.country',
defaultMessage: 'Country',
defaultMessage: 'Country/Region',
})}
placeholder={formatMessage({
id: 'payment_form.country',
defaultMessage: 'Country',
defaultMessage: 'Country/Region',
})}
name={'country_dropdown'}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Object {
<div
class="DropDown__placeholder css-1wa3eu0-placeholder"
>
Country
Country/Region
</div>
<div
class="css-1ed09z3-Input"
Expand Down
2 changes: 1 addition & 1 deletion webapp/channels/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4356,7 +4356,7 @@
"payment_form.change_payment_method": "Change Payment Method",
"payment_form.city": "City",
"payment_form.company_name": "Company Name",
"payment_form.country": "Country",
"payment_form.country": "Country/Region",
"payment_form.credit_card": "Credit Card",
"payment_form.gather_wire_transfer_intent": "Looking for other payment options?",
"payment_form.gather_wire_transfer_intent_modal.ach": "ACH",
Expand Down
7 changes: 6 additions & 1 deletion webapp/channels/src/utils/countries.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {getData} from 'country-list';
import {getData, overwrite} from 'country-list';

type Country = {
name: string;
code: string;
}

overwrite([{
code: 'TW',
name: 'Taiwan',
}]);

export const COUNTRIES = getData().sort((a: Country, b: Country) => (a.name > b.name ? 1 : -1));

0 comments on commit 09b7012

Please sign in to comment.