[web] Remove toasts and NEW indicators from conversions (#35591)

* [web] Remove toasts for document conversions

* [web] Remove NEW indicators from document conversions

GitOrigin-RevId: 608b344d9be596ecb3cf4573ab1152f78d7d9d43
This commit is contained in:
Mathias Jakobsen
2026-09-17 11:36:11 +00:00
committed by Copybot
parent 17363fcc59
commit 33e0a5e1c2
11 changed files with 0 additions and 174 deletions
@@ -6,7 +6,6 @@ import { debugConsole } from '@/utils/debugging'
import importOverleafModules from '../../../../macros/import-overleaf-module.macro'
import { OLToastContainer } from '@/shared/components/ol/ol-toast-container'
import clipboardToastGenerators from '@/features/source-editor/components/clipboard-toasts'
import importDocumentFeedbackToastGenerators from '@/features/project-list/components/new-project-button/import-document-feedback-toast'
import exportDocumentToastGenerators from '@/features/ide-react/components/toolbar/export-document-toasts'
const moduleGeneratorsImport = importOverleafModules('toastGenerators') as {
@@ -29,7 +28,6 @@ type GlobalToastGenerator = (
const GENERATOR_LIST: GlobalToastGeneratorEntry[] = [
...moduleGenerators.flat(),
...clipboardToastGenerators,
...importDocumentFeedbackToastGenerators,
...exportDocumentToastGenerators,
]
const GENERATOR_MAP: Map<string, GlobalToastGenerator> = new Map(
@@ -8,7 +8,6 @@ import {
} from '@/shared/components/ol/ol-modal'
import OLButton from '@/shared/components/ol/ol-button'
import { useEffect, useState } from 'react'
import { showImportDocumentFeedbackToast } from '@/features/project-list/components/new-project-button/import-document-feedback-toast'
function ProjectConvertedFromDocumentModal() {
const [convertedFrom, setConvertedFrom] = useState<string | null>(null)
@@ -34,9 +33,6 @@ function ProjectConvertedFromDocumentModal() {
<ProjectConvertedFromImportModalContent
onHide={() => {
setConvertedFrom(null)
if (convertedFrom === 'docx' || convertedFrom === 'markdown') {
showImportDocumentFeedbackToast(convertedFrom)
}
}}
/>
)}
@@ -41,63 +41,6 @@ const ExportDocumentErrorToast = ({ data }: { data?: any }) => {
)
}
const ExportDocumentSuccessToast = ({ data }: { data?: any }) => {
const type = data?.type
if (type === 'docx') {
return (
<Trans
i18nKey="docx_export_feedback_message"
components={[
// eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
<a
href="https://forms.gle/Fg4BUXV2yv61hStX8"
target="_BLANK"
rel="noopener noreferrer"
/>,
]}
/>
)
} else if (type === 'markdown') {
return (
<Trans
i18nKey="markdown_export_feedback_message"
components={[
// eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
<a
href="https://forms.gle/wc43zEukeqpec9mAA"
target="_BLANK"
rel="noopener noreferrer"
/>,
]}
/>
)
} else if (type === 'html') {
return (
<Trans
i18nKey="html_export_feedback_message"
components={[
// eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
<a
href="https://forms.gle/nBUVGqPYwLcWHSmt5"
target="_BLANK"
rel="noopener noreferrer"
/>,
]}
/>
)
} else {
return (
<Trans
i18nKey="generic_export_feedback_message"
components={[
// eslint-disable-next-line react/jsx-key, jsx-a11y/anchor-has-content
<a href="/contact" target="_BLANK" rel="noopener noreferrer" />,
]}
/>
)
}
}
const generators: GlobalToastGeneratorEntry[] = [
{
key: 'export-document:error',
@@ -119,16 +62,6 @@ const generators: GlobalToastGeneratorEntry[] = [
isDismissible: true,
}),
},
{
key: 'export-document:success',
generator: (data: any) => ({
content: <ExportDocumentSuccessToast data={data} />,
type: 'success',
autoHide: true,
delay: 45000,
isDismissible: true,
}),
},
]
export default generators
@@ -173,13 +106,3 @@ export const hidePreparingExportToast = (handle: string) => {
})
)
}
export const showExportDocumentSuccess = (
type: 'docx' | 'markdown' | 'html'
) => {
window.dispatchEvent(
new CustomEvent('ide:show-toast', {
detail: { key: 'export-document:success', type },
})
)
}