From 6d19b20d181b6c55ab54342082d732a81f31783d Mon Sep 17 00:00:00 2001 From: enisn Date: Mon, 12 Apr 2021 17:18:28 +0300 Subject: [PATCH 1/3] CmsKit - Remove EntityId from Filtering Comments --- .../CmsKit/Admin/Comments/CommentGetListInput.cs | 2 -- .../Admin/Comments/CommentAdminAppService.cs | 2 -- .../Pages/CmsKit/Comments/Index.cshtml | 5 +---- .../Pages/CmsKit/Comments/Index.cshtml.cs | 2 -- .../Volo/CmsKit/Comments/ICommentRepository.cs | 2 -- .../CmsKit/Comments/EfCoreCommentRepository.cs | 6 ------ .../MongoDB/Comments/MongoCommentRepository.cs | 16 +++++----------- 7 files changed, 6 insertions(+), 29 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs index cc79741213..f4ffe68d42 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentGetListInput.cs @@ -8,8 +8,6 @@ namespace Volo.CmsKit.Admin.Comments { public string EntityType { get; set; } - public string EntityId { get; set; } - public string Text { get; set; } public Guid? RepliedCommentId { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs index df381fbc2b..a9469bcca8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Comments/CommentAdminAppService.cs @@ -27,7 +27,6 @@ namespace Volo.CmsKit.Admin.Comments var totalCount = await CommentRepository.GetCountAsync( input.Text, input.EntityType, - input.EntityId, input.RepliedCommentId, input.Author, input.CreationStartDate, @@ -36,7 +35,6 @@ namespace Volo.CmsKit.Admin.Comments var comments = await CommentRepository.GetListAsync( input.Text, input.EntityType, - input.EntityId, input.RepliedCommentId, input.Author, input.CreationStartDate, diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml index 44fd02e9d8..41a4abd911 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml @@ -46,13 +46,10 @@ - + - - - diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml.cs index 4e8a03593b..c6f51131ed 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Index.cshtml.cs @@ -6,8 +6,6 @@ namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Comments { public string EntityType { get; set; } - public string EntityId { get; set; } - public string Author { get; set; } public DateTime? CreationStartDate { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs index 234b866183..90d9623ce6 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/ICommentRepository.cs @@ -14,7 +14,6 @@ namespace Volo.CmsKit.Comments Task> GetListAsync( string filter = null, string entityType = null, - string entityId = null, Guid? repliedCommentId = null, string authorUsername = null, DateTime? creationStartDate = null, @@ -28,7 +27,6 @@ namespace Volo.CmsKit.Comments Task GetCountAsync( string text = null, string entityType = null, - string entityId = null, Guid? repliedCommentId = null, string authorUsername = null, DateTime? creationStartDate = null, diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs index 3b718f774e..8e0a1b1632 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Comments/EfCoreCommentRepository.cs @@ -47,7 +47,6 @@ namespace Volo.CmsKit.Comments public async Task> GetListAsync( string filter = null, string entityType = null, - string entityId = null, Guid? repliedCommentId = null, string authorUsername = null, DateTime? creationStartDate = null, @@ -62,7 +61,6 @@ namespace Volo.CmsKit.Comments var query = await GetListQueryAsync( filter, entityType, - entityId, repliedCommentId, authorUsername, creationStartDate, @@ -83,7 +81,6 @@ namespace Volo.CmsKit.Comments public async Task GetCountAsync( string text = null, string entityType = null, - string entityId = null, Guid? repliedCommentId = null, string authorUsername = null, DateTime? creationStartDate = null, @@ -95,7 +92,6 @@ namespace Volo.CmsKit.Comments var query = await GetListQueryAsync( text, entityType, - entityId, repliedCommentId, authorUsername, creationStartDate, @@ -148,7 +144,6 @@ namespace Volo.CmsKit.Comments protected virtual async Task> GetListQueryAsync( string filter = null, string entityType = null, - string entityId = null, Guid? repliedCommentId = null, string authorUsername = null, DateTime? creationStartDate = null, @@ -170,7 +165,6 @@ namespace Volo.CmsKit.Comments return query.WhereIf(!filter.IsNullOrWhiteSpace(), c => c.Comment.Text.Contains(filter)) .WhereIf(!entityType.IsNullOrWhiteSpace(), c => c.Comment.EntityType.Contains(entityType)) - .WhereIf(!entityId.IsNullOrWhiteSpace(), c => c.Comment.EntityId.Contains(entityId)) .WhereIf(repliedCommentId.HasValue, c => c.Comment.RepliedCommentId == repliedCommentId) .WhereIf(!authorUsername.IsNullOrWhiteSpace(),c=>c.Author.UserName.Contains(authorUsername)) .WhereIf(creationStartDate.HasValue, c => c.Comment.CreationTime >= creationStartDate) diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs index 1fc4feab43..1e909f820f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Comments/MongoCommentRepository.cs @@ -44,8 +44,7 @@ namespace Volo.CmsKit.MongoDB.Comments public async Task> GetListAsync( string filter = null, - string entityType = null, - string entityId = null, + string entityType = null, Guid? repliedCommentId = null, string authorUsername = null, DateTime? creationStartDate = null, @@ -59,8 +58,7 @@ namespace Volo.CmsKit.MongoDB.Comments var token = GetCancellationToken(cancellationToken); var query = await GetListQueryAsync( filter, - entityType, - entityId, + entityType, repliedCommentId, authorUsername, creationStartDate, @@ -94,8 +92,7 @@ namespace Volo.CmsKit.MongoDB.Comments public async Task GetCountAsync( string text = null, - string entityType = null, - string entityId = null, + string entityType = null, Guid? repliedCommentId = null, string authorUsername = null, DateTime? creationStartDate = null, @@ -105,8 +102,7 @@ namespace Volo.CmsKit.MongoDB.Comments { var query = await GetListQueryAsync( text, - entityType, - entityId, + entityType, repliedCommentId, authorUsername, creationStartDate, @@ -172,8 +168,7 @@ namespace Volo.CmsKit.MongoDB.Comments protected virtual async Task> GetListQueryAsync( string filter = null, - string entityType = null, - string entityId = null, + string entityType = null, Guid? repliedCommentId = null, string authorUsername = null, DateTime? creationStartDate = null, @@ -196,7 +191,6 @@ namespace Volo.CmsKit.MongoDB.Comments return queryable.WhereIf(!filter.IsNullOrWhiteSpace(), c => c.Text.Contains(filter)) .WhereIf(!entityType.IsNullOrWhiteSpace(), c => c.EntityType == entityType) - .WhereIf(!entityId.IsNullOrWhiteSpace(), c => c.EntityId == entityId) .WhereIf(repliedCommentId.HasValue, c => c.RepliedCommentId == repliedCommentId) .WhereIf(creationStartDate.HasValue, c => c.CreationTime >= creationStartDate) .WhereIf(creationEndDate.HasValue, c => c.CreationTime <= creationEndDate); From 997c41fbf92a02aac29ac74634081f4c7926daf1 Mon Sep 17 00:00:00 2001 From: enisn Date: Mon, 12 Apr 2021 17:34:18 +0300 Subject: [PATCH 2/3] CmsKit - Remove Details from PageLayout --- .../Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml index ae2e11713c..6dc3c94568 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml @@ -13,7 +13,6 @@ @model DetailsModel @{ - PageLayout.Content.Title = L["Details"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:CMS"].Value); PageLayout.Content.BreadCrumb.Add(L["Comments"].Value); PageLayout.Content.MenuItemName = CmsKitAdminMenus.Comments.CommentsMenu; From ab5ead0127bbee83d1a2108b7c9f8c7f3fc05f98 Mon Sep 17 00:00:00 2001 From: enisn Date: Mon, 12 Apr 2021 17:35:15 +0300 Subject: [PATCH 3/3] CmsKit - Fix bradcrumbs for Comment details --- .../Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml index 6dc3c94568..a275f8a104 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/Details.cshtml @@ -13,8 +13,8 @@ @model DetailsModel @{ + PageLayout.Content.Title = L["Comments"].Value; PageLayout.Content.BreadCrumb.Add(L["Menu:CMS"].Value); - PageLayout.Content.BreadCrumb.Add(L["Comments"].Value); PageLayout.Content.MenuItemName = CmsKitAdminMenus.Comments.CommentsMenu; }