MM-51977 : Remove inconsistencies of the duplicate IDs with different defaultMessages (#22965)

* eslint format lib to root

* eslint fixes

* no id rule removed

* same rectintl

* try 1

* eslint format lib to root

* eslint fixes

* no id rule removed

* same rectintl

* react intl in root

* type fix

* add back version to components

* missing translations added

* remove type casting

* a

* type fix formatjs

* snaps updated

* Update package-lock.json

* Update package-lock.json

* rem

* snapshot updates

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
M-ZubairAhmed
2023-04-18 01:04:45 +05:30
коммит произвёл GitHub
родитель 3f022e728f
Коммит adff327b9c
49 изменённых файлов: 565 добавлений и 139 удалений

Просмотреть файл

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {useEffect, useState} from 'react';
import React, {useEffect, useState, ReactNode} from 'react';
import {useIntl} from 'react-intl';
import {useDispatch} from 'react-redux';
@@ -14,8 +14,9 @@ import {trackEvent} from 'actions/telemetry_actions';
import {openModal, closeModal} from 'actions/views/modals';
import TrialBenefitsModal from 'components/trial_benefits_modal/trial_benefits_modal';
import ExternalLink from 'components/external_link';
import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants';
import {ModalIdentifiers, TELEMETRY_CATEGORIES, LicenseLinks} from 'utils/constants';
import RequestBusinessEmailModal from './request_business_email_modal';
import './cloud_start_trial_btn.scss';
@@ -129,7 +130,7 @@ const CloudStartTrialButton = ({
}));
};
const btnText = (status: TrialLoadStatus): string => {
const btnText = (status: TrialLoadStatus) => {
switch (status) {
case TrialLoadStatus.Started:
return formatMessage({id: 'start_cloud_trial.modal.gettingTrial', defaultMessage: 'Getting Trial...'});
@@ -138,7 +139,22 @@ const CloudStartTrialButton = ({
case TrialLoadStatus.Failed:
return formatMessage({id: 'start_cloud_trial.modal.failed', defaultMessage: 'Failed'});
case TrialLoadStatus.Embargoed:
return formatMessage({id: 'admin.license.trial-request.embargoed'});
return formatMessage<ReactNode>(
{
id: 'admin.license.trial-request.embargoed',
defaultMessage: 'We were unable to process the request due to limitations for embargoed countries. <link>Learn more in our documentation</link>, or reach out to legal@mattermost.com for questions around export limitations.',
},
{
link: (text: string) => (
<ExternalLink
location='trial_banner'
href={LicenseLinks.EMBARGOED_COUNTRIES}
>
{text}
</ExternalLink>
),
},
);
default:
return message;
}