Files
dev-bot BotandClaude Sonnet 5.5 f96dec267b
CI / App (npm ci + Build, ESLint, Stylelint, Jest) (pull_request) Canceled after 0s
CI / Storage (mongo) (pull_request) Canceled after 0s
CI / Storage (postgres) (pull_request) Canceled after 0s
feat(git): Hinweis im Account-Panel, Startlog, Fehlersuche und Betriebs-Compose (#30)
- Panel zeigt bei 503/G10 und 403/G07 einen Hinweis statt sich auszublenden; ohne Login unsichtbar
- Startlog: Info-Zeile bei aktivem Backend (kid, Allowlist), ohne Secrets
- docs/git: Abschnitt Fehlersuche / nachträglich aktivieren
- docs/deploy: compose.yaml-Vorlage für das veröffentlichte Image, Verlinkung aus README/FORK/auth/storage
- Dev-Compose reicht HB_ASSET_* durch

Refs #30

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-26 11:04:24 +00:00

19 lines
1.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Zustand des Git-Panels auf der Account-Seite (FLW-258): aus dem Fehler von GET /api/git/connections
// wird entschieden, ob das Panel einen Hinweis zeigt, normal arbeitet oder unsichtbar bleibt.
export const NOTICES = {
disabled : 'Git-Backend auf diesem Server nicht aktiviert – siehe docs/git (Abschnitt „Fehlersuche / nachträglich aktivieren“).',
noOidc : 'Nur mit OIDC-Anmeldung verfügbar.'
};
/**
* @param {{ status?: number, HBErrorCode?: string }} err Fehler aus gitApi.listConnections()
* @returns {{ state: 'notice'|'hidden'|'error', notice?: string }}
* notice = Hinweis anzeigen, hidden = nichts anzeigen (nicht angemeldet), error = Panel mit Fehlermeldung
*/
export const classifyListError = (err)=>{
if(err?.status === 503 && (!err.HBErrorCode || err.HBErrorCode === 'G10')) return { state: 'notice', notice: NOTICES.disabled };
if(err?.status === 403 && (!err.HBErrorCode || err.HBErrorCode === 'G07')) return { state: 'notice', notice: NOTICES.noOidc };
if(err?.status === 401) return { state: 'hidden' };
return { state: 'error' };
};