changes to monitor onboarding checklist

This commit is contained in:
Yinyin Liu 2026-06-02 08:29:20 +02:00
parent 88757c562b
commit edb30286fa
9 changed files with 42 additions and 19 deletions

View File

@ -13,7 +13,8 @@ public static class ChecklistStepDefinitions
new( 3, "Installation created on Monitor under correct product and folder",
"""
[
{"text":"checklistStep3Sub1","checked":false}
{"text":"checklistStep3Sub1","checked":false},
{"text":"checklistStep3Sub2","checked":false}
]
"""),
new( 4, "Gateway SD card configured, VPN and gateway name registered", NoSubtasks),
@ -64,8 +65,5 @@ public static class ChecklistStepDefinitions
new(11, "Software verified on site", NoSubtasks),
new(12, "Installation online on Monitor", NoSubtasks),
new(13, "Customer informed about Monitor account and reports", NoSubtasks),
new(14, "User account created with correct folders and access", NoSubtasks),
new(15, "Customer follow-up completed, feedback collected", NoSubtasks),
new(16, "Further issues tracked via Ticket system", NoSubtasks),
};
}

View File

@ -168,6 +168,14 @@ public static partial class Db
// raw-string JSON form preserving each row's existing checked state.
BackfillStep10Sub3();
// One-time backfill: the former step 14 (user account created) became a subtask of step 3.
// Append it to existing step-3 rows, preserving each row's existing checked state.
BackfillStep3Sub2();
// One-time cleanup: steps 14 (now a subtask of step 3), 15 and 16 were removed from the
// onboarding checklist. Drop any rows seeded before removal.
Connection.Execute("DELETE FROM ChecklistItem WHERE StepNumber IN (14, 15, 16)");
// One-time cleanup: step 9 (Abschluss) was removed from the on-site checklist —
// the e-signature block now handles sign-off. Drop any rows seeded before removal.
Connection.Execute("DELETE FROM OnSiteChecklistItem WHERE StepNumber = 9");
@ -200,6 +208,31 @@ public static partial class Db
}
}
// Must run AFTER the step-3 Sub1 SQL backfill above: that step populates rows whose Subtasks
// were NULL/empty, after which they become eligible for the Sub2 append below.
private static void BackfillStep3Sub2()
{
var rows = Connection.Query<ChecklistItem>(
"SELECT * FROM ChecklistItem WHERE StepNumber = 3 AND Subtasks IS NOT NULL AND Subtasks != ''");
foreach (var row in rows)
{
if (row.Subtasks is null) continue;
if (row.Subtasks.Contains("checklistStep3Sub2")) continue;
// Insert sub2 before the closing bracket. Works regardless of indentation/whitespace
// since we only look for the last `]`.
var lastBracket = row.Subtasks.LastIndexOf(']');
if (lastBracket < 0) continue;
var head = row.Subtasks.Substring(0, lastBracket).TrimEnd();
// head ends with `}` of the last existing subtask.
var newJson = head + ",{\"text\":\"checklistStep3Sub2\",\"checked\":false}]";
Connection.Execute(
"UPDATE ChecklistItem SET Subtasks = ? WHERE Id = ?",
newJson, row.Id);
}
}
private static SQLiteConnection InitConnection()
{
var latestDb = new DirectoryInfo("DbBackups")

View File

@ -11,7 +11,7 @@ function phaseId(done: number, total: number): string {
if (total === 0) return 'checklistPhaseEmpty';
if (done >= total) return 'checklistPhaseComplete';
if (done <= 5) return 'checklistPhasePreparation';
if (done <= 12) return 'checklistPhaseOnSite';
if (done <= 11) return 'checklistPhaseOnSite';
return 'checklistPhaseHandover';
}

View File

@ -550,7 +550,7 @@ const FlatInstallationView = (props: FlatInstallationViewProps) => {
return (
<SetupProgress
done={summary?.done ?? 0}
total={summary?.total ?? 16}
total={summary?.total ?? 13}
/>
);
})()}

View File

@ -329,7 +329,7 @@ const FlatInstallationView = (props: FlatInstallationViewProps) => {
return (
<SetupProgress
done={summary?.done ?? 0}
total={summary?.total ?? 16}
total={summary?.total ?? 13}
/>
);
})()}

View File

@ -777,10 +777,8 @@
"checklistStep11": "Software vor Ort verifiziert",
"checklistStep12": "Installation online auf Monitor",
"checklistStep13": "Kunde über Monitor-Konto und Reports informiert",
"checklistStep14": "Benutzerkonto mit richtigen Ordnern und Zugriffen erstellt",
"checklistStep15": "Kundennachverfolgung abgeschlossen, Feedback eingeholt",
"checklistStep16": "Weitere Anliegen werden über das Ticket-System verfolgt",
"checklistStep3Sub1": "Installations-Seriennummer",
"checklistStep3Sub2": "Benutzerkonto mit richtigen Ordnern und Zugriffen erstellt",
"checklistStep5Sub1": "Kundeninformationen (E-Mail, Adresse)",
"checklistStep5Sub2": "Installationsinformationen (externes EMS, Stromanbieter, Datenerfassung)",
"checklistStep5Sub3": "Batterie-Seriennummer",

View File

@ -525,10 +525,8 @@
"checklistStep11": "Software verified on site",
"checklistStep12": "Installation online on Monitor",
"checklistStep13": "Customer informed about Monitor account and reports",
"checklistStep14": "User account created with correct folders and access",
"checklistStep15": "Customer follow-up completed, feedback collected",
"checklistStep16": "Further issues tracked via Ticket system",
"checklistStep3Sub1": "Installation serial number",
"checklistStep3Sub2": "User account created with correct folders and access",
"checklistStep5Sub1": "Customer information (email, address)",
"checklistStep5Sub2": "Installation information (external EMS, grid provider, data collection)",
"checklistStep5Sub3": "Battery serial number",

View File

@ -777,10 +777,8 @@
"checklistStep11": "Logiciel vérifié sur site",
"checklistStep12": "Installation en ligne sur Monitor",
"checklistStep13": "Client informé du compte Monitor et des rapports",
"checklistStep14": "Compte utilisateur créé avec les dossiers et accès corrects",
"checklistStep15": "Suivi client effectué, retour recueilli",
"checklistStep16": "Problèmes ultérieurs suivis via le système de tickets",
"checklistStep3Sub1": "Numéro de série de l'installation",
"checklistStep3Sub2": "Compte utilisateur créé avec les dossiers et accès corrects",
"checklistStep5Sub1": "Informations client (e-mail, adresse)",
"checklistStep5Sub2": "Informations d'installation (EMS externe, fournisseur réseau, collecte de données)",
"checklistStep5Sub3": "Numéro de série de la batterie",

View File

@ -777,10 +777,8 @@
"checklistStep11": "Software verificato in sito",
"checklistStep12": "Installazione online su Monitor",
"checklistStep13": "Cliente informato su account Monitor e report",
"checklistStep14": "Account utente creato con cartelle e accessi corretti",
"checklistStep15": "Follow-up cliente completato, feedback raccolto",
"checklistStep16": "Ulteriori problemi tracciati tramite il sistema di ticket",
"checklistStep3Sub1": "Numero di serie dell'installazione",
"checklistStep3Sub2": "Account utente creato con cartelle e accessi corretti",
"checklistStep5Sub1": "Informazioni cliente (e-mail, indirizzo)",
"checklistStep5Sub2": "Informazioni installazione (EMS esterno, fornitore di rete, raccolta dati)",
"checklistStep5Sub3": "Numero di serie batteria",