Resolved #629 : Project management UI for docs module

pull/691/head
Yunus Emre Kalkan 6 years ago
parent 5e551438e7
commit 8d6cdd287c

@ -65,7 +65,7 @@ namespace Volo.Blogging
[Route("{id}")]
public async Task<BlogDto> Update(Guid id, UpdateBlogDto input)
{
throw new NotImplementedException();
return await _blogAppService.Update(id, input);
}
[HttpDelete]

@ -33,15 +33,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin-app", "admin-app", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "public-app", "public-app", "{8B0CDFC9-E313-4323-9390-59CFFAAC60B5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.Application.Contracts", "src\Volo.Docs.Admin.Application.Contracts\Volo.Docs.Admin.Application.Contracts.csproj", "{37D483C8-400B-4127-A6D0-2EE4E80CB696}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Admin.Application.Contracts", "src\Volo.Docs.Admin.Application.Contracts\Volo.Docs.Admin.Application.Contracts.csproj", "{37D483C8-400B-4127-A6D0-2EE4E80CB696}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.Application", "src\Volo.Docs.Admin.Application\Volo.Docs.Admin.Application.csproj", "{823C51A7-40AB-45D8-8FB8-F212AF7E45F2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Admin.Application", "src\Volo.Docs.Admin.Application\Volo.Docs.Admin.Application.csproj", "{823C51A7-40AB-45D8-8FB8-F212AF7E45F2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.HttpApi", "src\Volo.Docs.Admin.HttpApi\Volo.Docs.Admin.HttpApi.csproj", "{262F38DB-62AF-427F-96E2-C6385C5AB695}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Admin.HttpApi", "src\Volo.Docs.Admin.HttpApi\Volo.Docs.Admin.HttpApi.csproj", "{262F38DB-62AF-427F-96E2-C6385C5AB695}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.HttpApi.Client", "src\Volo.Docs.Admin.HttpApi.Client\Volo.Docs.Admin.HttpApi.Client.csproj", "{81EE378A-0DE1-47BA-86D9-08EF6317BB95}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Admin.HttpApi.Client", "src\Volo.Docs.Admin.HttpApi.Client\Volo.Docs.Admin.HttpApi.Client.csproj", "{81EE378A-0DE1-47BA-86D9-08EF6317BB95}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Docs.Admin.Web", "src\Volo.Docs.Admin.Web\Volo.Docs.Admin.Web.csproj", "{116A6145-9D66-4867-B3EF-A464FAC47946}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Docs.Admin.Web", "src\Volo.Docs.Admin.Web\Volo.Docs.Admin.Web.csproj", "{116A6145-9D66-4867-B3EF-A464FAC47946}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

@ -1,5 +1,8 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Docs.EntityFrameworkCore;
namespace Volo.DocsTestApp.EntityFrameworkCore
@ -16,6 +19,9 @@ namespace Volo.DocsTestApp.EntityFrameworkCore
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureDocs();
}
}

@ -1,11 +1,17 @@
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Docs.EntityFrameworkCore;
namespace Volo.DocsTestApp.EntityFrameworkCore
{
[DependsOn(
typeof(DocsEntityFrameworkCoreModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCoreSqlServerModule))]
public class DocsTestAppEntityFrameworkCoreModule : AbpModule
{

@ -0,0 +1,458 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.DocsTestApp.EntityFrameworkCore;
namespace Volo.DocsTestApp.EntityFrameworkCore.Migrations
{
[DbContext(typeof(DocsTestAppDbContext))]
[Migration("20181225063242_Added_Identity")]
partial class Added_Identity
{
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.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<string>("Description")
.HasMaxLength(256);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("Regex")
.HasMaxLength(512);
b.Property<string>("RegexDescription")
.HasMaxLength(128);
b.Property<bool>("Required");
b.Property<int>("ValueType");
b.HasKey("Id");
b.ToTable("AbpClaimTypes");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDefault")
.HasColumnName("IsDefault");
b.Property<bool>("IsPublic")
.HasColumnName("IsPublic");
b.Property<bool>("IsStatic")
.HasColumnName("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.IsRequired()
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("NormalizedName");
b.ToTable("AbpRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasMaxLength(1024);
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AbpRoleClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount")
.ValueGeneratedOnAdd()
.HasColumnName("AccessFailedCount")
.HasDefaultValue(0);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<DateTime>("CreationTime");
b.Property<Guid?>("CreatorId");
b.Property<Guid?>("DeleterId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("Email")
.HasColumnName("Email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted");
b.Property<DateTime?>("LastModificationTime");
b.Property<Guid?>("LastModifierId");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled")
.HasDefaultValue(false);
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("Name")
.HasColumnName("Name")
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.HasColumnName("NormalizedEmail")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasColumnName("NormalizedUserName")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnName("PasswordHash")
.HasMaxLength(256);
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasDefaultValue(false);
b.Property<string>("SecurityStamp")
.IsRequired()
.HasColumnName("SecurityStamp")
.HasMaxLength(256);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<bool>("TwoFactorEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("TwoFactorEnabled")
.HasDefaultValue(false);
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasMaxLength(1024);
b.Property<Guid?>("TenantId");
b.Property<Guid>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AbpUserClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(64);
b.Property<string>("ProviderDisplayName")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(196);
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "LoginProvider");
b.HasIndex("LoginProvider", "ProviderKey");
b.ToTable("AbpUserLogins");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.Property<Guid>("UserId");
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId", "UserId");
b.ToTable("AbpUserRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(64);
b.Property<string>("Name")
.HasMaxLength(128);
b.Property<Guid?>("TenantId");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AbpUserTokens");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Docs.Projects.Project", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp");
b.Property<string>("DefaultDocumentName")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("DocumentStoreType");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("Format");
b.Property<string>("LatestVersionBranchName")
.HasMaxLength(128);
b.Property<string>("MainWebsiteUrl");
b.Property<string>("MinimumVersion");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("NavigationDocumentName")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ShortName")
.IsRequired()
.HasMaxLength(32);
b.HasKey("Id");
b.ToTable("DocsProjects");
});
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);
});
#pragma warning restore 612, 618
}
}
}

@ -0,0 +1,313 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Volo.DocsTestApp.EntityFrameworkCore.Migrations
{
public partial class Added_Identity : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 256, nullable: false),
Required = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
Regex = table.Column<string>(maxLength: 512, nullable: true),
RegexDescription = table.Column<string>(maxLength: 128, nullable: true),
Description = table.Column<string>(maxLength: 256, nullable: true),
ValueType = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 128, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 256, nullable: false),
NormalizedName = table.Column<string>(maxLength: 256, nullable: false),
IsDefault = table.Column<bool>(nullable: false),
IsStatic = table.Column<bool>(nullable: false),
IsPublic = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettings",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(maxLength: 2048, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUsers",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
LastModificationTime = table.Column<DateTime>(nullable: true),
LastModifierId = table.Column<Guid>(nullable: true),
IsDeleted = table.Column<bool>(nullable: false),
DeleterId = table.Column<Guid>(nullable: true),
DeletionTime = table.Column<DateTime>(nullable: true),
TenantId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: false),
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: true),
Surname = table.Column<string>(maxLength: 64, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
PasswordHash = table.Column<string>(maxLength: 256, nullable: true),
SecurityStamp = table.Column<string>(maxLength: 256, nullable: false),
PhoneNumber = table.Column<string>(maxLength: 16, nullable: true),
PhoneNumberConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
TwoFactorEnabled = table.Column<bool>(nullable: false, defaultValue: false),
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
LockoutEnabled = table.Column<bool>(nullable: false, defaultValue: false),
AccessFailedCount = table.Column<int>(nullable: false, defaultValue: 0)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ClaimType = table.Column<string>(maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(maxLength: 1024, nullable: true),
RoleId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AbpRoleClaims_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ClaimType = table.Column<string>(maxLength: 256, nullable: false),
ClaimValue = table.Column<string>(maxLength: 1024, nullable: true),
UserId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AbpUserClaims_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserLogins",
columns: table => new
{
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(maxLength: 196, nullable: false),
ProviderDisplayName = table.Column<string>(maxLength: 128, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider });
table.ForeignKey(
name: "FK_AbpUserLogins_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserRoles",
columns: table => new
{
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
RoleId = table.Column<Guid>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AbpUserRoles_AbpRoles_RoleId",
column: x => x.RoleId,
principalTable: "AbpRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AbpUserRoles_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserTokens",
columns: table => new
{
TenantId = table.Column<Guid>(nullable: true),
UserId = table.Column<Guid>(nullable: false),
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AbpUserTokens_AbpUsers_UserId",
column: x => x.UserId,
principalTable: "AbpUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
table: "AbpPermissionGrants",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpRoleClaims_RoleId",
table: "AbpRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_AbpRoles_NormalizedName",
table: "AbpRoles",
column: "NormalizedName");
migrationBuilder.CreateIndex(
name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
table: "AbpSettings",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpUserClaims_UserId",
table: "AbpUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AbpUserLogins_LoginProvider_ProviderKey",
table: "AbpUserLogins",
columns: new[] { "LoginProvider", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpUserRoles_RoleId_UserId",
table: "AbpUserRoles",
columns: new[] { "RoleId", "UserId" });
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_Email",
table: "AbpUsers",
column: "Email");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_NormalizedEmail",
table: "AbpUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_NormalizedUserName",
table: "AbpUsers",
column: "NormalizedUserName");
migrationBuilder.CreateIndex(
name: "IX_AbpUsers_UserName",
table: "AbpUsers",
column: "UserName");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpClaimTypes");
migrationBuilder.DropTable(
name: "AbpPermissionGrants");
migrationBuilder.DropTable(
name: "AbpRoleClaims");
migrationBuilder.DropTable(
name: "AbpSettings");
migrationBuilder.DropTable(
name: "AbpUserClaims");
migrationBuilder.DropTable(
name: "AbpUserLogins");
migrationBuilder.DropTable(
name: "AbpUserRoles");
migrationBuilder.DropTable(
name: "AbpUserTokens");
migrationBuilder.DropTable(
name: "AbpRoles");
migrationBuilder.DropTable(
name: "AbpUsers");
}
}
}

@ -19,12 +19,357 @@ namespace Volo.DocsTestApp.EntityFrameworkCore.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<string>("Description")
.HasMaxLength(256);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("Regex")
.HasMaxLength(512);
b.Property<string>("RegexDescription")
.HasMaxLength(128);
b.Property<bool>("Required");
b.Property<int>("ValueType");
b.HasKey("Id");
b.ToTable("AbpClaimTypes");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDefault")
.HasColumnName("IsDefault");
b.Property<bool>("IsPublic")
.HasColumnName("IsPublic");
b.Property<bool>("IsStatic")
.HasColumnName("IsStatic");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.IsRequired()
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("NormalizedName");
b.ToTable("AbpRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasMaxLength(1024);
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AbpRoleClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount")
.ValueGeneratedOnAdd()
.HasColumnName("AccessFailedCount")
.HasDefaultValue(0);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<DateTime>("CreationTime");
b.Property<Guid?>("CreatorId");
b.Property<Guid?>("DeleterId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("Email")
.HasColumnName("Email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted");
b.Property<DateTime?>("LastModificationTime");
b.Property<Guid?>("LastModifierId");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled")
.HasDefaultValue(false);
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("Name")
.HasColumnName("Name")
.HasMaxLength(64);
b.Property<string>("NormalizedEmail")
.HasColumnName("NormalizedEmail")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasColumnName("NormalizedUserName")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnName("PasswordHash")
.HasMaxLength(256);
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasDefaultValue(false);
b.Property<string>("SecurityStamp")
.IsRequired()
.HasColumnName("SecurityStamp")
.HasMaxLength(256);
b.Property<string>("Surname")
.HasColumnName("Surname")
.HasMaxLength(64);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<bool>("TwoFactorEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("TwoFactorEnabled")
.HasDefaultValue(false);
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasMaxLength(1024);
b.Property<Guid?>("TenantId");
b.Property<Guid>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AbpUserClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(64);
b.Property<string>("ProviderDisplayName")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(196);
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "LoginProvider");
b.HasIndex("LoginProvider", "ProviderKey");
b.ToTable("AbpUserLogins");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.Property<Guid>("UserId");
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId", "UserId");
b.ToTable("AbpUserRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(64);
b.Property<string>("Name")
.HasMaxLength(128);
b.Property<Guid?>("TenantId");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AbpUserTokens");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Docs.Projects.Project", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnName("ConcurrencyStamp");
b.Property<string>("DefaultDocumentName")
.IsRequired()
@ -60,6 +405,51 @@ namespace Volo.DocsTestApp.EntityFrameworkCore.Migrations
b.ToTable("DocsProjects");
});
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);
});
#pragma warning restore 612, 618
}
}

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Remove="Migrations\20181101121126_Added_LatestVersionBranchName.cs" />
<Compile Remove="Migrations\20181225063151_Added_Identity.cs" />
</ItemGroup>
<ItemGroup>
@ -17,6 +17,9 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Docs.EntityFrameworkCore\Volo.Docs.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
</ItemGroup>
</Project>

@ -5,9 +5,9 @@ namespace Volo.DocsTestApp.Controllers
{
public class HomeController : AbpController
{
public ActionResult Index()
public void Index()
{
return Redirect("/Documents/");
}
}
}

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Localization;
@ -9,6 +10,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Modularity;
using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
@ -18,19 +20,28 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theming;
using Volo.Abp.Autofac;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity;
using Volo.Abp.Identity.Web;
using Volo.Abp.Modularity;
using Volo.Abp.Threading;
using Volo.Abp.UI;
using Volo.Abp.VirtualFileSystem;
using Volo.Docs;
using Volo.Docs.Admin;
using Volo.DocsTestApp.EntityFrameworkCore;
namespace Volo.DocsTestApp
{
[DependsOn(
typeof(DocsWebModule),
typeof(DocsAdminWebModule),
typeof(DocsApplicationModule),
typeof(DocsAdminApplicationModule),
typeof(DocsTestAppEntityFrameworkCoreModule),
typeof(AbpAutofacModule),
typeof(AbpAccountWebModule),
typeof(AbpIdentityWebModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule)
)]
public class DocsTestAppModule : AbpModule
@ -62,6 +73,7 @@ namespace Volo.DocsTestApp
options.FileSets.ReplaceEmbeddedByPyhsical<AbpAspNetCoreMvcUiBasicThemeModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPyhsical<DocsDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Volo.Docs.Domain", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPyhsical<DocsWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Volo.Docs.Web", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPyhsical<DocsWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Volo.Docs.Admin.Web", Path.DirectorySeparatorChar)));
});
}
@ -72,7 +84,6 @@ namespace Volo.DocsTestApp
options.DocInclusionPredicate((docName, description) => true);
});
var cultures = new List<CultureInfo> { new CultureInfo("en"), new CultureInfo("tr") };
Configure<RequestLocalizationOptions>(options =>
{
@ -94,7 +105,7 @@ namespace Volo.DocsTestApp
app.UseDeveloperExceptionPage();
app.UseVirtualFiles();
app.UseSwagger();
app.UseSwaggerUI(options =>
{
@ -115,6 +126,16 @@ namespace Volo.DocsTestApp
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
AsyncHelper.RunSync(async () =>
{
await context.ServiceProvider
.GetRequiredService<IIdentityDataSeeder>()
.SeedAsync(
"1q2w3E*",
IdentityPermissions.GetAll().Union(DocsAdminPermissions.GetAll())
);
});
}
}
}

@ -0,0 +1,4 @@
@page
@model Volo.DocsTestApp.Pages.IndexModel
<h3>Welcome to the Docs demo application.</h3>
<a href="/Documents/">Go to Docs</a>

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Volo.DocsTestApp.Pages
{
public class IndexModel : PageModel
{
public void OnGet()
{
}
}
}

@ -1,4 +1,6 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Docs.Web
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling
@addTagHelper *, Volo.Docs.Web
@addTagHelper *, Volo.Docs.Admin.Web

@ -18,10 +18,15 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Volo.Docs.Application\Volo.Docs.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Docs.Admin.Application\Volo.Docs.Admin.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Docs.Web\Volo.Docs.Web.csproj" />
<ProjectReference Include="..\..\src\Volo.Docs.Admin.Web\Volo.Docs.Admin.Web.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" />
<ProjectReference Include="..\Volo.DocsTestApp.EntityFrameworkCore\Volo.DocsTestApp.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Application\Volo.Abp.Identity.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Web\Volo.Abp.Identity.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\account\src\Volo.Abp.Account.Web\Volo.Abp.Account.Web.csproj" />
</ItemGroup>
</Project>

@ -9,6 +9,16 @@
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="Volo\Docs\Admin\Localization\Resources\Docs\ApplicationContracts\en.json" />
<None Remove="Volo\Docs\Admin\Localization\Resources\Docs\ApplicationContracts\tr.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Volo\Docs\Admin\Localization\Resources\Docs\ApplicationContracts\en.json" />
<EmbeddedResource Include="Volo\Docs\Admin\Localization\Resources\Docs\ApplicationContracts\tr.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Docs.Domain.Shared\Volo.Docs.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj" />

@ -1,5 +1,9 @@
using Volo.Abp.Application;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
using Volo.Docs.Localization;
namespace Volo.Docs.Admin
{
@ -9,6 +13,24 @@ namespace Volo.Docs.Admin
)]
public class DocsAdminApplicationContractsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<PermissionOptions>(options =>
{
options.DefinitionProviders.Add<DocsAdminPermissionDefinitionProvider>();
});
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<DocsAdminApplicationContractsModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<DocsResource>()
.AddVirtualJson("Volo/Docs/Admin/Localization/Resources/Docs/ApplicationContracts");
});
}
}
}

@ -0,0 +1,24 @@
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
using Volo.Docs.Localization;
namespace Volo.Docs.Admin
{
public class DocsAdminPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var group = context.AddGroup(DocsAdminPermissions.GroupName, L("Permission:DocumentManagement"));
var projects = group.AddPermission(DocsAdminPermissions.Projects.Default, L("Permission:Projects"));
projects.AddChild(DocsAdminPermissions.Projects.Update, L("Permission:Edit"));
projects.AddChild(DocsAdminPermissions.Projects.Delete, L("Permission:Delete"));
projects.AddChild(DocsAdminPermissions.Projects.Create, L("Permission:Create"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<DocsResource>(name);
}
}
}

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Volo.Docs.Admin
{
public class DocsAdminPermissions
{
public const string GroupName = "Docs.Admin";
public static class Projects
{
public const string Default = GroupName + ".Projects";
public const string Delete = Default + ".Delete";
public const string Update = Default + ".Update";
public const string Create = Default + ".Create";
}
public static string[] GetAll()
{
return new[]
{
GroupName,
Projects.Default,
Projects.Delete,
Projects.Update,
Projects.Create,
};
}
}
}

@ -0,0 +1,10 @@
{
"culture": "en",
"texts": {
"Permission:DocumentManagement": "Document Management",
"Permission:Projects": "Projects",
"Permission:Edit": "Edit",
"Permission:Delete": "Delete",
"Permission:Create": "Create"
}
}

@ -0,0 +1,10 @@
{
"culture": "tr",
"texts": {
"Permission:DocumentManagement": "Döküman yönetimi",
"Permission:Projects": "Projeler",
"Permission:Edit": "Düzenle",
"Permission:Delete": "Sil",
"Permission:Create": "Oluştur"
}
}

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Guids;
@ -8,6 +9,7 @@ using Volo.Docs.Projects;
namespace Volo.Docs.Admin.Projects
{
[Authorize(DocsAdminPermissions.Projects.Default)]
public class ProjectAdminAppService : ApplicationService, IProjectAdminAppService
{
private readonly IProjectRepository _projectRepository;
@ -22,11 +24,11 @@ namespace Volo.Docs.Admin.Projects
public async Task<PagedResultDto<ProjectDto>> GetListAsync(PagedAndSortedResultRequestDto input)
{
var blogs = await _projectRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount);
var projects = await _projectRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount);
var totalCount = await _projectRepository.GetTotalProjectCount();
var dtos = ObjectMapper.Map<List<Project>, List<ProjectDto>>(blogs);
var dtos = ObjectMapper.Map<List<Project>, List<ProjectDto>>(projects);
return new PagedResultDto<ProjectDto>(totalCount, dtos);
}
@ -38,6 +40,7 @@ namespace Volo.Docs.Admin.Projects
return ObjectMapper.Map<Project, ProjectDto>(project);
}
[Authorize(DocsAdminPermissions.Projects.Create)]
public async Task<ProjectDto> CreateAsync(CreateProjectDto input)
{
var project = new Project(_guidGenerator.Create(),
@ -64,6 +67,7 @@ namespace Volo.Docs.Admin.Projects
return ObjectMapper.Map<Project, ProjectDto>(project);
}
[Authorize(DocsAdminPermissions.Projects.Update)]
public async Task<ProjectDto> UpdateAsync(Guid id, UpdateProjectDto input)
{
var project = await _projectRepository.GetAsync(id);
@ -87,6 +91,7 @@ namespace Volo.Docs.Admin.Projects
return ObjectMapper.Map<Project, ProjectDto>(project);
}
[Authorize(DocsAdminPermissions.Projects.Delete)]
public async Task DeleteAsync(Guid id)
{
await _projectRepository.DeleteAsync(id);

@ -1,50 +0,0 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
namespace Volo.Docs.Admin.Projects
{
[RemoteService]
[Area("docs")]
[ControllerName("Project")]
[Route("api/docs/admin/projects")]
public class DocsAdminProjectController : AbpController, IProjectAdminAppService
{
protected IProjectAdminAppService ProjectAppService { get; }
public DocsAdminProjectController(IProjectAdminAppService projectAppService)
{
ProjectAppService = projectAppService;
}
public Task<PagedResultDto<ProjectDto>> GetListAsync(PagedAndSortedResultRequestDto input)
{
return ProjectAppService.GetListAsync(input);
}
[HttpGet]
[Route("{id}")]
public Task<ProjectDto> GetAsync(Guid id)
{
return ProjectAppService.GetAsync(id);
}
public Task<ProjectDto> CreateAsync(CreateProjectDto input)
{
return ProjectAppService.CreateAsync(input);
}
public Task<ProjectDto> UpdateAsync(Guid id, UpdateProjectDto input)
{
return ProjectAppService.UpdateAsync(id, input);
}
public Task DeleteAsync(Guid id)
{
return ProjectAppService.DeleteAsync(id);
}
}
}

@ -0,0 +1,57 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Docs.Admin.Projects;
namespace Volo.Docs.Admin
{
[RemoteService]
[Area("docs")]
[ControllerName("ProjectsAdmin")]
[Route("api/docs/admin/projects")]
public class ProjectsAdminController : AbpController, IProjectAdminAppService
{
private readonly IProjectAdminAppService _projectAppService;
public ProjectsAdminController(IProjectAdminAppService projectAdminAppService)
{
_projectAppService = projectAdminAppService;
}
[HttpGet]
[Route("")]
public Task<PagedResultDto<ProjectDto>> GetListAsync(PagedAndSortedResultRequestDto input)
{
return _projectAppService.GetListAsync(input);
}
[HttpGet]
[Route("{id}")]
public Task<ProjectDto> GetAsync(Guid id)
{
return _projectAppService.GetAsync(id);
}
[HttpPost]
public Task<ProjectDto> CreateAsync(CreateProjectDto input)
{
return _projectAppService.CreateAsync(input);
}
[HttpPut]
[Route("{id}")]
public Task<ProjectDto> UpdateAsync(Guid id, UpdateProjectDto input)
{
return _projectAppService.UpdateAsync(id, input);
}
[HttpDelete]
public Task DeleteAsync(Guid id)
{
return _projectAppService.DeleteAsync(id);
}
}
}

@ -1,5 +1,7 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Volo.Docs.Admin.Pages.Docs.Admin.Projects;
using Volo.Docs.Admin.Projects;
namespace Volo.Docs.Admin
{
@ -7,7 +9,12 @@ namespace Volo.Docs.Admin
{
public DocsAdminWebAutoMapperProfile()
{
CreateMap<CreateModel.CreateGithubProjectViewModel, CreateProjectDto>().Ignore(x => x.ExtraProperties);
CreateMap<EditModel.EditGithubProjectViewModel, UpdateProjectDto>().Ignore(x => x.ExtraProperties);
CreateMap<ProjectDto, EditModel.EditGithubProjectViewModel > ()
.Ignore(x => x.GitHubAccessToken).Ignore(x => x.GitHubRootUrl);
}
}
}

@ -1,7 +1,11 @@
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AutoMapper;
using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Modularity;
using Volo.Abp.UI;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
using Volo.Docs.Localization;
@ -23,11 +27,26 @@ namespace Volo.Docs.Admin
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<NavigationOptions>(options =>
{
options.MenuContributors.Add(new DocsMenuContributor());
});
Configure<VirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<DocsAdminWebModule>("Volo.Docs.Admin");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<DocsResource>()
.AddBaseTypes(typeof(AbpValidationResource))
.AddBaseTypes(typeof(AbpUiModule))
.AddVirtualJson("/Localization/Resources/Docs/Web");
});
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<DocsAdminWebAutoMapperProfile>(validate: true);

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Volo.Abp.UI.Navigation;
using Volo.Docs.Localization;
namespace Volo.Docs.Admin
{
public class DocsMenuContributor : IMenuContributor
{
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
await ConfigureMainMenu(context);
}
}
private async Task ConfigureMainMenu(MenuConfigurationContext context)
{
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<DocsResource>>();
//if (await authorizationService.IsGrantedAsync(DocsAdminPermissions.GroupName))
{
var rootMenuItem = new ApplicationMenuItem("DocumentManagement", l["Menu:DocumentManagement"], "/Docs/Admin");
if (await authorizationService.IsGrantedAsync(DocsAdminPermissions.Projects.Default))
{
rootMenuItem.AddItem(new ApplicationMenuItem("ProjectManagement", l["Menu:ProjectManagement"], "/Docs/Admin/Projects"));
}
context.Menu.AddItem(rootMenuItem);
}
}
}
}

