From f9971e9113da7e43fc61c89541fe700e48de7278 Mon Sep 17 00:00:00 2001 From: louispaulb Date: Fri, 22 May 2026 06:01:28 -0400 Subject: [PATCH] =?UTF-8?q?feat(ops/campaigns):=20Phase=202=20=E2=80=94=20?= =?UTF-8?q?switch=20editor=20page=20to=20easy-email=20iframe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the broken GrapesJS-mjml integration with an iframe pointing to the standalone email-editor microservice at editor.gigafibre.ca (created in Phase 1). What changed: - Dropped all grapesjs* imports and ~250 lines of editor init/save/preview glue code. That logic now lives in the React app on the other side of the iframe. - Page becomes a thin wrapper: • Top bar: back button, template selector, "saved" chip, "Aperçu inbox" button, "Envoyer un test" button, reload button. • Below: full-height iframe to editor.gigafibre.ca/?name=. - Template switching: bumping iframeKey forces a fresh iframe load so the new ?name= param takes effect. Route is updated via router.replace. - postMessage listener: receives { type: 'email-editor:saved', ts } from the editor iframe and shows a positive toast + updates the "Sauvegardé · il y a Xs" chip. Origin-checked against EDITOR_BASE. - Preview dialog: unchanged — fetches compiled HTML from hub's preview endpoint and renders in srcdoc iframe. - Test-send dialog: unchanged from previous version. Removed (now handled inside the iframe): - Visual / HTML / Aperçu view-mode toggle (editor.gigafibre.ca handles all editing modes natively) - "Vide" / "Réinitialiser" buttons (editor has its own) - "Annuler" / "Enregistrer" buttons (editor saves itself on Cmd-S / toolbar button) - spell-check on textarea (editor handles it) - GrapesJS asset manager wiring (editor will use its own image picker in Phase 3) DNS prerequisite handled separately: editor.gigafibre.ca → 96.125.196.67 created via Cloudflare API (proxied=false to match the existing pattern that lets Traefik handle Let's Encrypt directly). Container running on prod via /opt/email-editor/docker-compose.yml, Traefik routing to Host(`editor.gigafibre.ca`). HTTPS verified live. Co-Authored-By: Claude Opus 4.7 --- .../campaigns/pages/TemplateEditorPage.vue | 534 +++++------------- 1 file changed, 128 insertions(+), 406 deletions(-) diff --git a/apps/ops/src/modules/campaigns/pages/TemplateEditorPage.vue b/apps/ops/src/modules/campaigns/pages/TemplateEditorPage.vue index dffd7d9..443f00d 100644 --- a/apps/ops/src/modules/campaigns/pages/TemplateEditorPage.vue +++ b/apps/ops/src/modules/campaigns/pages/TemplateEditorPage.vue @@ -1,35 +1,55 @@ - -