Browse Source

cmskit: commentUrl has been renamed

pull/16476/head
Onur Pıçakcı 3 years ago
parent
commit
6135245fe1
  1. 2352
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504103522_Change_CommentUrl_Name.Designer.cs
  2. 28
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504103522_Change_CommentUrl_Name.cs
  3. 8
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs
  4. 2
      modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentWithAuthorDto.cs
  5. 3
      modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Comments/index.js
  6. 2
      modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Localization/Resources/en.json
  7. 6
      modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Comments/Comment.cs
  8. 2
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs
  9. 2
      modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CommentDto.cs
  10. 2
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js

2352
modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504103522_Change_CommentUrl_Name.Designer.cs

File diff suppressed because it is too large

28
modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20230504103522_Change_CommentUrl_Name.cs

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Volo.CmsKit.Migrations
{
/// <inheritdoc />
public partial class ChangeCommentUrlName : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "CommentUrl",
table: "CmsComments",
newName: "Url");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Url",
table: "CmsComments",
newName: "CommentUrl");
}
}
}

8
modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs

@ -1587,10 +1587,6 @@ namespace Volo.CmsKit.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("CommentUrl")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
@ -1631,6 +1627,10 @@ namespace Volo.CmsKit.Migrations
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.Property<string>("Url")
.HasMaxLength(512)
.HasColumnType("nvarchar(512)");
b.HasKey("Id");
b.HasIndex("TenantId", "RepliedCommentId");

2
modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Comments/CommentWithAuthorDto.cs

@ -21,5 +21,5 @@ public class CommentWithAuthorDto
public CmsUserDto Author { get; set; }
public string CommentUrl { get; set; }
public string Url { get; set; }
}

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

@ -116,9 +116,8 @@ $(function (){
},
{
title: l("CommentUrl"),
data: "commentUrl",
data: "url",
render: function (data, type, row) {
console.log(data);
if (data !== null) {
return '<a href="' + data + '#comment-'+ row.id + '" target="_blank"><i class="fa fa-location-arrow"></i></a>';
}

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": "Comment Url"
"CommentUrl": "Url"
}
}

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

@ -23,7 +23,7 @@ public class Comment : AggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator,
public virtual DateTime CreationTime { get; set; }
public virtual string CommentUrl { get; set; }
public virtual string Url { get; set; }
protected Comment()
{
@ -37,7 +37,7 @@ public class Comment : AggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator,
[NotNull] string text,
Guid? repliedCommentId,
Guid creatorId,
[CanBeNull] string commentUrl,
[CanBeNull] string url,
Guid? tenantId = null)
: base(id)
{
@ -45,7 +45,7 @@ public class Comment : AggregateRoot<Guid>, IHasCreationTime, IMustHaveCreator,
EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), CommentConsts.MaxEntityIdLength);
RepliedCommentId = repliedCommentId;
CreatorId = creatorId;
CommentUrl = commentUrl;
Url = url;
TenantId = tenantId;
SetTextInternal(text);

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.CommentUrl).HasMaxLength(CommentConsts.MaxCommentUrlLength);
b.Property(x => x.Url).HasMaxLength(CommentConsts.MaxCommentUrlLength);
b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId });
b.HasIndex(x => new { x.TenantId, x.RepliedCommentId });

2
modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Comments/CommentDto.cs

@ -24,5 +24,5 @@ public class CommentDto : IHasConcurrencyStamp
public string ConcurrencyStamp { get; set; }
public string CommentUrl { get; set; }
public string Url { get; set; }
}

2
modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Commenting/default.js

@ -150,7 +150,7 @@
entityType: $commentArea.attr('data-entity-type'),
repliedCommentId: formAsObject.repliedCommentId,
text: formAsObject.commentText,
commentUrl: window.location.href,
url: window.location.href,
captchaToken: formAsObject.captchaId,
captchaAnswer: formAsObject.input?.captcha
}),

Loading…
Cancel
Save