@ -0,0 +1,25 @@
{
"culture": "en",
"texts": {
"Menu:DocumentManagement": "Documents",
"Menu:ProjectManagement": "Projects",
"CreateANewProject": "Create new project",
"Edit": "Edit",
"Create": "Create",
"Projects": "Projects",
"Name": "Name",
"ShortName": "ShortName",
"DocumentStoreType": "DocumentStoreType",
"Format": "Format",
"DisplayName:Name": "Name",
"DisplayName:ShortName": "Short name",
"DisplayName:Format": "Format",
"DisplayName:DefaultDocumentName": "Default documentName",
"DisplayName:NavigationDocumentName": "Navigation document name",
"DisplayName:MinimumVersion": "Minimum version",
"DisplayName:MainWebsiteUrl": "Main web site url",
"DisplayName:LatestVersionBranchName": "Latest version branch name",
"DisplayName:GitHubRootUrl": "GitHub root url",
"DisplayName:GitHubAccessToken": "GitHub access token"
}
}

@ -0,0 +1,26 @@
{
"culture": "tr",
"texts": {
"Menu:DocumentManagement": "Dökümanlar",
"Menu:ProjectManagement": "Projeler",
"CreateANewProject": "Yeni proje oluştur",
"Edit": "Düzenle",
"Create": "Yeni oluştur",
"Projects": "Projeler",
"Name": "İsim",
"ShortName": "Kısa isim",
"DocumentStoreType": "Döküman saklama tipi",
"Format": "Format",
"Actions": "İşlemler",
"DisplayName:Name": "Adı",
"DisplayName:ShortName": "Kısa adı",
"DisplayName:Format": "Format",
"DisplayName:DefaultDocumentName": "Varsayılan döküman adı",
"DisplayName:NavigationDocumentName": "Navigasyon dökümanı adı",
"DisplayName:MinimumVersion": "Minimum versiyon",
"DisplayName:MainWebsiteUrl": "Ana web site url'i",
"DisplayName:LatestVersionBranchName": "Son versiyon Branch adı",
"DisplayName:GitHubRootUrl": "GitHub kök url'i",
"DisplayName:GitHubAccessToken": "GitHub erişim jetonu"
}
}

@ -0,0 +1,13 @@
using Microsoft.AspNetCore.Mvc.Localization;
using Microsoft.AspNetCore.Mvc.Razor.Internal;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Docs.Localization;
namespace Volo.Docs.Admin.Pages.Docs.Admin
{
public abstract class DocsAdminPage : AbpPage
{
[RazorInject]
public IHtmlLocalizer<DocsResource> L { get; set; }
}
}

@ -0,0 +1,22 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Docs.Admin.Pages.Docs.Admin.Projects
@inherits Volo.Docs.Admin.Pages.Docs.Admin.DocsAdminPage
@model Volo.Docs.Admin.Pages.Docs.Admin.Projects.CreateModel
@{
Layout = null;
}
@if (Model.GithubProject != null)
{
<abp-dynamic-form submit-button="false" abp-model="@Model.GithubProject" asp-page="/Docs/Admin/Projects/Create">
<abp-modal size="@(AbpModalSize.Default)">
<abp-modal-header title="@L["Create"].Value"></abp-modal-header>
<abp-modal-body>
<abp-form-content />
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)">
</abp-modal-footer>
</abp-modal>
</abp-dynamic-form>
}

@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Docs.Admin.Projects;
using Volo.Docs.Projects;
namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
{
public class CreateModel : AbpPageModel
{
[BindProperty]
public CreateGithubProjectViewModel GithubProject { get; set; }
private readonly IProjectAdminAppService _projectAppService;
public List<SelectListItem> FormatTypes { get; set; }
= new List<SelectListItem> {new SelectListItem("markdown", "md")};
public CreateModel(IProjectAdminAppService projectAppService)
{
_projectAppService = projectAppService;
}
public async Task<ActionResult> OnGetAsync(string source)
{
if (source == "GitHub")
{
GithubProject = new CreateGithubProjectViewModel();
return Page();
}
else
{
throw new BusinessException("UnknowDocumentSourceExceptionMessage");
}
}
public async void OnPostAsync()
{
if (GithubProject != null)
{
var dto = GetGithubProjectAsDto();
await _projectAppService.CreateAsync(dto);
}
}
public CreateProjectDto GetGithubProjectAsDto()
{
var dto = ObjectMapper.Map<CreateGithubProjectViewModel, CreateProjectDto>(GithubProject);
dto.ExtraProperties = new Dictionary<string, object>
{
{nameof(GithubProject.GitHubRootUrl), GithubProject.GitHubRootUrl},
{nameof(GithubProject.GitHubAccessToken), GithubProject.GitHubAccessToken}
};
return dto;
}
public abstract class CreateProjectViewModelBase
{
[Required]
[StringLength(ProjectConsts.MaxNameLength)]
public string Name { get; set; }
[Required]
[StringLength(ProjectConsts.MaxShortNameLength)]
public string ShortName { get; set; }
[Required]
[SelectItems(nameof(FormatTypes))]
public string Format { get; set; }
[StringLength(ProjectConsts.MaxDefaultDocumentNameLength)]
public string DefaultDocumentName { get; set; }
[StringLength(ProjectConsts.MaxNavigationDocumentNameLength)]
public string NavigationDocumentName { get; set; }
[StringLength(ProjectConsts.MaxVersionNameLength)]
public string MinimumVersion { get; set; }
public string MainWebsiteUrl { get; set; }
[StringLength(ProjectConsts.MaxLatestVersionBranchNameLength)]
public string LatestVersionBranchName { get; set; }
[HiddenInput]
public string DocumentStoreType { get; set; } = "GitHub";
}
public class CreateGithubProjectViewModel : CreateProjectViewModelBase
{
[DisplayOrder(10001)]
[Required]
[StringLength(256)]
public string GitHubRootUrl { get; set; }
[DisplayOrder(10001)]
[StringLength(512)]
public string GitHubAccessToken { get; set; }
}
}
}

