mirror of https://github.com/abpframework/abp.git
committed by
GitHub
27 changed files with 2721 additions and 325 deletions
File diff suppressed because it is too large
@ -0,0 +1,226 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class AddedBlogUserOptionals : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Biography", |
||||
|
table: "BlgUsers", |
||||
|
type: "nvarchar(1000)", |
||||
|
maxLength: 1000, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Company", |
||||
|
table: "BlgUsers", |
||||
|
type: "nvarchar(128)", |
||||
|
maxLength: 128, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Github", |
||||
|
table: "BlgUsers", |
||||
|
type: "nvarchar(64)", |
||||
|
maxLength: 64, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "JobTitle", |
||||
|
table: "BlgUsers", |
||||
|
type: "nvarchar(32)", |
||||
|
maxLength: 32, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Linkedin", |
||||
|
table: "BlgUsers", |
||||
|
type: "nvarchar(64)", |
||||
|
maxLength: 64, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "Twitter", |
||||
|
table: "BlgUsers", |
||||
|
type: "nvarchar(64)", |
||||
|
maxLength: 64, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<string>( |
||||
|
name: "WebSite", |
||||
|
table: "BlgUsers", |
||||
|
type: "nvarchar(256)", |
||||
|
maxLength: 256, |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<int>( |
||||
|
name: "EntityVersion", |
||||
|
table: "AbpUsers", |
||||
|
type: "int", |
||||
|
nullable: false, |
||||
|
defaultValue: 0); |
||||
|
|
||||
|
migrationBuilder.AddColumn<DateTimeOffset>( |
||||
|
name: "LastPasswordChangeTime", |
||||
|
table: "AbpUsers", |
||||
|
type: "datetimeoffset", |
||||
|
nullable: true); |
||||
|
|
||||
|
migrationBuilder.AddColumn<bool>( |
||||
|
name: "ShouldChangePasswordOnNextLogin", |
||||
|
table: "AbpUsers", |
||||
|
type: "bit", |
||||
|
nullable: false, |
||||
|
defaultValue: false); |
||||
|
|
||||
|
migrationBuilder.AddColumn<int>( |
||||
|
name: "EntityVersion", |
||||
|
table: "AbpRoles", |
||||
|
type: "int", |
||||
|
nullable: false, |
||||
|
defaultValue: 0); |
||||
|
|
||||
|
migrationBuilder.AddColumn<int>( |
||||
|
name: "EntityVersion", |
||||
|
table: "AbpOrganizationUnits", |
||||
|
type: "int", |
||||
|
nullable: false, |
||||
|
defaultValue: 0); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpPermissionGroups", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
||||
|
DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpPermissions", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
GroupName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
||||
|
ParentName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), |
||||
|
DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
IsEnabled = table.Column<bool>(type: "bit", nullable: false), |
||||
|
MultiTenancySide = table.Column<byte>(type: "tinyint", nullable: false), |
||||
|
Providers = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), |
||||
|
StateCheckers = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), |
||||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpPermissions", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpUserDelegations", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
SourceUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TargetUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
StartTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
EndTime = table.Column<DateTime>(type: "datetime2", nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpUserDelegations", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpPermissionGroups_Name", |
||||
|
table: "AbpPermissionGroups", |
||||
|
column: "Name", |
||||
|
unique: true); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpPermissions_GroupName", |
||||
|
table: "AbpPermissions", |
||||
|
column: "GroupName"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpPermissions_Name", |
||||
|
table: "AbpPermissions", |
||||
|
column: "Name", |
||||
|
unique: true); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpPermissionGroups"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpPermissions"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpUserDelegations"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Biography", |
||||
|
table: "BlgUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Company", |
||||
|
table: "BlgUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Github", |
||||
|
table: "BlgUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "JobTitle", |
||||
|
table: "BlgUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Linkedin", |
||||
|
table: "BlgUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "Twitter", |
||||
|
table: "BlgUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "WebSite", |
||||
|
table: "BlgUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "EntityVersion", |
||||
|
table: "AbpUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "LastPasswordChangeTime", |
||||
|
table: "AbpUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "ShouldChangePasswordOnNextLogin", |
||||
|
table: "AbpUsers"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "EntityVersion", |
||||
|
table: "AbpRoles"); |
||||
|
|
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "EntityVersion", |
||||
|
table: "AbpOrganizationUnits"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Blogging.Users; |
||||
|
|
||||
|
namespace Volo.Blogging.Members; |
||||
|
|
||||
|
public class CustomIdentityBlogUserUpdateDto |
||||
|
{ |
||||
|
[StringLength(UserConsts.MaxNameLength)] |
||||
|
public string Name { get; set; } |
||||
|
|
||||
|
[StringLength(UserConsts.MaxSurnameLength)] |
||||
|
public string Surname { get; set; } |
||||
|
|
||||
|
[RegularExpression(@"^((?!\s).)*$", ErrorMessage= "PersonalSiteUrlValidationMessage")] |
||||
|
[StringLength(UserConsts.MaxWebSiteLength)] |
||||
|
public string WebSite { get; set; } |
||||
|
|
||||
|
[RegularExpression(@"^((?!\s).)*$", ErrorMessage= "TwitterUserNameValidationMessage")] |
||||
|
[StringLength(UserConsts.MaxTwitterLength)] |
||||
|
public string Twitter { get; set; } |
||||
|
|
||||
|
[RegularExpression(@"^((?!\s).)*$", ErrorMessage= "GitHubUserNameValidationMessage")] |
||||
|
[StringLength(UserConsts.MaxGithubLength)] |
||||
|
public string Github { get; set; } |
||||
|
|
||||
|
[RegularExpression(@"^((?!\s).)*$", ErrorMessage= "LinkedinUrlValidationMessage")] |
||||
|
[StringLength(UserConsts.MaxLinkedinLength)] |
||||
|
public string Linkedin { get; set; } |
||||
|
|
||||
|
[StringLength(UserConsts.MaxCompanyLength)] |
||||
|
public string Company { get; set; } |
||||
|
|
||||
|
[StringLength(UserConsts.MaxJobTitleLength)] |
||||
|
public string JobTitle { get; set; } |
||||
|
|
||||
|
[StringLength(UserConsts.MaxBiographyLength)] |
||||
|
public string Biography { get; set; } |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
namespace Volo.Blogging.Users; |
||||
|
|
||||
|
public class UserConsts |
||||
|
{ |
||||
|
public const int MaxNameLength = 64; |
||||
|
|
||||
|
public const int MaxSurnameLength = 64; |
||||
|
|
||||
|
public const int MaxBiographyLength = 1000; |
||||
|
|
||||
|
public const int MaxWebSiteLength = 256; |
||||
|
|
||||
|
public const int MaxTwitterLength = 128; |
||||
|
|
||||
|
public const int MaxGithubLength = 256; |
||||
|
|
||||
|
public const int MaxLinkedinLength = 256; |
||||
|
|
||||
|
public const int MaxCompanyLength = 256; |
||||
|
|
||||
|
public const int MaxJobTitleLength = 128; |
||||
|
} |
||||
@ -1,3 +1,6 @@ |
|||||
.post-desc { |
.post-desc { |
||||
overflow-wrap: break-word; |
overflow-wrap: break-word; |
||||
} |
} |
||||
|
a:not(#all-posts-tab,#edit-profile-tab) { |
||||
|
color: unset!important; |
||||
|
} |
||||
|
|||||
@ -0,0 +1,9 @@ |
|||||
|
$(function () { |
||||
|
if (window.location.hash === '#edit-profile'){ |
||||
|
$('#all-posts-tab').removeClass('active'); |
||||
|
$('#all-posts').removeClass('show').removeClass('active'); |
||||
|
$('#edit-profile-tab').addClass('active'); |
||||
|
$('#edit-profile').addClass('show').addClass('active'); |
||||
|
window.location.hash = ''; |
||||
|
} |
||||
|
}); |
||||
Loading…
Reference in new issue