Skip to content

Reuse import/export for cards and fix MD export - #62

Merged
BykhovDenis merged 5 commits into
developfrom
fix-md-export
Aug 2, 2026
Merged

Reuse import/export for cards and fix MD export#62
BykhovDenis merged 5 commits into
developfrom
fix-md-export

Conversation

@ArtyomSavchenko

Copy link
Copy Markdown
Collaborator

Problem

The docx/md export+import flow (fetch → convert → download, progress toast, diff-preview-before-apply) lived entirely inside controlled-documents-resources, hardcoded to ControlledDocument. Reusing it for Cards (needed now) or generic Documents (planned later) meant copy-pasting the whole thing.

Changes

  • New shared module plugins/export-resources/src/document/:
    • actions.ts — generalized exportDocumentContent/importDocumentContent, typed against any { _class, _id, title? } instead of ControlledDocument. Reuses existing downloadBlob/fileNameFromResponse helpers (also fixed a synchronous-revokeObjectURL bug 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-export Export/ExportFailed/Import strings. Translated to all 14 locales.
  • Controlled documents: models/controlled-documents/src/index.ts now points its Export/Import actions at the shared components. Removed the now-dead docxActions.ts, Export/ImportFormatPopup.svelte, ImportDocxPopup.svelte, and their orphaned ids/strings (12 keys, all 14 lang files).
  • Cards: two new actions in models/card/src/actions.ts — "Export content" / "Import content" (distinct label from the existing CSV ExportTable action to avoid two ambiguous "Export" menu items).
  • Server: no changes needed — pod-export's exportDocumentHandler already resolves the collaborative field generically by the name content, which Card also uses.
  • Documents (generic, non-controlled): out of scope, planned as a follow-up — wiring will just be two more createAction calls against the shared components.

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
ArtyomSavchenko marked this pull request as ready for review July 31, 2026 08:25
Signed-off-by: Artem Savchenko <armisav@gmail.com>
@BykhovDenis
BykhovDenis merged commit a7bcee4 into develop Aug 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants