2024-08-11 14:48:00 -05:00
|
|
|
@using BootstrapBlazor.Components
|
|
|
|
|
@inherits FeedbackComponent<Data.Models.Game, SDK.Models.Issue>
|
|
|
|
|
@inject SDK.Client Client
|
|
|
|
|
@inject IMessageService MessageService
|
|
|
|
|
|
|
|
|
|
<Form Model="Issue">
|
2024-09-09 18:20:27 -05:00
|
|
|
<FormItem Style="margin-bottom: 0">
|
2024-08-11 14:48:00 -05:00
|
|
|
<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)
|
|
|
|
|
{
|
2024-09-09 18:20:45 -05:00
|
|
|
try {
|
|
|
|
|
Issue.GameId = Options.Id;
|
2024-08-11 14:48:00 -05:00
|
|
|
|
2024-09-09 18:20:45 -05:00
|
|
|
var success = await Client.Issues.Open(Issue.Description, Issue.GameId);
|
2024-08-11 14:48:00 -05:00
|
|
|
|
2024-09-09 18:20:45 -05:00
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
MessageService.Success("Issue reported!");
|
|
|
|
|
|
|
|
|
|
await base.FeedbackRef.CloseAsync();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
MessageService.Error("Unknown error: issue not reported");
|
2024-08-11 14:48:00 -05:00
|
|
|
|
2024-09-09 18:20:45 -05:00
|
|
|
args.Reject();
|
|
|
|
|
}
|
2024-08-11 14:48:00 -05:00
|
|
|
}
|
2024-09-09 18:20:45 -05:00
|
|
|
catch (Exception ex)
|
2024-08-11 14:48:00 -05:00
|
|
|
{
|
2024-09-09 18:20:45 -05:00
|
|
|
MessageService.Error("Unknown error: issue not reported");
|
2024-08-11 14:48:00 -05:00
|
|
|
|
|
|
|
|
args.Reject();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|