diff --git a/src/commons/preview-eml/banner.ts b/src/commons/preview-eml/banner.ts deleted file mode 100644 index 6c3e3e4be..000000000 --- a/src/commons/preview-eml/banner.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Zextras - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { t } from '@zextras/carbonio-shell-ui'; - -export const banner = ` - - - - - - -

- ${t( - 'label.attachments_disclaimer', - 'You are viewing an attached message. The authenticity of the attached messages can not be verified.' - )} -

- -`; diff --git a/src/commons/preview-eml/get-actions-row.ts b/src/commons/preview-eml/get-actions-row.ts deleted file mode 100644 index 727a47373..000000000 --- a/src/commons/preview-eml/get-actions-row.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Zextras - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { t } from '@zextras/carbonio-shell-ui'; -import { map } from 'lodash'; -import type { MailMessage } from '../../types'; -import { getAttachmentsDownloadLink } from '../../views/app/detail-panel/preview/utils'; - -export const getActionsRow = ({ msg }: { msg: MailMessage }): string => ` - - -

${t('label.attachment_with_count', { - count: msg.attachments?.length, - defaultValue: '{{count}} Attachment', - defaultValue_plural: '{{count}} Attachments' -})} - ${t('label.download', { - count: msg.attachments?.length, - defaultValue: 'Download', - defaultValue_plural: 'Download all' -})} - -

- - -`; diff --git a/src/commons/preview-eml/get-attachments.ts b/src/commons/preview-eml/get-attachments.ts deleted file mode 100644 index c383ede43..000000000 --- a/src/commons/preview-eml/get-attachments.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Zextras - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { find, map } from 'lodash'; -import { DefaultTheme } from 'styled-components'; -import type { MailMessage } from '../../types'; -import { humanFileSize } from '../../views/app/detail-panel/preview/file-preview'; -import { getAttachmentIconColors } from '../../views/app/detail-panel/preview/utils'; -import { getFileExtension } from '../utilities'; - -export const getAttachments = ({ msg, theme }: { msg: MailMessage; theme: DefaultTheme }): string => - ` - - -${map( - msg.attachments, - (item) => ` -
-

- ${ - getFileExtension(item).displayName?.toUpperCase() ?? - getFileExtension(item).value.toUpperCase() - } -

