From 21087d6c25633e2ff7014b6c555e6444ebeb8eaa Mon Sep 17 00:00:00 2001 From: RaidMax Date: Wed, 31 Mar 2021 11:20:32 -0500 Subject: [PATCH] remove whitespace on alias display and client name search --- SharedLibraryCore/Services/ClientService.cs | 9 +++++---- WebfrontCore/Views/Client/Profile/Index.cshtml | 16 ++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/SharedLibraryCore/Services/ClientService.cs b/SharedLibraryCore/Services/ClientService.cs index 3544aa4e4..f642fbcba 100644 --- a/SharedLibraryCore/Services/ClientService.cs +++ b/SharedLibraryCore/Services/ClientService.cs @@ -547,7 +547,8 @@ namespace SharedLibraryCore.Services public async Task> FindClientsByIdentifier(string identifier) { - if (identifier?.Length < 3) + var trimmedIdentifier = identifier?.Trim(); + if (trimmedIdentifier?.Length < 3) { return new List(); } @@ -556,11 +557,11 @@ namespace SharedLibraryCore.Services long? networkId = null; try { - networkId = identifier.ConvertGuidToLong(System.Globalization.NumberStyles.HexNumber); + networkId = trimmedIdentifier.ConvertGuidToLong(System.Globalization.NumberStyles.HexNumber); } catch { } - int? ipAddress = identifier.ConvertToIP(); + int? ipAddress = trimmedIdentifier.ConvertToIP(); IQueryable iqLinkIds = context.Aliases.Where(_alias => _alias.Active); @@ -573,7 +574,7 @@ namespace SharedLibraryCore.Services // want to find them by name (wildcard) else { - iqLinkIds = iqLinkIds.Where(_alias => EF.Functions.Like((_alias.SearchableName ?? _alias.Name.ToLower()), $"%{identifier.ToLower()}%")); + iqLinkIds = iqLinkIds.Where(_alias => EF.Functions.Like((_alias.SearchableName ?? _alias.Name.ToLower()), $"%{trimmedIdentifier.ToLower()}%")); } var linkIds = await iqLinkIds diff --git a/WebfrontCore/Views/Client/Profile/Index.cshtml b/WebfrontCore/Views/Client/Profile/Index.cshtml index d29cf144e..526c47579 100644 --- a/WebfrontCore/Views/Client/Profile/Index.cshtml +++ b/WebfrontCore/Views/Client/Profile/Index.cshtml @@ -38,18 +38,22 @@
@foreach (var linked in Model.LinkedAccounts) { - @Html.ActionLink(linked.Value.ToString("X"), "ProfileAsync", "Client", new {id = linked.Key}, new {@class = "link-inverse"})
+
+ @Html.ActionLink(linked.Value.ToString("X"), "ProfileAsync", "Client", new {id = linked.Key}, new {@class = "link-inverse"}) +
} @foreach (var alias in Model.Aliases) { - -
+
+ +
} - @foreach (string ip in Model.IPs) + @foreach (var ip in Model.IPs) { - @ip -
+
+ @ip +
}
}