Display different message for empty library vs no filtered results
Fixes #193
This commit is contained in:
parent
0595386d50
commit
e67bb55487
4 changed files with 33 additions and 22 deletions
|
|
@ -91,12 +91,12 @@
|
|||
|
||||
}
|
||||
|
||||
async Task ResetFilter()
|
||||
public async Task ResetFilter()
|
||||
{
|
||||
await LibraryService.Filter.ResetFilter();
|
||||
}
|
||||
|
||||
async Task ApplyFilter()
|
||||
public async Task ApplyFilter()
|
||||
{
|
||||
await LibraryService.Filter.UpdateFilter();
|
||||
await Popover.Close();
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@
|
|||
|
||||
async Task LoadData()
|
||||
{
|
||||
Saves = (await SaveService.Get(Options.Id)).OrderByDescending(s => s.CreatedOn);
|
||||
Saves = await SaveService.Get(Options.Id);
|
||||
Saves = Saves.OrderByDescending(s => s.CreatedOn);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<Drawer Placement="DrawerPlacement.Bottom" Class="depot-game-details" @bind-Visible="@Visible" OnClose="Hide">
|
||||
@if (SelectedGame != null)
|
||||
{
|
||||
<div class="game-details no-scrollbar">
|
||||
<div @key="SelectedGame.Id" class="game-details no-scrollbar">
|
||||
<Button Class="game-details-close-btn" Type="@ButtonType.Text" Icon="@IconType.Outline.Close" OnClick="Hide" />
|
||||
|
||||
@if (SelectedGame != null)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@inject NavigationManager NavigationManager
|
||||
|
||||
<Flex Vertical Class="library-list">
|
||||
@if (LibraryItems == null || !LibraryItems.Any())
|
||||
@if (LibraryService.Items == null || !LibraryService.Items.Any())
|
||||
{
|
||||
<Empty Simple Description="false">
|
||||
<Button Type="ButtonType.Primary" OnClick="@(() => NavigationManager.NavigateTo("/Depot"))">Browse Depot</Button>
|
||||
|
|
@ -15,29 +15,38 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
<Collapse>
|
||||
@if (Groups.Count > 1)
|
||||
{
|
||||
foreach (var group in Groups.OrderByTitle(g => g))
|
||||
if (LibraryItems == null || !LibraryItems.Any())
|
||||
{
|
||||
<Empty Simple Description="@("No Results Found")">
|
||||
<Button Type="ButtonType.Primary" OnClick="Filter.ResetFilter">Reset Filter</Button>
|
||||
</Empty>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Collapse>
|
||||
@if (Groups.Count > 1)
|
||||
{
|
||||
<Panel Header="@group" Key="@group">
|
||||
<AntList DataSource="@(LibraryItems.Where(i => i.Groups.Contains(group) || (group == "Uncategorized" && !i.Groups.Any())))" TItem="Models.ListItem" Class="ant-list-clickable" Size="ListSize.Small">
|
||||
foreach (var group in Groups.OrderByTitle(g => g))
|
||||
{
|
||||
<Panel Header="@group" Key="@group">
|
||||
<AntList DataSource="@(LibraryItems.Where(i => i.Groups.Contains(group) || (group == "Uncategorized" && !i.Groups.Any())))" TItem="Models.ListItem" Class="ant-list-clickable" Size="ListSize.Small">
|
||||
<LibraryListItem Model="@context" OnClick="() => SelectItem(context)" @bind-SelectedItem="SelectedItem"/>
|
||||
</AntList>
|
||||
</Panel>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<Panel Class="no-header">
|
||||
<AntList DataSource="LibraryItems" TItem="Models.ListItem" Class="ant-list-clickable" Size="ListSize.Small">
|
||||
<LibraryListItem Model="@context" OnClick="() => SelectItem(context)" @bind-SelectedItem="SelectedItem"/>
|
||||
</AntList>
|
||||
</Panel>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<Panel Class="no-header">
|
||||
<AntList DataSource="LibraryItems" TItem="Models.ListItem" Class="ant-list-clickable" Size="ListSize.Small">
|
||||
<LibraryListItem Model="@context" OnClick="() => SelectItem(context)" @bind-SelectedItem="SelectedItem"/>
|
||||
</AntList>
|
||||
</Panel>
|
||||
}
|
||||
</Collapse>
|
||||
</Collapse>
|
||||
}
|
||||
|
||||
<LibraryItemFilter/>
|
||||
<LibraryItemFilter @ref="Filter" />
|
||||
}
|
||||
</Flex>
|
||||
|
||||
|
|
@ -47,6 +56,7 @@
|
|||
|
||||
List<string> Groups = new();
|
||||
IEnumerable<Models.ListItem> LibraryItems;
|
||||
LibraryItemFilter Filter;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue