Buildversion and FilterHelper
This commit is contained in:
@@ -106,7 +106,7 @@ namespace FoodsharingSiegen.Server.Auth
|
||||
{
|
||||
Name = "Andre",
|
||||
Mail = "fs@beging.de",
|
||||
GroupsList = new List<UserGroup> { UserGroup.Ambassador },
|
||||
GroupsList = [UserGroup.Ambassador],
|
||||
Type = UserType.Admin,
|
||||
Created = DateTime.UtcNow,
|
||||
EncryptedPassword = "qSIxTZo7J8M="
|
||||
|
||||
@@ -4,8 +4,18 @@
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<BuildDate>$([System.DateTime]::Now.ToString("yyyyMMdd"))</BuildDate>
|
||||
<PublishDir>..\Publish\Server</PublishDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="GenerateBuildInfo" BeforeTargets="Build">
|
||||
<WriteLinesToFile File="$(ProjectDir)wwwroot\buildinfo.txt" Lines="$(BuildDate)" Overwrite="true" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FoodsharingSiegen.Contracts\FoodsharingSiegen.Contracts.csproj" />
|
||||
<ProjectReference Include="..\FoodsharingSiegen.Shared\FoodsharingSiegen.Shared.csproj" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
@page "/prospect"
|
||||
@page "/prospects"
|
||||
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
<PageTitle>Neue Foodsaver - @AppSettings.Title</PageTitle>
|
||||
@@ -15,28 +16,15 @@
|
||||
</Button>
|
||||
|
||||
@{
|
||||
var filterListQ = ProspectList?.AsQueryable();
|
||||
if (!string.IsNullOrWhiteSpace(Filter.Text))
|
||||
{
|
||||
filterListQ = filterListQ?
|
||||
.Where(x =>
|
||||
x.Name.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) ||
|
||||
(!string.IsNullOrWhiteSpace(x.Memo) && x.Memo.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) == true) ||
|
||||
x.FsId.ToString().Contains(Filter.Text, StringComparison.OrdinalIgnoreCase)).AsQueryable();
|
||||
}
|
||||
|
||||
if (Filter.WithoutStepInBriefing)
|
||||
filterListQ = filterListQ?.Where(x => x.Interactions.All(i => i.Type != InteractionType.StepInBriefing));
|
||||
|
||||
var filterList = filterListQ?.ToList();
|
||||
var filterList = ProspectList.ApplyFilter(Filter);
|
||||
}
|
||||
|
||||
<hr/>
|
||||
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
||||
<hr />
|
||||
<h5>@(filterList?.Count ?? 0) Einträge</h5>
|
||||
<h5>@(filterList.Count) Einträge</h5>
|
||||
|
||||
@if (filterList?.Any() == true)
|
||||
@if (filterList.Any())
|
||||
{
|
||||
<div class="row m-0">
|
||||
<Repeater Items="@filterList">
|
||||
|
||||
@@ -80,6 +80,7 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
{
|
||||
CannotHaveInteractions = [InteractionType.Complete, InteractionType.Verify, InteractionType.ReleasedForVerification]
|
||||
};
|
||||
|
||||
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
|
||||
if (prospectsR.Success) ProspectList = prospectsR.Data;
|
||||
|
||||
|
||||
@@ -1,32 +1,20 @@
|
||||
@page "/done"
|
||||
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
<PageTitle>Abgeschlossene Einarbeitungen - @AppSettings.Title</PageTitle>
|
||||
<h2>Abgeschlossene Einarbeitungen</h2>
|
||||
|
||||
@{
|
||||
var filterListQ = ProspectList?.AsQueryable();
|
||||
if (!string.IsNullOrWhiteSpace(Filter.Text))
|
||||
{
|
||||
filterListQ = filterListQ?
|
||||
.Where(x =>
|
||||
x.Name.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) ||
|
||||
(!string.IsNullOrWhiteSpace(x.Memo) && x.Memo.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) == true) ||
|
||||
x.FsId.ToString().Contains(Filter.Text, StringComparison.OrdinalIgnoreCase)).AsQueryable();
|
||||
}
|
||||
|
||||
if (Filter.WithoutStepInBriefing)
|
||||
filterListQ = filterListQ?.Where(x => x.Interactions.All(i => i.Type != InteractionType.StepInBriefing));
|
||||
|
||||
var filterList = filterListQ?.ToList();
|
||||
var filterList = ProspectList.ApplyFilter(Filter);
|
||||
}
|
||||
|
||||
<hr />
|
||||
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
||||
<hr />
|
||||
<h5>@(filterList?.Count ?? 0) Einträge</h5>
|
||||
@if (filterList?.Any() == true)
|
||||
<h5>@(filterList.Count) Einträge</h5>
|
||||
@if (filterList.Any())
|
||||
{
|
||||
|
||||
<div class="row m-0">
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
@page "/todo"
|
||||
|
||||
@inherits FsBase
|
||||
|
||||
<PageTitle>Freischalten - @AppSettings.Title</PageTitle>
|
||||
|
||||
<h2>Freischalten</h2>
|
||||
|
||||
@{
|
||||
var filterListQ = ProspectList?.AsQueryable();
|
||||
if (!string.IsNullOrWhiteSpace(Filter.Text))
|
||||
{
|
||||
filterListQ = filterListQ?
|
||||
.Where(x =>
|
||||
x.Name.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) ||
|
||||
(!string.IsNullOrWhiteSpace(x.Memo) && x.Memo.Contains(Filter.Text, StringComparison.OrdinalIgnoreCase) == true) ||
|
||||
x.FsId.ToString().Contains(Filter.Text, StringComparison.OrdinalIgnoreCase)).AsQueryable();
|
||||
}
|
||||
|
||||
if (Filter.WithoutStepInBriefing)
|
||||
filterListQ = filterListQ?.Where(x => x.Interactions.All(i => i.Type != InteractionType.StepInBriefing));
|
||||
|
||||
var filterList = filterListQ?.ToList();
|
||||
}
|
||||
|
||||
<hr/>
|
||||
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
||||
<hr />
|
||||
<h5>@(filterList?.Count ?? 0) Einträge</h5>
|
||||
@if (filterList?.Any() == true)
|
||||
{
|
||||
<div class="row m-0">
|
||||
<Repeater Items="@filterList">
|
||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" ProspectModal="ProspectModal" RemoveInteraction="RemoveInteraction" StateFilter="ProspectStateFilter.Verification"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
}
|
||||
|
||||
<AddProspectModal @ref="ProspectModal" OnUpdate="OnUpdateProspect"></AddProspectModal>
|
||||
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||
28
FoodsharingSiegen.Server/Pages/ProspectsVerify.razor
Normal file
28
FoodsharingSiegen.Server/Pages/ProspectsVerify.razor
Normal file
@@ -0,0 +1,28 @@
|
||||
@page "/verify"
|
||||
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
<PageTitle>Freischalten - @AppSettings.Title</PageTitle>
|
||||
|
||||
<h2>Freischalten</h2>
|
||||
|
||||
@{
|
||||
var filterList = ProspectList.ApplyFilter(Filter);
|
||||
}
|
||||
|
||||
<hr/>
|
||||
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
||||
<hr />
|
||||
<h5>@(filterList.Count) Einträge</h5>
|
||||
@if (filterList.Any())
|
||||
{
|
||||
<div class="row m-0">
|
||||
<Repeater Items="@filterList">
|
||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" ProspectModal="ProspectModal" RemoveInteraction="RemoveInteraction" StateFilter="ProspectStateFilter.Verification"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
}
|
||||
|
||||
<AddProspectModal @ref="ProspectModal" OnUpdate="OnUpdateProspect"></AddProspectModal>
|
||||
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||
@@ -9,7 +9,7 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
/// <summary>
|
||||
/// The prospects done class (a. beging, 07.02.2023)
|
||||
/// </summary>
|
||||
public partial class ProspectsTodo
|
||||
public partial class ProspectsVerify
|
||||
{
|
||||
#region Dependencies
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<nav class="flex-column">
|
||||
<nav class="d-flex flex-column h-100">
|
||||
<div class="nav-logo"></div>
|
||||
<div class="d-flex px-3 justify-content-center text-center font-weight-bold">
|
||||
Einarbeitungen<br/>
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<div @onclick="NavLinkClickedAsync">
|
||||
<NavLink class="nav-link" href="todo" Match="NavLinkMatch.All">
|
||||
<NavLink class="nav-link" href="verify" Match="NavLinkMatch.All">
|
||||
<span class="fas fa-user-pen mr-2" aria-hidden="true" style="font-size: 1.4em;"></span> Freischalten
|
||||
</NavLink>
|
||||
</div>
|
||||
@@ -31,12 +31,24 @@
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (CurrentUser.IsAdmin())
|
||||
{
|
||||
<hr/>
|
||||
<div class="nav-item px-3">
|
||||
<div @onclick="NavLinkClickedAsync">
|
||||
<NavLink class="nav-link" href="done" Match="NavLinkMatch.All">
|
||||
<span class="fas fa-user-shield mr-2" aria-hidden="true" style="font-size: 1.4em;"></span> Alle (Admin)
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<hr/>
|
||||
|
||||
@if (CurrentUser.IsAdmin())
|
||||
{
|
||||
<div class="nav-item px-3">
|
||||
<div class="nav-item px-3 pb-0">
|
||||
<div @onclick="NavLinkClickedAsync">
|
||||
<NavLink class="nav-link" href="users" Match="NavLinkMatch.All">
|
||||
<span class="fas fa-users mr-2" aria-hidden="true" style="font-size: 1.4em;"></span> Benutzer
|
||||
@@ -45,14 +57,6 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<div @onclick="NavLinkClickedAsync">
|
||||
<NavLink class="nav-link" href="profile" Match="NavLinkMatch.All">
|
||||
<span class="fas fa-user mr-2" aria-hidden="true" style="font-size: 1.4em;"></span> Profil
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<div @onclick="NavLinkClickedAsync">
|
||||
<NavLink class="nav-link" href="audit" Match="NavLinkMatch.All">
|
||||
@@ -61,6 +65,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-grow-1"></div>
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<div @onclick="NavLinkClickedAsync">
|
||||
<NavLink class="nav-link" href="profile" Match="NavLinkMatch.All">
|
||||
<span class="fas fa-user mr-2" aria-hidden="true" style="font-size: 1.4em;"></span> Mein Profil
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nav-item px-3">
|
||||
<div @onclick="NavLinkClickedAsync">
|
||||
<NavLink class="nav-link" href="logout" Match="NavLinkMatch.All">
|
||||
@@ -68,4 +82,6 @@
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pb-1 text-center small">@($"v{Version ?? "0"}")</div>
|
||||
</nav>
|
||||
@@ -12,9 +12,6 @@ namespace FoodsharingSiegen.Server.Shared
|
||||
/// </summary>
|
||||
public partial class NavMenu
|
||||
{
|
||||
[Inject]
|
||||
private IJSRuntime JsRuntime { get; set; } = null!;
|
||||
|
||||
#region Dependencies
|
||||
|
||||
[Inject]
|
||||
@@ -23,6 +20,12 @@ namespace FoodsharingSiegen.Server.Shared
|
||||
[Inject]
|
||||
protected AuthService AuthService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IWebHostEnvironment Env { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
private IJSRuntime JsRuntime { get; set; } = null!;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Properties
|
||||
@@ -32,6 +35,8 @@ namespace FoodsharingSiegen.Server.Shared
|
||||
/// </summary>
|
||||
private User CurrentUser => AuthService.User ?? new User();
|
||||
|
||||
private string? Version { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protected Properties
|
||||
@@ -50,14 +55,22 @@ namespace FoodsharingSiegen.Server.Shared
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await AuthService.Initialize();
|
||||
|
||||
var filePath = Path.Combine(Env.WebRootPath, "buildinfo.txt");
|
||||
if (File.Exists(filePath)) Version = await File.ReadAllTextAsync(filePath);
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method NavLinkClickedAsync
|
||||
|
||||
private async Task NavLinkClickedAsync()
|
||||
{
|
||||
await JsRuntime.InvokeVoidAsync("eval", "document.getElementById('menu-toggler').checked=false;");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user