From 3f4f1a8278c0dd28bf459a49cee41159d1d29eec Mon Sep 17 00:00:00 2001 From: sbwalker Date: Tue, 9 Sep 2025 08:52:20 -0400 Subject: [PATCH] profile improvements --- .../Modules/Admin/Profiles/Edit.razor | 2 +- .../Modules/Admin/UserProfile/Index.razor | 28 +++++++++++++++---- Oqtane.Client/Modules/Admin/Users/Add.razor | 18 ++++++++++-- Oqtane.Client/Modules/Admin/Users/Edit.razor | 18 ++++++++++-- .../Modules/Admin/Profiles/Edit.resx | 2 +- 5 files changed, 54 insertions(+), 14 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/Profiles/Edit.razor b/Oqtane.Client/Modules/Admin/Profiles/Edit.razor index 6c820ac2..e2e16b55 100644 --- a/Oqtane.Client/Modules/Admin/Profiles/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Profiles/Edit.razor @@ -56,7 +56,7 @@
- +
diff --git a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor index 95ecbd52..cb9dd0c4 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/Index.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/Index.razor @@ -124,15 +124,19 @@ @if (!string.IsNullOrEmpty(p.Autocomplete)) { @@ -140,15 +144,19 @@ else { @@ -404,6 +412,14 @@ _togglepassword = SharedLocalizer["ShowPassword"]; _allowtwofactor = (SettingService.GetSetting(PageState.Site.Settings, "LoginOptions:TwoFactor", "false") == "true"); _profiles = await ProfileService.GetProfilesAsync(ModuleState.SiteId); + foreach (var profile in _profiles) + { + if (profile.Options.ToLower().StartsWith("entityname:")) + { + var options = await SettingService.GetSettingsAsync(profile.Options.Substring(11), -1); + profile.Options = string.Join(",", options.Select(kvp => $"{kvp.Key}:{kvp.Value}")); + } + } _timezones = TimeZoneService.GetTimeZones(); if (PageState.User != null) diff --git a/Oqtane.Client/Modules/Admin/Users/Add.razor b/Oqtane.Client/Modules/Admin/Users/Add.razor index e5581222..99f5694c 100644 --- a/Oqtane.Client/Modules/Admin/Users/Add.razor +++ b/Oqtane.Client/Modules/Admin/Users/Add.razor @@ -86,15 +86,19 @@ @if (!string.IsNullOrEmpty(p.Options)) { @@ -145,6 +149,14 @@ { _timezones = TimeZoneService.GetTimeZones(); _profiles = await ProfileService.GetProfilesAsync(ModuleState.SiteId); + foreach (var profile in _profiles) + { + if (profile.Options.ToLower().StartsWith("entityname:")) + { + var options = await SettingService.GetSettingsAsync(profile.Options.Substring(11), -1); + profile.Options = string.Join(",", options.Select(kvp => $"{kvp.Key}:{kvp.Value}")); + } + } _settings = new Dictionary(); _timezoneid = PageState.Site.TimeZoneId; _initialized = true; diff --git a/Oqtane.Client/Modules/Admin/Users/Edit.razor b/Oqtane.Client/Modules/Admin/Users/Edit.razor index 35e43bb9..9bf7ea28 100644 --- a/Oqtane.Client/Modules/Admin/Users/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Users/Edit.razor @@ -119,15 +119,19 @@ @if (!string.IsNullOrEmpty(p.Options)) { @@ -204,6 +208,14 @@ _passwordrequirements = await UserService.GetPasswordRequirementsAsync(PageState.Site.SiteId); _togglepassword = SharedLocalizer["ShowPassword"]; _profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId); + foreach (var profile in _profiles) + { + if (profile.Options.ToLower().StartsWith("entityname:")) + { + var options = await SettingService.GetSettingsAsync(profile.Options.Substring(11), -1); + profile.Options = string.Join(",", options.Select(kvp => $"{kvp.Key}:{kvp.Value}")); + } + } _timezones = TimeZoneService.GetTimeZones(); if (PageState.QueryString.ContainsKey("id") && int.TryParse(PageState.QueryString["id"], out int UserId)) diff --git a/Oqtane.Client/Resources/Modules/Admin/Profiles/Edit.resx b/Oqtane.Client/Resources/Modules/Admin/Profiles/Edit.resx index 79a2f0f4..d67a4f7a 100644 --- a/Oqtane.Client/Resources/Modules/Admin/Profiles/Edit.resx +++ b/Oqtane.Client/Resources/Modules/Admin/Profiles/Edit.resx @@ -157,7 +157,7 @@ The default value for this profile item - A comma delimited list of options the user can select from + A comma delimited list of options. Options can contain a key and value if they are seperated by a colon (ie. key:value). You can also dynamically load your options from custom Settings (ie. 'EntityName:Countries'). Should a user be required to provide a value for this profile item?