Reuse import/export for cards and fix MD export - #62
Merged
Conversation
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
ArtyomSavchenko
marked this pull request as ready for review
July 31, 2026 08:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The docx/md export+import flow (fetch → convert → download, progress toast, diff-preview-before-apply) lived entirely inside
controlled-documents-resources, hardcoded toControlledDocument. Reusing it for Cards (needed now) or generic Documents (planned later) meant copy-pasting the whole thing.Changes
plugins/export-resources/src/document/:actions.ts— generalizedexportDocumentContent/importDocumentContent, typed against any{ _class, _id, title? }instead ofControlledDocument. Reuses existingdownloadBlob/fileNameFromResponsehelpers (also fixed a synchronous-revokeObjectURLbug there).components/—DocumentExportFormatPopup,DocumentImportFormatPopup,DocumentImportDiffPopup.svelte.@hcengineering/export(plugins/export/src/plugin.ts): new component ids + 13 strings, namespaced to avoid collision with the existing (unrelated) CSV/table-exportExport/ExportFailed/Importstrings. Translated to all 14 locales.models/controlled-documents/src/index.tsnow points its Export/Import actions at the shared components. Removed the now-deaddocxActions.ts,Export/ImportFormatPopup.svelte,ImportDocxPopup.svelte, and their orphaned ids/strings (12 keys, all 14 lang files).models/card/src/actions.ts— "Export content" / "Import content" (distinct label from the existing CSVExportTableaction to avoid two ambiguous "Export" menu items).pod-export'sexportDocumentHandleralready resolves the collaborative field generically by the namecontent, which Card also uses.createActioncalls against the shared components.