pull/16476/head
Engincan VESKE 2 years ago
parent d63154af52
commit 9a766facfb

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

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

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

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

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

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

Loading…
Cancel
Save