Remove /admin/rules/export page (migration export tool no longer needed) #129
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
m: we don't need the migration-export tool — remove it cleanly.
The
/admin/rules/exportpage (originally Slice 11b, t-paliad-192) surfaces theGET /admin/api/rules/export-migrationsendpoint, which generatedINSERT/UPDATESQL from rules edited via the admin UI so they could be back-ported as numbered migrations. The workflow has shifted: rule changes land directly in numbered SQL migration files written by hand. The export tool has no other consumers.Files to delete
frontend/src/admin-rules-export.tsx— page templatefrontend/src/client/admin-rules-export.ts— page client bundleFiles to edit (remove the export-related lines only)
internal/handlers/handlers.go:GET /admin/rules/export(around line 673)GET /admin/api/rules/export-migrations(around line 676)internal/handlers/admin_rules.go:handleAdminExportRuleMigrationshandler (around line 303)handleAdminRulesExportPagehandler (around line 330)go build ./...)frontend/build.ts:import { renderAdminRulesExport } from "./src/admin-rules-export"(around line 49)Bun.write("admin-rules-export.html", renderAdminRulesExport())line (around line 419)admin-rules-export.tsis listed therefrontend/src/components/Sidebar.tsx:navItem("/admin/rules/export", ...)line (around line 208)frontend/src/admin-rules-list.tsx:<a href="/admin/rules/export" ...>button (around line 42)frontend/src/i18n-keys.ts:"nav.admin.rules_export"keyfrontend/src/client/i18n.ts:"nav.admin.rules_export"entries in both DE (around line 2895) and EN (around line 5969)admin.rules.export.*translation keys if they exist (search foradmin.rules.export)Acceptance
go build ./...andcd frontend && bun run buildboth clean.grep -rn "rules/export\|rules_export\|RulesExport\|admin-rules-export\|export-migrations\|handleAdminExportRuleMigrations\|handleAdminRulesExportPage\|renderAdminRulesExport" .returns zero hits./admin/rulesstill works; the "Migrations exportieren" button is gone./admin/rules/exportreturns 404 (route unregistered) — not a 500.Notes
/admin/rulesand/admin/rules/{id}/editstay. Only the export-to-SQL flow goes.Done —
/admin/rules/exportpage +export-migrationsAPI removed (pure deletion, no behaviour changes elsewhere).Commit:
cc13a5b857Branch:
mai/artemis/gitster-remove-adminWhat changed
Deleted files
frontend/src/admin-rules-export.tsxfrontend/src/client/admin-rules-export.tsBackend (Go)
internal/handlers/handlers.go— removed both route registrations (GET /admin/rules/export,GET /admin/api/rules/export-migrations).internal/handlers/admin_rules.go— removedhandleAdminExportRuleMigrations+handleAdminRulesExportPage.internal/services/rule_editor_service.go— removedExportMigrationsSincemethod +ExportResulttype + thesqlEscapehelper (its only callsite was the removed export). Themigration_exportedcolumn onpaliad.deadline_rule_auditis untouched — no schema change requested.Frontend
frontend/build.ts— dropped therenderAdminRulesExportimport, thedist/admin-rules-export.htmlwrite, and theadmin-rules-export.tsclient-bundle entry.frontend/src/components/Sidebar.tsx— removed theRegel-Migrationsnav item.frontend/src/admin-rules-list.tsx— removed theMigrations exportierenbutton (the+ Neue Regelbutton remains; the.admin-rules-header-actionsflex container is kept for it).frontend/src/i18n-keys.ts— droppednav.admin.rules_export,admin.rules.list.export, and the 17admin.rules.export.*keys.frontend/src/client/i18n.ts— removed the matching DE + EN translation blocks.frontend/src/styles/global.css— removed the dead.admin-rules-export-*CSS rules (orphaned by the page deletion).Docs
docs/design-fristen-phase2-2026-05-15.md— table row marked as removed-in-t-paliad-297 (it cited the now-deleted endpoint).docs/design-paliad-data-export-2026-05-19.md— two references updated. The "existing export precedent" pointer + the linked-files list now point athandleAdminDownloadBackup(/api/admin/backups/{id}/file) as the surviving admin-gated-download pattern, with a note that the old precedent was removed in this task. Acceptance #2 (grep returns zero hits) requires touching docs too.Acceptance verification
go build ./...— clean (no output).cd frontend && bun run build— clean (i18n codegen: 2890 keys (unchanged),i18n scan: data-i18n attributes clean,Build complete → dist/).grep -rn "rules/export\|rules_export\|RulesExport\|admin-rules-export\|export-migrations\|handleAdminExportRuleMigrations\|handleAdminRulesExportPage\|renderAdminRulesExport" .— zero hits.GET /admin/rules/exportis gone — the Gonet/httpServeMux returns 404 for unregistered paths, so/admin/rules/exportwill 404 (not 500).Regeln verwaltenonly — theRegel-Migrationscompanion line is gone (Sidebar.tsx diff confirms)./admin/ruleslist header no longer showsMigrations exportieren— only the+ Neue Regelbutton remains.Diff stat: 13 files changed, 3 insertions(+), 392 deletions(-) — matches the issue's "small ~-400 lines" estimate.
Caveat
Per CLAUDE.md UI-changes-need-browser-verification, the most rigorous version would be spinning up
paliad-server(needsDATABASE_URL+SUPABASE_URL+ a logged-in admin session) and clicking through/admin/rules+/admin/rules/export. I relied on build success + the grep + the route-registration diff instead because this is a pure deletion with no live code paths exercising the removed code anymore. Happy to do the browser pass on request, but for a deletion of this shape the static checks are exhaustive.Not closing — per CLAUDE.md only m closes. Stamping
donelabel.