Compare commits
7 Commits
image
...
82d2c48ff7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82d2c48ff7 | ||
|
|
41b1f8ae1d | ||
|
|
eda6625e91 | ||
|
|
701388ee34 | ||
|
|
3e099988bc | ||
|
|
ee967cd046 | ||
|
|
76c3e6ddde |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ riderModule.iml
|
|||||||
|
|
||||||
Publish/
|
Publish/
|
||||||
app.db
|
app.db
|
||||||
|
FoodsharingSiegen.Server/wwwroot/buildinfo.txt
|
||||||
10
FoodsharingSiegen.Contracts/Enums/ProspectSortOption.cs
Normal file
10
FoodsharingSiegen.Contracts/Enums/ProspectSortOption.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace FoodsharingSiegen.Contracts.Enums
|
||||||
|
{
|
||||||
|
public enum ProspectSortOption
|
||||||
|
{
|
||||||
|
NameAscending,
|
||||||
|
NameDescending,
|
||||||
|
ModifiedAscending,
|
||||||
|
ModifiedDescending
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,26 @@ namespace FoodsharingSiegen.Contracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const string ProspectFilter = "ProspectFilter";
|
public const string ProspectFilter = "ProspectFilter";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the storage key used for prospect sorting preferences.
|
||||||
|
/// </summary>
|
||||||
|
public const string SortProspects = "SortProspects";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the storage key used for sorting all prospects.
|
||||||
|
/// </summary>
|
||||||
|
public const string SortProspectsAll = "SortProspectsAll";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the storage key used for sorting completed prospects.
|
||||||
|
/// </summary>
|
||||||
|
public const string SortProspectsDone = "SortProspectsDone";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the storage key used for sorting prospects pending verification.
|
||||||
|
/// </summary>
|
||||||
|
public const string SortProspectsVerify = "SortProspectsVerify";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The token key
|
/// The token key
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -12,8 +12,23 @@
|
|||||||
<div class="@divClass">
|
<div class="@divClass">
|
||||||
<h5 class="mb-2 d-flex">
|
<h5 class="mb-2 d-flex">
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
|
@if(string.IsNullOrWhiteSpace(Prospect?.Name))
|
||||||
|
{
|
||||||
|
<i class="fa-solid fa-exclamation-triangle text-warning"></i>
|
||||||
|
<doublearrows></doublearrows>
|
||||||
|
|
||||||
|
<em>»Name fehlt«</em>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
@Prospect?.Name
|
@Prospect?.Name
|
||||||
<small style="font-size: .9rem;">@Prospect?.FsId</small>
|
}
|
||||||
|
|
||||||
|
@if (Prospect?.FsId != null && Prospect.FsId != 0)
|
||||||
|
{
|
||||||
|
<small style="font-size: .9rem; margin-left: 0.5rem;">@Prospect?.FsId</small>
|
||||||
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@if (CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador))
|
@if (CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador))
|
||||||
|
|||||||
17
FoodsharingSiegen.Server/Controls/ProspectSortControl.razor
Normal file
17
FoodsharingSiegen.Server/Controls/ProspectSortControl.razor
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
@using FoodsharingSiegen.Contracts.Enums
|
||||||
|
|
||||||
|
<Button Color="Color.Primary"
|
||||||
|
Width="Width.Px(50)"
|
||||||
|
Height="Height.Px(50)"
|
||||||
|
title="Sortieren"
|
||||||
|
style="min-width: auto;"
|
||||||
|
Clicked="@OpenSortDialogAsync">
|
||||||
|
<i class="fa-solid fa-sort"></i>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<div class="badge-row mt-2">
|
||||||
|
@if (HasCustomSort)
|
||||||
|
{
|
||||||
|
<Badge Color="Color.Primary" Closable="true" CloseClicked="@EventCallback.Factory.Create(this, ResetSortAsync)">@CurrentSortText</Badge>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using Blazorise;
|
||||||
|
using FoodsharingSiegen.Contracts.Entity;
|
||||||
|
using FoodsharingSiegen.Contracts.Enums;
|
||||||
|
using FoodsharingSiegen.Server.Data.Service;
|
||||||
|
using FoodsharingSiegen.Server.Dialogs;
|
||||||
|
using FoodsharingSiegen.Server.Service;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace FoodsharingSiegen.Server.Controls;
|
||||||
|
|
||||||
|
public partial class ProspectSortControl
|
||||||
|
{
|
||||||
|
[Inject] private IModalService ModalService { get; set; } = null!;
|
||||||
|
|
||||||
|
[Inject] private LocalStorageService LocalStorageService { get; set; } = null!;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public ProspectSortOption CurrentSort { get; set; } = ProspectSortOption.NameAscending;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public EventCallback<ProspectSortOption> CurrentSortChanged { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public EventCallback OnSortChanged { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string? StorageKey { get; set; }
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(StorageKey))
|
||||||
|
{
|
||||||
|
var savedSort = await LocalStorageService.GetItem<ProspectSortOption?>(StorageKey);
|
||||||
|
if (savedSort.HasValue)
|
||||||
|
{
|
||||||
|
CurrentSort = savedSort.Value;
|
||||||
|
await CurrentSortChanged.InvokeAsync(CurrentSort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task OpenSortDialogAsync()
|
||||||
|
{
|
||||||
|
await ProspectSortDialog.ShowAsync(ModalService, CurrentSort, async option =>
|
||||||
|
{
|
||||||
|
await UpdateSortAsync(option);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool HasCustomSort => CurrentSort != ProspectSortOption.NameAscending;
|
||||||
|
|
||||||
|
private string CurrentSortText => CurrentSort switch
|
||||||
|
{
|
||||||
|
ProspectSortOption.NameDescending => "Sortierung: Name (absteigend)",
|
||||||
|
ProspectSortOption.ModifiedAscending => "Sortierung: Zuletzt geändert (aufsteigend)",
|
||||||
|
ProspectSortOption.ModifiedDescending => "Sortierung: Zuletzt geaendert (absteigend)",
|
||||||
|
_ => string.Empty
|
||||||
|
};
|
||||||
|
|
||||||
|
private async Task ResetSortAsync()
|
||||||
|
{
|
||||||
|
await UpdateSortAsync(ProspectSortOption.NameAscending);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task UpdateSortAsync(ProspectSortOption option)
|
||||||
|
{
|
||||||
|
CurrentSort = option;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(StorageKey))
|
||||||
|
{
|
||||||
|
await LocalStorageService.SetItem(StorageKey, CurrentSort);
|
||||||
|
}
|
||||||
|
|
||||||
|
await CurrentSortChanged.InvokeAsync(CurrentSort);
|
||||||
|
await OnSortChanged.InvokeAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
@inherits FsBase
|
||||||
|
@using FoodsharingSiegen.Contracts.Enums
|
||||||
|
|
||||||
|
<div class="d-grid gap-2">
|
||||||
|
<Button Color="@GetSortButtonColor(ProspectSortOption.NameAscending)" Clicked="() => SelectAsync(ProspectSortOption.NameAscending)">Name (aufsteigend)</Button>
|
||||||
|
<Button Color="@GetSortButtonColor(ProspectSortOption.NameDescending)" Clicked="() => SelectAsync(ProspectSortOption.NameDescending)">Name (absteigend)</Button>
|
||||||
|
<Button Color="@GetSortButtonColor(ProspectSortOption.ModifiedAscending)" Clicked="() => SelectAsync(ProspectSortOption.ModifiedAscending)">Geändert (aufsteigend)</Button>
|
||||||
|
<Button Color="@GetSortButtonColor(ProspectSortOption.ModifiedDescending)" Clicked="() => SelectAsync(ProspectSortOption.ModifiedDescending)">Geändert (absteigend)</Button>
|
||||||
|
</div>
|
||||||
39
FoodsharingSiegen.Server/Dialogs/ProspectSortDialog.razor.cs
Normal file
39
FoodsharingSiegen.Server/Dialogs/ProspectSortDialog.razor.cs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
using Blazorise;
|
||||||
|
using FoodsharingSiegen.Contracts.Enums;
|
||||||
|
using FoodsharingSiegen.Server.BaseClasses;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace FoodsharingSiegen.Server.Dialogs
|
||||||
|
{
|
||||||
|
public partial class ProspectSortDialog : FsBase
|
||||||
|
{
|
||||||
|
[Parameter]
|
||||||
|
public ProspectSortOption CurrentSort { get; set; } = ProspectSortOption.NameAscending;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public Func<ProspectSortOption, Task>? OnSortSelected { get; set; }
|
||||||
|
|
||||||
|
public static async Task ShowAsync(IModalService modalService, ProspectSortOption currentSort, Func<ProspectSortOption, Task> onSortSelected)
|
||||||
|
{
|
||||||
|
await modalService.Show<ProspectSortDialog>("Sortieren", p =>
|
||||||
|
{
|
||||||
|
p.Add(nameof(CurrentSort), currentSort);
|
||||||
|
p.Add(nameof(OnSortSelected), onSortSelected);
|
||||||
|
}, new ModalInstanceOptions
|
||||||
|
{
|
||||||
|
Size = ModalSize.Small,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color GetSortButtonColor(ProspectSortOption option)
|
||||||
|
{
|
||||||
|
return CurrentSort == option ? Color.Success : Color.Secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task SelectAsync(ProspectSortOption option)
|
||||||
|
{
|
||||||
|
if (OnSortSelected != null) await OnSortSelected(option);
|
||||||
|
await ModalService.Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
@page "/prospect"
|
@page "/prospect"
|
||||||
@page "/prospects"
|
@page "/prospects"
|
||||||
|
|
||||||
|
@using FoodsharingSiegen.Contracts
|
||||||
@using FoodsharingSiegen.Contracts.Enums
|
@using FoodsharingSiegen.Contracts.Enums
|
||||||
@using FoodsharingSiegen.Shared.Helper
|
@using FoodsharingSiegen.Shared.Helper
|
||||||
@inherits FsBase
|
@inherits FsBase
|
||||||
@@ -16,20 +17,27 @@
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
Color="Color.Primary"
|
Color="Color.Primary"
|
||||||
|
Width="Width.Px(50)"
|
||||||
|
Height="Height.Px(50)"
|
||||||
|
title="Hinzufügen"
|
||||||
|
style="min-width: auto;"
|
||||||
Clicked="@CreateProspectAsync"
|
Clicked="@CreateProspectAsync"
|
||||||
Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
|
Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
|
||||||
>Hinzufügen
|
><i class="fa-solid fa-plus"></i>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<ProspectSortControl @bind-CurrentSort="CurrentSort" StorageKey="@StorageKeys.SortProspects" OnSortChanged="StateHasChanged" />
|
||||||
|
|
||||||
@{
|
@{
|
||||||
var filterList = ProspectList.ApplyFilter(Filter);
|
var filterList = ProspectList.ApplyFilter(Filter);
|
||||||
|
var sortList = filterList.ApplySort(CurrentSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<ProspectFilterControl Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.OnBoarding"></ProspectFilterControl>
|
<ProspectFilterControl Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.OnBoarding"></ProspectFilterControl>
|
||||||
<hr />
|
<hr />
|
||||||
<ProspectGrid
|
<ProspectGrid
|
||||||
Prospects="filterList"
|
Prospects="sortList"
|
||||||
OnDataChanged="@LoadProspects"
|
OnDataChanged="@LoadProspects"
|
||||||
StateFilter="ProspectStateFilter.OnBoarding">
|
StateFilter="ProspectStateFilter.OnBoarding">
|
||||||
</ProspectGrid>
|
</ProspectGrid>
|
||||||
@@ -36,6 +36,8 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private List<Prospect>? ProspectList { get; set; }
|
private List<Prospect>? ProspectList { get; set; }
|
||||||
|
|
||||||
|
private ProspectSortOption CurrentSort { get; set; } = ProspectSortOption.NameAscending;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Override InitializeDataAsync
|
#region Override InitializeDataAsync
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
@page "/all"
|
@page "/all"
|
||||||
@page "/archive"
|
@page "/archive"
|
||||||
|
|
||||||
|
@using FoodsharingSiegen.Contracts
|
||||||
@using FoodsharingSiegen.Contracts.Enums
|
@using FoodsharingSiegen.Contracts.Enums
|
||||||
@using FoodsharingSiegen.Shared.Helper
|
@using FoodsharingSiegen.Shared.Helper
|
||||||
@inherits FsBase
|
@inherits FsBase
|
||||||
@@ -13,15 +14,18 @@
|
|||||||
<div class="alert alert-danger"><strong>TESTMODUS!</strong> Änderungen werden wieder gelöscht.</div>
|
<div class="alert alert-danger"><strong>TESTMODUS!</strong> Änderungen werden wieder gelöscht.</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<ProspectSortControl @bind-CurrentSort="CurrentSort" StorageKey="@StorageKeys.SortProspectsAll" OnSortChanged="StateHasChanged" />
|
||||||
|
|
||||||
@{
|
@{
|
||||||
var filterList = ProspectList.ApplyFilter(Filter);
|
var filterList = ProspectList.ApplyFilter(Filter);
|
||||||
|
var sortList = filterList.ApplySort(CurrentSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<ProspectFilterControl Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.All"></ProspectFilterControl>
|
<ProspectFilterControl Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.All"></ProspectFilterControl>
|
||||||
<hr />
|
<hr />
|
||||||
<ProspectGrid
|
<ProspectGrid
|
||||||
Prospects="filterList"
|
Prospects="sortList"
|
||||||
OnDataChanged="@LoadProspects"
|
OnDataChanged="@LoadProspects"
|
||||||
StateFilter="ProspectStateFilter.All">
|
StateFilter="ProspectStateFilter.All">
|
||||||
</ProspectGrid>
|
</ProspectGrid>
|
||||||
@@ -39,6 +39,8 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private List<Prospect>? ProspectList { get; set; }
|
private List<Prospect>? ProspectList { get; set; }
|
||||||
|
|
||||||
|
private ProspectSortOption CurrentSort { get; set; } = ProspectSortOption.NameAscending;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Override InitializeDataAsync
|
#region Override InitializeDataAsync
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@page "/done"
|
@page "/done"
|
||||||
|
|
||||||
|
@using FoodsharingSiegen.Contracts
|
||||||
@using FoodsharingSiegen.Contracts.Enums
|
@using FoodsharingSiegen.Contracts.Enums
|
||||||
@using FoodsharingSiegen.Shared.Helper
|
@using FoodsharingSiegen.Shared.Helper
|
||||||
@inherits FsBase
|
@inherits FsBase
|
||||||
@@ -12,15 +13,18 @@
|
|||||||
<div class="alert alert-danger"><strong>TESTMODUS!</strong> Änderungen werden wieder gelöscht.</div>
|
<div class="alert alert-danger"><strong>TESTMODUS!</strong> Änderungen werden wieder gelöscht.</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<ProspectSortControl @bind-CurrentSort="CurrentSort" StorageKey="@StorageKeys.SortProspectsDone" OnSortChanged="StateHasChanged" />
|
||||||
|
|
||||||
@{
|
@{
|
||||||
var filterList = ProspectList.ApplyFilter(Filter);
|
var filterList = ProspectList.ApplyFilter(Filter);
|
||||||
|
var sortList = filterList.ApplySort(CurrentSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
<ProspectFilterControl Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.Completed"></ProspectFilterControl>
|
<ProspectFilterControl Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.Completed"></ProspectFilterControl>
|
||||||
<hr />
|
<hr />
|
||||||
<ProspectGrid
|
<ProspectGrid
|
||||||
Prospects="filterList"
|
Prospects="sortList"
|
||||||
OnDataChanged="@LoadProspects"
|
OnDataChanged="@LoadProspects"
|
||||||
StateFilter="ProspectStateFilter.Completed">
|
StateFilter="ProspectStateFilter.Completed">
|
||||||
</ProspectGrid>
|
</ProspectGrid>
|
||||||
@@ -31,6 +31,8 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private List<Prospect>? ProspectList { get; set; }
|
private List<Prospect>? ProspectList { get; set; }
|
||||||
|
|
||||||
|
private ProspectSortOption CurrentSort { get; set; } = ProspectSortOption.NameAscending;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Override InitializeDataAsync
|
#region Override InitializeDataAsync
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@page "/verify"
|
@page "/verify"
|
||||||
|
|
||||||
|
@using FoodsharingSiegen.Contracts
|
||||||
@using FoodsharingSiegen.Contracts.Enums
|
@using FoodsharingSiegen.Contracts.Enums
|
||||||
@using FoodsharingSiegen.Shared.Helper
|
@using FoodsharingSiegen.Shared.Helper
|
||||||
@inherits FsBase
|
@inherits FsBase
|
||||||
@@ -12,15 +13,18 @@
|
|||||||
<div class="alert alert-danger"><strong>TESTMODUS!</strong> Änderungen werden wieder gelöscht.</div>
|
<div class="alert alert-danger"><strong>TESTMODUS!</strong> Änderungen werden wieder gelöscht.</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<ProspectSortControl @bind-CurrentSort="CurrentSort" StorageKey="@StorageKeys.SortProspectsVerify" OnSortChanged="StateHasChanged" />
|
||||||
|
|
||||||
@{
|
@{
|
||||||
var filterList = ProspectList.ApplyFilter(Filter);
|
var filterList = ProspectList.ApplyFilter(Filter);
|
||||||
|
var sortList = filterList.ApplySort(CurrentSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<ProspectFilterControl Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.Verification"></ProspectFilterControl>
|
<ProspectFilterControl Filter="Filter" FilterChanged="FilterChangedAsync" StateFilter="ProspectStateFilter.Verification"></ProspectFilterControl>
|
||||||
<hr />
|
<hr />
|
||||||
<ProspectGrid
|
<ProspectGrid
|
||||||
Prospects="filterList"
|
Prospects="sortList"
|
||||||
OnDataChanged="@LoadProspects"
|
OnDataChanged="@LoadProspects"
|
||||||
StateFilter="ProspectStateFilter.Verification">
|
StateFilter="ProspectStateFilter.Verification">
|
||||||
</ProspectGrid>
|
</ProspectGrid>
|
||||||
@@ -37,6 +37,8 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private List<Prospect>? ProspectList { get; set; }
|
private List<Prospect>? ProspectList { get; set; }
|
||||||
|
|
||||||
|
private ProspectSortOption CurrentSort { get; set; } = ProspectSortOption.NameAscending;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Override InitializeDataAsync
|
#region Override InitializeDataAsync
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "http://localhost:56000/",
|
||||||
"applicationUrl": "http://localhost:56000",
|
"applicationUrl": "http://localhost:56000",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
20260410
|
|
||||||
@@ -56,6 +56,20 @@ namespace FoodsharingSiegen.Shared.Helper
|
|||||||
return filterListQ.ToList();
|
return filterListQ.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Prospect> ApplySort(this List<Prospect>? prospectList, ProspectSortOption sortOption)
|
||||||
|
{
|
||||||
|
if (prospectList == null) return [];
|
||||||
|
|
||||||
|
return sortOption switch
|
||||||
|
{
|
||||||
|
ProspectSortOption.NameAscending => prospectList.OrderBy(x => x.Name, StringComparer.OrdinalIgnoreCase).ToList(),
|
||||||
|
ProspectSortOption.NameDescending => prospectList.OrderByDescending(x => x.Name, StringComparer.OrdinalIgnoreCase).ToList(),
|
||||||
|
ProspectSortOption.ModifiedAscending => prospectList.OrderBy(x => x.Modified ?? x.Created).ToList(),
|
||||||
|
ProspectSortOption.ModifiedDescending => prospectList.OrderByDescending(x => x.Modified ?? x.Created).ToList(),
|
||||||
|
_ => prospectList
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user