Added more UI styling. Updated voice work search provider to send back English tag names, if applicable.
All checks were successful
ci / build-test (push) Successful in 2m15s
ci / publish-image (push) Has been skipped

This commit is contained in:
2025-11-15 22:37:15 -05:00
parent 634050c06f
commit 75900a90ef
10 changed files with 245 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
@page "/voiceworks"
@using JSMR.Application.Common.Search
@using JSMR.Application.VoiceWorks.Queries.Search
@using JSMR.UI.Blazor.Components
@using JSMR.UI.Blazor.Services
@@ -6,21 +7,61 @@
<PageTitle>Voice Works</PageTitle>
<h3>VoiceWorks</h3>
<h3>Voice Works</h3>
<JProductCollection Products="items"></JProductCollection>
<JProductCollection Products="searchResults?.Items"></JProductCollection>
@if (searchResults is not null)
{
<JPagination PageNumber="PageNumber" PageNumberChanged="OnPageNumberChanged" PageSize="PageSize" PageSizeChanged="OnPageSizeChanged" @bind-TotalItems="searchResults.TotalItems" />
}
@code {
VoiceWorkSearchResult[]? items;
public int PageNumber { get; set; } = 1;
public int PageSize { get; set; } = 100;
SearchResult<VoiceWorkSearchResult>? searchResults;
protected override async Task OnInitializedAsync()
{
await UpdateDataAsync(true);
}
private async Task UpdateDataAsync(bool resetPageNumber)
{
if (resetPageNumber)
PageNumber = 1;
SearchVoiceWorksRequest request = new(
Options: new()
{
Criteria = new()
{
SupportedLanguages = [Domain.Enums.Language.English]
},
SortOptions =
[
new(VoiceWorkSortField.ReleaseDate, Application.Common.Search.SortDirection.Descending)
],
PageNumber = PageNumber,
PageSize = PageSize
}
);
var result = await Client.SearchAsync(request);
SearchVoiceWorksResponse? response = await Client.SearchAsync(request);
items = result?.Results.Items ?? [];
searchResults = response?.Results;
}
public async Task OnPageNumberChanged(int newPageNumber)
{
PageNumber = newPageNumber;
await UpdateDataAsync(false);
}
public async Task OnPageSizeChanged(int newPageSize)
{
PageSize = newPageSize;
await UpdateDataAsync(true);
}
}