From 87ac98c524f4c264c1d49c2d5d32b62116b56f49 Mon Sep 17 00:00:00 2001 From: Zubair Imtiaz <106450046+ZubairImtiaz3@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:08:48 +0500 Subject: [PATCH] [MM-60836] Replace FormattedMarkdownMessage in 'webapp/channels/src/components/admin_console/message_export_settings.tsx' with FormattedMessage (#28635) --- .../message_export_settings.test.tsx.snap | 120 +++++++++++------- .../admin_console/message_export_settings.tsx | 43 +++++-- webapp/channels/src/i18n/en.json | 3 +- 3 files changed, 109 insertions(+), 57 deletions(-) diff --git a/webapp/channels/src/components/admin_console/__snapshots__/message_export_settings.test.tsx.snap b/webapp/channels/src/components/admin_console/__snapshots__/message_export_settings.test.tsx.snap index 0a9c2af51b..195d707ada 100644 --- a/webapp/channels/src/components/admin_console/__snapshots__/message_export_settings.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/__snapshots__/message_export_settings.test.tsx.snap @@ -67,17 +67,25 @@ exports[`components/MessageExportSettings should match snapshot, disabled, actia + +

+ +

+

+ +

+
} id="exportFormat" label={ @@ -223,17 +231,25 @@ exports[`components/MessageExportSettings should match snapshot, disabled, globa + +

+ +

+

+ +

+
} id="exportFormat" label={ @@ -493,17 +509,25 @@ exports[`components/MessageExportSettings should match snapshot, enabled, actian + +

+ +

+

+ +

+
} id="exportFormat" label={ @@ -649,17 +673,25 @@ exports[`components/MessageExportSettings should match snapshot, enabled, global + +

+ +

+

+ +

+
} id="exportFormat" label={ diff --git a/webapp/channels/src/components/admin_console/message_export_settings.tsx b/webapp/channels/src/components/admin_console/message_export_settings.tsx index 950659fef3..c7c81aa629 100644 --- a/webapp/channels/src/components/admin_console/message_export_settings.tsx +++ b/webapp/channels/src/components/admin_console/message_export_settings.tsx @@ -5,15 +5,14 @@ import React from 'react'; import type {ReactNode} from 'react'; import type {MessageDescriptor, WrappedComponentProps} from 'react-intl'; import {FormattedMessage, defineMessage, defineMessages, injectIntl} from 'react-intl'; +import {Link} from 'react-router-dom'; import type {AdminConfig} from '@mattermost/types/config'; import type {Job} from '@mattermost/types/jobs'; import ExternalLink from 'components/external_link'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import {DocLinks, JobTypes, exportFormats} from 'utils/constants'; -import {getSiteURL} from 'utils/url'; import type {BaseProps, BaseState} from './admin_settings'; import AdminSettings from './admin_settings'; @@ -51,13 +50,21 @@ const messages = defineMessages({ exportJobStartTime_title: {id: 'admin.complianceExport.exportJobStartTime.title', defaultMessage: 'Compliance Export Time:'}, exportJobStartTime_description: {id: 'admin.complianceExport.exportJobStartTime.description', defaultMessage: 'Set the start time of the daily scheduled compliance export job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM.'}, exportFormat_title: {id: 'admin.complianceExport.exportFormat.title', defaultMessage: 'Export Format:'}, - exportFormat_description: {id: 'admin.complianceExport.exportFormat.description', defaultMessage: 'Format of the compliance export. Corresponds to the system that you want to import the data into.{lineBreak} {lineBreak}For Actiance XML, compliance export files are written to the exports subdirectory of the configured [Local Storage Directory]({url}). For Global Relay EML, they are emailed to the configured email address.'}, + exportFormat_description_intro: { + id: 'admin.complianceExport.exportFormatDetail.intro', + defaultMessage: 'Format of the compliance export. Corresponds to the system that you want to import the data into.'}, + exportFormat_description_details: { + id: 'admin.complianceExport.exportFormatDetail.details', + defaultMessage: 'For Actiance XML, compliance export files are written to the exports subdirectory of the configured Local Storage Directory. For Global Relay EML, they are emailed to the configured email address.'}, createJob_title: {id: 'admin.complianceExport.createJob.title', defaultMessage: 'Run Compliance Export Job Now'}, createJob_help: {id: 'admin.complianceExport.createJob.help', defaultMessage: 'Initiates a Compliance Export job immediately.'}, }); -export const searchableStrings: Array = [ - [messages.exportFormat_description, {siteURL: ''}], +export const searchableStrings: Array< +string | MessageDescriptor | [MessageDescriptor, { [key: string]: any }] +> = [ + messages.exportFormat_description_intro, + messages.exportFormat_description_details, messages.complianceExportTitle, messages.complianceExportDesc, messages.exportJobStartTime_title, @@ -308,13 +315,25 @@ export class MessageExportSettings extends AdminSettings + <> +

+ +

+

+ ( + + {chunks} + + ), + }} + /> +

+ ); return ( diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json index 012c93869a..6ac4e39a6c 100644 --- a/webapp/channels/src/i18n/en.json +++ b/webapp/channels/src/i18n/en.json @@ -584,9 +584,10 @@ "admin.complianceExport.createJob.title": "Run Compliance Export Job Now", "admin.complianceExport.exportFormat.actiance": "Actiance XML", "admin.complianceExport.exportFormat.csv": "CSV", - "admin.complianceExport.exportFormat.description": "Format of the compliance export. Corresponds to the system that you want to import the data into.\n \nFor Actiance XML, compliance export files are written to the \"exports\" subdirectory of the configured [Local Storage Directory]({siteURL}/admin_console/environment/file_storage). For Global Relay EML, they are emailed to the configured email address.", "admin.complianceExport.exportFormat.globalrelay": "Global Relay EML", "admin.complianceExport.exportFormat.title": "Export Format:", + "admin.complianceExport.exportFormatDetail.details": "For Actiance XML, compliance export files are written to the exports subdirectory of the configured Local Storage Directory. For Global Relay EML, they are emailed to the configured email address.", + "admin.complianceExport.exportFormatDetail.intro": "Format of the compliance export. Corresponds to the system that you want to import the data into.", "admin.complianceExport.exportJobStartTime.description": "Set the start time of the daily scheduled compliance export job. Choose a time when fewer people are using your system. Must be a 24-hour time stamp in the form HH:MM.", "admin.complianceExport.exportJobStartTime.example": "E.g.: \"02:00\"", "admin.complianceExport.exportJobStartTime.title": "Compliance Export time:",