Browse Source

Refactoring #16476

pull/16476/head
Engincan VESKE 3 years ago
parent
commit
9a766facfb
  1. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.js
  2. 3
      modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentConsts.cs
  3. 2
      modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json
  4. 2
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/Comment.cs
  5. 2
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs
  6. 18
      modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs

2
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.js

@ -115,7 +115,7 @@ $(function (){
}
},
{
title: l("CommentUrl"),
title: l("URL"),
data: "url",
render: function (data, type, row) {
if (data !== null) {

3
modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Comments/CommentConsts.cs

@ -10,5 +10,6 @@ public static class CommentConsts
public static int MaxEntityIdLength { get; set; } = CmsEntityConsts.MaxEntityIdLength;
public static int MaxTextLength { get; set; } = 512;
public static int MaxCommentUrlLength { get; set; } = 512;
public static int MaxUrlLength { get; set; } = 512;
}

2
modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json

@ -218,6 +218,6 @@
"CaptchaCodeErrorMessage" : "The answer you entered for the CAPTCHA was not correct. Please try again",
"CaptchaCodeMissingMessage": "The captcha code is missing!",
"UnAllowedExternalUrlMessage": "You included an unallowed external URL. Please try again without the external URL.",
"CommentUrl": "Url"
"URL": "URL"
}
}

2
modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/Comment.cs

@ -37,7 +37,7 @@ public class Comment : AggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator,
[NotNull] string text,
Guid? repliedCommentId,
Guid creatorId,
[CanBeNull] string url,
[CanBeNull] string url = null,
Guid? tenantId = null)
: base(id)
{

2
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs

@ -79,7 +79,7 @@ public static class CmsKitDbContextModelCreatingExtensions
b.Property(x => x.EntityId).IsRequired().HasMaxLength(CommentConsts.MaxEntityIdLength);
b.Property(x => x.Text).IsRequired().HasMaxLength(CommentConsts.MaxTextLength);
b.Property(x => x.RepliedCommentId);
b.Property(x => x.Url).HasMaxLength(CommentConsts.MaxCommentUrlLength);
b.Property(x => x.Url).HasMaxLength(CommentConsts.MaxUrlLength);
b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId });
b.HasIndex(x => new { x.TenantId, x.RepliedCommentId });

18
modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs

@ -193,8 +193,7 @@ public class CmsKitDataSeedContributor : IDataSeedContributor, ITransientDepende
_cmsKitTestData.EntityId1,
"comment",
null,
_cmsKitTestData.User1Id,
""
_cmsKitTestData.User1Id
));
await _commentRepository.InsertAsync(new Comment(_guidGenerator.Create(),
@ -202,8 +201,7 @@ public class CmsKitDataSeedContributor : IDataSeedContributor, ITransientDepende
_cmsKitTestData.EntityId1,
"reply",
comment1.Id,
_cmsKitTestData.User2Id,
""
_cmsKitTestData.User2Id
));
await _commentRepository.InsertAsync(new Comment(_guidGenerator.Create(),
@ -211,8 +209,7 @@ public class CmsKitDataSeedContributor : IDataSeedContributor, ITransientDepende
_cmsKitTestData.EntityId1,
"reply",
comment1.Id,
_cmsKitTestData.User1Id,
""
_cmsKitTestData.User1Id
));
await _commentRepository.InsertAsync(new Comment(_guidGenerator.Create(),
@ -220,8 +217,7 @@ public class CmsKitDataSeedContributor : IDataSeedContributor, ITransientDepende
_cmsKitTestData.EntityId1,
"comment",
null,
_cmsKitTestData.User2Id,
""
_cmsKitTestData.User2Id
));
await _commentRepository.InsertAsync(new Comment(_guidGenerator.Create(),
@ -229,8 +225,7 @@ public class CmsKitDataSeedContributor : IDataSeedContributor, ITransientDepende
_cmsKitTestData.EntityId2,
"comment",
null,
_cmsKitTestData.User2Id,
""
_cmsKitTestData.User2Id
));
await _commentRepository.InsertAsync(new Comment(_guidGenerator.Create(),
@ -238,8 +233,7 @@ public class CmsKitDataSeedContributor : IDataSeedContributor, ITransientDepende
_cmsKitTestData.EntityId1,
"comment",
null,
_cmsKitTestData.User2Id,
""
_cmsKitTestData.User2Id
));
}

Loading…
Cancel
Save