Finalized delete voice work logic.
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
|
||||
<BitPivot Size="BitSize.Medium">
|
||||
<BitPivotItem HeaderText="@($"Available ({availableVoiceWorks?.Length ?? 0})")">
|
||||
<JProductCollection Products="availableVoiceWorks"></JProductCollection>
|
||||
<JProductCollection Products="availableVoiceWorks" ProductDeleted="OnAvailableProductDeleted"></JProductCollection>
|
||||
</BitPivotItem>
|
||||
<BitPivotItem HeaderText="@($"Upcoming ({upcomingVoiceWorks?.Length ?? 0})")">
|
||||
<JProductCollection Products="upcomingVoiceWorks"></JProductCollection>
|
||||
<JProductCollection Products="upcomingVoiceWorks" ProductDeleted="OnUpcomingProductDeleted"></JProductCollection>
|
||||
</BitPivotItem>
|
||||
<BitPivotItem HeaderText="@($"Announcements ({announcedVoiceWorks?.Length ?? 0})")">
|
||||
<JProductCollection Products="announcedVoiceWorks" ProductDeleted="OnAnnouncedProductDeleted"></JProductCollection>
|
||||
@@ -106,8 +106,20 @@
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task OnAvailableProductDeleted()
|
||||
{
|
||||
_ = LoadAvailableVoiceWorksAsync();
|
||||
}
|
||||
|
||||
private async Task OnUpcomingProductDeleted()
|
||||
{
|
||||
_ = LoadUpcomingVoiceWorksAsync();
|
||||
_ = LoadAnnouncedVoiceWorksAsync();
|
||||
}
|
||||
|
||||
private async Task OnAnnouncedProductDeleted()
|
||||
{
|
||||
_ = LoadUpcomingVoiceWorksAsync();
|
||||
_ = LoadAnnouncedVoiceWorksAsync();
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
<h3>Voice Works</h3>
|
||||
|
||||
<VoiceWorkFilters Value="@State" ValueChanged="UpdateAsync" />
|
||||
<JProductCollection Products="Result?.Items"></JProductCollection>
|
||||
<JProductCollection Products="Result?.Items" ProductDeleted="OnProductDeleted"></JProductCollection>
|
||||
|
||||
@if (Result is not null)
|
||||
{
|
||||
@@ -69,4 +69,9 @@
|
||||
|
||||
protected override Task<SearchResult<VoiceWorkSearchResult>> ExecuteSearchAsync(VoiceWorkFilterState state, CancellationToken ct)
|
||||
=> Client.SearchAsync(state.ToSearchRequest(), ct).ContinueWith(t => t.Result?.Results ?? new SearchResult<VoiceWorkSearchResult>(), ct);
|
||||
|
||||
private async Task OnProductDeleted()
|
||||
{
|
||||
_ = RunSearchAsync(false);
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,19 @@ public abstract class SearchPageBase<TState, TItem> : ComponentBase, IAsyncDispo
|
||||
_ = RunSearchAsync();
|
||||
}
|
||||
|
||||
//protected async Task Update2Async(TState next, bool scrollToTop)
|
||||
//{
|
||||
// if (Equals(next, State))
|
||||
// return;
|
||||
|
||||
// Console.WriteLine("Got here");
|
||||
|
||||
// State = next;
|
||||
// NavigateToState(next);
|
||||
|
||||
// _ = RunSearchAsync(scrollToTop);
|
||||
//}
|
||||
|
||||
private void NavigateToState(TState next)
|
||||
{
|
||||
string uri = BuildUri(next);
|
||||
@@ -73,9 +86,12 @@ public abstract class SearchPageBase<TState, TItem> : ComponentBase, IAsyncDispo
|
||||
_ = RunSearchAsync();
|
||||
}
|
||||
|
||||
private async Task RunSearchAsync()
|
||||
protected async Task RunSearchAsync(bool scrollTotop = true)
|
||||
{
|
||||
await JS.InvokeVoidAsync("pageHelpers.scrollToTop");
|
||||
if (scrollTotop)
|
||||
await JS.InvokeVoidAsync("pageHelpers.scrollToTop");
|
||||
|
||||
Console.WriteLine("Got here 2");
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -21,10 +21,13 @@
|
||||
|
||||
/* Buttons */
|
||||
.ant-btn {
|
||||
font-weight: var(--ant-button-font-weight);
|
||||
border: var(--ant-btn-border-width) var(--ant-btn-border-style) var(--ant-btn-border-color);
|
||||
/*font-weight: var(--ant-button-font-weight);
|
||||
border-width: var(--ant-btn-border-width);
|
||||
border-style: var(--ant-btn-border-style);
|
||||
border-color: var(--ant-btn-border-color);
|
||||
color: var(--ant-btn-text-color);
|
||||
background-color: var(--ant-btn-bg-color);
|
||||
border-radius: var(--ant-border-radius);*/
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -75,6 +75,9 @@
|
||||
--surface-container-outline-high: rgb(83, 99, 109);
|
||||
--surface-container-outline: rgb(72, 88, 99);
|
||||
--surface-container-outline-low: rgb(63, 78, 88);
|
||||
/* Ant Design - Core */
|
||||
--ant-border-radius: 12px;
|
||||
--ant-line-width: 1px;
|
||||
/* Ant Design - Modals */
|
||||
--ant-color-text: #b4c8d6;
|
||||
--ant-modal-content-bg: #273f50;
|
||||
|
||||
Reference in New Issue
Block a user