Compare commits
14
Commits
main
..
45fe327840
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45fe327840 | ||
|
|
4d0d5c8d88 | ||
|
|
1686f5769c | ||
|
|
2d36ab0b88 | ||
|
|
62e2b7dee8 | ||
|
|
86a73b862a | ||
|
|
22e509d982 | ||
|
|
76ba79b63e | ||
|
|
33a8abf5cc | ||
|
|
9c41856b5b | ||
|
|
122d4de809 | ||
|
|
5e0ad197f0 | ||
|
|
a3c1bee09e | ||
|
|
317c696e70 |
Vendored
+1
-1
@@ -7,7 +7,7 @@
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/src/Duempelkas.Desktop/Duempelkas.Desktop.csproj"
|
||||
"${workspaceFolder}/Duempelkas.slnx"
|
||||
],
|
||||
"problemMatcher": "$msCompile",
|
||||
"group": {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<Solution>
|
||||
<Folder Name="/src/">
|
||||
<Project Path="src/Duempelkas.App/Duempelkas.App.csproj" />
|
||||
<Project Path="src/Duempelkas.Desktop/Duempelkas.Desktop.csproj" />
|
||||
<Project Path="src/Duempelkas.Domain/Duempelkas.Domain.csproj" />
|
||||
<Project Path="src/Duempelkas.Infrastructure/Duempelkas.Infrastructure.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/tests/">
|
||||
<Project Path="tests/Duempelkas.Tests/Duempelkas.Tests.csproj" />
|
||||
</Folder>
|
||||
</Solution>
|
||||
@@ -79,67 +79,3 @@ Beide Seiten zeigen dieselbe Richtung Von → Nach und erklären das feste aktue
|
||||
## U12 – Anfangsbestand und Bestandskorrektur
|
||||
|
||||
Neue Konten erhalten einen erklärten Anfangsbestand ohne künstliche Einnahme. Spätere Korrektur zeigt Konto/Jahr, Formel, vorher/nachher für gewählten Bestand, gemeinsamen Anfangsbestand und Endstand sowie ausdrücklich die Auswirkungen auf frühere/spätere Jahre. Zustimmung ist erst nach Eingabe gültig, Abbrechen hat Anfangsfokus. Bestehende gemeinsame Semantik bleibt unverändert, keine Migration oder jahresbezogene neue Speicherregel. Dienst prüft den erwarteten Bestand in einer Transaktion und weist veraltete Vorschauen ab. Mehrjahrestest prüft die Verschiebung aller Jahre bei unveränderten Buchungen, Formularprüfung die notwendige Zustimmung.
|
||||
|
||||
## U13 – Lesbarkeit und Fenstergröße
|
||||
|
||||
Grundschrift 16 px, beschriftete Textgrößenwahl bis 200 % (lokal gemerkt), keine kleinen Großbuchstaben in Formular/Tabellenkopf. Lange Namen umbrechen, Dialoge passen ins Fenster und scrollen; bei schmaler Ansicht einspaltige Formulare und Buchungskarten. Licht-/Dunkelrollen für Text und Beträge getrennt; Gelöscht bleibt zusätzlich als Text erkennbar. Keine Änderung von Windows-DPI-Einstellungen und keine daraus abgeleitete vollständige Barrierefreiheitszusage. Kontrastmessung und Layout-Stichproben werden im Abschluss ergänzt.
|
||||
|
||||
U13-Kontrastmessung: Text-, Hilfstext-, Einnahme-, Ausgabe- und Umbuchungsfarben gegen Hintergrund/Oberfläche jeweils mindestens 5.91:1 (hell) und 8.37:1 (dunkel); beschriftete primäre/Erfassen-/Umbuchungs-/Löschbuttons mindestens 6.47:1. Dies sind berechnete Rollen-Stichproben, keine vollständige Messung sämtlicher Zustände.
|
||||
|
||||
## U14 – Lokale Hilfe und Einführung
|
||||
|
||||
Hilfe steht in der Navigation und wird als Teil der Anwendung offline ausgeliefert. Sie beschreibt die aktuellen Abläufe einschließlich Anfangsbestand, Undo, Suche, Sicherungsumfang und Fehlerauswegen. Überspringbare Einführung mit Vereinsname, erstem Konto/erklärtem Anfangsbestand, echter erster Buchung und Sicherung; Fortschritt wird in den lokalen Einstellungen gespeichert, keine Registrierung und keine automatischen Beispielbuchungen. Der Integrationstest überspringt/öffnet erneut, legt ein selbst benanntes Konto mit Anfangsbestand an und bestätigt die leere Buchungsliste.
|
||||
|
||||
## U15 – Suchen und Sortieren
|
||||
|
||||
Suche über Beschreibung, Nummer, Datum, Gegenkonto und deutsche Betragsdarstellung; mehrere Suchwörter müssen gemeinsam passen. Auswahl für Datum, vorzeichenrichtigen Betrag und Beschreibung. Trefferzahl und eigene wirksame Treffermengensumme erklären ausdrücklich den unveränderten Kontostand des gewählten Zeitraums. Zurücksetzen zeigt dessen vollständige aktive Liste; Historie bleibt gesondert. Test sucht mit Umlaut und 12,50 aus 400 Einträgen, prüft Nummer, Leerzustand, Reset und unveränderte Originalbeträge.
|
||||
|
||||
## U16 – Offline und Fehlerauswege
|
||||
|
||||
Bootstrap 5.3.3 sowie Bootstrap Icons 1.11.3 einschließlich Schriftdateien und MIT-Lizenzen werden lokal ausgeliefert; Startseite lädt keine CDN-Dateien mehr. Ressourcenprüfung prüft CSS-/JS-/Schriftdateien. Fehlergrenze bietet sicheren Wiederholungs-/Übersichtsweg, behauptet keine Speicherung und gibt nur Referenz/Fehlertyp statt potenzieller Buchungsdaten aus; Angaben sind kopierbar. Nicht gefunden bietet Rückweg. Erwartbare Speicherfehler sind weiterhin mit erhaltenen Eingaben als Toast behandelt. Paket- und Offline-Layoutprüfung folgt im Abschluss.
|
||||
|
||||
## Abschließende Prüfungen U08–U16
|
||||
|
||||
Debug-Suite nach jeder Maßnahme bestanden: U08 44, U09 45, U10 46, U11 49, U12 51, U13 51, U14 52, U15 54, U16 57 Tests. Desktop jeweils ohne Warnungen/Fehler gebaut; abschließende Release-Suite 57/57 bestanden.
|
||||
|
||||
Zusätzliche Headless-Chromium-Prüfung der tatsächlich gerenderten Konto-/Buchungs-Komponenten mit lokalen Produktionsressourcen: 16 Kombinationen bei 768 × 480 CSS-Pixeln, hell/dunkel und 100/125/150/200 % Textgröße. Browsernetz blockiert, keine externen Requests, lokale Symbole sichtbar. Kein horizontaler Seitenüberlauf; Dialog im Fenster, Speichern per Scrollen erreichbar. PNGs wurden exemplarisch kontrolliert. Dies prüft Textvergrößerung und Browserlayout, nicht sämtliche realen Windows-DPI-/Screenreader-Kombinationen.
|
||||
|
||||
Computer Use wurde nach der Unterbrechung fortgesetzt. U08: semantische Kontolinks, sichtbarer Eingabefokus, modaler Accessibility-Baum ohne Hintergrund und Escape-Schließen geprüft. Nach behobener Fensterzuordnung: finale Anwendung mit lokalen Bootstrap-Ressourcen gestartet; beschriftetes Zeilenmenü geöffnet und empfangene Umbuchung mit korrekter Von→Nach-Richtung, festem/änderbarem Konto sowie Minus/Plus-Vorschau gelesen. Sämtliche Tätigkeiten fanden im künstlichen Debug-Datenordner statt. Kein tatsächlicher Bankvorgang und keine Änderung am Vereinsbestand. Native vollständige DPI-/Hilfstechnologie-/Zielgruppenabnahme bleibt offen.
|
||||
|
||||
Abschlusskorrekturen aus der nativen Prüfung: Betragswert im Korrekturdialog und erklärter Leerzustand werden als Werte statt als Parametertexte gebunden; Regressionen prüfen beide Ausgangsanzeigen. Rückgängig aktualisiert auch den sichtbaren Löschstatus und verwendet nach Navigation weiterhin das ursprüngliche Konto. Eine zweite Escape-Anforderung im Verlustschutz rendert den Wechsel zurück zur Bearbeitung. Finale Prüfung: **58/58 Debug- und 58/58 Release-Tests**, Desktop Debug/Release ohne Warnungen/Fehler; alle 16 Offline-Layoutkombinationen erneut bestanden. Die native Prüfung der Bestandskorrektur bestätigte Konto/Jahr, Formel, Vorher/Nachher und Warnung für alle Jahre; es wurde keine Korrektur gespeichert. Der anschließend korrigierte Zahlenwert ist zusätzlich automatisiert geprüft.
|
||||
|
||||
## Weitere Bedienkorrekturen nach manueller Analyse
|
||||
|
||||
Zusätzliche Nachkommastellen und ungültige Einfügungen werden weiterhin vollständig abgewiesen, jetzt ohne Warnmeldung. Die Historie ist als beschrifteter Switch mit vertikalem Abstand erreichbar. Aktive Buchungen haben direkte Stift-/Papierkorbbuttons mit mindestens 44 × 44 Pixeln, Title und buchungsbezogener zugänglicher Beschriftung.
|
||||
|
||||
Der Jahreswechselhinweis ist eine Warnbox mit Symbol, Datum, angezeigtem und tatsächlichem Buchungsjahr. Die Prüfung erfolgt beim Verlassen des Datumsfelds, damit der native Kalender beim Blättern geöffnet bleibt. Vor dem Speichern wird auch ein noch nicht verlassenes Datumsfeld übernommen und validiert; der Verlustschutz berücksichtigt solche Eingaben bereits während der Bearbeitung. Das gilt für Einnahmen/Ausgaben und Umbuchungen.
|
||||
|
||||
Validierung: 60/60 Tests in Debug und Release; Desktop Debug/Release ohne Warnungen oder Fehler. Regressionen prüfen stille Betragsabweisung, direkte Aktionen, Datumskorrektur, verzögerte Prüfung, externe Datumswerte, Verlustschutz und Submit ohne vorherigen Fokuswechsel. Alle 16 Offline-Layoutkombinationen erneut bestanden. Native Computer-Use-Prüfung mit künstlichem Bestand: Switch blendet gelöschte Zeilen ein, direkter Stift öffnet Bearbeiten, dritte Nachkommastelle bleibt ohne Meldung blockiert. Im Erfassen-Dialog bleibt der Kalender beim Blättern von Dezember 2026 nach Januar 2027 geöffnet; nach Abschluss und Wechsel zur Beschreibung erscheint die Warnbox. Keine Testbuchung gespeichert und keine Vereinsdaten verändert.
|
||||
|
||||
## Windows-Anwendungssymbol
|
||||
|
||||
Das vorhandene Kassen-Icon bleibt in der Windows-EXE eingebettet und wird als natives Fenstersymbol gesetzt. Die ungenutzte Photino-Registrierung für Windows-Systembenachrichtigungen ist deaktiviert: Sie kann die explizite AppUserModelID überschreiben und Verknüpfungen zum generischen dotnet-Host anlegen. Damit bleibt die eigene Windows-Zuordnung für die Taskleiste erhalten; die in der Anwendung angezeigten Toasts funktionieren unabhängig davon. Bestehende Windows-Verknüpfungen werden nicht verändert.
|
||||
|
||||
Release als eigenständige Windows-Einzeldatei veröffentlicht. Das aus der veröffentlichten EXE extrahierte Anwendungssymbol entspricht dem vorhandenen Kassen-Icon; auch das native Testfenster zeigt es in der Titelleiste. Die Taskleistendarstellung wurde nicht separat visuell erfasst. Build und Veröffentlichung ohne Warnungen oder Fehler.
|
||||
|
||||
## Zentrierte Symbole, Tabellenkontrast und konkrete Laufmeldungen
|
||||
|
||||
Stift und Papierkorb sind in beiden Achsen zentriert; die Symbolschrift verwendet im Button eine Blockbox ohne Baseline-Versatz. Tabellenköpfe verwenden die Text- und Oberflächenfarbe des aktuellen Designs statt der festen Bootstrap-Klasse für helle Tabellen. Die sechs generischen Laufmeldungen benennen nun Sicherung erstellen, Sicherung wiederherstellen, Kontenübersicht als PDF erstellen/speichern, Kontoauszug als PDF erstellen/speichern oder gespeicherte PDF öffnen.
|
||||
|
||||
Debug-Tests: 60/60 bestanden. Zusätzliche Browserprüfung mit lokalem Produktions-CSS: Symbole bei 100 und 200 % in beiden Designs innerhalb von 0,6 Pixeln zentriert, Buttons mindestens 44 × 44 Pixel. Kontrast der sichtbaren Tabellenköpfe 17,85:1 (hell) und 12,89:1 (dunkel). Alle 16 bisherigen Offline-Layoutkombinationen bestehen weiterhin; dunkler Tabellenkopf und Symbole zusätzlich visuell geprüft.
|
||||
|
||||
Auch die Release-Suite besteht mit 60/60 Tests. Desktop Debug und Release bauen ohne Warnungen oder Fehler; `git diff --check` ist sauber.
|
||||
|
||||
## Dauerhafte Anzeige gelöschter Buchungen
|
||||
|
||||
Die Historienansicht wird als benutzerweite Einstellung in settings.json gespeichert und beim Öffnen jeder Kontoliste geladen. Sie bleibt über Kontowechsel und Neustarts aktiv, bis der Switch ausgeschaltet wird. „Filter zurücksetzen“ ändert nur Suche und Sortierung. Bestehende Einstellungsdateien ohne diesen Wert starten weiterhin mit ausgeblendeten gelöschten Buchungen.
|
||||
|
||||
62/62 Tests in Debug und Release bestanden. Neue Regressionen prüfen Kontowechsel, Filterreset, Ausschalten, erneutes Laden durch eine neue SettingsService-Instanz und Erhalt der übrigen Einstellungen. Navigationstest wartet auf die tatsächlich geladene Kontokarte. Debug-Desktop-Build ohne Warnungen/Fehler. Der vorhandene Publish-Task wird anschließend mit seinen unveränderten Release-/win-x64-/Einzeldatei-Argumenten ausgeführt. Die bereits vorhandene lokale Anpassung an AccountCard.razor bleibt separat erhalten und fließt in die lokale Veröffentlichung ein.
|
||||
|
||||
Publish-Task erfolgreich abgeschlossen: Publish/Duempelkas-v26.306.exe (69.325.134 Bytes). Die ältere veröffentlichte Version bleibt erhalten. Die veröffentlichte Release-Anwendung wurde nicht gegen die Vereinsdaten gestartet.
|
||||
|
||||
## Builddatum im Über-Dialog
|
||||
|
||||
Neben der Programmversion steht jetzt das Builddatum im Format TT.MM.JJJJ. Der Desktop-Build bettet seinen UTC-Zeitstempel als Assembly-Metadatum ein; die Anzeige benötigt weder einen Dateipfad noch das Änderungsdatum der EXE und bleibt dadurch auch in der veröffentlichten Einzeldatei verfügbar. Debug-Build ohne Warnungen/Fehler; eingebettetes Datum 02.11.2026 aus der erzeugten Desktop-Assembly ausgelesen und geprüft. Debug-Suite: 62/62 Tests bestanden.
|
||||
|
||||
Auch Release: 62/62 Tests bestanden; vorhandener Publish-Task erfolgreich erneut ausgeführt und Publish/Duempelkas-v26.306.exe aktualisiert.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
<a class="card account-card h-100" href="@($"/accounts/{Account.Id}")" @onclick="Navigate" @onclick:preventDefault="true">
|
||||
<div class="card-body d-flex flex-column justify-content-between pb-0 pt-1 px-2">
|
||||
<h4 class="card-title mb-3 mt-0">@Account.Name</h4>
|
||||
<div class="@(Account.TotalBalance >= 0 ? "amount-positive" : "amount-negative") fs-5">
|
||||
<div class="card-body d-flex flex-column justify-content-between">
|
||||
<h3 class="card-title mb-3 mt-0">@Account.Name</h3>
|
||||
<div class="@(Account.TotalBalance >= 0 ? "amount-positive" : "amount-negative") fs-4">
|
||||
@($"{Account.TotalBalance:N2} €")
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<td data-label="Nummer">@Entry.DisplayId</td>
|
||||
<td data-label="Datum">@Entry.Date.ToString("dd.MM.yyyy")</td>
|
||||
<td data-label="Beschreibung" class="entry-description">
|
||||
<span class="entry-title">@Entry.Title</span>
|
||||
@Entry.Title
|
||||
@if (Entry.IsDeleted)
|
||||
{
|
||||
<p class="deleted-status">Gelöscht – zählt nicht zum Kontostand</p>
|
||||
@@ -26,14 +26,15 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="entry-action-buttons">
|
||||
<button type="button" class="btn btn-outline-secondary" title="Buchung bearbeiten" @onclick="() => OnEdit.InvokeAsync(Entry.Id)" aria-label="@($"{Entry.DisplayId} {Entry.Title} bearbeiten")">
|
||||
<i class="bi bi-pencil" aria-hidden="true"></i>
|
||||
<details class="entry-action-menu">
|
||||
<summary aria-label="@($"Aktionen für {Entry.DisplayId} {Entry.Title}")">Aktionen</summary>
|
||||
<button type="button" class="btn btn-outline-secondary" @onclick="() => OnEdit.InvokeAsync(Entry.Id)" aria-label="@($"{Entry.DisplayId} {Entry.Title} bearbeiten")">
|
||||
<i class="bi bi-pencil" aria-hidden="true"></i> Bearbeiten
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-danger" title="Buchung löschen" @onclick="() => OnDelete.InvokeAsync(Entry.Id)" aria-label="@($"{Entry.DisplayId} {Entry.Title} löschen")">
|
||||
<i class="bi bi-trash" aria-hidden="true"></i>
|
||||
<button type="button" class="btn btn-outline-danger" @onclick="() => OnDelete.InvokeAsync(Entry.Id)" aria-label="@($"{Entry.DisplayId} {Entry.Title} löschen")">
|
||||
<i class="bi bi-trash" aria-hidden="true"></i> Löschen
|
||||
</button>
|
||||
</div>
|
||||
</details>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,31 +1,10 @@
|
||||
@inject ISettingsService Settings
|
||||
|
||||
<div class="entry-filters">
|
||||
<div><label for="entry-search">Buchungen suchen</label>
|
||||
<input id="entry-search" type="search" class="form-control" @bind="searchText" @bind:event="oninput" placeholder="Beschreibung, Nummer, Datum oder Betrag" /></div>
|
||||
<div><label for="entry-sort">Sortierung</label>
|
||||
<select id="entry-sort" @bind="sort">
|
||||
<option value="date-asc">Datum: älteste zuerst</option><option value="date-desc">Datum: neueste zuerst</option>
|
||||
<option value="amount-asc">Betrag: aufsteigend</option><option value="amount-desc">Betrag: absteigend</option>
|
||||
<option value="title">Beschreibung: A–Z</option>
|
||||
</select></div>
|
||||
<button type="button" class="btn btn-outline-secondary filter-reset" @onclick="ResetFilters">Filter zurücksetzen</button>
|
||||
</div>
|
||||
@if (!string.IsNullOrWhiteSpace(searchText))
|
||||
{
|
||||
<p class="search-summary" role="status">@VisibleEntries.Count Treffer. Summe der wirksamen Treffer: @ResultSum.ToString("N2", System.Globalization.CultureInfo.GetCultureInfo("de-DE")) €.
|
||||
Der Kontostand des gewählten Zeitraums oben bleibt unverändert.</p>
|
||||
}
|
||||
@if (Entries.Any(e => e.IsDeleted))
|
||||
{
|
||||
<div class="form-check form-switch history-toggle">
|
||||
<input id="show-deleted" class="form-check-input" type="checkbox" role="switch" @bind="showDeleted" @bind:after="SaveHistoryPreference" />
|
||||
<label class="form-check-label" for="show-deleted">Gelöschte Buchungen anzeigen (@Entries.Count(e => e.IsDeleted))</label>
|
||||
</div>
|
||||
<label class="history-toggle"><input type="checkbox" @bind="showDeleted" /> Gelöschte Buchungen anzeigen (@Entries.Count(e => e.IsDeleted))</label>
|
||||
}
|
||||
<div class="table-responsive entry-list">
|
||||
<table class="table table-hover table-sm align-middle">
|
||||
<thead>
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th style="width: 100px;">LfdNr</th>
|
||||
<th style="width: 120px;">Datum</th>
|
||||
@@ -45,6 +24,6 @@
|
||||
|
||||
@if (!VisibleEntries.Any())
|
||||
{
|
||||
<div class="text-center py-3 text-muted">@(string.IsNullOrWhiteSpace(searchText) ? EmptyMessage : "Keine Treffer. Filter zurücksetzen zeigt wieder die Buchungen des gewählten Zeitraums.")</div>
|
||||
<div class="text-center py-3 text-muted">@EmptyMessage</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -6,13 +6,7 @@ namespace Duempelkas.App.Components.Accounts;
|
||||
public partial class EntryTable
|
||||
{
|
||||
private bool showDeleted;
|
||||
protected override async Task OnInitializedAsync() => showDeleted = await Settings.GetShowDeletedEntriesAsync();
|
||||
private Task SaveHistoryPreference() => Settings.SetShowDeletedEntriesAsync(showDeleted);
|
||||
private string searchText = string.Empty;
|
||||
private string sort = "date-asc";
|
||||
private List<EntryDto> VisibleEntries => Duempelkas.App.Services.EntryListQuery.Apply(Entries, searchText, showDeleted, sort);
|
||||
private decimal ResultSum => VisibleEntries.Where(e => !e.IsDeleted).Sum(Duempelkas.App.Services.EntryListQuery.SignedAmount);
|
||||
private void ResetFilters() { searchText = string.Empty; sort = "date-asc"; }
|
||||
private IEnumerable<EntryDto> VisibleEntries => Entries.Where(e => !e.IsDeleted || showDeleted);
|
||||
[Parameter] public int? HighlightedEntryId { get; set; }
|
||||
[Parameter] public string EmptyMessage { get; set; } = "Keine Buchungen vorhanden.";
|
||||
#region Parameters
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<input id="@Id" type="text" inputmode="decimal" class="form-control" data-amount-guard
|
||||
data-allow-negative="@AllowNegative.ToString().ToLowerInvariant()"
|
||||
@bind:get="Value" @bind:set="SetValue" @bind:event="oninput" disabled="@Disabled" />
|
||||
@bind:get="Value" @bind:set="SetValue" @bind:event="oninput" disabled="@Disabled"
|
||||
aria-describedby="@(Id + "-rejected")" />
|
||||
<span id="@(Id + "-rejected")" class="input-rejection text-danger" role="status">@rejection</span>
|
||||
|
||||
@code {
|
||||
[Parameter] public string Id { get; set; } = "amount";
|
||||
@@ -8,12 +10,15 @@
|
||||
[Parameter] public EventCallback<string> ValueChanged { get; set; }
|
||||
[Parameter] public bool Disabled { get; set; }
|
||||
[Parameter] public bool AllowNegative { get; set; }
|
||||
private string? rejection;
|
||||
private async Task SetValue(string value)
|
||||
{
|
||||
if (!BookingInput.IsAmountDraft(value, AllowNegative))
|
||||
{
|
||||
rejection = "Diese Eingabe wurde nicht übernommen. Bitte einen Betrag wie 12,50 eingeben.";
|
||||
return;
|
||||
}
|
||||
rejection = null;
|
||||
await ValueChanged.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
@inherits ErrorBoundary
|
||||
@inject IJSRuntime JS
|
||||
@inject ToastService Toasts
|
||||
|
||||
@if (CurrentException == null)
|
||||
{
|
||||
@ChildContent
|
||||
}
|
||||
else
|
||||
{
|
||||
<section class="error-recovery" role="alert">
|
||||
<h1>Diese Ansicht konnte nicht angezeigt werden</h1>
|
||||
<p>Ein unerwarteter Fehler ist aufgetreten. Eine Speicherung ist dadurch nicht bestätigt. Bitte vor einer erneuten Buchung zuerst die Liste prüfen.</p>
|
||||
<p>Ungespeicherte Eingaben dieser Ansicht können verloren sein. Bei erwartbaren Speicherfehlern im Formular bleiben sie erhalten.</p>
|
||||
<button type="button" class="btn btn-primary" @onclick="Recover">Ansicht erneut versuchen</button>
|
||||
<a class="btn btn-outline-secondary" href="/">Zur Kontenübersicht</a>
|
||||
<details><summary>Technische Angaben zur Fehlermeldung</summary>
|
||||
<p>@diagnostic</p><button type="button" class="btn btn-outline-secondary" @onclick="Copy">Angaben kopieren</button>
|
||||
</details>
|
||||
</section>
|
||||
}
|
||||
|
||||
@code {
|
||||
private string diagnostic = string.Empty;
|
||||
protected override Task OnErrorAsync(Exception exception)
|
||||
{
|
||||
diagnostic = $"Dümpelkas; Fehlerreferenz {Guid.NewGuid():N}; Typ {exception.GetType().Name}";
|
||||
// Deliberately exclude exception messages/stack traces that may contain booking data.
|
||||
System.Diagnostics.Trace.TraceError(diagnostic);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
private async Task Copy()
|
||||
{
|
||||
try { await JS.InvokeVoidAsync("navigator.clipboard.writeText", diagnostic); Toasts.Show("Technische Angaben kopiert.", ToastKind.Success); }
|
||||
catch (JSException) { Toasts.Show("Kopieren ist nicht möglich. Bitte die technischen Angaben markieren und manuell kopieren.", ToastKind.Error); }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<input @attributes="Attributes" id="@Id" type="date" value="@renderedValue" @oninput="Input" @onblur="CommitAsync" />
|
||||
|
||||
@code {
|
||||
[Parameter] public string Id { get; set; } = "booking-date";
|
||||
[Parameter] public string Value { get; set; } = string.Empty;
|
||||
[Parameter] public EventCallback<string> ValueChanged { get; set; }
|
||||
[Parameter] public EventCallback<bool> PendingChangesChanged { get; set; }
|
||||
[Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object>? Attributes { get; set; }
|
||||
private string? lastValue;
|
||||
private string renderedValue = string.Empty;
|
||||
private string draft = string.Empty;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
if (Value != lastValue) draft = renderedValue = Value;
|
||||
lastValue = Value;
|
||||
}
|
||||
|
||||
private async Task Input(ChangeEventArgs args)
|
||||
{
|
||||
draft = args.Value?.ToString() ?? string.Empty;
|
||||
await PendingChangesChanged.InvokeAsync(draft != Value);
|
||||
}
|
||||
|
||||
public async Task CommitAsync()
|
||||
{
|
||||
// Native calendars close when their surrounding dialog layout changes. Validate only
|
||||
// after leaving the date field, so year warnings never interrupt calendar navigation.
|
||||
lastValue = draft;
|
||||
await ValueChanged.InvokeAsync(lastValue);
|
||||
await PendingChangesChanged.InvokeAsync(false);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
@inject ToastService Toasts
|
||||
@inject IEntryService EntryService
|
||||
|
||||
<ModalDialog @ref="modal" Title="Einnahme oder Ausgabe" OnCancel="OnCancel" Busy="isSaving" Dirty="@(committedResult == null && (IsDirty || pendingDateChanges))">
|
||||
<ModalDialog @ref="modal" Title="Einnahme oder Ausgabe" OnCancel="OnCancel" Busy="isSaving" Dirty="@(committedResult == null && IsDirty)">
|
||||
<h5 id="entry-dialog-title">@(EditEntry != null ? "Buchung bearbeiten" : "Einnahme oder Ausgabe erfassen") – @AccountName</h5>
|
||||
|
||||
<form @onsubmit="Save" @onsubmit:preventDefault="true" aria-busy="@(isSaving ? "true" : "false")">
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<label class="form-label" for="entry-date">Datum</label>
|
||||
<div>
|
||||
<BookingDateInput @ref="bookingDate" Id="entry-date" @bind-Value="dateText" PendingChangesChanged="pending => pendingDateChanges = pending" aria-describedby="entry-date-help" aria-invalid="@(date == default ? "true" : "false")" />
|
||||
<input id="entry-date" type="date" value="@dateText" @oninput="e => dateText = e.Value?.ToString() ?? string.Empty" aria-describedby="entry-date-help" aria-invalid="@(date == default ? "true" : "false")" />
|
||||
@if (date == default) { <p id="entry-date-help" class="text-danger">Bitte ein gültiges Datum eingeben.</p> }
|
||||
</div>
|
||||
|
||||
@@ -43,12 +43,9 @@
|
||||
|
||||
@if (OutsideYear && date != default)
|
||||
{
|
||||
<div class="alert alert-warning booking-year-warning" role="status">
|
||||
<i class="bi bi-exclamation-triangle-fill" aria-hidden="true"></i>
|
||||
<div><strong>Das Buchungsdatum liegt in einem anderen Jahr.</strong>
|
||||
<p>Du erfasst die Buchung am @date.ToString("dd.MM.yyyy") und damit außerhalb des angezeigten Jahres @ContextYear. Sie wird im Jahr @date.Year gespeichert und erscheint erst, wenn du dieses Jahr oder „Alle Buchungen“ auswählst.</p>
|
||||
<div class="alert alert-warning" role="status">
|
||||
Datum @date.ToString("dd.MM.yyyy"): Diese Buchung liegt außerhalb von Jahr @ContextYear und wird dort nicht angezeigt.
|
||||
<label><input type="checkbox" checked="@(confirmDifferentYear && confirmedYear == date.Year)" @onchange="e => { confirmDifferentYear = e.Value is true; confirmedYear = date.Year; }" /> Ich möchte die Buchung im Jahr @date.Year speichern.</label>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -62,4 +59,4 @@
|
||||
</form>
|
||||
</ModalDialog>
|
||||
|
||||
@code { private ModalDialog? modal; private BookingDateInput? bookingDate; private bool pendingDateChanges; }
|
||||
@code { private ModalDialog? modal; }
|
||||
|
||||
@@ -76,8 +76,6 @@ public partial class AddEntryDialog
|
||||
|
||||
private async Task Save()
|
||||
{
|
||||
if (isSaving || completed) return;
|
||||
if (committedResult == null && bookingDate != null) await bookingDate.CommitAsync();
|
||||
if (isSaving || completed || (committedResult == null && !CanSave)) return;
|
||||
var busyToast = Toasts.Show("Wird gespeichert …", persistent: true);
|
||||
isSaving = true;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@inject IEntryService EntryService
|
||||
@inject IAccountService AccountService
|
||||
|
||||
<ModalDialog @ref="modal" Title="Geld zwischen Konten verschieben" OnCancel="OnCancel" Busy="isSaving" Dirty="@(committedResult == null && (IsDirty || pendingDateChanges))">
|
||||
<ModalDialog @ref="modal" Title="Geld zwischen Konten verschieben" OnCancel="OnCancel" Busy="isSaving" Dirty="@(committedResult == null && IsDirty)">
|
||||
<h5 class="mb-3">@(EditEntry != null ? "Umbuchung bearbeiten" : "Neue Umbuchung")</h5>
|
||||
|
||||
<p class="text-muted">Erfasst nur die Buchung. Führt keine Banküberweisung aus.</p>
|
||||
@@ -30,7 +30,7 @@
|
||||
</select>
|
||||
|
||||
<label class="form-label" for="transfer-date">Datum</label>
|
||||
<BookingDateInput @ref="bookingDate" Id="transfer-date" class="form-control" @bind-Value="dateText" PendingChangesChanged="pending => pendingDateChanges = pending" />
|
||||
<input id="transfer-date" type="date" class="form-control" value="@dateText" @oninput="e => dateText = e.Value?.ToString() ?? string.Empty" />
|
||||
|
||||
<label class="form-label" for="transfer-title">Bezeichnung</label>
|
||||
<input id="transfer-title" type="text" class="form-control" @bind="title" @bind:event="oninput" placeholder="Beschreibung der Umbuchung" />
|
||||
@@ -40,14 +40,11 @@
|
||||
<p class="text-muted">Betrag ohne Minuszeichen.</p></div>
|
||||
</div>
|
||||
|
||||
@if (OutsideYear && date != default)
|
||||
@if (OutsideYear)
|
||||
{
|
||||
<div class="alert alert-warning booking-year-warning" role="status">
|
||||
<i class="bi bi-exclamation-triangle-fill" aria-hidden="true"></i>
|
||||
<div><strong>Das Buchungsdatum liegt in einem anderen Jahr.</strong>
|
||||
<p>Du erfasst die Buchung am @date.ToString("dd.MM.yyyy") und damit außerhalb des angezeigten Jahres @ContextYear. Sie wird im Jahr @date.Year gespeichert und erscheint erst, wenn du dieses Jahr oder „Alle Buchungen“ auswählst.</p>
|
||||
<div class="alert alert-warning" role="status">
|
||||
Datum @date.ToString("dd.MM.yyyy"): Diese Buchung liegt außerhalb von Jahr @ContextYear und wird dort nicht angezeigt.
|
||||
<label><input type="checkbox" checked="@(confirmDifferentYear && confirmedYear == date.Year)" @onchange="e => { confirmDifferentYear = e.Value is true; confirmedYear = date.Year; }" /> Ich möchte die Buchung im Jahr @date.Year speichern.</label>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -61,4 +58,4 @@
|
||||
</form>
|
||||
</ModalDialog>
|
||||
|
||||
@code { private ModalDialog? modal; private BookingDateInput? bookingDate; private bool pendingDateChanges; }
|
||||
@code { private ModalDialog? modal; }
|
||||
|
||||
@@ -91,8 +91,6 @@ public partial class AddTransferDialog
|
||||
|
||||
private async Task Save()
|
||||
{
|
||||
if (isSaving || completed) return;
|
||||
if (committedResult == null && bookingDate != null) await bookingDate.CommitAsync();
|
||||
if (isSaving || completed || (committedResult == null && !CanSave)) return;
|
||||
var busyToast = Toasts.Show("Wird gespeichert …", persistent: true);
|
||||
isSaving = true;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@inject ToastService Toasts
|
||||
<ModalDialog @ref="modal" Title="Bestandskorrektur" OnCancel="OnCancel" Dirty="@(amountText != CurrentAmount.ToString("0.00", System.Globalization.CultureInfo.GetCultureInfo("de-DE")))" Busy="saving">
|
||||
<ModalDialog @ref="modal" Title="Bestandskorrektur" OnCancel="OnCancel" Dirty="@(amount != CurrentAmount)" Busy="saving">
|
||||
<h5>Bestandskorrektur – @AccountName</h5>
|
||||
<p>@(Year.HasValue ? $"Übertrag zum 01.01.{Year}" : "Gemeinsamer Anfangsbestand – alle Jahre")</p>
|
||||
<p>Anfangsbestand + Einnahmen − Ausgaben = Kontostand</p>
|
||||
<p>Dies ist eine spätere Korrektur, keine zusätzliche Einnahme oder Ausgabe.</p>
|
||||
<label for="carryover">@(Year.HasValue ? "Neuer Übertrag (€)" : "Neuer Anfangsbestand (€)")</label>
|
||||
<AmountInput Id="carryover" Value="@amountText" ValueChanged="ChangeAmount" AllowNegative="true" Disabled="saving" />
|
||||
<AmountInput Id="carryover" Value="amountText" ValueChanged="ChangeAmount" AllowNegative="true" Disabled="saving" />
|
||||
<div class="correction-preview">
|
||||
<p>Gewählter Bestand: @Money(CurrentAmount) → @Money(amount)</p>
|
||||
<p>Gemeinsamer Anfangsbestand: @Money(InitialBalance) → @Money(InitialBalance + Delta)</p>
|
||||
|
||||
@@ -55,11 +55,7 @@
|
||||
focusPrompt = true;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else if (discardPrompt)
|
||||
{
|
||||
await ContinueEditing();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else if (discardPrompt) await ContinueEditing();
|
||||
else await OnCancel.InvokeAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,20 @@
|
||||
@inject NavigationManager Navigation
|
||||
@inherits LayoutComponentBase
|
||||
@inject IJSRuntime JS
|
||||
|
||||
<ToastHost />
|
||||
|
||||
<div class="app-shell">
|
||||
<div class="d-flex flex-column vh-100">
|
||||
<nav class="app-navbar d-flex justify-content-between align-items-center">
|
||||
<a class="navbar-brand" href="">
|
||||
<strong>Dümpelkas</strong> <small class="text-muted">Kassenbuch</small>
|
||||
</a>
|
||||
<div class="reading-controls">
|
||||
<a class="btn btn-outline-secondary" href="hilfe">Hilfe</a>
|
||||
<label for="text-scale">Textgröße</label>
|
||||
<select id="text-scale" @bind="fontScale" @bind:after="ApplyTextScale">
|
||||
<option value="75">Klein (75 %)</option><option value="100">Normal</option><option value="125">Groß (125 %)</option>
|
||||
<option value="150">Sehr groß (150 %)</option><option value="200">200 %</option>
|
||||
</select>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="flex-grow-1 overflow-auto p-3">
|
||||
<AppErrorBoundary @key="Navigation.Uri">@Body</AppErrorBoundary>
|
||||
@Body
|
||||
</main>
|
||||
|
||||
<footer class="app-footer d-flex align-items-center justify-content-center gap-2">
|
||||
<span>Dümpelkas © @DateTime.Now.Year · Version @AppVersion</span> ·<button type="button" class="app-footer-about btn btn-link" @onclick="OpenAboutDialog">Über</button>
|
||||
<span>Dümpelkas © @DateTime.Now.Year · Version @AppVersion</span> ·<a class="app-footer-about" @onclick="OpenAboutDialog">Über</a>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -32,8 +22,7 @@
|
||||
{
|
||||
<ModalDialog Title="Über Dümpelkas" OnCancel="CloseAboutDialog">
|
||||
<h5>Über Dümpelkas · Version @AppVersion</h5>
|
||||
<p class="mb-1 mt-3">Erstellt: @AppBuildDate</p>
|
||||
<p class="mb-1">Entwickler: Andre Beging</p>
|
||||
<p class="mb-2">Entwickler: Andre Beging</p>
|
||||
<p class="mb-3">E-Mail: <a href="mailto:mail@beging.de" style="color: var(--color-text);">mail@beging.de</a></p>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="button" class="btn btn-outline-secondary" @onclick="CloseAboutDialog">
|
||||
|
||||
@@ -1,21 +1,9 @@
|
||||
using Microsoft.JSInterop;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Duempelkas.App.Components.Layout;
|
||||
|
||||
public partial class MainLayout
|
||||
{
|
||||
private int fontScale = 100;
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
var value = await JS.InvokeAsync<int>("duempelkasReading.get");
|
||||
fontScale = value is 75 or 125 or 150 or 200 ? value : 100;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
private async Task ApplyTextScale() => await JS.InvokeVoidAsync("duempelkasReading.set", fontScale);
|
||||
#region Fields
|
||||
|
||||
private bool showAboutDialog;
|
||||
@@ -24,19 +12,6 @@ public partial class MainLayout
|
||||
|
||||
#region Properties
|
||||
|
||||
private static string AppBuildDate
|
||||
{
|
||||
get
|
||||
{
|
||||
var value = Assembly.GetEntryAssembly()?.GetCustomAttributes<AssemblyMetadataAttribute>()
|
||||
.FirstOrDefault(attribute => attribute.Key == "BuildDate")?.Value;
|
||||
return DateTimeOffset.TryParse(value, System.Globalization.CultureInfo.InvariantCulture,
|
||||
System.Globalization.DateTimeStyles.AssumeUniversal, out var built)
|
||||
? built.UtcDateTime.ToString("dd.MM.yyyy", System.Globalization.CultureInfo.InvariantCulture)
|
||||
: "unbekannt";
|
||||
}
|
||||
}
|
||||
|
||||
private static string AppVersion
|
||||
{
|
||||
get
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
</Found>
|
||||
<NotFound>
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<h1>Diese Seite wurde nicht gefunden</h1>
|
||||
<a class="btn btn-primary" href="/">Zur Kontenübersicht</a>
|
||||
<p>Seite nicht gefunden.</p>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@inject ToastService Toasts
|
||||
@implements IDisposable
|
||||
@inject ReportingPeriod Period
|
||||
@page "/accounts/{AccountId:int}"
|
||||
@inject IAccountService AccountService
|
||||
@@ -22,7 +21,7 @@
|
||||
{
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<div class="d-flex align-items-center flex-grow-1" style="min-width: 0;">
|
||||
<h1 class="mb-0 mt-0 page-heading">
|
||||
<h1 class="mb-0 mt-0" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
||||
@account.Name
|
||||
<button class="btn-edit-pen" @onclick="() => showEditName = true" title="Name bearbeiten"><i class="bi bi-pencil"></i></button>
|
||||
</h1>
|
||||
@@ -97,7 +96,7 @@
|
||||
@if (entries != null)
|
||||
{
|
||||
<div class="entries-scroll-wrapper">
|
||||
<EntryTable HighlightedEntryId="lastSaved?.EntryId" Entries="entries" EmptyMessage="@emptyEntriesMessage" OnDeleteEntry="RequestDeleteEntry" OnRestoreEntry="RequestRestoreEntry" OnEditEntry="RequestEditEntry" />
|
||||
<EntryTable HighlightedEntryId="lastSaved?.EntryId" Entries="entries" EmptyMessage="emptyEntriesMessage" OnDeleteEntry="RequestDeleteEntry" OnRestoreEntry="RequestRestoreEntry" OnEditEntry="RequestEditEntry" />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ namespace Duempelkas.App.Pages.Accounts;
|
||||
|
||||
public partial class AccountDetail
|
||||
{
|
||||
private bool disposed;
|
||||
public void Dispose() => disposed = true;
|
||||
#region Parameters
|
||||
|
||||
[Parameter]
|
||||
@@ -166,7 +164,7 @@ public partial class AccountDetail
|
||||
await LoadAll();
|
||||
if (undoToastId.HasValue) Toasts.Dismiss(undoToastId.Value);
|
||||
undoToastId = Toasts.Show("Buchung gelöscht.", ToastKind.Success,
|
||||
actionLabel: "Rückgängig", action: CreateUndoAction(AccountId, id, true));
|
||||
actionLabel: "Rückgängig", action: () => UndoEntryChange(id, true));
|
||||
}
|
||||
catch (Exception ex) { Toasts.Show("Die Buchung konnte nicht geändert werden. Bitte erneut versuchen.", ToastKind.Error, ex.Message); }
|
||||
finally { entryActionBusy = false; }
|
||||
@@ -197,21 +195,19 @@ public partial class AccountDetail
|
||||
await LoadAll();
|
||||
if (undoToastId.HasValue) Toasts.Dismiss(undoToastId.Value);
|
||||
undoToastId = Toasts.Show("Buchung wiederhergestellt.", ToastKind.Success,
|
||||
actionLabel: "Rückgängig", action: CreateUndoAction(AccountId, id, false));
|
||||
actionLabel: "Rückgängig", action: () => UndoEntryChange(id, false));
|
||||
}
|
||||
catch (Exception ex) { Toasts.Show("Die Buchung konnte nicht geändert werden. Bitte erneut versuchen.", ToastKind.Error, ex.Message); }
|
||||
finally { entryActionBusy = false; }
|
||||
}
|
||||
|
||||
private Func<Task> CreateUndoAction(int accountId, int id, bool restore) => () => UndoEntryChange(accountId, id, restore);
|
||||
|
||||
private async Task UndoEntryChange(int accountId, int id, bool restore)
|
||||
private async Task UndoEntryChange(int id, bool restore)
|
||||
{
|
||||
if (entryActionBusy) return;
|
||||
entryActionBusy = true;
|
||||
try
|
||||
{
|
||||
var current = (await EntryService.GetEntriesAsync(accountId, (int?)null)).FirstOrDefault(e => e.Id == id);
|
||||
var current = (await EntryService.GetEntriesAsync(AccountId, (int?)null)).FirstOrDefault(e => e.Id == id);
|
||||
if (current == null || current.IsDeleted != restore)
|
||||
{
|
||||
Toasts.Show("Die Buchung wurde inzwischen geändert. Bitte die aktuelle Liste prüfen.");
|
||||
@@ -219,12 +215,7 @@ public partial class AccountDetail
|
||||
}
|
||||
if (restore) await EntryService.RestoreEntryAsync(id); else await EntryService.DeleteEntryAsync(id);
|
||||
if (undoToastId.HasValue) Toasts.Dismiss(undoToastId.Value);
|
||||
if (!disposed)
|
||||
{
|
||||
await LoadAll();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else Navigation.NavigateTo($"/accounts/{accountId}");
|
||||
await LoadAll();
|
||||
Toasts.Show("Änderung rückgängig gemacht.", ToastKind.Success);
|
||||
}
|
||||
finally { entryActionBusy = false; }
|
||||
@@ -258,7 +249,7 @@ public partial class AccountDetail
|
||||
private async Task HandleExport()
|
||||
{
|
||||
if (fileBusy) return;
|
||||
var busyToast = Toasts.Show("Kontoauszug wird als PDF erstellt und gespeichert … Bitte warten.", persistent: true);
|
||||
var busyToast = Toasts.Show("Dateiaktion läuft … Bitte warten.", persistent: true);
|
||||
fileBusy = true;
|
||||
fileResult = null;
|
||||
try
|
||||
@@ -277,7 +268,7 @@ public partial class AccountDetail
|
||||
private async Task HandleOpenSavedPdf()
|
||||
{
|
||||
if (fileBusy) return;
|
||||
var busyToast = Toasts.Show("Gespeicherte PDF-Datei wird geöffnet … Bitte warten.", persistent: true);
|
||||
var busyToast = Toasts.Show("Dateiaktion läuft … Bitte warten.", persistent: true);
|
||||
fileBusy = true;
|
||||
fileResult = null;
|
||||
try
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center flex-grow-1" style="min-width: 0;">
|
||||
<h1 class="mb-0 mt-0 page-heading">
|
||||
<h1 class="mb-0 mt-0" style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
||||
@DisplayClubName
|
||||
<button class="btn-edit-pen" @onclick="() => showEditClubName = true" title="Vereinsname bearbeiten">
|
||||
<i class="bi bi-pencil"></i>
|
||||
@@ -71,7 +71,6 @@
|
||||
<div class="text-center py-5 text-muted">
|
||||
<h4>Noch keine Konten vorhanden</h4>
|
||||
<p>Erstelle dein erstes Konto, um loszulegen.</p>
|
||||
<a class="btn btn-primary" href="einstieg">Kurze Einführung starten oder fortsetzen</a>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
|
||||
@@ -101,7 +101,7 @@ public partial class Dashboard
|
||||
private async Task HandleBackupAsync()
|
||||
{
|
||||
if (fileBusy) return;
|
||||
var busyToast = Toasts.Show("Sicherung wird erstellt … Bitte warten.", persistent: true);
|
||||
var busyToast = Toasts.Show("Dateiaktion läuft … Bitte warten.", persistent: true);
|
||||
fileBusy = true;
|
||||
fileResult = null;
|
||||
try
|
||||
@@ -127,7 +127,7 @@ public partial class Dashboard
|
||||
private async Task HandleConfirmRestore()
|
||||
{
|
||||
if (fileBusy) return;
|
||||
var busyToast = Toasts.Show("Sicherung wird wiederhergestellt … Bitte warten.", persistent: true);
|
||||
var busyToast = Toasts.Show("Dateiaktion läuft … Bitte warten.", persistent: true);
|
||||
fileBusy = true;
|
||||
fileResult = null;
|
||||
try
|
||||
@@ -144,7 +144,7 @@ public partial class Dashboard
|
||||
private async Task HandleDashboardExportAsync()
|
||||
{
|
||||
if (fileBusy) return;
|
||||
var busyToast = Toasts.Show("Kontenübersicht wird als PDF erstellt und gespeichert … Bitte warten.", persistent: true);
|
||||
var busyToast = Toasts.Show("Dateiaktion läuft … Bitte warten.", persistent: true);
|
||||
fileBusy = true;
|
||||
fileResult = null;
|
||||
try
|
||||
@@ -180,7 +180,7 @@ public partial class Dashboard
|
||||
private async Task HandleOpenSavedPdf()
|
||||
{
|
||||
if (fileBusy) return;
|
||||
var busyToast = Toasts.Show("Gespeicherte PDF-Datei wird geöffnet … Bitte warten.", persistent: true);
|
||||
var busyToast = Toasts.Show("Dateiaktion läuft … Bitte warten.", persistent: true);
|
||||
fileBusy = true;
|
||||
fileResult = null;
|
||||
try
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
@page "/einstieg"
|
||||
@inject ISettingsService Settings
|
||||
@inject IAccountService Accounts
|
||||
@inject IBackupService Backups
|
||||
@inject ToastService Toasts
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
<h1>Erste Schritte</h1>
|
||||
<p>Schritt @(step + 1) von 5. Du kannst die Einführung jederzeit überspringen und über Hilfe fortsetzen.</p>
|
||||
@if (loading) { <p role="status">Einführung wird geladen …</p> }
|
||||
else
|
||||
{
|
||||
@if (step == 0)
|
||||
{
|
||||
<h2>Dein Verein</h2>
|
||||
<label for="setup-club">Vereinsname</label><input id="setup-club" class="form-control" @bind="clubName" @bind:event="oninput" />
|
||||
<button class="btn btn-primary setup-next" disabled="@(busy || string.IsNullOrWhiteSpace(clubName))" @onclick="SaveClub">Speichern und weiter</button>
|
||||
}
|
||||
else if (step == 1)
|
||||
{
|
||||
<h2>Dein erstes Konto</h2>
|
||||
<p>Zum Beispiel Barkasse oder Girokonto. Der Anfangsbestand ist das bereits vorhandene Geld, keine neue Einnahme.</p>
|
||||
<button class="btn btn-primary" @onclick="() => showAccount = true">Konto anlegen</button>
|
||||
@if (accounts.Count > 0)
|
||||
{
|
||||
<p>Ein Konto ist bereits eingerichtet.</p><button class="btn btn-outline-secondary setup-next" @onclick="Next">Vorhandenes Konto verwenden</button>
|
||||
}
|
||||
}
|
||||
else if (step == 2)
|
||||
{
|
||||
<h2>Die erste Buchung</h2>
|
||||
<p>Wähle ein Konto und erfasse einen tatsächlichen Mitgliedsbeitrag oder eine Ausgabe, etwa Porto. Es werden keine Beispielbuchungen erzeugt.</p>
|
||||
@foreach (var account in accounts) { <p><a href="@($"accounts/{account.Id}")">@account.Name öffnen und buchen</a></p> }
|
||||
<button class="btn btn-primary setup-next" @onclick="Next">Weiter zur Sicherung</button>
|
||||
}
|
||||
else if (step == 3)
|
||||
{
|
||||
<h2>Deine Daten sichern</h2>
|
||||
<p>Sichere die Buchungen zusätzlich auf einem unabhängigen Datenträger. Vereinsname und Darstellung sind nicht enthalten. Zur Einrichtung muss keine Sicherung zurückgespielt werden.</p>
|
||||
<button class="btn btn-primary" disabled="@busy" @onclick="Backup">Sicherung erstellen</button>
|
||||
<OperationNotice Result="backupResult" />
|
||||
<button class="btn btn-outline-secondary setup-next" @onclick="Next">Weiter</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h2>Bereit für das Kassenbuch</h2><p>Die Hilfe bleibt jederzeit erreichbar. Prüfe regelmäßig Kontostände und Sicherungen.</p>
|
||||
<a class="btn btn-primary" href="/">Zur Kontenübersicht</a>
|
||||
<button class="btn btn-outline-secondary" @onclick="Restart">Einführung erneut durchgehen</button>
|
||||
}
|
||||
<p><button class="btn btn-outline-secondary" disabled="@busy" @onclick="Skip">Einführung später fortsetzen</button> <a href="hilfe">Zur Hilfe</a></p>
|
||||
}
|
||||
@if (showAccount)
|
||||
{
|
||||
<AddAccountDialog OnSave="CreateAccount" OnCancel="() => showAccount = false" />
|
||||
}
|
||||
|
||||
@code {
|
||||
private int step;
|
||||
private bool loading = true, busy, showAccount, advancing;
|
||||
private string clubName = string.Empty;
|
||||
private List<AccountSummaryDto> accounts = [];
|
||||
private FileOperationResult? backupResult;
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
step = Math.Clamp(await Settings.GetSetupStepAsync(), 0, 4);
|
||||
clubName = await Settings.GetClubNameAsync() ?? string.Empty;
|
||||
accounts = await Accounts.GetAllAccountsAsync();
|
||||
loading = false;
|
||||
}
|
||||
private async Task Next()
|
||||
{
|
||||
if (advancing) return;
|
||||
advancing = true;
|
||||
try { var next = Math.Min(step + 1, 4); await Settings.SetSetupStepAsync(next); step = next; }
|
||||
catch (Exception ex) { Toasts.Show("Der Fortschritt konnte nicht gespeichert werden. Bitte erneut versuchen.", ToastKind.Error, ex.Message); }
|
||||
finally { advancing = false; }
|
||||
}
|
||||
private async Task SaveClub()
|
||||
{
|
||||
if (busy || string.IsNullOrWhiteSpace(clubName)) return;
|
||||
busy = true;
|
||||
try { await Settings.SetClubNameAsync(clubName); await Next(); }
|
||||
catch (Exception ex) { Toasts.Show("Der Schritt konnte nicht gespeichert werden. Bitte erneut versuchen.", ToastKind.Error, ex.Message); }
|
||||
finally { busy = false; }
|
||||
}
|
||||
private async Task CreateAccount(AccountSetup setup)
|
||||
{
|
||||
await Accounts.CreateAccountAsync(setup.Name, setup.InitialBalance);
|
||||
showAccount = false;
|
||||
accounts = await Accounts.GetAllAccountsAsync();
|
||||
await Next();
|
||||
}
|
||||
private async Task Backup()
|
||||
{
|
||||
if (busy) return;
|
||||
busy = true;
|
||||
try { backupResult = await Backups.CreateBackupAsync(); }
|
||||
catch (Exception ex) { backupResult = FileOperationResult.Error(ex); }
|
||||
finally { busy = false; }
|
||||
}
|
||||
private Task Skip() { Navigation.NavigateTo("/"); return Task.CompletedTask; }
|
||||
private async Task Restart() { step = 0; await Settings.SetSetupStepAsync(0); }
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
@page "/hilfe"
|
||||
<h1>Hilfe für Dümpelkas</h1>
|
||||
<p>Passend zu dieser Programmversion. Diese Hilfe ist auch ohne Internet verfügbar.</p>
|
||||
<p><a class="btn btn-primary" href="einstieg">Erste Schritte öffnen oder fortsetzen</a> <a href="/">Zur Kontenübersicht</a></p>
|
||||
<details open><summary>Konten einrichten</summary>
|
||||
<p>Auf der Übersicht „Neues Konto“ wählen. Beispiele: Barkasse, Girokonto, Sparbuch. Den tatsächlich vorhandenen Anfangsbestand vor der ersten erfassten Buchung eingeben; 0 oder ein negativer Bestand sind möglich. Es werden keine Beispielbuchungen angelegt.</p>
|
||||
</details>
|
||||
<details><summary>Einnahme oder Ausgabe erfassen</summary>
|
||||
<p>Konto öffnen, „Einnahme oder Ausgabe erfassen“ wählen, Art, echtes Datum, Beschreibung und Betrag eingeben. Beispiele sind Mitgliedsbeitrag und Porto. Komma und Punkt sind als Dezimaltrenner möglich; das Control verhindert zusätzliche Dezimalstellen und übernimmt ungültige Einfügungen nicht. Beträge ohne Minuszeichen erfassen; die Art legt die Richtung fest.</p>
|
||||
<p>Beim Speichern kurz warten. Ein Toast bestätigt Art und Betrag. Bei Fehlern bleiben Eingaben erhalten. Beim Bearbeiten bleibt die Art fest; eine falsche Art durch Löschen und erneutes Erfassen korrigieren.</p>
|
||||
</details>
|
||||
<details><summary>Jahr, Kontostand und Anfangsbestand verstehen</summary>
|
||||
<p>„Jahr“ begrenzt Liste und Summen; „Alle Jahre“ zeigt den gesamten Zeitraum. Die Auswahl bleibt beim Navigieren erhalten. Ein abweichendes Buchungsdatum bleibt unverändert und wird vor dem Speichern erklärt. Die Meldung bietet den Aufruf des gespeicherten Jahres.</p>
|
||||
<p>Anfangsbestand + Einnahmen − Ausgaben = Kontostand. Der Übertrag ist der Bestand vor Beginn des gewählten Jahres. Spätere Bestandskorrekturen ändern den gemeinsamen Anfangsbestand und damit auch frühere und spätere Jahresstände. Vorher/nachher prüfen und erst dann bestätigen; eine fehlende Buchung gewöhnlich als Buchung erfassen.</p>
|
||||
</details>
|
||||
<details><summary>Geld zwischen Konten verschieben</summary>
|
||||
<p>Die Richtung wird immer als Von → Nach gezeigt, auch beim Öffnen der empfangenen Seite. Das aktuelle Konto ist fest, das Gegenkonto änderbar. Beispiel: Barkasse −50,00 €, Girokonto +50,00 €; die Vereinssumme bleibt gleich. Es wird nur die Buchung erfasst, keine Banküberweisung ausgeführt.</p>
|
||||
</details>
|
||||
<details><summary>Bearbeiten, Löschen und Wiederherstellen</summary>
|
||||
<p>Das Aktionsmenü der richtigen Zeile öffnen. Bestätigungen nennen Datum, Betrag und Konto; bei Umbuchungen wirken Löschen und Wiederherstellen gemeinsam auf beide Konten. Gelöschte Zeilen sind zunächst ausgeblendet und zählen nicht zum Kontostand. „Gelöschte Buchungen anzeigen“ öffnet die Historie. Der Erfolgstoast bietet für die letzte Änderung „Rückgängig“.</p>
|
||||
</details>
|
||||
<details><summary>Buchungen finden</summary>
|
||||
<p>Jahr auswählen und die Suche über der Liste verwenden. Sie findet Beschreibung und Buchungsnummer, zusätzlich Datum und Betrag. Die Sortierung kann geändert werden. „Filter zurücksetzen“ zeigt die vollständige Liste des gewählten Jahres. Der Kontostand bleibt unverändert; eine Treffermengensumme ist gesondert beschriftet.</p>
|
||||
</details>
|
||||
<details><summary>Als PDF speichern</summary>
|
||||
<p>Auf der Kontoansicht wird ein Einzelkonto, auf der Übersicht werden alle Konten exportiert. Der gewählte Zeitraum wird übernommen. Normale PDFs enthalten nur wirksame Buchungen. Umbuchungen sind im Einzelkonto Zu-/Abgänge und in der Gesamtübersicht eine Zeile mit beiden Konten. Der Toast nennt den Speicherort und bietet „Ordner öffnen“.</p>
|
||||
</details>
|
||||
<details><summary>Sichern und zurückspielen</summary>
|
||||
<p>„Sicherung erstellen“ speichert Konten und Buchungen einschließlich Historie. Vereinsname, Textgröße, Farbdarstellung und Fenstergröße sind nicht enthalten. Eine Kopie auf derselben Festplatte schützt nicht vor Geräteausfall; eine weitere Kopie auf einem unabhängigen Datenträger aufbewahren.</p>
|
||||
<p>„Weitere Aktionen → Sicherung zurückspielen“ ersetzt die aktuellen Konten und Buchungen. Nur passende geprüfte Sicherungen werden angenommen. Vorher legt Dümpelkas eine Rückfallsicherung neben der aktiven Datenbank an; diese wird nicht automatisch gelöscht. Eine alte Sicherung enthält spätere Buchungen nicht. Rückspielen nicht zum Ausprobieren auf dem Vereinsbestand verwenden.</p>
|
||||
</details>
|
||||
<details><summary>Tastatur, Darstellung und Fehler</summary>
|
||||
<p>Tab und Umschalt-Tab wechseln zwischen Bedienelementen. Enter öffnet Links oder speichert passende Formulare. Escape schließt Dialoge; geänderte Eingaben werden vorher abgefangen. Unsichere Bestätigungen beginnen auf Abbrechen.</p>
|
||||
<p>Textgröße steht oben, der Farbmodus in der Übersicht. Meldungen erscheinen oben, verschwinden zeitgesteuert und pausieren bei Maus/Fokus. Bei erwartbaren Speicherfehlern bleibt die Eingabe erhalten. Technische Details sind bei Bedarf aufklappbar. Ein unerwarteter Fehler bestätigt keine Speicherung: vor einem erneuten Eintrag zuerst die Liste prüfen.</p>
|
||||
</details>
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Globalization;
|
||||
using Duempelkas.App.Services.Models;
|
||||
using Duempelkas.Domain.Enums;
|
||||
|
||||
namespace Duempelkas.App.Services;
|
||||
|
||||
public static class EntryListQuery
|
||||
{
|
||||
public static decimal SignedAmount(EntryDto entry) => entry.Type == EntryType.Income ? entry.Amount : -entry.Amount;
|
||||
public static List<EntryDto> Apply(IEnumerable<EntryDto> entries, string search, bool showDeleted, string sort)
|
||||
{
|
||||
var terms = search.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||
var de = CultureInfo.GetCultureInfo("de-DE");
|
||||
var matches = entries.Where(e => !e.IsDeleted || showDeleted).Where(e =>
|
||||
{
|
||||
var text = $"{e.Title} {e.DisplayId} {e.Date:dd.MM.yyyy} {e.Amount.ToString("N2", de)} {SignedAmount(e).ToString("0.00", de)} {e.LinkedAccountName}";
|
||||
return terms.All(term => text.Contains(term, StringComparison.OrdinalIgnoreCase));
|
||||
});
|
||||
return (sort switch
|
||||
{
|
||||
"date-desc" => matches.OrderByDescending(e => e.Date).ThenByDescending(e => e.Id),
|
||||
"amount-asc" => matches.OrderBy(SignedAmount).ThenBy(e => e.Id),
|
||||
"amount-desc" => matches.OrderByDescending(SignedAmount).ThenBy(e => e.Id),
|
||||
"title" => matches.OrderBy(e => e.Title, StringComparer.Create(de, true)).ThenBy(e => e.Id),
|
||||
_ => matches.OrderBy(e => e.Date).ThenBy(e => e.Id)
|
||||
}).ToList();
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,6 @@ namespace Duempelkas.App.Services;
|
||||
|
||||
public interface ISettingsService
|
||||
{
|
||||
Task<bool> GetShowDeletedEntriesAsync();
|
||||
Task SetShowDeletedEntriesAsync(bool show);
|
||||
Task<int> GetSetupStepAsync() => Task.FromResult(0);
|
||||
Task SetSetupStepAsync(int step) => Task.CompletedTask;
|
||||
Task<string?> GetClubNameAsync();
|
||||
Task SetClubNameAsync(string? clubName);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyMetadata Include="BuildDate" Value="$([System.DateTime]::UtcNow.ToString('yyyy-MM-ddTHH:mm:ssZ'))" />
|
||||
<Content Include="wwwroot\**">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
||||
@@ -66,9 +66,6 @@ class Program
|
||||
|
||||
var app = appBuilder.Build();
|
||||
|
||||
// Native toast registration replaces the Windows app identity and creates host shortcuts.
|
||||
// All notifications are displayed inside the application instead.
|
||||
app.MainWindow.SetNotificationsEnabled(false);
|
||||
app.MainWindow.StartUrl = PhotinoWebViewManager.AppBaseUri;
|
||||
|
||||
// Force the native window icon for title bar + taskbar representation.
|
||||
@@ -123,7 +120,7 @@ class Program
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += (sender, error) =>
|
||||
{
|
||||
app.MainWindow.ShowMessage("Dümpelkas konnte nicht fortgesetzt werden", "Bitte das Programm schließen und neu öffnen. Eine Speicherung ist nicht bestätigt; vor erneutem Buchen die Liste prüfen. Fehlerart: " + error.ExceptionObject.GetType().Name);
|
||||
app.MainWindow.ShowMessage("Schwerwiegender Fehler", error.ExceptionObject.ToString());
|
||||
};
|
||||
|
||||
app.Run();
|
||||
|
||||
@@ -350,9 +350,8 @@ html[data-ui-theme="light"] .btn-dark {
|
||||
}
|
||||
|
||||
.table thead th {
|
||||
background-color: var(--color-surface);
|
||||
border-bottom-color: var(--color-border);
|
||||
color: var(--color-text);
|
||||
color: var(--color-text-muted);
|
||||
font-weight: 600;
|
||||
font-size: 0.8rem;
|
||||
text-transform: uppercase;
|
||||
@@ -630,6 +629,7 @@ fieldset { min-width: 0; }
|
||||
.toast-close { position: absolute; right: .3rem; top: .3rem; background: transparent; border: 0; color: inherit; width: 2rem; height: 2rem; font-size: 1.5rem; }
|
||||
@keyframes toast-enter { from { transform: translateY(-2rem); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
||||
@media (prefers-reduced-motion: reduce) { .app-toast { animation: none; } }
|
||||
.input-rejection:empty { display: none; }
|
||||
|
||||
.app-modal { color: var(--color-text); max-height: calc(100dvh - 2rem); overflow-y: auto; }
|
||||
.app-modal::backdrop { background: #0009; backdrop-filter: blur(3px); }
|
||||
@@ -642,11 +642,9 @@ body:has(dialog[open]) .toast-stack:not(.modal-toasts) { display: none; }
|
||||
|
||||
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
|
||||
|
||||
.entry-actions button { min-height: 44px; min-width: 44px; padding: .6rem; }
|
||||
.entry-action-buttons { display: flex; gap: .5rem; }
|
||||
.entry-action-buttons .btn { display: inline-flex; align-items: center; justify-content: center; }
|
||||
.entry-action-buttons .btn i { margin: 0; line-height: 1; }
|
||||
.entry-action-buttons .btn i::before { display: block; }
|
||||
.entry-actions button, .entry-action-menu summary { min-height: 44px; padding: .6rem; }
|
||||
.entry-action-menu summary { cursor: pointer; border: 1px solid var(--color-border); border-radius: .4rem; }
|
||||
.entry-action-menu button { display: block; width: 100%; margin-top: .5rem; }
|
||||
.entry-description { overflow-wrap: anywhere; }
|
||||
@media (max-width: 900px) {
|
||||
.entry-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
|
||||
@@ -657,61 +655,6 @@ body:has(dialog[open]) .toast-stack:not(.modal-toasts) { display: none; }
|
||||
.entry-list .entry-description, .entry-list .entry-actions { grid-column: 1 / -1; }
|
||||
}
|
||||
|
||||
.history-toggle { margin-block: 1rem; min-height: 2rem; display: flex; align-items: center; gap: .75rem; }
|
||||
.history-toggle .form-check-input { flex-shrink: 0; margin-top: 0; }
|
||||
.booking-year-warning { display: flex; gap: .75rem; align-items: flex-start; }
|
||||
.booking-year-warning > i { font-size: 1.4rem; }
|
||||
.booking-year-warning label { display: block; margin-top: .75rem; }
|
||||
dialog.app-modal { scrollbar-gutter: stable; }
|
||||
.history-toggle { display: block; padding: .75rem 0; }
|
||||
.entry-deleted { opacity: 1 !important; }
|
||||
.deleted-status { text-decoration: none; color: var(--color-text-muted); margin: .3rem 0; }
|
||||
|
||||
/* Readable theme roles, also used when external styles are unavailable. */
|
||||
:root { --color-bg: #f1f5f9; --color-income: #166534; --color-expense: #b91c1c; --color-transfer: #1d4ed8; --color-text-muted: #475569; --color-border: #94a3b8; }
|
||||
html[data-ui-theme="dark"] { --color-income: #4ade80; --color-expense: #fca5a5; --color-transfer: #93c5fd; --color-text-muted: #cbd5e1; --color-border: #64748b; }
|
||||
html { font-size: var(--app-font-size, 16px); }
|
||||
body { line-height: 1.5; }
|
||||
h1,h2,h3,h4,h5,h6 { font-family: inherit; }
|
||||
small, .text-muted { color: var(--color-text-muted) !important; }
|
||||
small { font-size: .9rem; }
|
||||
.form-label, .table thead th { text-transform: none; letter-spacing: normal; font-size: 1rem; }
|
||||
.app-shell { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
|
||||
.app-navbar, .app-footer { flex-wrap: wrap; gap: .5rem; height: auto; min-height: 2.5rem; }
|
||||
.app-footer { font-size: .9rem; }
|
||||
.reading-controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
|
||||
.reading-controls select { padding: .35rem; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); }
|
||||
.page-heading, .card-title { overflow-wrap: anywhere; white-space: normal; }
|
||||
.app-modal { box-sizing: border-box; width: min(38rem, calc(100vw - 2rem)); min-width: 0; max-width: calc(100vw - 2rem); max-height: calc(100dvh - 2rem); }
|
||||
.app-modal p, .app-modal label { overflow-wrap: anywhere; }
|
||||
.app-modal .dialog-actions, .app-modal form > .d-flex { flex-wrap: wrap; position: sticky; bottom: -1rem; background: var(--color-surface); padding: .75rem 0; }
|
||||
.form-container { max-width: none; }
|
||||
.btn-primary { background: #4338ca; border-color: #4338ca; color: #fff; }
|
||||
.btn-success { background: #166534; border-color: #166534; color: #fff; }
|
||||
.btn-info { background: #1e40af; border-color: #1e40af; color: #fff; }
|
||||
.btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
|
||||
.btn-warning { background: #fbbf24; border-color: #fbbf24; color: #111827; }
|
||||
.btn-secondary { background: var(--color-surface-hover); color: var(--color-text); border-color: var(--color-border); }
|
||||
.btn:hover { filter: brightness(.92); }
|
||||
input,select,textarea,button { font: inherit; }
|
||||
button,summary { touch-action: manipulation; }
|
||||
@media (max-width: 1000px) {
|
||||
.form-container { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
|
||||
.form-container label,.form-container input,.form-container select,.form-container textarea { grid-column: auto; }
|
||||
.action-toolbar { gap: .5rem; }
|
||||
}
|
||||
|
||||
.btn-primary:hover { background: #4338ca; border-color: #4338ca; color: #fff; }
|
||||
.btn-success:hover { background: #166534; border-color: #166534; color: #fff; }
|
||||
.btn-info:hover { background: #1e40af; border-color: #1e40af; color: #fff; }
|
||||
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
|
||||
|
||||
.entry-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; padding: .75rem 0; }
|
||||
.entry-filters > div { flex: 1 1 14rem; min-width: 0; }
|
||||
.entry-filters input,.entry-filters select { width: 100%; box-sizing: border-box; padding: .5rem; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); }
|
||||
.search-summary { padding: .6rem; border-left: 3px solid var(--color-accent); }
|
||||
|
||||
.text-danger { color: var(--color-expense) !important; }
|
||||
.text-success { color: var(--color-income) !important; }
|
||||
|
||||
.entry-deleted td { text-decoration: none; }
|
||||
.entry-deleted .entry-title, .entry-deleted td[data-label="Betrag"] { text-decoration: line-through; }
|
||||
|
||||
@@ -109,17 +109,21 @@
|
||||
})();
|
||||
</script>
|
||||
<title>Dümpelkas – Kassenbuch</title>
|
||||
<link href="vendor/bootstrap/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="vendor/bootstrap-icons/bootstrap-icons.min.css" rel="stylesheet" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet"
|
||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YcnS/1nDaGm7AT/+aIi56blBBJoSpcBx5Hn"
|
||||
crossorigin="anonymous" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
|
||||
rel="stylesheet" />
|
||||
<link href="css/app.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<app>Laden...</app>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
Die Ansicht konnte wegen eines unerwarteten Fehlers nicht fortgesetzt werden. Eine Speicherung ist nicht bestätigt; bitte vor erneutem Buchen die Liste prüfen.
|
||||
<a href="" class="reload">Ansicht neu laden</a>
|
||||
<button type="button" class="dismiss" aria-label="Fehlerhinweis schließen">×</button>
|
||||
Ein unbehandelter Fehler ist aufgetreten.
|
||||
<a href="" class="reload">Neu laden</a>
|
||||
<a class="dismiss">×</a>
|
||||
</div>
|
||||
|
||||
<script src="js/app.js"></script>
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
}
|
||||
function accept(input, text) {
|
||||
const next = input.value.slice(0, input.selectionStart) + text + input.value.slice(input.selectionEnd);
|
||||
return allowed(input, next);
|
||||
const ok = allowed(input, next);
|
||||
const hint = document.getElementById(input.id + '-rejected');
|
||||
if (hint) hint.textContent = ok ? '' : 'Diese Eingabe wurde nicht übernommen. Bitte einen Betrag wie 12,50 eingeben.';
|
||||
return ok;
|
||||
}
|
||||
document.addEventListener('beforeinput', e => {
|
||||
if (e.target.matches('[data-amount-guard]') && e.data != null && !accept(e.target, e.data)) e.preventDefault();
|
||||
@@ -27,14 +30,3 @@ window.duempelkasDialog = {
|
||||
close(dialog) { if (dialog?.open) dialog.close(); },
|
||||
focus(dialog, selector) { dialog.querySelector(selector)?.focus(); }
|
||||
};
|
||||
|
||||
window.duempelkasReading = {
|
||||
get() { let value = 100; try { value = Number(localStorage.getItem('duempelkas-text-scale')) || 100; } catch (_) {} return this.set(value, false); },
|
||||
set(value, persist = true) {
|
||||
const scale = [75,100,125,150,200].includes(Number(value)) ? Number(value) : 100;
|
||||
document.documentElement.style.setProperty('--app-font-size', (16 * scale / 100) + 'px');
|
||||
if (persist) { try { localStorage.setItem('duempelkas-text-scale', String(scale)); } catch (_) {} }
|
||||
return scale;
|
||||
}
|
||||
};
|
||||
window.duempelkasReading.get();
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
Bootstrap 5.3.3 and Bootstrap Icons 1.11.3, MIT-licensed. Vendored from the corresponding npm releases via cdn.jsdelivr.net; original licenses are in each directory. Font query hashes were removed for local WebView paths.
|
||||
|
||||
bootstrap\bootstrap.min.css SHA256 3c8f27e6009ccfd710a905e6dcf12d0ee3c6f2ac7da05b0572d3e0d12e736fc8
|
||||
bootstrap\LICENSE SHA256 8c14611ae41ac6fd543c13349f22188eb12c69b3e59105c5eca3925a8e4eca3e
|
||||
bootstrap-icons\bootstrap-icons.min.css SHA256 ea5f11e3455e7ec8cdfec5a46a6f0905308979d60cb2777c9246bc04cd37cff7
|
||||
bootstrap-icons\LICENSE SHA256 0fb3e11bd57e896c5a512afd64864d28a37de45d19835016c87ca1ad19ead969
|
||||
bootstrap-icons\fonts\bootstrap-icons.woff SHA256 bb1de989b83970f6f4e54de1cd974c5cba55b73582da5e1b225a6d0edf029483
|
||||
bootstrap-icons\fonts\bootstrap-icons.woff2 SHA256 476adf42b40325098fcfa8b36ab3e769186bb4f6ce6a249753e2e1a9c22bf99e
|
||||
@@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019-2024 The Bootstrap Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
File diff suppressed because one or more lines are too long
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2024 The Bootstrap Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
File diff suppressed because one or more lines are too long
@@ -12,15 +12,6 @@ public class SettingsService : ISettingsService
|
||||
|
||||
private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true };
|
||||
|
||||
public async Task<bool> GetShowDeletedEntriesAsync() => (await LoadAsync()).ShowDeletedEntries;
|
||||
|
||||
public async Task SetShowDeletedEntriesAsync(bool show)
|
||||
{
|
||||
var settings = await LoadAsync();
|
||||
settings.ShowDeletedEntries = show;
|
||||
await SaveAsync(settings);
|
||||
}
|
||||
|
||||
public async Task<string?> GetClubNameAsync()
|
||||
{
|
||||
var settings = await LoadAsync();
|
||||
@@ -34,14 +25,6 @@ public class SettingsService : ISettingsService
|
||||
await SaveAsync(settings);
|
||||
}
|
||||
|
||||
public async Task<int> GetSetupStepAsync() => (await LoadAsync()).SetupStep;
|
||||
public async Task SetSetupStepAsync(int step)
|
||||
{
|
||||
var settings = await LoadAsync();
|
||||
settings.SetupStep = Math.Clamp(step, 0, 4);
|
||||
await SaveAsync(settings);
|
||||
}
|
||||
|
||||
private async Task<AppSettings> LoadAsync()
|
||||
{
|
||||
if (!File.Exists(SettingsPath))
|
||||
@@ -68,8 +51,6 @@ public class SettingsService : ISettingsService
|
||||
|
||||
private class AppSettings
|
||||
{
|
||||
public bool ShowDeletedEntries { get; set; }
|
||||
public string? ClubName { get; set; }
|
||||
public int SetupStep { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
using Bunit;
|
||||
using Duempelkas.App.Components;
|
||||
using Xunit;
|
||||
|
||||
namespace Duempelkas.Tests;
|
||||
|
||||
public class BookingDateInputTests
|
||||
{
|
||||
[Fact]
|
||||
public void DateIsValidatedOnLeavingField_WithoutInterruptingNativeCalendar()
|
||||
{
|
||||
using var context = new BunitContext();
|
||||
var value = "2025-12-31";
|
||||
var field = context.Render<BookingDateInput>(p => p
|
||||
.Add(x => x.Value, value).Add(x => x.ValueChanged, next => value = next));
|
||||
field.Find("input").Input("2026-01-01");
|
||||
Assert.Equal("2025-12-31", value);
|
||||
field.Find("input").Blur();
|
||||
Assert.Equal("2026-01-01", value);
|
||||
field.Render(p => p.Add(x => x.Value, value));
|
||||
// The browser owns the edited value; avoid resetting its calendar by writing it back.
|
||||
Assert.Equal("2025-12-31", field.Find("input").GetAttribute("value"));
|
||||
field.Render(p => p.Add(x => x.Value, "2027-02-03"));
|
||||
Assert.Equal("2027-02-03", field.Find("input").GetAttribute("value"));
|
||||
}
|
||||
}
|
||||
@@ -11,26 +11,6 @@ namespace Duempelkas.Tests;
|
||||
|
||||
public class BookingFormTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task PendingDate_IsProtectedOnCancel_AndValidatedBeforeSubmit()
|
||||
{
|
||||
using var f = new LedgerUiFixture();
|
||||
var dialog = f.Context.Render<AddEntryDialog>(p => p.Add(x => x.AccountId, 1).Add(x => x.ContextYear, DateTime.Today.Year));
|
||||
dialog.Find("#entry-date").Input($"{DateTime.Today.Year + 1}-01-02");
|
||||
Assert.Empty(dialog.FindAll(".booking-year-warning"));
|
||||
var modal = dialog.FindComponent<ModalDialog>();
|
||||
await modal.InvokeAsync(() => modal.Instance.RequestCloseAsync());
|
||||
Assert.NotEmpty(dialog.FindAll("[role=alertdialog]"));
|
||||
dialog.Find("[data-discard-continue]").Click();
|
||||
dialog.Find("#entry-title").Input("Pending date");
|
||||
dialog.Find("#entry-amount").Input("12,50");
|
||||
// A keyboard submit can happen without the date field losing focus first.
|
||||
dialog.Find("form").Submit();
|
||||
Assert.NotEmpty(dialog.FindAll(".booking-year-warning"));
|
||||
Assert.True(dialog.Find("button.btn-success").HasAttribute("disabled"));
|
||||
Assert.Empty(await f.Service<IEntryService>().GetEntriesAsync(1, (int?)null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Form_ExplainsMissingFields_AndDoesNotRoundInvalidInput()
|
||||
{
|
||||
@@ -51,11 +31,9 @@ public class BookingFormTests
|
||||
dialog.Find("#entry-amount").Input("12,50");
|
||||
Assert.False(dialog.Find("button.btn-success").HasAttribute("disabled"));
|
||||
dialog.Find("#entry-date").Input("");
|
||||
dialog.Find("#entry-date").Blur();
|
||||
Assert.True(dialog.Find("button.btn-success").HasAttribute("disabled"));
|
||||
Assert.Contains("Bitte ein gültiges Datum", dialog.Markup);
|
||||
dialog.Find("#entry-date").Input("2026-01-02");
|
||||
dialog.Find("#entry-date").Blur();
|
||||
Assert.False(dialog.Find("button.btn-success").HasAttribute("disabled"));
|
||||
}
|
||||
|
||||
|
||||
@@ -37,9 +37,7 @@ public class CarryoverCorrectionTests
|
||||
var dialog = f.Context.Render<EditCarryoverDialog>(p => p.Add(x => x.CurrentAmount, 110m)
|
||||
.Add(x => x.InitialBalance, 100m).Add(x => x.Year, 2026).Add(x => x.AccountName, "Barkasse")
|
||||
.Add(x => x.OnSave, value => saved = value));
|
||||
Assert.Equal("110,00", dialog.Find("#carryover").GetAttribute("value"));
|
||||
dialog.Find("#carryover").Input("120,00");
|
||||
Assert.Equal("120,00", dialog.Find("#carryover").GetAttribute("value"));
|
||||
Assert.Contains("frühere und spätere Jahre", dialog.Markup);
|
||||
Assert.Contains("110,00", dialog.Find(".correction-preview").TextContent);
|
||||
Assert.True(dialog.Find("button.btn-success").HasAttribute("disabled"));
|
||||
|
||||
@@ -174,8 +174,6 @@ public class DashboardPdfStatementServiceTests : IDisposable
|
||||
|
||||
private sealed class FixedSettingsService : ISettingsService
|
||||
{
|
||||
public Task<bool> GetShowDeletedEntriesAsync() => Task.FromResult(false);
|
||||
public Task SetShowDeletedEntriesAsync(bool show) => Task.CompletedTask;
|
||||
private readonly string? _clubName;
|
||||
|
||||
public FixedSettingsService(string? clubName)
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Xunit;
|
||||
|
||||
namespace Duempelkas.Tests;
|
||||
|
||||
public class DesktopResourceTests
|
||||
{
|
||||
[Fact]
|
||||
public void StartupStylesAndFonts_AreDeliveredLocally()
|
||||
{
|
||||
var root = new DirectoryInfo(AppContext.BaseDirectory);
|
||||
while (root != null && !File.Exists(Path.Combine(root.FullName, "src", "Duempelkas.Desktop", "Duempelkas.Desktop.csproj"))) root = root.Parent;
|
||||
Assert.NotNull(root);
|
||||
var web = Path.Combine(root.FullName, "src", "Duempelkas.Desktop", "wwwroot");
|
||||
var html = File.ReadAllText(Path.Combine(web, "index.html"));
|
||||
Assert.DoesNotContain("https://", html);
|
||||
foreach (Match match in Regex.Matches(html, "(?:href|src)=\"([^\"]+)\""))
|
||||
{
|
||||
var path = match.Groups[1].Value;
|
||||
if (path.Length == 0 || path == "/" || path.StartsWith("_framework")) continue;
|
||||
Assert.True(File.Exists(Path.Combine(web, path)), path);
|
||||
}
|
||||
var icons = Path.Combine(web, "vendor", "bootstrap-icons");
|
||||
var css = File.ReadAllText(Path.Combine(icons, "bootstrap-icons.min.css"));
|
||||
foreach (Match match in Regex.Matches(css, "url\\([\"']?([^\"')]+)"))
|
||||
Assert.True(File.Exists(Path.Combine(icons, match.Groups[1].Value.Split('?')[0])));
|
||||
Assert.True(File.Exists(Path.Combine(icons, "LICENSE")));
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public class EntryLifecycleUiTests
|
||||
await entries.CreateTransferAsync(1, 2, DateTime.Today, "Testtransfer", 20m);
|
||||
var page = f.Context.Render<Routes>();
|
||||
page.WaitForElement(".account-card").Click();
|
||||
page.WaitForElement(".entry-action-buttons");
|
||||
page.WaitForElement(".entry-action-menu");
|
||||
page.Find("button.btn-outline-danger").Click();
|
||||
page.WaitForAssertion(() => Assert.Contains("beiden Konten", page.Markup));
|
||||
Assert.Contains("Barkasse", page.Find("dialog").TextContent);
|
||||
@@ -27,7 +27,6 @@ public class EntryLifecycleUiTests
|
||||
Assert.Contains("zählt nicht zum Kontostand", page.Markup);
|
||||
page.Find(".toast-success .btn").Click();
|
||||
page.WaitForAssertion(() => Assert.Single(page.FindAll("tbody tr")));
|
||||
page.WaitForAssertion(() => Assert.Empty(page.FindAll(".deleted-status")));
|
||||
Assert.All(await entries.GetEntriesAsync(2, (int?)null), e => Assert.False(e.IsDeleted));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,27 +9,14 @@ namespace Duempelkas.Tests;
|
||||
public class EntryPresentationTests
|
||||
{
|
||||
[Fact]
|
||||
public void EmptyAccount_ShowsExplanationRatherThanParameterName()
|
||||
public void Actions_HaveVisibleTextAndBookingSpecificNames()
|
||||
{
|
||||
using var f = new LedgerUiFixture();
|
||||
f.Service<Microsoft.AspNetCore.Components.NavigationManager>().NavigateTo("/accounts/2");
|
||||
var page = f.Context.Render<Duempelkas.App.Components.Routes>();
|
||||
page.WaitForAssertion(() => Assert.Contains("Noch keine Buchungen vorhanden.", page.Markup));
|
||||
Assert.DoesNotContain("emptyEntriesMessage", page.Markup);
|
||||
}
|
||||
[Fact]
|
||||
public void Actions_AreDirectIconButtonsWithTitlesAndBookingSpecificNames()
|
||||
{
|
||||
using var fixture = new LedgerUiFixture();
|
||||
var context = fixture.Context;
|
||||
using var context = new BunitContext();
|
||||
var entry = new EntryDto(1, 1, "2026-001", EntryType.Expense, DateTime.Today, "Porto", 4.20m, false, false, null, null, null);
|
||||
var edited = 0;
|
||||
var table = context.Render<EntryTable>(p => p.Add(x => x.Entries, [entry]).Add(x => x.OnEditEntry, id => edited = id));
|
||||
Assert.Empty(table.FindAll("summary"));
|
||||
var edit = table.Find("button[title='Buchung bearbeiten']");
|
||||
Assert.Contains("2026-001 Porto", edit.GetAttribute("aria-label"));
|
||||
Assert.NotNull(edit.QuerySelector(".bi-pencil[aria-hidden=true]"));
|
||||
Assert.NotNull(table.Find("button.btn-outline-danger .bi-trash"));
|
||||
Assert.Contains("2026-001 Porto", table.Find("summary").GetAttribute("aria-label"));
|
||||
var edit = table.FindAll("button").Single(b => b.TextContent.Contains("Bearbeiten"));
|
||||
Assert.Contains("Porto", edit.GetAttribute("aria-label"));
|
||||
edit.Click();
|
||||
Assert.Equal(1, edited);
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
using Bunit;
|
||||
using Duempelkas.App.Components.Accounts;
|
||||
using Duempelkas.App.Services;
|
||||
using Duempelkas.App.Services.Models;
|
||||
using Duempelkas.Domain.Enums;
|
||||
using Xunit;
|
||||
|
||||
namespace Duempelkas.Tests;
|
||||
|
||||
public class EntrySearchTests
|
||||
{
|
||||
[Fact]
|
||||
public void Search_FindsKnownBookingInLargeList_AndResetsWithoutChangingAmounts()
|
||||
{
|
||||
using var fixture = new LedgerUiFixture();
|
||||
var context = fixture.Context;
|
||||
var entries = Enumerable.Range(1, 400).Select(i => new EntryDto(i, 1, $"2026-{i:D3}", EntryType.Income,
|
||||
new(2026, 1, 1), i == 321 ? "Älteres Jubiläum" : $"Beitrag {i}", i == 321 ? 12.50m : i, false, false, null, null, null)).ToList();
|
||||
var original = entries.Sum(e => e.Amount);
|
||||
var table = context.Render<EntryTable>(p => p.Add(x => x.Entries, entries));
|
||||
table.Find("#entry-search").Input("Älteres 12,50");
|
||||
Assert.Single(table.FindAll("tbody tr"));
|
||||
Assert.Contains("12,50", table.Find(".search-summary").TextContent);
|
||||
Assert.Contains("unverändert", table.Find(".search-summary").TextContent);
|
||||
table.Find("#entry-search").Input("nicht vorhanden");
|
||||
Assert.Empty(table.FindAll("tbody tr"));
|
||||
Assert.Contains("Keine Treffer", table.Markup);
|
||||
table.Find(".filter-reset").Click();
|
||||
Assert.Equal(400, table.FindAll("tbody tr").Count);
|
||||
Assert.Equal(original, entries.Sum(e => e.Amount));
|
||||
table.Find("#entry-search").Input("2026-321");
|
||||
Assert.Single(table.FindAll("tbody tr"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Sort_UsesSignedAmounts_AndDeletedHistoryDoesNotAffectResultSum()
|
||||
{
|
||||
var entries = new List<EntryDto> {
|
||||
new(1,1,"2026-001",EntryType.Expense,DateTime.Today,"Porto",20m,false,false,null,null,null),
|
||||
new(2,1,"2026-002",EntryType.Income,DateTime.Today,"Beitrag",10m,false,false,null,null,null),
|
||||
new(3,1,"2026-003",EntryType.Income,DateTime.Today,"Gelöscht",99m,true,false,null,null,null) };
|
||||
Assert.Equal(new[] { 2, 1 }, EntryListQuery.Apply(entries, "", false, "amount-desc").Select(e => e.Id));
|
||||
Assert.Single(EntryListQuery.Apply(entries, "-20,00", false, "date-asc"));
|
||||
Assert.Equal(3, EntryListQuery.Apply(entries, "", true, "date-asc").Count);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using Bunit;
|
||||
using Duempelkas.App.Components;
|
||||
using Duempelkas.App.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Rendering;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Xunit;
|
||||
|
||||
namespace Duempelkas.Tests;
|
||||
|
||||
public class ErrorRecoveryTests
|
||||
{
|
||||
[Fact]
|
||||
public void UnexpectedError_OffersRecoveryWithoutLeakingBookingData()
|
||||
{
|
||||
using var context = new BunitContext();
|
||||
context.Services.AddSingleton<ToastService>();
|
||||
var boundary = context.Render<AppErrorBoundary>(p => p.AddChildContent<Throws>());
|
||||
boundary.WaitForAssertion(() => Assert.Contains("nicht bestätigt", boundary.Markup));
|
||||
Assert.Contains("Zur Kontenübersicht", boundary.Markup);
|
||||
Assert.Contains("InvalidOperationException", boundary.Markup);
|
||||
Assert.DoesNotContain("SECRET_BOOKING_DATA", boundary.Markup);
|
||||
}
|
||||
private sealed class Throws : ComponentBase
|
||||
{
|
||||
protected override void BuildRenderTree(RenderTreeBuilder builder) => throw new InvalidOperationException("SECRET_BOOKING_DATA");
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using Bunit;
|
||||
using Duempelkas.App.Components;
|
||||
using Duempelkas.App.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Xunit;
|
||||
|
||||
namespace Duempelkas.Tests;
|
||||
|
||||
public class GettingStartedTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Introduction_CanBeSkippedAndResumed_AndCreatesNoSampleBookings()
|
||||
{
|
||||
using var f = new LedgerUiFixture(false);
|
||||
var navigation = f.Service<NavigationManager>();
|
||||
navigation.NavigateTo("/einstieg");
|
||||
var page = f.Context.Render<Routes>();
|
||||
page.WaitForElement("#setup-club").Input("Mein Testverein");
|
||||
page.Find(".setup-next").Click();
|
||||
page.WaitForAssertion(() => Assert.Contains("Dein erstes Konto", page.Markup));
|
||||
page.FindAll("button").Single(b => b.TextContent.Contains("später fortsetzen")).Click();
|
||||
navigation.NavigateTo("/einstieg");
|
||||
page.WaitForAssertion(() => Assert.Contains("Dein erstes Konto", page.Markup));
|
||||
page.FindAll("button").Single(b => b.TextContent.Trim() == "Konto anlegen").Click();
|
||||
page.Find("#account-name").Input("Barkasse");
|
||||
page.Find("#account-initial").Input("25,00");
|
||||
page.Find("dialog form").Submit();
|
||||
page.WaitForAssertion(() => Assert.Contains("Die erste Buchung", page.Markup));
|
||||
var account = Assert.Single(await f.Service<IAccountService>().GetAllAccountsAsync());
|
||||
Assert.Equal(25m, account.TotalBalance);
|
||||
Assert.Empty(await f.Service<IEntryService>().GetEntriesAsync(account.Id, (int?)null));
|
||||
Assert.Equal(2, await f.Service<ISettingsService>().GetSetupStepAsync());
|
||||
navigation.NavigateTo("/hilfe");
|
||||
page.WaitForAssertion(() => Assert.Contains("auch ohne Internet", page.Markup));
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
using Bunit;
|
||||
using Duempelkas.App.Components.Accounts;
|
||||
using Duempelkas.App.Services;
|
||||
using Duempelkas.App.Services.Models;
|
||||
using Duempelkas.Domain.Enums;
|
||||
using Duempelkas.Infrastructure.Services;
|
||||
using Xunit;
|
||||
|
||||
namespace Duempelkas.Tests;
|
||||
|
||||
public class HistoryPreferenceTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task PreferenceSurvivesRestart_AndPreservesOtherSettings()
|
||||
{
|
||||
var folder = Path.Combine(Path.GetTempPath(), "duempelkas-history-" + Guid.NewGuid().ToString("N"));
|
||||
try
|
||||
{
|
||||
var settings = new SettingsService(folder);
|
||||
Assert.False(await settings.GetShowDeletedEntriesAsync());
|
||||
await settings.SetClubNameAsync("Testverein");
|
||||
await settings.SetShowDeletedEntriesAsync(true);
|
||||
var restarted = new SettingsService(folder);
|
||||
Assert.True(await restarted.GetShowDeletedEntriesAsync());
|
||||
Assert.Equal("Testverein", await restarted.GetClubNameAsync());
|
||||
await restarted.SetSetupStepAsync(2);
|
||||
Assert.True(await new SettingsService(folder).GetShowDeletedEntriesAsync());
|
||||
await restarted.SetShowDeletedEntriesAsync(false);
|
||||
Assert.False(await new SettingsService(folder).GetShowDeletedEntriesAsync());
|
||||
}
|
||||
finally { if (Directory.Exists(folder)) Directory.Delete(folder, true); }
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task HistoryStaysEnabledAcrossAccountsAndFilterReset_UntilSwitchedOff()
|
||||
{
|
||||
using var f = new LedgerUiFixture();
|
||||
List<EntryDto> Rows(int account) => [new(account, account, "2026-001", EntryType.Income,
|
||||
DateTime.Today, "Deleted test", 10m, true, false, null, null, null)];
|
||||
var first = f.Context.Render<EntryTable>(p => p.Add(x => x.Entries, Rows(1)));
|
||||
Assert.Empty(first.FindAll("tbody tr"));
|
||||
await first.Find("#show-deleted").ChangeAsync(new() { Value = true });
|
||||
Assert.True(await f.Service<ISettingsService>().GetShowDeletedEntriesAsync());
|
||||
first.Find(".filter-reset").Click();
|
||||
Assert.Single(first.FindAll("tbody tr"));
|
||||
var second = f.Context.Render<EntryTable>(p => p.Add(x => x.Entries, Rows(2)));
|
||||
second.WaitForAssertion(() => Assert.Single(second.FindAll("tbody tr")));
|
||||
await second.Find("#show-deleted").ChangeAsync(new() { Value = false });
|
||||
Assert.False(await f.Service<ISettingsService>().GetShowDeletedEntriesAsync());
|
||||
var returning = f.Context.Render<EntryTable>(p => p.Add(x => x.Entries, Rows(1)));
|
||||
returning.WaitForAssertion(() => Assert.Empty(returning.FindAll("tbody tr")));
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
using Bunit;
|
||||
using Duempelkas.App.Components;
|
||||
using Duempelkas.App.Services;
|
||||
using Duempelkas.Domain.Enums;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Xunit;
|
||||
|
||||
namespace Duempelkas.Tests;
|
||||
|
||||
public class LayoutControlTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task TextScaleControl_ChangesPresentationWithoutChangingLedger()
|
||||
{
|
||||
using var f = new LedgerUiFixture();
|
||||
var entries = f.Service<IEntryService>();
|
||||
await entries.CreateEntryAsync(1, EntryType.Expense, DateTime.Today, "Porto mit sehr langer Beschreibung und Umlauten äöü", 4.20m);
|
||||
f.Service<NavigationManager>().NavigateTo("/accounts/1");
|
||||
var page = f.Context.Render<Routes>();
|
||||
page.WaitForElement("#text-scale").Change("200");
|
||||
Assert.Contains(f.Context.JSInterop.Invocations, i => i.Identifier == "duempelkasReading.set" && Equals(i.Arguments[0], 200));
|
||||
Assert.Equal(95.80m, (await f.Service<IBalanceQueryService>().GetAccountBalanceAsync(1)).TotalBalance);
|
||||
Capture("account", page.Markup);
|
||||
page.FindAll("button").Single(b => b.TextContent.Contains("Einnahme oder Ausgabe")).Click();
|
||||
page.WaitForElement("#entry-title");
|
||||
Capture("booking", page.Markup);
|
||||
}
|
||||
|
||||
private static void Capture(string name, string markup)
|
||||
{
|
||||
var output = Environment.GetEnvironmentVariable("DUEMPELKAS_LAYOUT_EVIDENCE");
|
||||
if (output == null) return;
|
||||
Directory.CreateDirectory(output);
|
||||
var root = new DirectoryInfo(AppContext.BaseDirectory);
|
||||
while (root != null && !File.Exists(Path.Combine(root.FullName, "src", "Duempelkas.Desktop", "Duempelkas.Desktop.csproj"))) root = root.Parent;
|
||||
var web = new Uri(Path.Combine(root!.FullName, "src", "Duempelkas.Desktop", "wwwroot") + Path.DirectorySeparatorChar).AbsoluteUri;
|
||||
File.WriteAllText(Path.Combine(output, name + ".html"), "<!doctype html><html lang='de'><head><meta charset='utf-8'><meta name='viewport' content='width=device-width, initial-scale=1'>" +
|
||||
$"<link rel='stylesheet' href='{web}vendor/bootstrap/bootstrap.min.css'><link rel='stylesheet' href='{web}vendor/bootstrap-icons/bootstrap-icons.min.css'><link rel='stylesheet' href='{web}css/app.css'>" +
|
||||
"</head><body>" + markup + $"<script src='{web}js/app.js'></script>" +
|
||||
"<script>document.querySelectorAll('dialog').forEach(d=>d.showModal());</script></body></html>");
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,6 @@ public class ModalDialogTests
|
||||
await modal.InvokeAsync(() => modal.Instance.RequestCloseAsync());
|
||||
Assert.Equal(1, cancelled);
|
||||
Assert.Contains("Ungespeicherte Eingaben", modal.Markup);
|
||||
await modal.InvokeAsync(() => modal.Instance.RequestCloseAsync());
|
||||
Assert.Empty(modal.FindAll("[role=alertdialog]"));
|
||||
await modal.InvokeAsync(() => modal.Instance.RequestCloseAsync());
|
||||
modal.Find("[data-discard-continue]").Click();
|
||||
Assert.Empty(modal.FindAll("[role=alertdialog]"));
|
||||
await modal.InvokeAsync(() => modal.Instance.RequestCloseAsync());
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ToastTests
|
||||
var control = context.Render<AmountInput>(p => p.Add(x => x.Value, amount).Add(x => x.ValueChanged, value => amount = value));
|
||||
control.Find("input").Input("12,501");
|
||||
Assert.Equal("12,50", amount);
|
||||
Assert.Empty(control.FindAll("[role=status]"));
|
||||
Assert.Contains("nicht übernommen", control.Markup);
|
||||
control.Find("input").Input("12.25");
|
||||
Assert.Equal("12.25", amount);
|
||||
}
|
||||
|
||||
@@ -34,20 +34,18 @@ public class YearNavigationTests
|
||||
context.Services.GetRequiredService<ReportingPeriod>().Year = 2025;
|
||||
var page = context.Render<Routes>();
|
||||
page.WaitForAssertion(() => Assert.Contains("Jahr: 2025", page.Markup));
|
||||
page.WaitForElement(".account-card").Click();
|
||||
page.Find(".account-card").Click();
|
||||
page.WaitForAssertion(() => Assert.Contains("Vorjahr", page.Markup));
|
||||
page.FindAll("button").Single(b => b.TextContent.Contains("Zurück")).Click();
|
||||
page.WaitForAssertion(() => Assert.Contains("Jahr: 2025", page.Markup));
|
||||
page.WaitForElement(".account-card").Click();
|
||||
page.Find(".account-card").Click();
|
||||
page.WaitForElement(".summary-section");
|
||||
page.FindAll("button").Single(b => b.TextContent.Contains("Einnahme oder Ausgabe erfassen")).Click();
|
||||
var dialog = page.FindComponent<AddEntryDialog>();
|
||||
dialog.Find("input[type=date]").Input("2026-01-02");
|
||||
dialog.Find("input[type=date]").Blur();
|
||||
dialog.Find("#entry-title").Input("Außerhalb");
|
||||
dialog.Find("#entry-amount").Input("12.50");
|
||||
Assert.Contains("außerhalb", dialog.Markup);
|
||||
Assert.NotNull(dialog.Find(".booking-year-warning[role=status] .bi-exclamation-triangle-fill"));
|
||||
Assert.True(dialog.Find("button.btn-success").HasAttribute("disabled"));
|
||||
dialog.Find("input[type=checkbox]").Change(true);
|
||||
dialog.Find("form").Submit();
|
||||
@@ -60,7 +58,7 @@ public class YearNavigationTests
|
||||
page.FindAll("button").Single(b => b.TextContent.Trim() == "Alle Buchungen").Click();
|
||||
page.FindAll("button").Single(b => b.TextContent.Contains("Zurück")).Click();
|
||||
page.WaitForAssertion(() => Assert.Contains("Alle Jahre", page.Markup));
|
||||
page.WaitForElement(".account-card").Click();
|
||||
page.Find(".account-card").Click();
|
||||
page.WaitForAssertion(() => Assert.Contains("Vorjahr", page.Markup));
|
||||
Assert.Null(context.Services.GetRequiredService<ReportingPeriod>().Year);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user