mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 05:33:43 +01:00
[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:
committed by
Copybot
parent
17363fcc59
commit
33e0a5e1c2
@@ -510,8 +510,6 @@
|
||||
"document_updated_externally": "",
|
||||
"document_updated_externally_detail": "",
|
||||
"documentation": "",
|
||||
"docx_export_feedback_message": "",
|
||||
"docx_import_feedback_message": "",
|
||||
"doesnt_match": "",
|
||||
"doing_this_allow_log_in_through_institution": "",
|
||||
"doing_this_allow_log_in_through_institution_2": "",
|
||||
@@ -771,7 +769,6 @@
|
||||
"generate_from_text_or_image": "",
|
||||
"generate_token": "",
|
||||
"generating": "",
|
||||
"generic_export_feedback_message": "",
|
||||
"generic_if_problem_continues_contact_us": "",
|
||||
"generic_linked_file_compile_error": "",
|
||||
"generic_something_went_wrong": "",
|
||||
@@ -942,7 +939,6 @@
|
||||
"how_to_insert_images": "",
|
||||
"how_we_use_your_data": "",
|
||||
"how_we_use_your_data_explanation": "",
|
||||
"html_export_feedback_message": "",
|
||||
"i_want_to_add_a_po_number": "",
|
||||
"i_want_to_stay": "",
|
||||
"id": "",
|
||||
@@ -1223,8 +1219,6 @@
|
||||
"manager": "",
|
||||
"managers_management": "",
|
||||
"managing_your_subscription": "",
|
||||
"markdown_export_feedback_message": "",
|
||||
"markdown_import_feedback_message": "",
|
||||
"marked_as_resolved": "",
|
||||
"math": "",
|
||||
"math_display": "",
|
||||
|
||||
@@ -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(
|
||||
|
||||
-4
@@ -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)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
-77
@@ -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 },
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
hideExportDocumentError,
|
||||
hidePreparingExportToast,
|
||||
showExportDocumentError,
|
||||
showExportDocumentSuccess,
|
||||
showPreparingExportToast,
|
||||
} from '../components/toolbar/export-document-toasts'
|
||||
import { RootDocInfo } from '@/shared/hooks/use-root-doc'
|
||||
@@ -45,7 +44,6 @@ export default function useConvertProject(
|
||||
if (downloadUrl) {
|
||||
const url = new URL(downloadUrl, window.location.origin)
|
||||
location.assign(url.toString())
|
||||
showExportDocumentSuccess(type)
|
||||
} else {
|
||||
showExportDocumentError()
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import type { OLDropdownProps } from '@/shared/components/types/dropdown-menu-pr
|
||||
import { useSendProjectListMB } from '@/features/project-list/components/project-list-events'
|
||||
import type { PortalTemplate } from '../../../../../types/portal-template'
|
||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
||||
import MaterialIcon from '@/shared/components/material-icon'
|
||||
import { useProjectListContext } from '@/features/project-list/context/project-list-context'
|
||||
import { isSplitTestEnabled } from '@/utils/splitTestUtils'
|
||||
|
||||
@@ -237,7 +236,6 @@ function NewProjectButton({
|
||||
dropdownMenuEvent: 'import-docx',
|
||||
})
|
||||
}
|
||||
trailingIcon={<MaterialIcon type="fiber_new" />}
|
||||
>
|
||||
{t('import_word_document')}
|
||||
</OLDropdownItem>
|
||||
@@ -252,7 +250,6 @@ function NewProjectButton({
|
||||
dropdownMenuEvent: 'import-markdown',
|
||||
})
|
||||
}
|
||||
trailingIcon={<MaterialIcon type="fiber_new" />}
|
||||
>
|
||||
{t('import_markdown_file')}
|
||||
</OLDropdownItem>
|
||||
|
||||
-69
@@ -1,69 +0,0 @@
|
||||
import { GlobalToastGeneratorEntry } from '@/features/ide-react/components/global-toasts'
|
||||
import { Trans } from 'react-i18next'
|
||||
|
||||
const DocxImportFeedbackToast = () => (
|
||||
<div>
|
||||
<Trans
|
||||
i18nKey="docx_import_feedback_message"
|
||||
components={[
|
||||
/* eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key */
|
||||
<a
|
||||
href="https://forms.gle/B1qrdiD983YcQCJA9"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
/>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
const MarkdownImportFeedbackToast = () => (
|
||||
<div>
|
||||
<Trans
|
||||
i18nKey="markdown_import_feedback_message"
|
||||
components={[
|
||||
/* eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key */
|
||||
<a
|
||||
href="https://forms.gle/BQnQ57wB9ddS1FdKA"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
/>,
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
const generators: GlobalToastGeneratorEntry[] = [
|
||||
{
|
||||
key: 'import:docx-feedback',
|
||||
generator: () => ({
|
||||
content: <DocxImportFeedbackToast />,
|
||||
type: 'info',
|
||||
autoHide: true,
|
||||
delay: 45000,
|
||||
isDismissible: true,
|
||||
}),
|
||||
},
|
||||
{
|
||||
key: 'import:markdown-feedback',
|
||||
generator: () => ({
|
||||
content: <MarkdownImportFeedbackToast />,
|
||||
type: 'info',
|
||||
autoHide: true,
|
||||
delay: 45000,
|
||||
isDismissible: true,
|
||||
}),
|
||||
},
|
||||
]
|
||||
|
||||
export default generators
|
||||
|
||||
export const showImportDocumentFeedbackToast = (type: 'docx' | 'markdown') => {
|
||||
const key =
|
||||
type === 'markdown' ? 'import:markdown-feedback' : 'import:docx-feedback'
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('ide:show-toast', {
|
||||
detail: { key },
|
||||
})
|
||||
)
|
||||
}
|
||||
-3
@@ -13,7 +13,6 @@ import {
|
||||
} from '@/shared/components/ol/ol-dropdown-menu'
|
||||
import createNewProjectImage from '../../images/create-a-new-project.svg'
|
||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
||||
import MaterialIcon from '@/shared/components/material-icon'
|
||||
|
||||
const CustomDropdownToggle = forwardRef<
|
||||
HTMLButtonElement,
|
||||
@@ -150,7 +149,6 @@ function WelcomeMessageCreateNewProjectDropdown({
|
||||
handleDropdownItemClick(e, 'import_docx', 'import-docx')
|
||||
}
|
||||
tabIndex={-1}
|
||||
trailingIcon={<MaterialIcon type="fiber_new" />}
|
||||
>
|
||||
{t('import_word_document')}
|
||||
</OLDropdownItem>
|
||||
@@ -164,7 +162,6 @@ function WelcomeMessageCreateNewProjectDropdown({
|
||||
handleDropdownItemClick(e, 'import_markdown', 'import-markdown')
|
||||
}
|
||||
tabIndex={-1}
|
||||
trailingIcon={<MaterialIcon type="fiber_new" />}
|
||||
>
|
||||
{t('import_markdown_file')}
|
||||
</OLDropdownItem>
|
||||
|
||||
@@ -425,7 +425,6 @@
|
||||
"document_updated_externally": "Dokument opdateret eksternt",
|
||||
"document_updated_externally_detail": "Dette dokument er blevet opdateret eksternt. Ændringer du måtte have lavet kan være blevet overskrevet. For at se tidligere versioner, kig venligst i historikken.",
|
||||
"documentation": "Dokumentation",
|
||||
"docx_import_feedback_message": "Import af Word-dokumenter er en ny funktion. <0>Fortæl os hvad du synes</0>",
|
||||
"does_not_contain_or_significantly_match_your_email": "indeholder ikke, og ligner ikke i betydelig grad, din e-mailadresse",
|
||||
"doesnt_match": "Matcher ikke",
|
||||
"doing_this_allow_log_in_through_institution": "Dermed får du mulghed for at logge ind i <b>__appName__</b> igennem din institution, og vil genbekræfte din institutionelle e-mailadresse.",
|
||||
|
||||
@@ -426,7 +426,6 @@
|
||||
"do_you_want_to_change_your_primary_email_address_to": "Willst Du deine primäre E-Mail-Adresse in <b>__email__</b> ändern?",
|
||||
"do_you_want_to_overwrite_them": "Willst Du sie überschreiben?",
|
||||
"documentation": "Dokumentation",
|
||||
"docx_import_feedback_message": "Das Importieren von Word-Dokumenten ist eine neue Funktion. <0>Sag uns, was du davon hältst</0>",
|
||||
"does_not_contain_or_significantly_match_your_email": "nicht mit Teilen deiner E-Mail-Adresse übereinstimmt",
|
||||
"doesnt_match": "Stimmt nicht überein",
|
||||
"doing_this_allow_log_in_through_institution": "Dadurch kannst du dich über dein institutionelles Portal bei <b>__appName__</b> anmelden und deine institutionelle E-Mail-Adresse bestätigen.",
|
||||
|
||||
@@ -666,8 +666,6 @@
|
||||
"document_updated_externally_detail": "This document was just updated externally. Any recent changes you have made may have been overwritten. To see previous versions, please look in the history.",
|
||||
"documentation": "Documentation",
|
||||
"documentation_articles": "Documentation and articles",
|
||||
"docx_export_feedback_message": "Exporting Word docs is a new feature. <0>Let us know what you think</0>",
|
||||
"docx_import_feedback_message": "Importing Word docs is a new feature. <0>Let us know what you think</0>",
|
||||
"does_not_contain_or_significantly_match_your_email": "does not contain or significantly match your email",
|
||||
"doesnt_match": "Doesn’t match",
|
||||
"doing_this_allow_log_in_through_institution": "Doing this will allow you to log in to <b>__appName__</b> through your institution and will reconfirm your institutional email address.",
|
||||
@@ -1002,7 +1000,6 @@
|
||||
"generate_from_text_or_image": "From text or image",
|
||||
"generate_token": "Generate token",
|
||||
"generating": "Generating",
|
||||
"generic_export_feedback_message": "This is a new feature. <0>Let us know what you think</0>",
|
||||
"generic_if_problem_continues_contact_us": "If the problem continues please contact us",
|
||||
"generic_linked_file_compile_error": "This project’s output files are not available because it failed to compile. Please open the project to see the compilation error details.",
|
||||
"generic_something_went_wrong": "Sorry, something went wrong",
|
||||
@@ -1199,7 +1196,6 @@
|
||||
"how_to_insert_images": "How to insert images",
|
||||
"how_we_use_your_data": "How we use your data",
|
||||
"how_we_use_your_data_explanation": "<0>Please help us continue to improve Overleaf by answering a few quick questions. Your answers will help us and our corporate group understand more about our user base. We may use this information to improve your Overleaf experience, for example by providing personalized onboarding, upgrade prompts, help suggestions, and tailored marketing communications (if you’ve opted-in to receive them).</0><1>For more details on how we use your personal data, please see our <0>Privacy Notice</0>.</1>",
|
||||
"html_export_feedback_message": "Exporting as HTML is a new feature. <0>Let us know what you think</0>",
|
||||
"hundreds_templates_info": "Produce beautiful documents starting from our gallery of LaTeX templates for journals, conferences, theses, reports, CVs and much more.",
|
||||
"i_want_to_add_a_po_number": "I want to add a PO number",
|
||||
"i_want_to_stay": "I want to stay",
|
||||
@@ -1588,8 +1584,6 @@
|
||||
"managers_management": "Managers management",
|
||||
"managing_your_subscription": "Managing your subscription",
|
||||
"march": "March",
|
||||
"markdown_export_feedback_message": "Exporting as Markdown is a new feature. <0>Let us know what you think</0>",
|
||||
"markdown_import_feedback_message": "Importing Markdown files is a new feature. <0>Let us know what you think</0>",
|
||||
"marked_as_resolved": "Marked as resolved",
|
||||
"math": "Math",
|
||||
"math_display": "Math Display",
|
||||
|
||||
Reference in New Issue
Block a user