[MM-60824] Replace FormattedMarkdownMessage in 'webapp/channels/src/components/leave_team_modal/leave_team_modal.tsx' with FormattedMessage (#28547)

This commit is contained in:
TheInvincible 2024-10-11 14:56:12 +01:00 committed by GitHub
parent 2780b87d00
commit 7895000ab7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 40 additions and 38 deletions

View File

@ -52,13 +52,13 @@ exports[`components/LeaveTeamModal should render the leave team model 1`] = `
bsClass="modal-body" bsClass="modal-body"
componentClass="div" componentClass="div"
> >
<FormattedMarkdownMessage <MemoizedFormattedMessage
defaultMessage="**You will be removed from {num_of_private_channels} private {num_of_private_channels,one {channel} other {channels}} on this team.** If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?" defaultMessage="<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?"
id="leave_team_modal_private.desc" id="leave_team_modal_private.description"
values={ values={
Object { Object {
"num_of_private_channels": 0, "num_of_private_channels": 0,
"num_of_public_channels": 0, "strong": [Function],
} }
} }
/> />

View File

@ -9,8 +9,6 @@ import type {UserProfile} from '@mattermost/types/users';
import * as UserUtils from 'mattermost-redux/utils/user_utils'; import * as UserUtils from 'mattermost-redux/utils/user_utils';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import Constants from 'utils/constants'; import Constants from 'utils/constants';
import {isKeyPressed} from 'utils/keyboard'; import {isKeyPressed} from 'utils/keyboard';
@ -83,66 +81,70 @@ export default class LeaveTeamModal extends React.PureComponent<Props, State> {
if (isGuest) { if (isGuest) {
if (numOfPublicChannels !== 0 && numOfPrivateChannels !== 0) { if (numOfPublicChannels !== 0 && numOfPrivateChannels !== 0) {
modalMessage = ( modalMessage = (
<FormattedMarkdownMessage <FormattedMessage
id='leave_team_modal_guest.desc' id='leave_team_modal_guest.description'
defaultMessage="** You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?" defaultMessage='<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> You won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{ values={{
num_of_public_channels: numOfPublicChannels, num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels, num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}} }}
/> />
); );
} else if (numOfPublicChannels === 0) { } else if (numOfPublicChannels === 0) {
modalMessage = ( modalMessage = (
<FormattedMarkdownMessage <FormattedMessage
id='leave_team_modal_guest_only_private.desc' id='leave_team_modal_guest_only_private.description'
defaultMessage="** You will be removed from {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?" defaultMessage='<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> You won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{ values={{
num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels, num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}} }}
/> />
); );
} else { } else {
modalMessage = ( modalMessage = (
<FormattedMarkdownMessage <FormattedMessage
id='leave_team_modal_guest_only_public.desc' id='leave_team_modal_guest_only_public.description'
defaultMessage="** You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?" defaultMessage='<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} on this team.</strong> You won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{ values={{
num_of_public_channels: numOfPublicChannels, num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels, strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}} }}
/>); />
);
} }
} else if (numOfPublicChannels !== 0 && numOfPrivateChannels !== 0) { } else if (numOfPublicChannels !== 0 && numOfPrivateChannels !== 0) {
modalMessage = ( modalMessage = (
<FormattedMarkdownMessage <FormattedMessage
id='leave_team_modal.desc' id='leave_team_modal.description'
defaultMessage="**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels} } and {num_of_private_channels} private {num_of_private_channels,one {channel} other {channels}} on this team.** If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?" defaultMessage='<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{ values={{
num_of_public_channels: numOfPublicChannels, num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels, num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}} }}
/>); />
);
} else if (numOfPublicChannels === 0) { } else if (numOfPublicChannels === 0) {
modalMessage = ( modalMessage = (
<FormattedMarkdownMessage <FormattedMessage
id='leave_team_modal_private.desc' id='leave_team_modal_private.description'
defaultMessage="**You will be removed from {num_of_private_channels} private {num_of_private_channels,one {channel} other {channels}} on this team.** If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?" defaultMessage='<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won&apos;t be able to rejoin it without an invitation from another team member. Are you sure?'
values={{ values={{
num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels, num_of_private_channels: numOfPrivateChannels,
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}} }}
/>); />
);
} else { } else {
modalMessage = ( modalMessage = (
<FormattedMarkdownMessage <FormattedMessage
id='leave_team_modal_public.desc' id='leave_team_modal_public.description'
defaultMessage='**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels} } on this team.** Are you sure?' defaultMessage='<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} on this team.</strong> Are you sure?'
values={{ values={{
num_of_public_channels: numOfPublicChannels, num_of_public_channels: numOfPublicChannels,
num_of_private_channels: numOfPrivateChannels, strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
}} }}
/> />
); );

View File

@ -4135,12 +4135,12 @@
"leave_private_channel_modal.title": "Leave Private Channel {channel}", "leave_private_channel_modal.title": "Leave Private Channel {channel}",
"leave_public_channel_modal.message": "Are you sure you wish to leave the channel {channel}? You can re-join this channel in the future if you change your mind.", "leave_public_channel_modal.message": "Are you sure you wish to leave the channel {channel}? You can re-join this channel in the future if you change your mind.",
"leave_public_channel_modal.title": "Leave Channel {channel}", "leave_public_channel_modal.title": "Leave Channel {channel}",
"leave_team_modal_guest_only_private.desc": "**You will be removed from {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?", "leave_team_modal_guest_only_private.description": "<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> You won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_guest_only_public.desc": "**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?", "leave_team_modal_guest_only_public.description": "<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} on this team.</strong> You won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_guest.desc": "**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** You won't be able to rejoin it without an invitation from another team member. Are you sure?", "leave_team_modal_guest.description": "<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> You won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_private.desc": "**You will be removed from {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels} } on this team.** If the team is private you won't be able to rejoin it the team without an invitation from another team member. Are you sure?", "leave_team_modal_private.description": "<strong>You will be removed from {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal_public.desc": "**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels} } on this team.** Are you sure?", "leave_team_modal_public.description": "<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} on this team.</strong> Are you sure?",
"leave_team_modal.desc": "**You will be removed from {num_of_public_channels} public { num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private { num_of_private_channels,plural,one {channel} other {channels}} on this team.** If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?", "leave_team_modal.description": "<strong>You will be removed from {num_of_public_channels} public {num_of_public_channels,plural,one {channel} other {channels}} and {num_of_private_channels} private {num_of_private_channels,plural,one {channel} other {channels}} on this team.</strong> If the team is private you won't be able to rejoin it without an invitation from another team member. Are you sure?",
"leave_team_modal.no": "No", "leave_team_modal.no": "No",
"leave_team_modal.title": "Leave the team?", "leave_team_modal.title": "Leave the team?",
"leave_team_modal.yes": "Yes", "leave_team_modal.yes": "Yes",