diff --git a/web/static/js/migration.js b/web/static/js/migration.js new file mode 100644 index 0000000..636c8b4 --- /dev/null +++ b/web/static/js/migration.js @@ -0,0 +1,365 @@ +// Migration workflow: options modal → progress → results view + +import { api } from './api.js'; +import { state, setState } from './state.js'; +import { escHtml, formatDateTime, downloadCsv } from './utils.js'; +import { navigate } from './router.js'; +import { refreshTemplates } from './templates.js'; + +// ── Helpers ──────────────────────────────────────────────────────────────── + +function getSettings() { + try { return JSON.parse(localStorage.getItem('migrator_settings')) || {}; } + catch { return {}; } +} + +// ── Options modal ────────────────────────────────────────────────────────── + +export function showOptionsModal(ids) { + if (!ids || !ids.length) return; + const settings = getSettings(); + const names = ids.map(id => { + const t = state.templates.find(t => t.adobe_id === id); + return t ? t.name : id; + }); + + const existing = document.getElementById('migration-modal'); + if (existing) existing.remove(); + + const wrapper = document.createElement('div'); + wrapper.id = 'migration-modal'; + wrapper.innerHTML = ` +
+