From 797642f3e68e6e0aecf3d831999037f378dc9807 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Tue, 25 Oct 2022 14:03:35 -0500 Subject: [PATCH] only titleize single word titles on action dialogs --- Application/Misc/InteractionRegistration.cs | 11 ++++++----- WebfrontCore/Views/Action/_ActionForm.cshtml | 2 +- WebfrontCore/Views/Client/Profile/Index.cshtml | 7 +------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Application/Misc/InteractionRegistration.cs b/Application/Misc/InteractionRegistration.cs index 99e173a0b..00692fc18 100644 --- a/Application/Misc/InteractionRegistration.cs +++ b/Application/Misc/InteractionRegistration.cs @@ -130,8 +130,8 @@ public class InteractionRegistration : IInteractionRegistration return null; } - private async Task> GetInteractionsInternal(string prefix = null, int? clientId = null, - Reference.Game? game = null, CancellationToken token = default) + private async Task> GetInteractionsInternal(string prefix = null, + int? clientId = null, Reference.Game? game = null, CancellationToken token = default) { var interactions = _interactions .Where(interaction => string.IsNullOrWhiteSpace(prefix) || interaction.Key.StartsWith(prefix)).Select( @@ -149,9 +149,10 @@ public class InteractionRegistration : IInteractionRegistration clientId); return null; } - }).Where(interaction => interaction is not null) - .ToList(); + }); - return await Task.WhenAll(interactions); + return (await Task.WhenAll(interactions)) + .Where(interaction => interaction is not null) + .ToList(); } } diff --git a/WebfrontCore/Views/Action/_ActionForm.cshtml b/WebfrontCore/Views/Action/_ActionForm.cshtml index 854c81eec..31d173f5e 100644 --- a/WebfrontCore/Views/Action/_ActionForm.cshtml +++ b/WebfrontCore/Views/Action/_ActionForm.cshtml @@ -3,7 +3,7 @@ @{ Layout = null; } - + @if (Model.Inputs.Any(input => input.Type != "hidden")) {
diff --git a/WebfrontCore/Views/Client/Profile/Index.cshtml b/WebfrontCore/Views/Client/Profile/Index.cshtml index 693d453df..983aad3f4 100644 --- a/WebfrontCore/Views/Client/Profile/Index.cshtml +++ b/WebfrontCore/Views/Client/Profile/Index.cshtml @@ -393,13 +393,8 @@ }); } - foreach (var interaction in Model.Interactions?.Where(i => (int?)ViewBag.User?.Level >= ((int?)i?.MinimumPermission ?? 0))) + foreach (var interaction in Model.Interactions.Where(i => (int)ViewBag.User.Level >= ((int?)i.MinimumPermission ?? 0))) { - if (interaction is null) - { - continue; - } - menuItems.Items.Add(new SideContextMenuItem { Title = interaction.Name,