LANCommander/LANCommander.Launcher/UI/Components/ReportIssueDialog.razor
Pat Hartl 76106691eb Add ability to track issues with games
Adds an admin section to view and resolve submitted issues and a menu option in the game context menu in the launcher to report an issue.
2024-08-11 14:48:00 -05:00

34 lines
855 B
Text

@using BootstrapBlazor.Components
@inherits FeedbackComponent<Data.Models.Game, SDK.Models.Issue>
@inject SDK.Client Client
@inject IMessageService MessageService
<Form Model="Issue">
<FormItem>
<TextArea @bind-Value="@context.Description" MinRows="10" />
</FormItem>
</Form>
@code {
SDK.Models.Issue Issue { get; set; } = new SDK.Models.Issue();
public override async Task OnFeedbackOkAsync(ModalClosingEventArgs args)
{
Issue.GameId = Options.Id;
var success = await Client.Issues.Open(Issue.Description, Issue.GameId);
if (success)
{
MessageService.Success("Issue reported!");
await base.FeedbackRef.CloseAsync();
}
else
{
MessageService.Error("Issue could not be reported!");
args.Reject();
}
}
}