Autoselect interaction creator

This commit is contained in:
Andre Beging
2025-03-27 17:47:53 +01:00
parent 19796928e7
commit 6bc2757eb0
5 changed files with 16 additions and 14 deletions

View File

@@ -21,7 +21,7 @@ namespace FoodsharingSiegen.Server.Controls
private async Task AddInteraction(InteractionType type)
{
await InteractionModal.Show(type, Prospect?.Id);
await InteractionModal.ShowAsync(type, Prospect?.Id);
}
private List<Interaction> GetTyped(InteractionType type)

View File

@@ -24,21 +24,21 @@
}
<div class="row">
<div class="col">
<Field>
<FieldLabel>Wer?</FieldLabel>
<Select TValue="Guid" @bind-SelectedValue="SelectedUser">
@foreach (var user in Users ?? new List<User>())
{
<SelectItem Value="@user.Id">@user.Name</SelectItem>
}
</Select>
</Field>
</div>
@* <div class="col"> *@
@* <Field> *@
@* <FieldLabel>Wer?</FieldLabel> *@
@* <Select TValue="Guid" @bind-SelectedValue="SelectedUser"> *@
@* @foreach (var user in Users ?? new List<User>()) *@
@* { *@
@* <SelectItem Value="@user.Id">@user.Name</SelectItem> *@
@* } *@
@* </Select> *@
@* </Field> *@
@* </div> *@
<div class="col">
<Field>
<FieldLabel>Wann?</FieldLabel>
<DatePicker TValue="DateTime" @bind-Date="Interaction.Date" ElementId="aim-datepicker" Max="DateTime.UtcNow.AddDays(7)"/>
<DatePicker TValue="DateTime" @bind-Date="Interaction.Date" ElementId="aim-datepicker" Max="DateTime.UtcNow.AddDays(7)" DisplayFormat="dd.MM.yyyy" />
</Field>
</div>
</div>

View File

@@ -31,7 +31,7 @@ namespace FoodsharingSiegen.Server.Dialogs
await base.OnParametersSetAsync();
}
public async Task Show(InteractionType type, Guid? prospectId)
public async Task ShowAsync(InteractionType type, Guid? prospectId)
{
if (prospectId == null) return;
_showInfo = false;

View File

@@ -112,6 +112,7 @@ namespace FoodsharingSiegen.Server.Pages
/// <param name="arg">The arg</param>
private async Task OnAddInteraction(Interaction arg)
{
arg.UserID = CurrentUser.Id;
await ProspectService.AddInteraction(arg);
await LoadProspects();
}

View File

@@ -110,6 +110,7 @@ namespace FoodsharingSiegen.Server.Pages
/// <param name="arg">The arg</param>
private async Task OnAddInteraction(Interaction arg)
{
arg.UserID = CurrentUser.Id;
await ProspectService.AddInteraction(arg);
await LoadProspects();
}