From 6fafeedeb92b076a585902e714fd5ed1e233d80b Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 24 Aug 2023 08:50:33 -0400 Subject: [PATCH] reverse InputList Dictionary usage --- .../Modules/Controls/InputList.razor | 22 +++++++++++++------ Oqtane.Client/Resources/IconResources.resx | 3 +++ Oqtane.Server/Controllers/SystemController.cs | 12 +--------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Oqtane.Client/Modules/Controls/InputList.razor b/Oqtane.Client/Modules/Controls/InputList.razor index c8a14924..25de9fda 100644 --- a/Oqtane.Client/Modules/Controls/InputList.razor +++ b/Oqtane.Client/Modules/Controls/InputList.razor @@ -1,12 +1,18 @@ @namespace Oqtane.Modules.Controls -@using System.Linq.Expressions; @inherits LocalizableComponent - + @foreach(var kvp in DataList) { - + if (!string.IsNullOrEmpty(kvp.Value)) + { + + } + else + { + + } } @@ -32,11 +38,13 @@ protected void OnChange(ChangeEventArgs e) { - if (string.IsNullOrWhiteSpace(e.Value.ToString())) { return; } - Value = e.Value.ToString(); - if (ValueChanged.HasDelegate) + if (!string.IsNullOrEmpty(e.Value.ToString())) { - ValueChanged.InvokeAsync(Value); + Value = e.Value.ToString(); + if (ValueChanged.HasDelegate) + { + ValueChanged.InvokeAsync(Value); + } } } } \ No newline at end of file diff --git a/Oqtane.Client/Resources/IconResources.resx b/Oqtane.Client/Resources/IconResources.resx index 6dec88ae..34336da9 100644 --- a/Oqtane.Client/Resources/IconResources.resx +++ b/Oqtane.Client/Resources/IconResources.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Account Login + Home diff --git a/Oqtane.Server/Controllers/SystemController.cs b/Oqtane.Server/Controllers/SystemController.cs index 184b650f..051e3d52 100644 --- a/Oqtane.Server/Controllers/SystemController.cs +++ b/Oqtane.Server/Controllers/SystemController.cs @@ -106,17 +106,7 @@ namespace Oqtane.Controllers { if (field.FieldType == typeof(string)) { - // add spacing between words based on capitalization - var name = ""; - for (int index = 0; index < field.Name.Length; index++) - { - name += ((index > 0 && field.Name[index] == Char.ToUpper(field.Name[index])) ? " " : "") + field.Name[index]; - } - - string fieldName = name; - string fieldValue = (string)field.GetValue(null); - - icons.Add(fieldName, fieldValue); + icons.Add((string)field.GetValue(null), field.Name); // ie. ("oi oi-home", "Home") } }