Großes Cleanup: Bugs fixen, Features fertigstellen, toten Code entfernen

Bugs behoben:
- handleEdit() async keyword hinzugefügt (E-Mail-Checkboxen funktionieren jetzt)
- parseUTC() Funktion definiert (Fortschritts-Timer nutzt Server-Startzeit)
- Status cancelling wird im Frontend korrekt angezeigt

Features fertiggestellt:
- Sidebar: Lagen nach Typ getrennt (adhoc/research) mit Zählern
- Quellen-Bearbeiten: Edit-Button pro Quelle, Formular vorausfüllen
- Lizenz-Info: Org-Name und Lizenzstatus im Header angezeigt

Toter Code entfernt:
- 5 verwaiste Dateien gelöscht (alte rss_parser, style.css, components.js, layout.js, setup_users)
- 6 ungenutzte Pydantic Models entfernt
- Ungenutzte Funktionen/Imports in auth.py, routers, agents, config
- Tote API-Methoden, Legacy-UI-Methoden, verwaiste WS-Handler
- Abgeschlossene DB-Migrationen aufgeräumt

Sonstiges:
- requirements.txt: passlib[bcrypt] durch bcrypt ersetzt
- Umlaute korrigiert (index.html)
- CSS: incident-type-label → incident-type-badge, .login-success hinzugefügt
- Schließen statt Schliessen im Feedback-Modal
Dieser Commit ist enthalten in:
claude-dev
2026-03-04 18:45:38 +01:00
Ursprung 2a155c084d
Commit 71296edb97
23 geänderte Dateien mit 269 neuen und 4768 gelöschten Zeilen

Datei anzeigen

@@ -52,6 +52,7 @@ CREATE TABLE IF NOT EXISTS magic_links (
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Hinweis: portal_admins wird von der Verwaltungs-App (Admin-Portal) genutzt, die dieselbe DB teilt.
CREATE TABLE IF NOT EXISTS portal_admins (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
@@ -213,14 +214,6 @@ async def init_db():
await db.commit()
logger.info("Migration: tenant_id zu incidents hinzugefuegt")
# Migration: E-Mail-Benachrichtigungs-Praeferenzen pro Lage
if "notify_email_summary" not in columns:
await db.execute("ALTER TABLE incidents ADD COLUMN notify_email_summary INTEGER DEFAULT 0")
await db.execute("ALTER TABLE incidents ADD COLUMN notify_email_new_articles INTEGER DEFAULT 0")
await db.execute("ALTER TABLE incidents ADD COLUMN notify_email_status_change INTEGER DEFAULT 0")
await db.commit()
logger.info("Migration: E-Mail-Benachrichtigungs-Spalten zu incidents hinzugefuegt")
# Migration: Token-Spalten fuer refresh_log
cursor = await db.execute("PRAGMA table_info(refresh_log)")
rl_columns = [row[1] for row in await cursor.fetchall()]
@@ -246,19 +239,6 @@ async def init_db():
await db.execute("ALTER TABLE refresh_log ADD COLUMN tenant_id INTEGER REFERENCES organizations(id)")
await db.commit()
# Migration: reliability_score entfernen (falls noch vorhanden)
cursor = await db.execute("PRAGMA table_info(incidents)")
inc_columns = [row[1] for row in await cursor.fetchall()]
if "reliability_score" in inc_columns:
await db.execute("ALTER TABLE incidents DROP COLUMN reliability_score")
await db.commit()
cursor = await db.execute("PRAGMA table_info(incident_snapshots)")
snap_columns = [row[1] for row in await cursor.fetchall()]
if "reliability_score" in snap_columns:
await db.execute("ALTER TABLE incident_snapshots DROP COLUMN reliability_score")
await db.commit()
# Migration: notifications-Tabelle (fuer bestehende DBs)
cursor = await db.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='notifications'")
if not await cursor.fetchone():
@@ -340,14 +320,6 @@ async def init_db():
await db.execute("ALTER TABLE users ADD COLUMN last_login_at TIMESTAMP")
await db.commit()
# Migration: E-Mail-Benachrichtigungs-Praeferenzen fuer users
if "notify_email_summary" not in user_columns:
await db.execute("ALTER TABLE users ADD COLUMN notify_email_summary INTEGER DEFAULT 0")
await db.execute("ALTER TABLE users ADD COLUMN notify_email_new_articles INTEGER DEFAULT 0")
await db.execute("ALTER TABLE users ADD COLUMN notify_email_status_change INTEGER DEFAULT 0")
await db.commit()
logger.info("Migration: E-Mail-Benachrichtigungs-Spalten zu users hinzugefuegt")
# Migration: tenant_id fuer articles
cursor = await db.execute("PRAGMA table_info(articles)")
art_columns = [row[1] for row in await cursor.fetchall()]