Add Components/Loading.razor and swap the ad-hoc `<p>Lädt…</p>` guard visuals for it across the four reports, three edit dialogs, and three chart pages (the last three now show the placeholder instead of a blank page while waiting for view data). Kept as a pure visual so each call site changes from `<p>Lädt…</p>` to `<Loading/>` with no other churn. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
98 lines
No EOL
3.4 KiB
Text
98 lines
No EOL
3.4 KiB
Text
@implements IDialogContentComponent<Transaction>
|
|
@rendermode InteractiveServer
|
|
|
|
<FluentDialogHeader ShowDismiss="true">
|
|
<FluentStack VerticalAlignment="VerticalAlignment.Center">
|
|
<FluentIcon Value="@(new Icons.Regular.Size24.WindowApps())"/>
|
|
<FluentLabel Typo="Typography.PaneHeader">
|
|
@Dialog.Instance.Parameters.Title
|
|
</FluentLabel>
|
|
</FluentStack>
|
|
</FluentDialogHeader>
|
|
|
|
<FluentDialogBody>
|
|
@if (editContext is null)
|
|
{
|
|
<Loading/>
|
|
return;
|
|
}
|
|
|
|
Total: @Math.Abs(Content.Value) / Rest: @openAmount
|
|
<FluentButton Appearance="Appearance.Neutral" IconEnd="@(new Icons.Regular.Size24.Add())"
|
|
OnClick="@AddTransactionAsync">
|
|
Transaktion hinzufügen
|
|
</FluentButton>
|
|
<EditForm EditContext="@editContext">
|
|
<DataAnnotationsValidator/>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Datum</th>
|
|
<th>Betrag</th>
|
|
<th>Text</th>
|
|
<th>Konto</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var transaction in transactionList)
|
|
{
|
|
<tr>
|
|
<td>
|
|
<div>@transaction.ValueDate.ToString("dd.MM.yyyy")</div>
|
|
</td>
|
|
<td>
|
|
<div>
|
|
<InputNumber @bind-Value="@transaction.Value" @onblur="CalculateOpenAmount"/>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="text-column">
|
|
<input list="texts" @bind="@transaction.Text" placeholder="Type or select..."/>
|
|
<datalist id="texts">
|
|
@foreach (var text in bookingTexts.OrderBy(t => t))
|
|
{
|
|
<option value="@text"></option>
|
|
}
|
|
</datalist>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<div class="account-column">
|
|
<AccountSelector Accounts="accounts" @bind-AccountId="@transaction.TargetAccountId" />
|
|
</div>
|
|
</td>
|
|
<td style="align-content: center">
|
|
<FluentButton IconEnd="@(new Icons.Regular.Size16.Delete())" Appearance="Appearance.Neutral"
|
|
OnClick="@(() => transactionList.Remove(transaction))"/>
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
<div>
|
|
<FluentValidationSummary/>
|
|
@if (validationErrors.Count > 0)
|
|
{
|
|
<ul class="validation-message">
|
|
@foreach (var err in validationErrors)
|
|
{
|
|
<li>@err</li>
|
|
}
|
|
</ul>
|
|
}
|
|
</div>
|
|
</EditForm>
|
|
</FluentDialogBody>
|
|
|
|
<FluentDialogFooter>
|
|
<FluentButton Appearance="Appearance.Neutral"
|
|
OnClick="@CancelAsync">
|
|
Abbrechen
|
|
</FluentButton>
|
|
<FluentButton Appearance="Appearance.Accent" Disabled="@(openAmount != 0)"
|
|
OnClick="@SaveAsync">
|
|
Speichern
|
|
</FluentButton>
|
|
</FluentDialogFooter> |