diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 359fad6446..b84eb68dcb 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -481,6 +481,7 @@ "document_updated_externally": "", "document_updated_externally_detail": "", "documentation": "", + "docx_import_feedback_message": "", "doesnt_match": "", "doing_this_allow_log_in_through_institution": "", "doing_this_allow_log_in_through_institution_2": "", diff --git a/services/web/frontend/js/features/ide-react/components/global-toasts.tsx b/services/web/frontend/js/features/ide-react/components/global-toasts.tsx index 7524459634..7788d4c0b3 100644 --- a/services/web/frontend/js/features/ide-react/components/global-toasts.tsx +++ b/services/web/frontend/js/features/ide-react/components/global-toasts.tsx @@ -6,6 +6,7 @@ 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 importDocxFeedbackToastGenerators from '@/features/project-list/components/new-project-button/import-docx-feedback-toast' const moduleGeneratorsImport = importOverleafModules('toastGenerators') as { import: { default: GlobalToastGeneratorEntry[] } @@ -27,6 +28,7 @@ type GlobalToastGenerator = ( const GENERATOR_LIST: GlobalToastGeneratorEntry[] = [ ...moduleGenerators.flat(), ...clipboardToastGenerators, + ...importDocxFeedbackToastGenerators, ] const GENERATOR_MAP: Map = new Map( GENERATOR_LIST.map(({ key, generator }) => [key, generator]) diff --git a/services/web/frontend/js/features/ide-react/components/modals/project-converted-from-docx-modal.tsx b/services/web/frontend/js/features/ide-react/components/modals/project-converted-from-docx-modal.tsx index 823a92ac34..b3d215b6cb 100644 --- a/services/web/frontend/js/features/ide-react/components/modals/project-converted-from-docx-modal.tsx +++ b/services/web/frontend/js/features/ide-react/components/modals/project-converted-from-docx-modal.tsx @@ -8,6 +8,7 @@ import { } from '@/shared/components/ol/ol-modal' import OLButton from '@/shared/components/ol/ol-button' import { useEffect, useState } from 'react' +import { showImportDocxFeedbackToast } from '@/features/project-list/components/new-project-button/import-docx-feedback-toast' function ProjectConvertedFromDocxModal() { const [ @@ -34,7 +35,10 @@ function ProjectConvertedFromDocxModal() { <> {showProjectConvertedFromDocxModal && ( setShowProjectConvertedFromDocxModal(false)} + onHide={() => { + setShowProjectConvertedFromDocxModal(false) + showImportDocxFeedbackToast() + }} /> )} diff --git a/services/web/frontend/js/features/project-list/components/new-project-button/import-docx-feedback-toast.tsx b/services/web/frontend/js/features/project-list/components/new-project-button/import-docx-feedback-toast.tsx new file mode 100644 index 0000000000..25b62780a2 --- /dev/null +++ b/services/web/frontend/js/features/project-list/components/new-project-button/import-docx-feedback-toast.tsx @@ -0,0 +1,42 @@ +import { GlobalToastGeneratorEntry } from '@/features/ide-react/components/global-toasts' +import { Trans } from 'react-i18next' + +const ImportDocxFeedbackToast = () => { + return ( +
+ , + ]} + /> +
+ ) +} + +const generators: GlobalToastGeneratorEntry[] = [ + { + key: 'import:docx-feedback', + generator: () => ({ + content: , + type: 'info', + autoHide: false, + isDismissible: true, + }), + }, +] + +export default generators + +export const showImportDocxFeedbackToast = () => { + window.dispatchEvent( + new CustomEvent('ide:show-toast', { + detail: { key: 'import:docx-feedback' }, + }) + ) +} diff --git a/services/web/locales/en.json b/services/web/locales/en.json index fcf08aada8..36ec97bd4a 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -617,6 +617,7 @@ "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_import_feedback_message": "This is a new feature, <0>give us feedback once you’ve had a look at the document", "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 __appName__ through your institution and will reconfirm your institutional email address.",