Autoselect interaction creator
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user