@ -0,0 +1,22 @@
@page
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Docs.Admin.Pages.Docs.Admin.Projects
@inherits Volo.Docs.Admin.Pages.Docs.Admin.DocsAdminPage
@model Volo.Docs.Admin.Pages.Docs.Admin.Projects.EditModel
@{
Layout = null;
}
@if (Model.GithubProject != null)
{
<abp-dynamic-form submit-button="false" abp-model="@Model.GithubProject" asp-page="/Docs/Admin/Projects/Edit">
<abp-modal size="@(AbpModalSize.Default)">
<abp-modal-header title="@L["Edit"].Value"></abp-modal-header>
<abp-modal-body>
<abp-form-content />
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)">
</abp-modal-footer>
</abp-modal>
</abp-dynamic-form>
}

@ -0,0 +1,119 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
using Volo.Docs.Admin.Projects;
using Volo.Docs.Projects;
namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
{
public class EditModel : AbpPageModel
{
[BindProperty]
public EditGithubProjectViewModel GithubProject { get; set; }
private readonly IProjectAdminAppService _projectAppService;
public List<SelectListItem> FormatTypes { get; set; }
= new List<SelectListItem> { new SelectListItem("markdown", "md") };
public EditModel(IProjectAdminAppService projectAppService)
{
_projectAppService = projectAppService;
}
public async Task<ActionResult> OnGetAsync(Guid id)
{
var project = await _projectAppService.GetAsync(id);
if (project.DocumentStoreType == "GitHub")
{
SetGithubProjectFromDto(project);
return Page();
}
else
{
throw new BusinessException("UnknowDocumentSourceExceptionMessage");
}
}
public async void OnPostAsync()
{
if (GithubProject != null)
{
var dto = GetGithubProjectAsDto();
await _projectAppService.UpdateAsync(GithubProject.Id, dto);
}
}
public UpdateProjectDto GetGithubProjectAsDto()
{
var dto = ObjectMapper.Map<EditGithubProjectViewModel, UpdateProjectDto>(GithubProject);
dto.ExtraProperties = new Dictionary<string, object>
{
{nameof(GithubProject.GitHubRootUrl), GithubProject.GitHubRootUrl},
{nameof(GithubProject.GitHubAccessToken), GithubProject.GitHubAccessToken}
};
return dto;
}
public void SetGithubProjectFromDto(ProjectDto dto)
{
GithubProject = ObjectMapper.Map<ProjectDto,EditGithubProjectViewModel>(dto);
GithubProject.GitHubAccessToken = (string) dto.ExtraProperties[nameof(GithubProject.GitHubAccessToken)];
GithubProject.GitHubRootUrl = (string) dto.ExtraProperties[nameof(GithubProject.GitHubRootUrl)];
}
public abstract class EditProjectViewModelBase
{
[Required]
[HiddenInput]
public Guid Id { get; set; }
[Required]
[StringLength(ProjectConsts.MaxNameLength)]
public string Name { get; set; }
[Required]
[SelectItems(nameof(FormatTypes))]
public string Format { get; set; }
[StringLength(ProjectConsts.MaxDefaultDocumentNameLength)]
public string DefaultDocumentName { get; set; }
[StringLength(ProjectConsts.MaxNavigationDocumentNameLength)]
public string NavigationDocumentName { get; set; }
[StringLength(ProjectConsts.MaxVersionNameLength)]
public string MinimumVersion { get; set; }
public string MainWebsiteUrl { get; set; }
[StringLength(ProjectConsts.MaxLatestVersionBranchNameLength)]
public string LatestVersionBranchName { get; set; }
}
public class EditGithubProjectViewModel : EditProjectViewModelBase
{
[DisplayOrder(10001)]
[Required]
[StringLength(256)]
public string GitHubRootUrl { get; set; }
[DisplayOrder(10001)]
[StringLength(512)]
public string GitHubAccessToken { get; set; }
}
}
}

