diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180924134933_Removed_Social_Links.Designer.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180924134933_Removed_Social_Links.Designer.cs new file mode 100644 index 0000000000..8818670a06 --- /dev/null +++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180924134933_Removed_Social_Links.Designer.cs @@ -0,0 +1,625 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.BloggingTestApp.EntityFrameworkCore; + +namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(BloggingTestAppDbContext))] + [Migration("20180924134933_Removed_Social_Links")] + partial class Removed_Social_Links + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.1.1-rtm-30846") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256); + + b.Property("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasMaxLength(1024); + + b.Property("RoleId"); + + b.Property("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsRequired() + .HasColumnName("ConcurrencyStamp") + .HasMaxLength(256); + + b.Property("Email") + .HasColumnName("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasDefaultValue(false); + + b.Property("LockoutEnd"); + + b.Property("NormalizedEmail") + .HasColumnName("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasMaxLength(1024); + + b.Property("TenantId"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId"); + + b.Property("LoginProvider") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196); + + b.Property("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId"); + + b.Property("RoleId"); + + b.Property("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider") + .HasMaxLength(128); + + b.Property("Name"); + + b.Property("TenantId"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64); + + b.Property("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CreationTime") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnName("Description") + .HasMaxLength(1024); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasColumnName("Name") + .HasMaxLength(256); + + b.Property("ShortName") + .IsRequired() + .HasColumnName("ShortName") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.ToTable("BlgBlogs"); + }); + + modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CreationTime") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId"); + + b.Property("PostId") + .HasColumnName("PostId"); + + b.Property("RepliedCommentId") + .HasColumnName("RepliedCommentId"); + + b.Property("Text") + .IsRequired() + .HasColumnName("Text") + .HasMaxLength(1024); + + b.HasKey("Id"); + + b.HasIndex("PostId"); + + b.HasIndex("RepliedCommentId"); + + b.ToTable("BlgComments"); + }); + + modelBuilder.Entity("Volo.Blogging.Posts.Post", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BlogId") + .HasColumnName("BlogId"); + + b.Property("Content") + .HasColumnName("Content") + .HasMaxLength(1048576); + + b.Property("CoverImage") + .IsRequired() + .HasColumnName("CoverImage"); + + b.Property("CreationTime") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId"); + + b.Property("ReadCount"); + + b.Property("Title") + .IsRequired() + .HasColumnName("Title") + .HasMaxLength(512); + + b.Property("Url") + .IsRequired() + .HasColumnName("Url") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.ToTable("BlgPosts"); + }); + + modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => + { + b.Property("PostId") + .HasColumnName("PostId"); + + b.Property("TagId") + .HasColumnName("TagId"); + + b.Property("CreationTime"); + + b.Property("CreatorId"); + + b.HasKey("PostId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("BlgPostTags"); + }); + + modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CreationTime") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnName("Description") + .HasMaxLength(512); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasColumnName("Name") + .HasMaxLength(64); + + b.Property("UsageCount") + .HasColumnName("UsageCount"); + + b.HasKey("Id"); + + b.ToTable("BlgTags"); + }); + + modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Email") + .HasColumnName("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties"); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasDefaultValue(false); + + b.Property("TenantId") + .HasColumnName("TenantId"); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.ToTable("BlgUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole") + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser") + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser") + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Volo.Abp.Identity.IdentityUser") + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser") + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => + { + b.HasOne("Volo.Blogging.Posts.Post") + .WithMany() + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Volo.Blogging.Comments.Comment") + .WithMany() + .HasForeignKey("RepliedCommentId"); + }); + + modelBuilder.Entity("Volo.Blogging.Posts.Post", b => + { + b.HasOne("Volo.Blogging.Blogs.Blog") + .WithMany() + .HasForeignKey("BlogId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => + { + b.HasOne("Volo.Blogging.Posts.Post") + .WithMany("Tags") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Volo.Blogging.Tagging.Tag") + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180924134933_Removed_Social_Links.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180924134933_Removed_Social_Links.cs new file mode 100644 index 0000000000..48ac26daf1 --- /dev/null +++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20180924134933_Removed_Social_Links.cs @@ -0,0 +1,63 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations +{ + public partial class Removed_Social_Links : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Facebook", + table: "BlgBlogs"); + + migrationBuilder.DropColumn( + name: "Github", + table: "BlgBlogs"); + + migrationBuilder.DropColumn( + name: "Instagram", + table: "BlgBlogs"); + + migrationBuilder.DropColumn( + name: "StackOverflow", + table: "BlgBlogs"); + + migrationBuilder.DropColumn( + name: "Twitter", + table: "BlgBlogs"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Facebook", + table: "BlgBlogs", + maxLength: 128, + nullable: true); + + migrationBuilder.AddColumn( + name: "Github", + table: "BlgBlogs", + maxLength: 128, + nullable: true); + + migrationBuilder.AddColumn( + name: "Instagram", + table: "BlgBlogs", + maxLength: 128, + nullable: true); + + migrationBuilder.AddColumn( + name: "StackOverflow", + table: "BlgBlogs", + maxLength: 128, + nullable: true); + + migrationBuilder.AddColumn( + name: "Twitter", + table: "BlgBlogs", + maxLength: 128, + nullable: true); + } + } +} diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs index 93aaad6c14..b59ab48a69 100644 --- a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs +++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs @@ -305,18 +305,6 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .HasColumnName("Description") .HasMaxLength(1024); - b.Property("Facebook") - .HasColumnName("Facebook") - .HasMaxLength(128); - - b.Property("Github") - .HasColumnName("Github") - .HasMaxLength(128); - - b.Property("Instagram") - .HasColumnName("Instagram") - .HasMaxLength(128); - b.Property("IsDeleted") .ValueGeneratedOnAdd() .HasColumnName("IsDeleted") @@ -338,14 +326,6 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .HasColumnName("ShortName") .HasMaxLength(32); - b.Property("StackOverflow") - .HasColumnName("StackOverflow") - .HasMaxLength(128); - - b.Property("Twitter") - .HasColumnName("Twitter") - .HasMaxLength(128); - b.HasKey("Id"); b.ToTable("BlgBlogs"); diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/BlogDto.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/BlogDto.cs index aefb5b9890..45aa60e171 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/BlogDto.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/BlogDto.cs @@ -10,15 +10,5 @@ namespace Volo.Blogging.Blogs.Dtos public string ShortName { get; set; } public string Description { get; set; } - - public string Facebook { get; set; } - - public string Twitter { get; set; } - - public string Instagram { get; set; } - - public string Github { get; set; } - - public string StackOverflow { get; set; } } } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/CreateBlogDto.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/CreateBlogDto.cs index 2f70583d18..802e271e33 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/CreateBlogDto.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/CreateBlogDto.cs @@ -7,15 +7,5 @@ namespace Volo.Blogging.Blogs.Dtos public string ShortName { get; set; } public string Description { get; set; } - - public string Facebook { get; set; } - - public string Twitter { get; set; } - - public string Instagram { get; set; } - - public string Github { get; set; } - - public string StackOverflow { get; set; } } } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/UpdateBlogDto.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/UpdateBlogDto.cs index 82b8ddc993..f7ec593465 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/UpdateBlogDto.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Blogs/Dtos/UpdateBlogDto.cs @@ -9,15 +9,5 @@ namespace Volo.Blogging.Blogs.Dtos public string ShortName { get; set; } public string Description { get; set; } - - public string Facebook { get; set; } - - public string Twitter { get; set; } - - public string Instagram { get; set; } - - public string Github { get; set; } - - public string StackOverflow { get; set; } } } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs index 7ae1128f38..cbc2b10917 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Blogs/BlogAppService.cs @@ -62,12 +62,7 @@ namespace Volo.Blogging.Blogs { var newBlog = await _blogRepository.InsertAsync(new Blog(GuidGenerator.Create(), input.Name, input.ShortName) { - Description = input.Description, - Facebook = input.Facebook, - Twitter = input.Twitter, - Instagram = input.Instagram, - Github = input.Github, - StackOverflow = input.StackOverflow + Description = input.Description }); return ObjectMapper.Map(newBlog); @@ -81,11 +76,6 @@ namespace Volo.Blogging.Blogs blog.SetName(input.Name); blog.SetShortName(input.ShortName); blog.Description = input.Description; - blog.Facebook = input.Facebook; - blog.Twitter = input.Twitter; - blog.Instagram = input.Instagram; - blog.Github = input.Github; - blog.StackOverflow = input.StackOverflow; return ObjectMapper.Map(blog); } diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs index 5fe2b9902c..502a4364e7 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Blogs/BlogConsts.cs @@ -7,7 +7,5 @@ public const int MaxShortNameLength = 32; public const int MaxDescriptionLength = 1024; - - public const int MaxSocialLinkLength = 128; } } diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/Blog.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/Blog.cs index 8f2910259d..473f28ae48 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/Blog.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/Blog.cs @@ -16,21 +16,6 @@ namespace Volo.Blogging.Blogs [CanBeNull] public virtual string Description { get; set; } - [CanBeNull] - public virtual string Facebook { get; set; } - - [CanBeNull] - public virtual string Twitter { get; set; } - - [CanBeNull] - public virtual string Instagram { get; set; } - - [CanBeNull] - public virtual string Github { get; set; } - - [CanBeNull] - public virtual string StackOverflow { get; set; } - protected Blog() { diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs index f85dc6beb4..529c6b3e6f 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContextModelBuilderExtensions.cs @@ -38,11 +38,6 @@ namespace Volo.Blogging.EntityFrameworkCore b.ConfigureFullAudited(); b.Property(x => x.Name).IsRequired().HasMaxLength(BlogConsts.MaxNameLength).HasColumnName(nameof(Blog.Name)); - b.Property(x => x.Facebook).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.Facebook)); - b.Property(x => x.Twitter).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.Twitter)); - b.Property(x => x.Instagram).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.Instagram)); - b.Property(x => x.Github).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.Github)); - b.Property(x => x.StackOverflow).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.StackOverflow)); b.Property(x => x.ShortName).IsRequired().HasMaxLength(BlogConsts.MaxShortNameLength).HasColumnName(nameof(Blog.ShortName)); b.Property(x => x.Description).IsRequired(false).HasMaxLength(BlogConsts.MaxDescriptionLength).HasColumnName(nameof(Blog.Description)); }); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml index f357e8c8fc..d9b2ab6cdf 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml @@ -8,26 +8,13 @@ } -
+ - - - - - - - - - - - - - - + - +
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs index d0c1cf48ed..7a35be4c73 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Create.cshtml.cs @@ -54,21 +54,6 @@ namespace Volo.Blogging.Pages.Admin.Blogs [StringLength(BlogConsts.MaxDescriptionLength)] public string Description { get; set; } - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string Facebook { get; set; } - - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string Twitter { get; set; } - - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string Instagram { get; set; } - - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string Github { get; set; } - - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string StackOverflow { get; set; } - } } } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml index 302aceaec1..67f8e9d602 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml @@ -8,27 +8,13 @@ } -
+ - - - - - - - - - - - - - - - + - \ No newline at end of file +
\ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs index e333840f88..4484eb8993 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Admin/Blogs/Edit.cshtml.cs @@ -48,12 +48,7 @@ namespace Volo.Blogging.Pages.Admin.Blogs { Name = Blog.Name, ShortName = Blog.ShortName, - Description = Blog.Description, - Facebook = Blog.Facebook, - Twitter = Blog.Twitter, - Instagram = Blog.Instagram, - Github = Blog.Github, - StackOverflow = Blog.StackOverflow + Description = Blog.Description }); } @@ -73,21 +68,6 @@ namespace Volo.Blogging.Pages.Admin.Blogs [StringLength(BlogConsts.MaxDescriptionLength)] public string Description { get; set; } - - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string Facebook { get; set; } - - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string Twitter { get; set; } - - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string Instagram { get; set; } - - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string Github { get; set; } - - [StringLength(BlogConsts.MaxSocialLinkLength)] - public string StackOverflow { get; set; } } } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml index b32125df9e..782e5b7989 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Index.cshtml @@ -49,40 +49,6 @@ @L["CreateANewPost"] | } - @if (!string.IsNullOrWhiteSpace(Model.Blog.Facebook)) - { - - - - | - } - @if (!string.IsNullOrWhiteSpace(Model.Blog.Twitter)) - { - - - - | - } - @if (!string.IsNullOrWhiteSpace(Model.Blog.Instagram)) - { - - - - | - } - @if (!string.IsNullOrWhiteSpace(Model.Blog.Github)) - { - - - - | - } - @if (!string.IsNullOrWhiteSpace(Model.Blog.StackOverflow)) - { - - - - } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/edit.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/edit.js index dac6f8252e..2d646de304 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/edit.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/edit.js @@ -88,16 +88,4 @@ $(this).off('submit').submit(); }); - $('#Post_Title').on("change paste keyup", function() { - var title = $('#Post_Title').val(); - - if (title.length > 64) { - title = title.substring(0, 64); - } - - title = title.replace(' ','-'); - title = title.replace(new RegExp(' ', 'g'), '-'); - $('#Post_Url').val(title); - }); - })(jQuery); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/new.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/new.js index 5931a96fe9..f28cb48d44 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/new.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/new.js @@ -86,7 +86,14 @@ $(this).off('submit').submit(); }); - $('#Post_Title').on("change paste keyup", function() { + var urlEdited = false; + var reflectedChange = false; + + $('#Post_Title').on("change paste keyup", function () { + if (urlEdited) { + return; + } + var title = $('#Post_Title').val(); if (title.length > 64) { @@ -95,7 +102,15 @@ title = title.replace(' ', '-'); title = title.replace(new RegExp(' ', 'g'), '-'); + reflectedChange = true; $('#Post_Url').val(title); + reflectedChange = false; + }); + + $('#Post_Url').change(function () { + if (!reflectedChange) { + urlEdited = true; + } }); })(jQuery); diff --git a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs index 067ad5e759..7c4dce8022 100644 --- a/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs +++ b/modules/docs/src/Volo.Docs.Application.Contracts/Volo/Docs/Documents/ContentWithDetailsDto.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; @@ -43,7 +44,7 @@ namespace Volo.Docs.Documents public bool IsEmpty => Text == null && Path == null; - public bool IsOpened(string documentName) + public bool IsSelected(string documentName) { if (documentName == null) { @@ -55,18 +56,19 @@ namespace Volo.Docs.Documents return documentName == Path; } - var isOpened = false; + var isSelected = false; foreach (var n in Items) { - if (n.IsOpened(documentName)) + if (n.IsSelected(documentName)) { - isOpened = true; + isSelected = true; break; } } - return isOpened; + return isSelected; } + } public class NavigationWithDetailsDto : DocumentWithDetailsDto @@ -76,9 +78,15 @@ namespace Volo.Docs.Documents public void ConvertItems() { - RootNode = string.IsNullOrWhiteSpace(Content) ? - new NavigationNode() : - JsonConvert.DeserializeObject(Content); + try + { + RootNode = JsonConvert.DeserializeObject(Content); + } + catch (JsonException) + { + //todo: should log the exception? + RootNode = new NavigationNode(); + } } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs index 838db2ab0c..4892c0015e 100644 --- a/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs +++ b/modules/docs/src/Volo.Docs.Application/Volo/Docs/Documents/DocumentAppService.cs @@ -60,12 +60,6 @@ namespace Volo.Docs.Documents dto.Project = ObjectMapper.Map(project); - //if (normalize) - //{ - // dto.Content = NormalizeLinks(dto.Content, project.ShortName, version); - // dto.Content = NormalizeImages(dto.Content, dto.RawRootUrl); - //} - return dto; } diff --git a/modules/docs/src/Volo.Docs.Web/Areas/Documents/Helpers/TagHelpers/TreeTagHelper.cs b/modules/docs/src/Volo.Docs.Web/Areas/Documents/Helpers/TagHelpers/TreeTagHelper.cs index 1f38c22a78..43b672dcd6 100644 --- a/modules/docs/src/Volo.Docs.Web/Areas/Documents/Helpers/TagHelpers/TreeTagHelper.cs +++ b/modules/docs/src/Volo.Docs.Web/Areas/Documents/Helpers/TagHelpers/TreeTagHelper.cs @@ -9,7 +9,7 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers [HtmlTargetElement("ul", Attributes = "root-node")] public class TreeTagHelper : TagHelper { - private const string LiItemTemplate = @"
  • + private const string LiItemTemplate = @"