From 806daaf7c94e29d2410e3511cc3f889ac02e9ac7 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Fri, 13 May 2022 17:00:10 -0400 Subject: [PATCH] remove columns from main user management view and migrate them to edit view --- Oqtane.Client/Modules/Admin/Users/Edit.razor | 114 ++++++++++-------- Oqtane.Client/Modules/Admin/Users/Index.razor | 19 ++- .../Resources/Modules/Admin/Users/Edit.resx | 12 ++ .../Resources/Modules/Admin/Users/Index.resx | 6 - 4 files changed, 85 insertions(+), 66 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/Users/Edit.razor b/Oqtane.Client/Modules/Admin/Users/Edit.razor index fa05cc6e..cb8339c0 100644 --- a/Oqtane.Client/Modules/Admin/Users/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Users/Edit.razor @@ -72,8 +72,19 @@ else +
+ +
+ +
+
+
+ +
+ +
+
- } @@ -137,63 +148,70 @@ else @code { - private int userid; - private string username = string.Empty; - private string _password = string.Empty; + private int userid; + private string username = string.Empty; + private string _password = string.Empty; private string _passwordtype = "password"; private string _togglepassword = string.Empty; - private string confirm = string.Empty; - private string email = string.Empty; - private string displayname = string.Empty; - private FileManager filemanager; - private int photofileid = -1; - private File photo = null; - private List profiles; - private Dictionary settings; - private string category = string.Empty; - private string createdby; - private DateTime createdon; - private string modifiedby; - private DateTime modifiedon; - private string deletedby; - private DateTime? deletedon; - private string isdeleted; + private string confirm = string.Empty; + private string email = string.Empty; + private string displayname = string.Empty; + private FileManager filemanager; + private int photofileid = -1; + private File photo = null; + private string isdeleted; + private string lastlogin; + private string lastipaddress; - public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin; + private List profiles; + private Dictionary settings; + private string category = string.Empty; - protected override async Task OnParametersSetAsync() - { - try - { - if (PageState.QueryString.ContainsKey("id")) - { - _togglepassword = SharedLocalizer["ShowPassword"]; - profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId); - userid = Int32.Parse(PageState.QueryString["id"]); - var user = await UserService.GetUserAsync(userid, PageState.Site.SiteId); - if (user != null) - { - username = user.Username; - email = user.Email; - displayname = user.DisplayName; - if (user.PhotoFileId != null) - { - photofileid = user.PhotoFileId.Value; - photo = await FileService.GetFileAsync(photofileid); - } - else - { - photofileid = -1; - photo = null; - } - settings = await SettingService.GetUserSettingsAsync(user.UserId); + private string createdby; + private DateTime createdon; + private string modifiedby; + private DateTime modifiedon; + private string deletedby; + private DateTime? deletedon; + + public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin; + + protected override async Task OnParametersSetAsync() + { + try + { + if (PageState.QueryString.ContainsKey("id")) + { + _togglepassword = SharedLocalizer["ShowPassword"]; + profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId); + userid = Int32.Parse(PageState.QueryString["id"]); + var user = await UserService.GetUserAsync(userid, PageState.Site.SiteId); + if (user != null) + { + username = user.Username; + email = user.Email; + displayname = user.DisplayName; + if (user.PhotoFileId != null) + { + photofileid = user.PhotoFileId.Value; + photo = await FileService.GetFileAsync(photofileid); + } + else + { + photofileid = -1; + photo = null; + } + isdeleted = user.IsDeleted.ToString(); + lastlogin = string.Format("{0:MMM dd yyyy HH:mm:ss}", user.LastLoginOn); + lastipaddress = user.LastIPAddress; + + settings = await SettingService.GetUserSettingsAsync(user.UserId); createdby = user.CreatedBy; createdon = user.CreatedOn; modifiedby = user.ModifiedBy; modifiedon = user.ModifiedOn; deletedby = user.DeletedBy; deletedon = user.DeletedOn; - isdeleted = user.IsDeleted.ToString(); } } } diff --git a/Oqtane.Client/Modules/Admin/Users/Index.razor b/Oqtane.Client/Modules/Admin/Users/Index.razor index 79b5d028..63147056 100644 --- a/Oqtane.Client/Modules/Admin/Users/Index.razor +++ b/Oqtane.Client/Modules/Admin/Users/Index.razor @@ -33,14 +33,12 @@ else
-   -   -   - @SharedLocalizer["Username"] - @SharedLocalizer["Email"] - @Localizer["LastLoginOn"] - @Localizer["LastIPAddress"] - @Localizer["CreatedOn"] +   +   +   + @SharedLocalizer["Username"] + @SharedLocalizer["Name"] + @Localizer["LastLoginOn"]
@@ -54,10 +52,7 @@ else @context.User.Username @((MarkupString)string.Format("{1}", @context.User.Email, @context.User.DisplayName)) - @string.Format("{0:dd-MMM-yyyy HH:mm}",context.User.LastLoginOn) - @context.User.LastIPAddress - @string.Format("{0:dd-MMM-yyyy HH:mm}",context.User.CreatedOn) - + @string.Format("{0:dd-MMM-yyyy HH:mm:ss}", context.User.LastLoginOn)
diff --git a/Oqtane.Client/Resources/Modules/Admin/Users/Edit.resx b/Oqtane.Client/Resources/Modules/Admin/Users/Edit.resx index 831ba0ad..41446826 100644 --- a/Oqtane.Client/Resources/Modules/Admin/Users/Edit.resx +++ b/Oqtane.Client/Resources/Modules/Admin/Users/Edit.resx @@ -186,4 +186,16 @@ Password + + The IP Address of the user recorded during their last login + + + Last IP Address: + + + The date and time when the user last signed in + + + Last Login: + \ No newline at end of file diff --git a/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx b/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx index 7d8463de..2568b5a9 100644 --- a/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx +++ b/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx @@ -369,12 +369,6 @@ Required - - Created On - - - Last IP Address - Last Login