@ -0,0 +1,49 @@
@page
@using Microsoft.AspNetCore.Authorization
@using Volo.Docs.Admin
@inherits Volo.Docs.Admin.Pages.Docs.Admin.DocsAdminPage
@model Volo.Docs.Admin.Pages.Docs.Admin.Projects.IndexModel
@inject IAuthorizationService Authorization
@{
ViewBag.PageTitle = "Projects";
}
@section scripts {
<abp-script src="/Pages/Docs/Admin/Projects/index.js" />
<abp-script src="/Pages/Docs/Admin/Projects/create.js" />
<abp-script src="/Pages/Docs/Admin/Projects/edit.js" />
}
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<h2>@L["Projects"]</h2>
</abp-column>
<abp-column size-md="_6" class="text-right">
@if (await Authorization.IsGrantedAsync(DocsAdminPermissions.Projects.Create))
{
<abp-dropdown>
<abp-dropdown-button button-type="Primary" icon="plus" text="@L["CreateANewProject"].Value"/>
<abp-dropdown-menu align="Right">
<abp-dropdown-item href="#" id="CreateNewGithubProjectButtonId">Github</abp-dropdown-item>
</abp-dropdown-menu>
</abp-dropdown>
}
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="ProjectsTable" class="nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["Name"]</th>
<th>@L["ShortName"]</th>
<th>@L["DocumentStoreType"]</th>
<th>@L["Format"]</th>
</tr>
</thead>
</abp-table>
</abp-card-body>
</abp-card>

@ -0,0 +1,11 @@
using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace Volo.Docs.Admin.Pages.Docs.Admin.Projects
{
public class IndexModel : AbpPageModel
{
public void OnGet()
{
}
}
}

@ -0,0 +1,14 @@
var abp = abp || {};
$(function () {
abp.modals.projectCreate = function () {
var initModal = function (publicApi, args) {
var $form = publicApi.getForm();
};
return {
initModal: initModal
}
};
});

@ -0,0 +1,14 @@
var abp = abp || {};
$(function () {
abp.modals.projectEdit = function () {
var initModal = function (publicApi, args) {
var $form = publicApi.getForm();
};
return {
initModal: initModal
}
};
});

@ -0,0 +1,98 @@
$(function () {
var l = abp.localization.getResource('Docs');
var _createModal = new abp.ModalManager({
viewUrl: abp.appPath + 'Docs/Admin/Projects/Create',
modalClass: 'projectCreate'
});
var _editModal = new abp.ModalManager({
viewUrl: abp.appPath + 'Docs/Admin/Projects/Edit',
modalClass: 'projectEdit'
});
var _dataTable = $('#ProjectsTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
searching: false,
autoWidth: false,
scrollCollapse: true,
order: [[2, "desc"]],
ajax: abp.libs.datatables.createAjax(volo.docs.admin.projectsAdmin.getList),
columnDefs: [
{
rowAction: {
items:
[
{
text: l('Edit'),
visible: function () {
return true; //TODO: Check permission
},
action: function (data) {
_editModal.open({
Id: data.record.id
});
}
},
{
text: l('Delete'),
visible: function () {
return true; //TODO: Check permission
},
confirmMessage: function (data) { return l('ProjectDeletionWarningMessage') },
action: function (data) {
volo.docs.admin.projectsAdmin
.delete(data.record.id)
.then(function () {
_dataTable.ajax.reload();
});
}
}
]
}
},
{
target: 1,
data: "name"
},
{
target: 2,
data: "shortName"
},
{
target: 3,
data: "documentStoreType"
},
{
target: 4,
data: "format",
render: function (data) {
if (data === 'md') {
return 'markdown';
}
return data;
}
}
]
}));
$("#CreateNewGithubProjectButtonId").click(function (event) {
event.preventDefault();
_createModal.open({source:"GitHub"});
});
_createModal.onClose(function () {
_dataTable.ajax.reload();
});
_editModal.onResult(function () {
_dataTable.ajax.reload();
});
});

@ -33,17 +33,17 @@
<ItemGroup>
<Content Remove="wwwroot\**\*.*" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Localization\Resources\**\*.json" />
<Content Remove="Localization\Resources\Docs\Web\en.json" />
<Content Remove="Localization\Resources\Docs\Web\tr.json" />
<Content Remove="Pages\Docs\Admin\Projects\Create.cshtml" />
<Content Remove="Pages\Docs\Admin\Projects\Edit.cshtml" />
<Content Remove="Pages\Docs\Admin\Projects\Index.cshtml" />
<Content Remove="Properties\launchSettings.json" />
<Content Remove="compilerconfig.json" />
<Content Remove="compilerconfig.json.defaults" />
<None Remove="Pages\Documents\Project\bootstrap-toc.js" />
<None Remove="Pages\Documents\Project\index - Copy.css" />
<None Remove="Pages\Documents\Project\index - Copy.min.css" />
<None Remove="Pages\Documents\Project\vs.js" />
<None Remove="Pages\Docs\Admin\Projects\create.js" />
<None Remove="Pages\Docs\Admin\Projects\edit.js" />
<None Remove="Pages\Docs\Admin\Projects\index.js" />
<None Include="compilerconfig.json" />
<None Include="Properties\launchSettings.json" />
</ItemGroup>
@ -52,4 +52,10 @@
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<Compile Update="Pages\Docs\Admin\Projects\Edit.cshtml.cs">
<DependentUpon>Edit.cshtml</DependentUpon>
</Compile>
</ItemGroup>
</Project>

Loading…
Cancel
Save