-
-
-
- ${item.filename} -
-
- ${humanFileSize(item.size ?? 0)} -
-
- -
` -).join('')} - - -`; diff --git a/src/commons/preview-eml/get-body-wrapper.ts b/src/commons/preview-eml/get-body-wrapper.ts deleted file mode 100644 index 8abe9ed8b..000000000 --- a/src/commons/preview-eml/get-body-wrapper.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Zextras - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export const getBodyWrapper = ({ - content, - subject -}: { - content: string; - subject: string; -}): string => { - const style = `background: white;font-family: Roboto, sans-serif;font-style: normal; font-weight: 400; font-size: 1.125rem; - line-height: 1.6875rem;`; - - return ` -
-
-
- ${subject} -
-
- ${content} -
-
-
- `; -}; diff --git a/src/commons/preview-eml/get-complete-html-for-eml.ts b/src/commons/preview-eml/get-complete-html-for-eml.ts deleted file mode 100644 index 6aac4a608..000000000 --- a/src/commons/preview-eml/get-complete-html-for-eml.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Zextras - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -export const getCompleteHTMLForEML = ({ content }: { content: string }): string => ` - - - Carbonio - - - - ${content} - - - -`; diff --git a/src/commons/preview-eml/get-eml-content.ts b/src/commons/preview-eml/get-eml-content.ts deleted file mode 100644 index ca43e1ff1..000000000 --- a/src/commons/preview-eml/get-eml-content.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Zextras - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { filter, forEach, isEmpty, map, reduce } from 'lodash'; -import { DefaultTheme } from 'styled-components'; -import type { MailMessage } from '../../types'; -import { - findAttachments, - plainTextToHTML, - _CI_REGEX, - _CI_SRC_REGEX -} from '../mail-message-renderer'; -import { getBodyWrapper } from './get-body-wrapper'; -import { getCompleteHTMLForEML } from './get-complete-html-for-eml'; -import { getEmlHeader } from './get-eml-header'; - -type GetEMLContentProps = { - messages: MailMessage[]; - conversations: Array<{ conversation: string; subject: string }>; - isMsg?: boolean; - theme: DefaultTheme; -}; - -export const getEMLContent = ({ - messages, - conversations, - isMsg = false, - theme -}: GetEMLContentProps): string => { - let content = ''; - - map(conversations, (conv) => { - const conversationMessage = isMsg - ? messages - : filter(messages, { conversation: conv.conversation }); - const _content = map(conversationMessage, (msg: MailMessage) => { - const { body } = msg; - switch (body.contentType) { - case 'text/html': { - const parts = findAttachments(msg.parts ?? [], []); - const parser = new DOMParser(); - const htmlDoc = parser.parseFromString(body.content, 'text/html'); - const imgMap = reduce( - parts, - (r, v) => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - if (!_CI_REGEX.test(v.ci)) return r; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - r[_CI_REGEX.exec(v.ci)[1]] = v; - return r; - }, - {} - ); - - const images = htmlDoc.getElementsByTagName('img'); - forEach(images, (p) => { - if (p.hasAttribute('dfsrc')) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - p.setAttribute('src', p.getAttribute('dfsrc')); - } - if (!_CI_SRC_REGEX.test(p.src)) return; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - const ci = _CI_SRC_REGEX.exec(p.getAttribute('src'))[1]; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - if (imgMap[ci]) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - const part = imgMap[ci]; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - p.setAttribute('pnsrc', p.getAttribute('src')); - p.setAttribute('src', `/service/home/~/?auth=co&id=${msg.id}&part=${part.name}`); - } - }); - - return getEmlHeader({ msg, content: htmlDoc.body.innerHTML, theme }); - } - case 'text/plain': { - return !isEmpty(body.content) - ? getEmlHeader({ msg, content: `

${plainTextToHTML(body.content)}

`, theme }) - : getEmlHeader({ msg, content: '

No Content

', theme }); - } - default: - return getEmlHeader({ msg, content: '

No Content

', theme }); - } - }); - content += getBodyWrapper({ - content: _content.join('
'), - subject: messages?.[0]?.subject - }); - }); - - return getCompleteHTMLForEML({ content }); -}; diff --git a/src/commons/preview-eml/get-eml-header.ts b/src/commons/preview-eml/get-eml-header.ts deleted file mode 100644 index a2154b896..000000000 --- a/src/commons/preview-eml/get-eml-header.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Zextras - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { filter } from 'lodash'; -import moment from 'moment'; -import { DefaultTheme } from 'styled-components'; -import type { MailMessage } from '../../types'; -import { getAvatarLabel } from '../useGetAvatarLabel'; -import { banner } from './banner'; -import { getActionsRow } from './get-actions-row'; -import { getAttachments } from './get-attachments'; -import { getParticipantHeader } from './get-participant-header'; -import { ParticipantRole } from '../../carbonio-ui-commons/constants/participants'; - -export type getEmailHeaderProps = { - msg: MailMessage; - content: string; - theme: DefaultTheme; -}; - -export const getEmlHeader = ({ msg, content, theme }: getEmailHeaderProps): string => { - const { participants } = msg; - const from = filter(participants, { type: ParticipantRole.FROM }); - const to = filter(participants, { type: ParticipantRole.TO }); - const cc = filter(participants, { type: ParticipantRole.CARBON_COPY }); - const bcc = filter(participants, { type: ParticipantRole.BLIND_CARBON_COPY }); - const replyTo = filter(participants, { type: ParticipantRole.REPLY_TO }); - const msgTime = moment(msg.date).format('ddd, MMM DD, YYYY hh:mm A'); - const hasAttachments = msg.attachments && msg.attachments?.length > 0; - return ` - - - - - - ${hasAttachments ? banner : ''} - ${hasAttachments ? getAttachments({ msg, theme }) : ''} - ${hasAttachments ? getActionsRow({ msg }) : ''} - - - - -
- - - - - - -
-
-

- ${getAvatarLabel(from?.[0]?.fullName ?? from?.[0]?.address)} -

-
-
- - ${getParticipantHeader(from, 'From')} - ${getParticipantHeader(to, 'To')} - ${getParticipantHeader(cc, 'Cc')} - ${getParticipantHeader(bcc, 'Bcc')} - ${getParticipantHeader(replyTo, 'Reply To')} -
-
- - - - -
- ${msgTime} -
-
-
-
-
- ${content} -
-
-
-`; -}; diff --git a/src/commons/print-conversation.js b/src/commons/print-conversation.js deleted file mode 100644 index 365cc5ec4..000000000 --- a/src/commons/print-conversation.js +++ /dev/null @@ -1,264 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Zextras - * - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { filter, forEach, isEmpty, map, reduce } from 'lodash'; -import moment from 'moment'; -import { - findAttachments, - plainTextToHTML, - _CI_REGEX, - _CI_SRC_REGEX -} from './mail-message-renderer'; - -export const getCompleteHTML = ({ content, account }) => - ` - - Carbonio - - - - - - - - -
- Carbonio - - ${account?.name} -
-
${content} -
${window.location.hostname}
- - - `; - -const getParticipantHeader = (participants, type) => { - const participantsList = map( - participants, - (f) => `${f.fullName || f.name || f.address} < ${f.address} > ` - ).join(', '); - - if (participants.length === 0) return ''; - return ` - ${type}: - - ${participantsList} - - `; -}; - -const getHeader = (msg, content) => { - const { participants, subject } = msg; - const from = filter(participants, { type: 'f' }); - const to = filter(participants, { type: 't' }); - const cc = filter(participants, { type: 'c' }); - const bcc = filter(participants, { type: 'b' }); - const replyTo = filter(participants, { type: 'r' }); - const msgTime = moment(msg.date).format('ddd, MMM DD, YYYY hh:mm A'); - return ` - - - - - - -
- - - - - -
- - ${getParticipantHeader(from, 'From')} - - - - - ${getParticipantHeader(to, 'To')} - ${getParticipantHeader(cc, 'Cc')} - ${getParticipantHeader(bcc, 'Bcc')} - ${getParticipantHeader(replyTo, 'Reply To')} -
Subject: ${subject}
-
- - - - -
- ${msgTime} -
-
-
-
- ${content} -
-
-
`; -}; - -export const getBodyWrapper = ({ content, subject }) => ` -
- - - - - - - -
-
- ${subject} -
-
-
${content}
-
`; - -export const getContentForPrint = ({ messages, account, conversations, isMsg = false }) => { - let content = ''; - map(conversations, (conv) => { - const conversationMessage = isMsg ? messages : filter(messages, { conversation: conv.id }); - const ss = map(conversationMessage, (msg) => { - const { body } = msg; - switch (body.contentType) { - case 'text/html': { - const parts = findAttachments(msg.parts ?? [], []); - const parser = new DOMParser(); - const htmlDoc = parser.parseFromString(body.content, 'text/html'); - const imgMap = reduce( - parts, - (r, v) => { - if (!_CI_REGEX.test(v.ci)) return r; - r[_CI_REGEX.exec(v.ci)[1]] = v; - return r; - }, - {} - ); - - const images = htmlDoc.getElementsByTagName('img'); - forEach(images, (p) => { - if (p.hasAttribute('dfsrc')) { - p.setAttribute('src', p.getAttribute('dfsrc')); - } - if (!_CI_SRC_REGEX.test(p.src)) return; - const ci = _CI_SRC_REGEX.exec(p.getAttribute('src'))[1]; - if (imgMap[ci]) { - const part = imgMap[ci]; - p.setAttribute('pnsrc', p.getAttribute('src')); - p.setAttribute('src', `/service/home/~/?auth=co&id=${msg.id}&part=${part.name}`); - } - }); - - return getHeader(msg, htmlDoc.body.innerHTML); - } - case 'text/plain': { - return !isEmpty(body.content) - ? getHeader(msg, `

${plainTextToHTML(body.content)}

`) - : getHeader(msg, '

No Content

'); - } - default: - return getHeader(msg, '

No Content

'); - } - }); - content += getBodyWrapper({ content: ss.join('
'), subject: conv.subject }); - }); - - return getCompleteHTML({ content, account }); -}; diff --git a/src/commons/print-conversation/get-attachments.ts b/src/commons/print-conversation/get-attachments.ts new file mode 100644 index 000000000..28a9d28bf --- /dev/null +++ b/src/commons/print-conversation/get-attachments.ts @@ -0,0 +1,73 @@ +/* + * SPDX-FileCopyrightText: 2022 Zextras + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { t } from '@zextras/carbonio-shell-ui'; +import { map } from 'lodash'; +import type { MailMessage } from '../../types'; + +export const getAttachments = ({ msg }: { msg: MailMessage }): string => + ` + + +
+ ${t('label.attachment_plural', 'Attachments')}: +
+ + ${map( + msg.attachments, + (item) => ` + +
+ + + +

+ ${item.filename} +

+
+ + ` + ).join('')} + + +`; diff --git a/src/commons/print-conversation/get-body-wrapper.ts b/src/commons/print-conversation/get-body-wrapper.ts new file mode 100644 index 000000000..ece6d2b4d --- /dev/null +++ b/src/commons/print-conversation/get-body-wrapper.ts @@ -0,0 +1,28 @@ +/* + * SPDX-FileCopyrightText: 2022 Zextras + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export function getBodyWrapper({ content, subject }: { content: string; subject: string }): string { + return ` +
+ + + + + + + +
+
+ ${subject} +
+
+
${content}
+
`; +} diff --git a/src/commons/print-conversation/get-complete-html.ts b/src/commons/print-conversation/get-complete-html.ts new file mode 100644 index 000000000..354082860 --- /dev/null +++ b/src/commons/print-conversation/get-complete-html.ts @@ -0,0 +1,118 @@ +/* + * SPDX-FileCopyrightText: 2022 Zextras + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { type Account } from '@zextras/carbonio-shell-ui'; + +export function getCompleteHTML({ + content, + account +}: { + content: string; + account: Account; +}): string { + return ` + + Carbonio + + + + + + + + +
+ Carbonio + + ${account?.name} +
+
${content} +
${window.location.hostname}
+ + + `; +} diff --git a/src/commons/print-conversation/get-header.ts b/src/commons/print-conversation/get-header.ts new file mode 100644 index 000000000..7acc775bc --- /dev/null +++ b/src/commons/print-conversation/get-header.ts @@ -0,0 +1,67 @@ +/* + * SPDX-FileCopyrightText: 2022 Zextras + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { filter } from 'lodash'; +import moment from 'moment'; +import { type MailMessage } from '../../types'; +import { getParticipantHeader } from './get-participant-header'; +import { getAttachments } from './get-attachments'; + +export function getHeader(msg: MailMessage, content: string): string { + const { participants, subject } = msg; + const from = filter(participants, { type: 'f' }); + const to = filter(participants, { type: 't' }); + const cc = filter(participants, { type: 'c' }); + const bcc = filter(participants, { type: 'b' }); + const replyTo = filter(participants, { type: 'r' }); + const msgTime = moment(msg.date).format('ddd, MMM DD, YYYY hh:mm A'); + const hasAttachments = msg.attachments && msg.attachments?.length > 0; + + return ` + + + + + + ${hasAttachments ? getAttachments({ msg }) : ''} + + + + +
+ + + + + +
+ + ${getParticipantHeader(from, 'From')} + + + + + ${getParticipantHeader(to, 'To')} + ${getParticipantHeader(cc, 'Cc')} + ${getParticipantHeader(bcc, 'Bcc')} + ${getParticipantHeader(replyTo, 'Reply To')} +
Subject: ${subject}
+
+ + + + +
+ ${msgTime} +
+
+
+
+ ${content} +
+
+
`; +} diff --git a/src/commons/preview-eml/get-participant-header.ts b/src/commons/print-conversation/get-participant-header.ts similarity index 100% rename from src/commons/preview-eml/get-participant-header.ts rename to src/commons/print-conversation/get-participant-header.ts diff --git a/src/commons/print-conversation/print-conversation.ts b/src/commons/print-conversation/print-conversation.ts new file mode 100644 index 000000000..c7c369bb2 --- /dev/null +++ b/src/commons/print-conversation/print-conversation.ts @@ -0,0 +1,91 @@ +/* + * SPDX-FileCopyrightText: 2022 Zextras + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { type Account } from '@zextras/carbonio-shell-ui'; +import { filter, forEach, isEmpty, map, reduce } from 'lodash'; +import { type MailMessage } from '../../types'; +import { + _CI_REGEX, + _CI_SRC_REGEX, + findAttachments, + plainTextToHTML +} from '../mail-message-renderer'; +import { getBodyWrapper } from './get-body-wrapper'; +import { getCompleteHTML } from './get-complete-html'; +import { getHeader } from './get-header'; + +function getSs(conversationMessage: Array): Array { + return map(conversationMessage, (msg) => { + const { body } = msg; + switch (body.contentType) { + case 'text/html': { + const parts = findAttachments(msg.parts ?? [], []); + const parser = new DOMParser(); + const htmlDoc = parser.parseFromString(body.content, 'text/html'); + const imgMap = reduce( + parts as any, + (r, v) => { + if (!_CI_REGEX.test(v.ci)) return r; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + r[_CI_REGEX.exec(v.ci)[1]] = v; + return r; + }, + {} + ); + + const images = htmlDoc.getElementsByTagName('img'); + forEach(images, (p) => { + if (p.hasAttribute('dfsrc')) { + p.setAttribute('src', p.getAttribute('dfsrc') ?? ''); + } + if (!_CI_SRC_REGEX.test(p.src)) return; + const ci = _CI_SRC_REGEX.exec(p.getAttribute('src') ?? '')?.[1] ?? ''; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + if (imgMap[ci]) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + const part = imgMap[ci]; + p.setAttribute('pnsrc', p.getAttribute('src') ?? ''); + p.setAttribute('src', `/service/home/~/?auth=co&id=${msg.id}&part=${part.name}`); + } + }); + + return getHeader(msg, htmlDoc.body.innerHTML); + } + case 'text/plain': { + return !isEmpty(body.content) + ? getHeader(msg, `

${plainTextToHTML(body.content)}

`) + : getHeader(msg, '

No Content

'); + } + default: + return getHeader(msg, '

No Content

'); + } + }); +} + +export const getContentForPrint = ({ + messages, + account, + conversations, + isMsg = false +}: { + messages: any; + account: Account; + conversations: any; + isMsg: boolean; +}): string => { + let content = ''; + map(conversations, (conv) => { + const filteredMessages = filter(messages, { conversation: conv.id }) ?? []; + const conversationMessages = isMsg ? messages : filteredMessages; + const ss = getSs(conversationMessages); + content += getBodyWrapper({ content: ss.join('
'), subject: conv.subject }); + }); + + return getCompleteHTML({ content, account }); +}; diff --git a/src/ui-actions/conversation-actions.tsx b/src/ui-actions/conversation-actions.tsx index 6961290cb..e63bb953e 100644 --- a/src/ui-actions/conversation-actions.tsx +++ b/src/ui-actions/conversation-actions.tsx @@ -6,14 +6,14 @@ import { Account, getBridgedFunctions, replaceHistory, t } from '@zextras/carbonio-shell-ui'; import { forEach, isArray, map } from 'lodash'; import React from 'react'; -import { errorPage } from '../commons/preview-eml/error-page'; -import { getContentForPrint } from '../commons/print-conversation'; +import { getContentForPrint } from '../commons/print-conversation/print-conversation'; import { ConversationActionsDescriptors } from '../constants'; import { convAction, getMsgsForPrint } from '../store/actions'; import { AppDispatch, StoreProvider } from '../store/redux'; import type { ConvActionReturnType, Conversation, MailMessage } from '../types'; import DeleteConvConfirm from './delete-conv-modal'; import MoveConvMessage from './move-conv-msg'; +import { errorPage } from './error-page'; type ConvActionIdsType = Array; type ConvActionValueType = string | boolean; @@ -165,14 +165,15 @@ export function printConversation({ const content = getContentForPrint({ messages: res, account, - conversations: conversation + conversations: conversation, + isMsg: false }); - if (printWindow && printWindow.top) { + if (printWindow?.top) { printWindow.top.document.title = 'Carbonio'; printWindow.document.write(content); } }) - .catch((err) => { + .catch(() => { const errorContent = errorPage; if (printWindow) printWindow.document.write(errorContent); }); diff --git a/src/commons/preview-eml/error-page.ts b/src/ui-actions/error-page.ts similarity index 96% rename from src/commons/preview-eml/error-page.ts rename to src/ui-actions/error-page.ts index bea05b800..699cd0a5b 100644 --- a/src/commons/preview-eml/error-page.ts +++ b/src/ui-actions/error-page.ts @@ -5,8 +5,8 @@ */ import { t } from '@zextras/carbonio-shell-ui'; -import productLogo from '../../assets/logo-product-grey.png'; -import logo from '../../assets/zextras-logo-gray.png'; +import productLogo from '../assets/logo-product-grey.png'; +import logo from '../assets/zextras-logo-gray.png'; export const errorPage = ` diff --git a/src/ui-actions/message-actions.tsx b/src/ui-actions/message-actions.tsx index 0068abba0..3332063e5 100644 --- a/src/ui-actions/message-actions.tsx +++ b/src/ui-actions/message-actions.tsx @@ -15,8 +15,7 @@ import { } from '@zextras/carbonio-shell-ui'; import { map, noop } from 'lodash'; import React from 'react'; -import { errorPage } from '../commons/preview-eml/error-page'; -import { getContentForPrint } from '../commons/print-conversation'; +import { getContentForPrint } from '../commons/print-conversation/print-conversation'; import { ActionsType } from '../commons/utils'; import { MAILS_ROUTE, MessageActionsDescriptors } from '../constants'; import { getMsgsForPrint, msgAction } from '../store/actions'; @@ -24,6 +23,7 @@ import { sendMsg } from '../store/actions/send-msg'; import { AppDispatch, StoreProvider } from '../store/redux'; import type { BoardContext, + Conversation, MailMessage, MessageActionReturnType, MsgActionParameters, @@ -32,6 +32,7 @@ import type { import DeleteConvConfirm from './delete-conv-modal'; import MoveConvMessage from './move-conv-msg'; import RedirectAction from './redirect-message-action'; +import { errorPage } from './error-page'; type MessageActionIdsType = Array; type MessageActionValueType = string | boolean; @@ -224,7 +225,7 @@ export function printMsg({ conversations, isMsg: true }); - if (printWindow && printWindow?.top) { + if (printWindow?.top) { printWindow.top.document.title = 'Carbonio'; printWindow.document.write(content); }