From 3d9451fd66105c140d9926579d4a1a235e2862c2 Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 19 Apr 2023 19:53:45 +0800 Subject: [PATCH 01/52] Return JSON results for ajax requests. --- .../AbpAspNetCoreMultiTenancyOptions.cs | 69 +++++++++++++++- .../Internal/ResponseContentTypeHelper.cs | 78 +++++++++++++++++++ ...TenancyMiddlewareErrorPageBuilder_Tests.cs | 18 ++++- 3 files changed, 161 insertions(+), 4 deletions(-) create mode 100644 framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Internal/ResponseContentTypeHelper.cs diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs index 5956e4f7d3..b63518cc8e 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/AbpAspNetCoreMultiTenancyOptions.cs @@ -1,14 +1,23 @@ using System; using System.Globalization; using System.Net; +using System.Runtime.ExceptionServices; +using System.Text; using System.Text.Encodings.Web; +using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; +using Microsoft.AspNetCore.Http.Json; +using Microsoft.AspNetCore.Internal; +using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; +using Microsoft.Net.Http.Headers; +using Volo.Abp.Http; +using Volo.Abp.Json; using Volo.Abp.MultiTenancy; namespace Volo.Abp.AspNetCore.MultiTenancy; @@ -58,14 +67,70 @@ public class AbpAspNetCoreMultiTenancyOptions } } + context.Response.Headers.Add("Abp-Tenant-Resolve-Error", exception.Message); if (isCookieAuthentication && context.Request.Method.Equals("Get", StringComparison.OrdinalIgnoreCase) && !context.Request.IsAjax()) { - context.Response.Headers.Add("Abp-Tenant-Resolve-Error", exception.Message); context.Response.Redirect(context.Request.GetEncodedUrl()); } + else if (context.Request.IsAjax()) + { + var error = new RemoteServiceErrorResponse(new RemoteServiceErrorInfo(exception.Message, exception is BusinessException businessException ? businessException.Details : string.Empty)); + + var jsonSerializerOptions = context.RequestServices.GetRequiredService>().Value.SerializerOptions; + + ResponseContentTypeHelper.ResolveContentTypeAndEncoding( + null, + context.Response.ContentType, + (new MediaTypeHeaderValue("application/json") + { + Encoding = Encoding.UTF8 + }.ToString(), Encoding.UTF8), + MediaType.GetEncoding, + out var resolvedContentType, + out var resolvedContentTypeEncoding); + + context.Response.ContentType = resolvedContentType; + context.Response.StatusCode = (int)HttpStatusCode.NotFound; + + var responseStream = context.Response.Body; + if (resolvedContentTypeEncoding.CodePage == Encoding.UTF8.CodePage) + { + try + { + await JsonSerializer.SerializeAsync(responseStream, error, error.GetType(), jsonSerializerOptions, context.RequestAborted); + await responseStream.FlushAsync(context.RequestAborted); + } + catch (OperationCanceledException) when (context.RequestAborted.IsCancellationRequested) { } + } + else + { + var transcodingStream = Encoding.CreateTranscodingStream(context.Response.Body, resolvedContentTypeEncoding, Encoding.UTF8, leaveOpen: true); + ExceptionDispatchInfo exceptionDispatchInfo = null; + try + { + await JsonSerializer.SerializeAsync(transcodingStream, error, error.GetType(), jsonSerializerOptions, context.RequestAborted); + await transcodingStream.FlushAsync(context.RequestAborted); + } + catch (OperationCanceledException) when (context.RequestAborted.IsCancellationRequested) { } + catch (Exception ex) + { + exceptionDispatchInfo = ExceptionDispatchInfo.Capture(ex); + } + finally + { + try + { + await transcodingStream.DisposeAsync(); + } + catch when (exceptionDispatchInfo != null) + { + } + exceptionDispatchInfo?.Throw(); + } + } + } else { - context.Response.Headers.Add("Abp-Tenant-Resolve-Error", exception.Message); context.Response.StatusCode = (int)HttpStatusCode.NotFound; context.Response.ContentType = "text/html"; diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Internal/ResponseContentTypeHelper.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Internal/ResponseContentTypeHelper.cs new file mode 100644 index 0000000000..bff1290835 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/Internal/ResponseContentTypeHelper.cs @@ -0,0 +1,78 @@ +using System; +using System.Net.Mime; +using System.Text; +using Microsoft.AspNetCore.Http; +using Microsoft.Net.Http.Headers; + +namespace Microsoft.AspNetCore.Internal; + +/// +/// https://github.com/dotnet/aspnetcore/blob/release/7.0/src/Shared/ResponseContentTypeHelper.cs +/// +public static class ResponseContentTypeHelper +{ + /// + /// Gets the content type and encoding that need to be used for the response. + /// The priority for selecting the content type is: + /// 1. ContentType property set on the action result + /// 2. property set on + /// 3. Default content type set on the action result + /// + /// + /// The user supplied content type is not modified and is used as is. For example, if user + /// sets the content type to be "text/plain" without any encoding, then the default content type's + /// encoding is used to write the response and the ContentType header is set to be "text/plain" without any + /// "charset" information. + /// + public static void ResolveContentTypeAndEncoding( + string? actionResultContentType, + string? httpResponseContentType, + (string defaultContentType, Encoding defaultEncoding) @default, + Func getEncoding, + out string resolvedContentType, + out Encoding resolvedContentTypeEncoding) + { + var (defaultContentType, defaultContentTypeEncoding) = @default; + + // 1. User sets the ContentType property on the action result + if (actionResultContentType != null) + { + resolvedContentType = actionResultContentType; + var actionResultEncoding = getEncoding(actionResultContentType); + resolvedContentTypeEncoding = actionResultEncoding ?? defaultContentTypeEncoding; + return; + } + + // 2. User sets the ContentType property on the http response directly + if (!string.IsNullOrEmpty(httpResponseContentType)) + { + var mediaTypeEncoding = getEncoding(httpResponseContentType); + if (mediaTypeEncoding != null) + { + resolvedContentType = httpResponseContentType; + resolvedContentTypeEncoding = mediaTypeEncoding; + } + else + { + resolvedContentType = httpResponseContentType; + resolvedContentTypeEncoding = defaultContentTypeEncoding; + } + + return; + } + + // 3. Fall-back to the default content type + resolvedContentType = defaultContentType; + resolvedContentTypeEncoding = defaultContentTypeEncoding; + } + + public static Encoding GetEncoding(string mediaType) + { + if (MediaTypeHeaderValue.TryParse(mediaType, out var parsed)) + { + return parsed.Encoding; + } + + return default; + } +} diff --git a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests.cs b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests.cs index 8932745f29..2d2de48992 100644 --- a/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.MultiTenancy.Tests/Volo/Abp/AspNetCore/MultiTenancy/AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests.cs @@ -1,9 +1,10 @@ -using System.Collections.Generic; -using System.Net; +using System.Net; +using System.Text.Json; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Shouldly; +using Volo.Abp.Http; using Xunit; namespace Volo.Abp.AspNetCore.MultiTenancy; @@ -23,4 +24,17 @@ public class AspNetCoreMultiTenancy_MultiTenancyMiddlewareErrorPageBuilder_Tests var result = await GetResponseAsStringAsync($"http://abp.io?{_options.TenantKey}=", HttpStatusCode.NotFound); result.ShouldNotContain(""); } + + [Fact] + public async Task MultiTenancyMiddlewareErrorPageBuilder_Ajax_Test() + { + using (var response = await GetResponseAsync($"http://abp.io?{_options.TenantKey}=abpio", HttpStatusCode.NotFound, xmlHttpRequest: true)) + { + var result = await response.Content.ReadAsStringAsync(); + var error = JsonSerializer.Deserialize(result, new JsonSerializerOptions {PropertyNamingPolicy = JsonNamingPolicy.CamelCase}); + error.Error.ShouldNotBeNull(); + error.Error.Message.ShouldBe("Tenant not found!"); + error.Error.Details.ShouldBe("There is no tenant with the tenant id or name: abpio"); + } + } } From e025a3b1dc6127b7696981ed6bfc39edfcaa6092 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Thu, 4 May 2023 12:09:08 +0300 Subject: [PATCH 02/52] fix IRemoteStreamContent issue on generate service --- .../packages/schematics/src/constants/volo.ts | 5 ++++- .../schematics/src/enums/binding-source-id.ts | 1 + .../packages/schematics/src/models/method.ts | 3 ++- .../packages/schematics/src/utils/service.ts | 16 +++++++++++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/constants/volo.ts b/npm/ng-packs/packages/schematics/src/constants/volo.ts index d45a4b9e72..f42f4ed196 100644 --- a/npm/ng-packs/packages/schematics/src/constants/volo.ts +++ b/npm/ng-packs/packages/schematics/src/constants/volo.ts @@ -1,2 +1,5 @@ export const VOLO_REGEX = /^Volo\.Abp\.(Application\.Dtos|ObjectExtending)/; -export const VOLO_REMOTE_STREAM_CONTENT = 'Volo.Abp.Content.IRemoteStreamContent' +export const VOLO_REMOTE_STREAM_CONTENT = [ + 'Volo.Abp.Content.IRemoteStreamContent', + 'Volo.Abp.Content.RemoteStreamContent', +]; diff --git a/npm/ng-packs/packages/schematics/src/enums/binding-source-id.ts b/npm/ng-packs/packages/schematics/src/enums/binding-source-id.ts index 1e4e65c5f5..308b8dfc32 100644 --- a/npm/ng-packs/packages/schematics/src/enums/binding-source-id.ts +++ b/npm/ng-packs/packages/schematics/src/enums/binding-source-id.ts @@ -3,4 +3,5 @@ export enum eBindingSourceId { Model = 'ModelBinding', Path = 'Path', Query = 'Query', + FormFile = 'FormFile', } diff --git a/npm/ng-packs/packages/schematics/src/models/method.ts b/npm/ng-packs/packages/schematics/src/models/method.ts index 6e86853ec0..043df6d458 100644 --- a/npm/ng-packs/packages/schematics/src/models/method.ts +++ b/npm/ng-packs/packages/schematics/src/models/method.ts @@ -59,6 +59,7 @@ export class Body { case eBindingSourceId.Query: this.params.push(paramName === value ? value : `${getParamName(paramName)}: ${value}`); break; + case eBindingSourceId.FormFile: case eBindingSourceId.Body: this.body = value; break; @@ -78,7 +79,7 @@ export class Body { } isBlobMethod() { - return this.responseTypeWithNamespace === VOLO_REMOTE_STREAM_CONTENT; + return VOLO_REMOTE_STREAM_CONTENT.some(x => x === this.responseTypeWithNamespace); } private setUrlQuotes() { diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 0b633a8dd5..22e17233a6 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -55,9 +55,12 @@ export function createControllerToServiceMapper({ function getTypesWithoutIRemoteStreamContent(types: Record) { const newType = { ...types }; - delete newType[VOLO_REMOTE_STREAM_CONTENT]; + VOLO_REMOTE_STREAM_CONTENT.forEach(fileType => { + delete newType[fileType]; + }); return newType; } + function sortMethods(methods: Method[]) { methods.sort((a, b) => (a.signature.name > b.signature.name ? 1 : -1)); } @@ -99,7 +102,14 @@ export function createActionToSignatureMapper() { ...action.parametersOnMethod, ...(versionParameter ? [versionParameter] : []), ]; + signature.parameters = parameters.map(p => { + const isFormData = isRemoteStreamContent(p.typeSimple); + if (isFormData) { + const formDataParameter = new Property({ name: p.name, type: 'FormData' }); + formDataParameter.setOptional(false); + return formDataParameter; + } const type = adaptType(p.typeSimple); const parameter = new Property({ name: p.name, type }); parameter.setDefault(p.defaultValue); @@ -112,6 +122,10 @@ export function createActionToSignatureMapper() { }; } +export function isRemoteStreamContent(type: string) { + return VOLO_REMOTE_STREAM_CONTENT.some(x => x === type); +} + function getMethodNameFromAction(action: Action): string { return action.uniqueName.split('Async')[0]; } From 9651fc22d8aed7b38fb1efa4bacf3f459b767307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= <98148844+onurpicakci@users.noreply.github.com> Date: Thu, 4 May 2023 15:20:26 +0300 Subject: [PATCH 03/52] blogging module: member page has been edited and improvements have been made to the shipment detail page --- ...70814_Added_BlogUser_Optionals.Designer.cs | 1489 +++++++++++++++++ ...20230504070814_Added_BlogUser_Optionals.cs | 226 +++ .../BloggingTestAppDbContextModelSnapshot.cs | 162 +- .../CustomIdentityBlogUserUpdateDto.cs | 38 + .../Blogging/Members/IMemberAppService.cs | 2 + .../Volo/Blogging/Posts/BlogUserDto.cs | 18 + .../Volo/Blogging/Members/MemberAppService.cs | 17 + .../Blogging/Localization/Resources/en.json | 13 +- .../Volo/Blogging/Users/UserConsts.cs | 22 + .../Volo/Blogging/Users/BlogUser.cs | 22 + ...BloggingDbContextModelBuilderExtensions.cs | 10 +- .../MembersClientProxy.Generated.cs | 8 + .../Pages/Blogs/Posts/Detail.cshtml | 53 + .../Pages/Blogs/Posts/Detail.cshtml.cs | 3 + .../Pages/Members/Index.cshtml | 106 +- .../Pages/Members/Index.cshtml.cs | 11 + 16 files changed, 2192 insertions(+), 8 deletions(-) create mode 100644 modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20230504070814_Added_BlogUser_Optionals.Designer.cs create mode 100644 modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20230504070814_Added_BlogUser_Optionals.cs create mode 100644 modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/CustomIdentityBlogUserUpdateDto.cs create mode 100644 modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Users/UserConsts.cs diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20230504070814_Added_BlogUser_Optionals.Designer.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20230504070814_Added_BlogUser_Optionals.Designer.cs new file mode 100644 index 0000000000..6386b0eb88 --- /dev/null +++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20230504070814_Added_BlogUser_Optionals.Designer.cs @@ -0,0 +1,1489 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Volo.BloggingTestApp.EntityFrameworkCore; + +#nullable disable + +namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(BloggingTestAppDbContext))] + [Migration("20230504070814_Added_BlogUser_Optionals")] + partial class AddedBlogUserOptionals + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "7.0.1") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContainerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("varbinary(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ContainerId"); + + b.HasIndex("TenantId", "ContainerId", "Name"); + + b.ToTable("AbpBlobs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpBlobContainers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetimeoffset"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("bit"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartTime") + .HasColumnType("datetime2"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[TenantId] IS NOT NULL"); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)") + .HasColumnName("Description"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Name"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)") + .HasColumnName("ShortName"); + + b.HasKey("Id"); + + b.ToTable("BlgBlogs", (string)null); + }); + + modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier") + .HasColumnName("PostId"); + + b.Property("RepliedCommentId") + .HasColumnType("uniqueidentifier") + .HasColumnName("RepliedCommentId"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)") + .HasColumnName("Text"); + + b.HasKey("Id"); + + b.HasIndex("PostId"); + + b.HasIndex("RepliedCommentId"); + + b.ToTable("BlgComments", (string)null); + }); + + modelBuilder.Entity("Volo.Blogging.Posts.Post", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BlogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("BlogId"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .HasMaxLength(1048576) + .HasColumnType("nvarchar(max)") + .HasColumnName("Content"); + + b.Property("CoverImage") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("CoverImage"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasColumnName("Description"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ReadCount") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("Title"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Url"); + + b.HasKey("Id"); + + b.HasIndex("BlogId"); + + b.ToTable("BlgPosts", (string)null); + }); + + modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => + { + b.Property("PostId") + .HasColumnType("uniqueidentifier") + .HasColumnName("PostId"); + + b.Property("TagId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TagId"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.HasKey("PostId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("BlgPostTags", (string)null); + }); + + modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BlogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("Description"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("UsageCount") + .HasColumnType("int") + .HasColumnName("UsageCount"); + + b.HasKey("Id"); + + b.ToTable("BlgTags", (string)null); + }); + + modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Biography") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasColumnName("Biography"); + + b.Property("Company") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("Company"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Github") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Github"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + b.Property("JobTitle") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)") + .HasColumnName("JobTitle"); + + b.Property("Linkedin") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Linkedin"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Twitter") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Twitter"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.Property("WebSite") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("WebSite"); + + b.HasKey("Id"); + + b.ToTable("BlgUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => + { + b.HasOne("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", null) + .WithMany() + .HasForeignKey("ContainerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Blogging.Comments.Comment", b => + { + b.HasOne("Volo.Blogging.Posts.Post", null) + .WithMany() + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Blogging.Comments.Comment", null) + .WithMany() + .HasForeignKey("RepliedCommentId"); + }); + + modelBuilder.Entity("Volo.Blogging.Posts.Post", b => + { + b.HasOne("Volo.Blogging.Blogs.Blog", null) + .WithMany() + .HasForeignKey("BlogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b => + { + b.HasOne("Volo.Blogging.Posts.Post", null) + .WithMany("Tags") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Blogging.Tagging.Tag", null) + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Blogging.Posts.Post", b => + { + b.Navigation("Tags"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20230504070814_Added_BlogUser_Optionals.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20230504070814_Added_BlogUser_Optionals.cs new file mode 100644 index 0000000000..f84cefc9f8 --- /dev/null +++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/20230504070814_Added_BlogUser_Optionals.cs @@ -0,0 +1,226 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations +{ + /// + public partial class AddedBlogUserOptionals : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Biography", + table: "BlgUsers", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: true); + + migrationBuilder.AddColumn( + name: "Company", + table: "BlgUsers", + type: "nvarchar(128)", + maxLength: 128, + nullable: true); + + migrationBuilder.AddColumn( + name: "Github", + table: "BlgUsers", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "JobTitle", + table: "BlgUsers", + type: "nvarchar(32)", + maxLength: 32, + nullable: true); + + migrationBuilder.AddColumn( + name: "Linkedin", + table: "BlgUsers", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "Twitter", + table: "BlgUsers", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "WebSite", + table: "BlgUsers", + type: "nvarchar(256)", + maxLength: 256, + nullable: true); + + migrationBuilder.AddColumn( + name: "EntityVersion", + table: "AbpUsers", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "LastPasswordChangeTime", + table: "AbpUsers", + type: "datetimeoffset", + nullable: true); + + migrationBuilder.AddColumn( + name: "ShouldChangePasswordOnNextLogin", + table: "AbpUsers", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "EntityVersion", + table: "AbpRoles", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "EntityVersion", + table: "AbpOrganizationUnits", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateTable( + name: "AbpPermissionGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpPermissions", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + IsEnabled = table.Column(type: "bit", nullable: false), + MultiTenancySide = table.Column(type: "tinyint", nullable: false), + Providers = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + StateCheckers = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpPermissions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AbpUserDelegations", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + SourceUserId = table.Column(type: "uniqueidentifier", nullable: false), + TargetUserId = table.Column(type: "uniqueidentifier", nullable: false), + StartTime = table.Column(type: "datetime2", nullable: false), + EndTime = table.Column(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); + } + + /// + 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"); + } + } +} diff --git a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs index 882783d768..b6dc962eaf 100644 --- a/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs +++ b/modules/blogging/app/Volo.BloggingTestApp.EntityFrameworkCore/Migrations/BloggingTestAppDbContextModelSnapshot.cs @@ -19,10 +19,10 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) - .HasAnnotation("ProductVersion", "6.0.0") + .HasAnnotation("ProductVersion", "7.0.1") .HasAnnotation("Relational:MaxIdentifierLength", 128); - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => { @@ -183,6 +183,9 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .HasColumnType("nvarchar(40)") .HasColumnName("ConcurrencyStamp"); + b.Property("EntityVersion") + .HasColumnType("int"); + b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); @@ -369,6 +372,9 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .HasDefaultValue(false) .HasColumnName("EmailConfirmed"); + b.Property("EntityVersion") + .HasColumnType("int"); + b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); @@ -397,6 +403,9 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); + b.Property("LastPasswordChangeTime") + .HasColumnType("datetimeoffset"); + b.Property("LockoutEnabled") .ValueGeneratedOnAdd() .HasColumnType("bit") @@ -445,6 +454,9 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .HasColumnType("nvarchar(256)") .HasColumnName("SecurityStamp"); + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("bit"); + b.Property("Surname") .HasMaxLength(64) .HasColumnType("nvarchar(64)") @@ -507,6 +519,33 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations b.ToTable("AbpUserClaims", (string)null); }); + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartTime") + .HasColumnType("datetime2"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => { b.Property("UserId") @@ -647,6 +686,9 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .HasColumnType("nvarchar(128)") .HasColumnName("DisplayName"); + b.Property("EntityVersion") + .HasColumnType("int"); + b.Property("ExtraProperties") .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); @@ -708,6 +750,59 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations b.ToTable("AbpOrganizationUnitRoles", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => { b.Property("Id") @@ -742,6 +837,34 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations b.ToTable("AbpPermissionGrants", (string)null); }); + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => { b.Property("Id") @@ -1099,6 +1222,16 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("Biography") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)") + .HasColumnName("Biography"); + + b.Property("Company") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("Company"); + b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasMaxLength(40) @@ -1121,10 +1254,25 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); + b.Property("Github") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Github"); + b.Property("IsActive") .HasColumnType("bit") .HasColumnName("IsActive"); + b.Property("JobTitle") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)") + .HasColumnName("JobTitle"); + + b.Property("Linkedin") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Linkedin"); + b.Property("Name") .HasMaxLength(64) .HasColumnType("nvarchar(64)") @@ -1150,12 +1298,22 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); + b.Property("Twitter") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Twitter"); + b.Property("UserName") .IsRequired() .HasMaxLength(256) .HasColumnType("nvarchar(256)") .HasColumnName("UserName"); + b.Property("WebSite") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("WebSite"); + b.HasKey("Id"); b.ToTable("BlgUsers", (string)null); diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/CustomIdentityBlogUserUpdateDto.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/CustomIdentityBlogUserUpdateDto.cs new file mode 100644 index 0000000000..8cd675ec1f --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/CustomIdentityBlogUserUpdateDto.cs @@ -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; } +} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/IMemberAppService.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/IMemberAppService.cs index 5e06d20956..a085d039ac 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/IMemberAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Members/IMemberAppService.cs @@ -7,4 +7,6 @@ namespace Volo.Blogging.Members; public interface IMemberAppService : IApplicationService { Task FindAsync(string username); + + Task UpdateUserProfileAsync(CustomIdentityBlogUserUpdateDto input); } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/BlogUserDto.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/BlogUserDto.cs index eb4f707e34..23e65b9e95 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/BlogUserDto.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/BlogUserDto.cs @@ -8,6 +8,10 @@ namespace Volo.Blogging.Posts { public Guid? TenantId { get; set; } + public string Name { get; set; } + + public string Surname { get; set; } + public string UserName { get; set; } public string Email { get; set; } @@ -17,7 +21,21 @@ namespace Volo.Blogging.Posts public string PhoneNumber { get; set; } public bool PhoneNumberConfirmed { get; set; } + + public string WebSite { get; set; } + + public string Twitter { get; set; } + + public string Github { get; set; } + + public string Linkedin { get; set; } + + public string Company { get; set; } + public string JobTitle { get; set; } + + public string Biography { get; set; } + public Dictionary ExtraProperties { get; set; } } } diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Members/MemberAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Members/MemberAppService.cs index e27c0baefa..afc5eac0b6 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Members/MemberAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Members/MemberAppService.cs @@ -26,4 +26,21 @@ public class MemberAppService : BloggingAppServiceBase, IMemberAppService return ObjectMapper.Map(user); } + + public async Task UpdateUserProfileAsync(CustomIdentityBlogUserUpdateDto input) + { + var user = await _userRepository.GetAsync(CurrentUser.Id.Value); + + user.Name = input.Name; + user.Surname = input.Surname; + user.WebSite = input.WebSite; + user.Twitter = input.Twitter; + user.Github = input.Github; + user.Linkedin = input.Linkedin; + user.Company = input.Company; + user.JobTitle = input.JobTitle; + user.Biography = input.Biography; + + await _userRepository.UpdateAsync(user); + } } \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json index d4bfede795..d9c7595247 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json @@ -61,6 +61,17 @@ "FileUploadInfo": "Drag, drop, or paste a copied image.", "PostDescriptionHint": "* Will be rendered in the article link preview, supports HTML", "ReadMore": "Continue Reading", - "MemberNotPublishedPostYet": "No posts yet!" + "MemberNotPublishedPostYet": "No posts yet!", + "UpdateUserWebSiteInfo": "Example: https://johndoe.com", + "UpdateUserTwitterInfo": "Example: johndoe", + "UpdateUserGithubInfo": "Example: johndoe", + "UpdateUserLinkedinInfo": "Example: https://www.linkedin.com/...", + "UpdateUserCompanyInfo": "Example: Volosoft", + "UpdateUserJobTitleInfo": "Example: Software Developer", + "WebSite": "Web Site", + "UserName": "Username", + "FullURL": "Full URL", + "JobTitle": "Job Title", + "PersonalWebsite": "PERSONAL WEBSITE" } } diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Users/UserConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Users/UserConsts.cs new file mode 100644 index 0000000000..3ad08da0d2 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Users/UserConsts.cs @@ -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 = 64; + + public const int MaxGithubLength = 64; + + public const int MaxLinkedinLength = 64; + + public const int MaxCompanyLength = 128; + + public const int MaxJobTitleLength = 32; +} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Users/BlogUser.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Users/BlogUser.cs index 4b7e5b63e8..c7dfa77650 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Users/BlogUser.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Users/BlogUser.cs @@ -1,4 +1,5 @@ using System; +using JetBrains.Annotations; using Volo.Abp.Domain.Entities; using Volo.Abp.Users; @@ -23,6 +24,27 @@ namespace Volo.Blogging.Users public virtual string PhoneNumber { get; protected set; } public virtual bool PhoneNumberConfirmed { get; protected set; } + + [CanBeNull] + public string WebSite { get; set; } + + [CanBeNull] + public string Twitter { get; set; } + + [CanBeNull] + public string Github { get; set; } + + [CanBeNull] + public string Linkedin { get; set; } + + [CanBeNull] + public string Company { get; set; } + + [CanBeNull] + public string JobTitle { get; set; } + + [CanBeNull] + public string Biography { get; set; } protected BlogUser() { 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 abf96ebcef..5388c4f313 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 @@ -26,8 +26,16 @@ namespace Volo.Blogging.EntityFrameworkCore builder.Entity(b => { b.ToTable(AbpBloggingDbProperties.DbTablePrefix + "Users", AbpBloggingDbProperties.DbSchema); - b.ConfigureByConvention(); + + b.Property(nameof(BlogUser.Biography)).HasMaxLength(UserConsts.MaxBiographyLength).HasColumnName(nameof(BlogUser.Biography)); + b.Property(nameof(BlogUser.WebSite)).HasMaxLength(UserConsts.MaxWebSiteLength).HasColumnName(nameof(BlogUser.WebSite)); + b.Property(nameof(BlogUser.Twitter)).HasMaxLength(UserConsts.MaxTwitterLength).HasColumnName(nameof(BlogUser.Twitter)); + b.Property(nameof(BlogUser.Github)).HasMaxLength(UserConsts.MaxGithubLength).HasColumnName(nameof(BlogUser.Github)); + b.Property(nameof(BlogUser.Linkedin)).HasMaxLength(UserConsts.MaxLinkedinLength).HasColumnName(nameof(BlogUser.Linkedin)); + b.Property(nameof(BlogUser.Company)).HasMaxLength(UserConsts.MaxCompanyLength).HasColumnName(nameof(BlogUser.Company)); + b.Property(nameof(BlogUser.JobTitle)).HasMaxLength(UserConsts.MaxJobTitleLength).HasColumnName(nameof(BlogUser.JobTitle)); + b.ConfigureAbpUser(); b.ApplyObjectExtensionMappings(); diff --git a/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.Generated.cs b/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.Generated.cs index dfabaed346..4a563e79e3 100644 --- a/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.Generated.cs +++ b/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/MembersClientProxy.Generated.cs @@ -25,4 +25,12 @@ public partial class MembersClientProxy : ClientProxyBase, IM { typeof(string), username } }); } + + public Task UpdateUserProfileAsync(CustomIdentityBlogUserUpdateDto input) + { + return RequestAsync(nameof(UpdateUserProfileAsync), new ClientProxyRequestTypeValue + { + { typeof(CustomIdentityBlogUserUpdateDto), input } + }); + } } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml index df6ab306e0..3b249ffff7 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml @@ -1,4 +1,5 @@ @page +@using System.Globalization @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Http.Extensions @using Microsoft.Extensions.Options @@ -11,6 +12,13 @@ @inject IAuthorizationService Authorization @inject IOptionsSnapshot twitterOptions @using Microsoft.AspNetCore.Mvc.Localization +@using Microsoft.AspNetCore.Mvc.TagHelpers +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Blockquote +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers @using Volo.Blogging.Localization @using Volo.Blogging.Pages.Blog @inject IHtmlLocalizer L @@ -355,6 +363,51 @@ { @L["LeaveComment"] } +
+
+

More from @CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.Post.Writer.UserName)

+ @for (var index = 1; index < Model.PostsList.Count && index < 5; index++) + { + var post = Model.PostsList[index]; +
+
+ + + + + + + @L["Blog"].Value.ToUpper() + +
+
+ +

+ + @post.Title + +

+

+ + @post.Description.TruncateWithPostfix(150) + + @L["ReadMore"] +

+
+
+
+ +
+
+
+ } +
+
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs index 0dd95c0769..f902d849f9 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs @@ -40,6 +40,8 @@ namespace Volo.Blogging.Pages.Blog.Posts public BlogDto Blog { get; set; } + public List PostsList { get; set; } + public DetailModel(IPostAppService postAppService, IBlogAppService blogAppService, ICommentAppService commentAppService) { _postAppService = postAppService; @@ -79,6 +81,7 @@ namespace Volo.Blogging.Pages.Blog.Posts { Blog = await _blogAppService.GetByShortNameAsync(BlogShortName); Post = await _postAppService.GetForReadingAsync(new GetPostInput { BlogId = Blog.Id, Url = PostUrl }); + PostsList = await _postAppService.GetListByUserIdAsync(Post.Writer.Id); CommentsWithReplies = await _commentAppService.GetHierarchicalListOfPostAsync(Post.Id); CountComments(); } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml index 62841ae158..58ab94f310 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml @@ -1,7 +1,12 @@ @page +@using System.Globalization @using Microsoft.Extensions.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Utils @using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers @using Volo.Abp.Users +@using Volo.Blogging +@using Volo.Blogging.Areas.Blog.Helpers.TagHelpers @using Volo.Blogging.Localization @model Volo.Blogging.Pages.Members.IndexModel @inject IStringLocalizer L @@ -23,12 +28,69 @@
- @if (Model.User.UserName != null) + @if (Model.User.Name != null && Model.User.Surname != null) { -

@Model.User.UserName

+

@Model.User.Name @Model.User.Surname

} - @L["UserName"].Value.ToUpper() + @if (Model.User.Company != null) + { +

@Model.User.Company

+ } + @if (Model.User.JobTitle != null) + { +

@Model.User.JobTitle

+ } + + @L["UserName"].Value.ToUpper()
@Model.User.UserName
+ + @if (Model.User.WebSite != null) + { + @L["PersonalWebsite"].Value.ToUpper() +
+ @Model.User.WebSite +
+ } + + + @if (Model.User.Twitter != null || Model.User.Github != null || Model.User.Linkedin != null) + { + @L["Social"].Value.ToUpper() +
    + @if (Model.User.Twitter != null) + { +
  • + +
    +
    +
  • + } + @if (Model.User.Github != null) + { +
  • + +
    +
    +
  • + } + @if (Model.User.Linkedin != null) + { +
  • + +
    +
    +
  • + } +
+ } + + @if (Model.User.Biography != null) + { +
+ @L["Biography"].Value.ToUpper() +

@Model.User.Biography

+
+ } @@ -36,7 +98,7 @@ {
- +
@foreach (var post in Model.Posts) { @@ -80,6 +142,42 @@ }
+ @if (CurrentUser.UserName == Model.User.UserName) + { + +
+
+ + + + + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+
+
+
+ }
} diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml.cs index 8018ea23e8..43cd31fd4a 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml.cs @@ -23,6 +23,9 @@ public class IndexModel : AbpPageModel public Dictionary BlogShortNameMap { get; set; } + [BindProperty] + public CustomIdentityBlogUserUpdateDto CustomUserUpdate { get; set; } + public IndexModel(IPostAppService postAppService, IMemberAppService memberAppService, IBlogAppService blogAppService) { _postAppService = postAppService; @@ -51,6 +54,14 @@ public class IndexModel : AbpPageModel return Page(); } + + public async Task OnPostAsync() + { + await _memberAppService.UpdateUserProfileAsync(CustomUserUpdate); + + return Redirect($"/members/{CurrentUser.UserName}"); + } + public string GetBlogPostUrl(PostWithDetailsDto post) { var blogShortName = BlogShortNameMap[post.BlogId]; From 98fa8e06419e7f6bc5468762548908f9b4f20225 Mon Sep 17 00:00:00 2001 From: Mahmut Gundogdu Date: Thu, 4 May 2023 18:05:53 +0300 Subject: [PATCH 04/52] fix IRemoteStreamContent[] issue on generate service --- .../packages/schematics/src/utils/service.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/service.ts b/npm/ng-packs/packages/schematics/src/utils/service.ts index 22e17233a6..b32dd5fba5 100644 --- a/npm/ng-packs/packages/schematics/src/utils/service.ts +++ b/npm/ng-packs/packages/schematics/src/utils/service.ts @@ -104,11 +104,10 @@ export function createActionToSignatureMapper() { ]; signature.parameters = parameters.map(p => { - const isFormData = isRemoteStreamContent(p.typeSimple); - if (isFormData) { - const formDataParameter = new Property({ name: p.name, type: 'FormData' }); - formDataParameter.setOptional(false); - return formDataParameter; + const isFormData = isRemoteStreamContent(p.type); + const isFormArray = isRemoteStreamContentArray(p.type); + if (isFormData || isFormArray) { + return new Property({ name: p.name, type: 'FormData' }); } const type = adaptType(p.typeSimple); const parameter = new Property({ name: p.name, type }); @@ -126,6 +125,10 @@ export function isRemoteStreamContent(type: string) { return VOLO_REMOTE_STREAM_CONTENT.some(x => x === type); } +export function isRemoteStreamContentArray(type: string) { + return VOLO_REMOTE_STREAM_CONTENT.map(x => `${x}[]`).some(x => x === type); +} + function getMethodNameFromAction(action: Action): string { return action.uniqueName.split('Async')[0]; } From d9c3818d6273c334a08c97e2282675aad3b5c353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= <98148844+onurpicakci@users.noreply.github.com> Date: Fri, 5 May 2023 16:10:35 +0300 Subject: [PATCH 05/52] blogging: changes applied to user-interface --- .../Pages/Blogs/Posts/Detail.cshtml | 701 ++++++++++-------- .../Pages/Blogs/Posts/Detail.cshtml.cs | 6 + .../Pages/Blogs/Posts/detail.js | 10 + .../Pages/Blogs/Shared/Styles/blog.css | 6 + .../Volo.Blogging.Web/Pages/Members/Index.css | 5 +- 5 files changed, 417 insertions(+), 311 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml index 3b249ffff7..37780167bb 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml @@ -13,12 +13,6 @@ @inject IOptionsSnapshot twitterOptions @using Microsoft.AspNetCore.Mvc.Localization @using Microsoft.AspNetCore.Mvc.TagHelpers -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Blockquote -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid -@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers @using Volo.Blogging.Localization @using Volo.Blogging.Pages.Blog @inject IHtmlLocalizer L @@ -57,359 +51,446 @@ }
- -
-
-
-
-
-
-

@Model.Post.Title

+ +
+
+
+
+
+
+

@Model.Post.Title

+
+ +
+
+
+ Cover Image +
+
+
+
+
+
+
+ @if (Model.Post.Writer != null) + { + + User Avatar + + } +
+ +
+

Last Blog Posts

+ @for (var index = 0; index < Model.LatestPosts.Count && index < 4; index++) + { + if (Model.LatestPosts[index].Id != Model.Post.Id) + { + var post = Model.LatestPosts[index]; + +
+
-
- Cover Image -
-
-
-
+
+ } + }
+
+
+ +
+
+
+

+ @Html.Raw(BloggingPageHelper.RenderMarkdownToHtml(Model.Post.Content)) +

+
+
+
+ +
+
+ +
+
+@if (Model.Post.Tags.Count > 0) +{ +
+
@L["TagsInThisArticle"]
+ @foreach (var tag in Model.Post.Tags) + { + @tag.Name + } +
+} + +@if (Model.CommentsWithReplies.Count > 0) +{ + + +

@L["CommentWithCount", @Model.CommentCount]

+ @if (hasCommentingPermission) + { + @L["LeaveComment"] + } + else + { + @L["LeaveComment"] + } +
+
-
-
-
-

- @Html.Raw(BloggingPageHelper.RenderMarkdownToHtml(Model.Post.Content)) +

+ @foreach (var commentWithRepliesDto in Model.CommentsWithReplies) + { +
+ User Avatar +
+
+ @(commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName) + @BloggingPageHelper.ConvertDatetimeToTimeAgo(commentWithRepliesDto.Comment.CreationTime) +
+

+ @commentWithRepliesDto.Comment.Text

-
-
-
+
-
-
-
-
- @(L["ShareOn"].Value + " :") - - Twitter - - - Linkedin - - - E-mail - -
- @if (Model.Post.Tags.Count > 0) - { -
-
@L["TagsInThisArticle"]
- @foreach (var tag in Model.Post.Tags) + @if (hasCommentingPermission) { - @tag.Name + + @L["Reply"] + } -
- } - @if (Model.CommentsWithReplies.Count > 0) - { - - -

@L["CommentWithCount", @Model.CommentCount]

- @if (hasCommentingPermission) - { - @L["LeaveComment"] - } - else - { - @L["LeaveComment"] - } -
-
+ @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Delete) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) + { + | + + @L["Delete"] + + } -
- @foreach (var commentWithRepliesDto in Model.CommentsWithReplies) + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) { -
- User Avatar -
-
- @(commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName) - @BloggingPageHelper.ConvertDatetimeToTimeAgo(commentWithRepliesDto.Comment.CreationTime) -
-

- @commentWithRepliesDto.Comment.Text -

-
+ | + + @L["Edit"] + + } +
- @if (hasCommentingPermission) - { - - @L["Reply"] - - } + @if (hasCommentingPermission) + { +
+
+

+ @L["ReplyTo", commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName] - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Delete) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { - | - - @L["Delete"] - - } +

+
+
+ + - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { - | - - @L["Edit"] - - } -
+
+ +
+ + + +
+
+
+ } + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) + { +
+
+
+
+ + +
+ +
+ + + +
+
+
+ } + + @foreach (var reply in commentWithRepliesDto.Replies) + { +
+ User Avatar +
+
+ @(reply.Writer == null ? "" : reply.Writer.UserName) + @BloggingPageHelper.ConvertDatetimeToTimeAgo(reply.CreationTime) +
+

+ @reply.Text +

+
@if (hasCommentingPermission) { -
-
-

- @L["ReplyTo", commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName] - -

-
-
- - - -
- -
- - - -
-
-
+ + @L["Reply"] + } - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Delete) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) { -
-
-
-
- - -
- -
- - - -
-
-
+ | + + @L["Delete"] + } - @foreach (var reply in commentWithRepliesDto.Replies) + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) { -
- User Avatar -
-
- @(reply.Writer == null ? "" : reply.Writer.UserName) - @BloggingPageHelper.ConvertDatetimeToTimeAgo(reply.CreationTime) -
-

- @reply.Text -

-
- - @if (hasCommentingPermission) - { - - @L["Reply"] - - } - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Delete) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { - | - - @L["Delete"] - - } - - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { - | - - @L["Edit"] - - } -
+ | + + @L["Edit"] + + } +
- @if (hasCommentingPermission) - { -
-
-

- @L["ReplyTo", commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName] -

-
-
- - -
- -
- - - -
-
+ @if (hasCommentingPermission) + { +
+
+

+ @L["ReplyTo", commentWithRepliesDto.Comment.Writer == null ? "" : commentWithRepliesDto.Comment.Writer.UserName] +

+
+
+ + +
+
- } - @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) - { -
-
-
- - -
- -
- - - -
-
+ + + +
+
+
+ } + @if (await Authorization.IsGrantedAsync(BloggingPermissions.Comments.Update) || (CurrentUser.Id == commentWithRepliesDto.Comment.CreatorId)) + { +
+
+
+
+ +
+
- } + + +
- } -
-
- } -
- } - - @if (hasCommentingPermission) - { -
-
-

@L["LeaveComment"]

-
-
-
-
- - -
-
- - -
-
-
- } - else - { - @L["LeaveComment"] - } -
-
-

More from @CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.Post.Writer.UserName)

- @for (var index = 1; index < Model.PostsList.Count && index < 5; index++) - { - var post = Model.PostsList[index]; -
-
- - - - - - - @L["Blog"].Value.ToUpper() - -
-
- -

- - @post.Title - -

-

- - @post.Description.TruncateWithPostfix(150) - - @L["ReadMore"] -

-
-
-
- -
+ }
}
+ } +
+} + +@if (hasCommentingPermission) +{ +
+
+

@L["LeaveComment"]

+
+
+
+
+ + +
+ +
+ +
+} +else +{ + @L["LeaveComment"] +} +
+
+

More from @CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.Post.Writer.UserName)

+ @for (var index = 0; index < Model.PostsList.Count && index <= 5; index++) + { + if (Model.PostsList[index].Id != Model.Post.Id) + { + var post = Model.PostsList[index]; +
+
+ + + + + + + @L["Blog"].Value.ToUpper() + +
+
+ +

+ + @post.Title + +

+

+ + @post.Description.TruncateWithPostfix(150) + + @L["ReadMore"] +

+
+
+
+ +
+
+
+ } + + } +
+
+
+
+ +
+
+
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs index f902d849f9..49bef9c549 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs @@ -41,6 +41,11 @@ namespace Volo.Blogging.Pages.Blog.Posts public BlogDto Blog { get; set; } public List PostsList { get; set; } + + public IReadOnlyList LatestPosts { get; set; } + + [BindProperty(SupportsGet = true)] + public string TagName { get; set; } public DetailModel(IPostAppService postAppService, IBlogAppService blogAppService, ICommentAppService commentAppService) { @@ -82,6 +87,7 @@ namespace Volo.Blogging.Pages.Blog.Posts Blog = await _blogAppService.GetByShortNameAsync(BlogShortName); Post = await _postAppService.GetForReadingAsync(new GetPostInput { BlogId = Blog.Id, Url = PostUrl }); PostsList = await _postAppService.GetListByUserIdAsync(Post.Writer.Id); + LatestPosts = (await _postAppService.GetListByBlogIdAndTagNameAsync(Blog.Id, TagName)).Items; CommentsWithReplies = await _commentAppService.GetHierarchicalListOfPostAsync(Post.Id); CountComments(); } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js index 7a0d0da168..b6d1a2d975 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js @@ -15,6 +15,12 @@ pageHeader + ' | ' + blogName + ' | ' + window.location.href ) ); + + $('#FacebookShareLink').attr( + 'href', + 'https://www.facebook.com/sharer/sharer.php?u=' + + encodeURI(window.location.href) + ); $('#LinkedinShareLink').attr( 'href', @@ -43,6 +49,10 @@ encodeURI(pageHeader + ' | ' + blogName) + '&' ); + + $(".copy-link").click(function() { + var copiedLink = $(this); + }); }; $('div .replyForm').hide(); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css index 6aac0e363b..66328cb885 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css @@ -320,3 +320,9 @@ div.vs-blog { text-decoration: none; } div.vs-blog > .form-group { margin: 0 !important; } +.last-post-title{ + font-size: 0.9rem; + font-weight: 550; + text-decoration: none; + color: black; +} diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.css b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.css index 4c5167a694..668e566cba 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.css +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.css @@ -1,3 +1,6 @@ .post-desc { overflow-wrap: break-word; -} \ No newline at end of file +} +a:not(#all-posts-tab,#edit-profile-tab) { + color: unset!important; +} From c0c7890435c76cded2bcb736ab358c9f720c8560 Mon Sep 17 00:00:00 2001 From: Masum ULU Date: Fri, 5 May 2023 17:36:56 +0300 Subject: [PATCH 06/52] bump up TS versions --- npm/ng-packs/package.json | 2 +- npm/ng-packs/packages/schematics/package.json | 2 +- .../schematics/src/utils/angular/latest-versions/package.json | 2 +- npm/ng-packs/scripts/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index eff2999101..fd93b8be9b 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -127,7 +127,7 @@ "tsickle": "^0.39.1", "tslib": "^2.3.0", "tslint": "~6.1.0", - "typescript": "4.8.4", + "typescript": "~4.8.4", "zone.js": "0.11.4" }, "dependencies": {}, diff --git a/npm/ng-packs/packages/schematics/package.json b/npm/ng-packs/packages/schematics/package.json index 1c0c39745a..2f9d5bd56b 100644 --- a/npm/ng-packs/packages/schematics/package.json +++ b/npm/ng-packs/packages/schematics/package.json @@ -15,7 +15,7 @@ "got": "^11.5.2", "jsonc-parser": "^2.3.0", "should-quote": "^1.0.0", - "typescript": "4.8.4" + "typescript": "~4.8.4" }, "devDependencies": { "@schematics/angular": "~14.2.1", diff --git a/npm/ng-packs/packages/schematics/src/utils/angular/latest-versions/package.json b/npm/ng-packs/packages/schematics/src/utils/angular/latest-versions/package.json index c04d111f07..600b1c9fc1 100644 --- a/npm/ng-packs/packages/schematics/src/utils/angular/latest-versions/package.json +++ b/npm/ng-packs/packages/schematics/src/utils/angular/latest-versions/package.json @@ -17,7 +17,7 @@ "rxjs": "~7.5.0", "tslib": "^2.3.0", "ts-node": "~10.9.0", - "typescript": "~4.8.2", + "typescript": "~4.8.4", "zone.js": "~0.12.0" } } diff --git a/npm/ng-packs/scripts/package.json b/npm/ng-packs/scripts/package.json index 92cb001545..c187b58d44 100644 --- a/npm/ng-packs/scripts/package.json +++ b/npm/ng-packs/scripts/package.json @@ -27,6 +27,6 @@ "esm": "^3.2.25", "ts-node": "^10.9.1", "tsconfig-paths": "^3.9.0", - "typescript": "4.7.4" + "typescript": "~4.8.4" } } From afeaa7623aeea5237bcb00f166578e9eac4347a6 Mon Sep 17 00:00:00 2001 From: Masum ULU Date: Fri, 5 May 2023 19:28:22 +0300 Subject: [PATCH 07/52] fix lint error --- npm/ng-packs/packages/schematics/src/utils/methods.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/schematics/src/utils/methods.ts b/npm/ng-packs/packages/schematics/src/utils/methods.ts index 4c2684f1c0..6767adf540 100644 --- a/npm/ng-packs/packages/schematics/src/utils/methods.ts +++ b/npm/ng-packs/packages/schematics/src/utils/methods.ts @@ -1,6 +1,6 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires import { camel } from './text'; +// eslint-disable-next-line @typescript-eslint/no-var-requires const shouldQuote = require('should-quote'); export const getParamName = (paramName: string) => shouldQuote(paramName) ? `["${paramName}"]` : paramName; From 7d61b8e9434e9cf45d7704b0fd5d5c538c82f791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= <98148844+onurpicakci@users.noreply.github.com> Date: Mon, 8 May 2023 11:23:25 +0300 Subject: [PATCH 08/52] cms-kit: detail page edited and member page deficiencies completed --- .../Blogging/Localization/Resources/en.json | 3 ++- .../Pages/Blogs/Posts/Detail.cshtml | 24 ++++++++++------- .../Pages/Blogs/Posts/detail.js | 15 +++++++---- .../Pages/Blogs/Shared/Styles/blog.css | 26 +++++++++++++++++-- .../Pages/Members/Index.cshtml | 6 ++++- .../Volo.Blogging.Web/Pages/Members/Index.js | 12 +++++++++ 6 files changed, 67 insertions(+), 19 deletions(-) create mode 100644 modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json index d9c7595247..989926f760 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/en.json @@ -72,6 +72,7 @@ "UserName": "Username", "FullURL": "Full URL", "JobTitle": "Job Title", - "PersonalWebsite": "PERSONAL WEBSITE" + "PersonalWebsite": "PERSONAL WEBSITE", + "EditProfile": "Edit Profile" } } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml index 37780167bb..790b04ccdf 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml @@ -52,7 +52,7 @@
-
+
@@ -114,9 +114,9 @@ - +
@@ -130,8 +130,8 @@
-
-
+
+
@if (Model.Post.Writer != null) { @@ -159,10 +159,14 @@

@Model.Post.Writer.JobTitle

}
+ @if (CurrentUser.UserName == Model.Post.Writer.UserName) + { + @L["EditProfile"] + }

Last Blog Posts

- @for (var index = 0; index < Model.LatestPosts.Count && index < 4; index++) + @for (var index = 0; index < Model.LatestPosts.Count && index < 5; index++) { if (Model.LatestPosts[index].Id != Model.Post.Id) { @@ -178,12 +182,12 @@ @if (post.Writer != null) { - User Avatar + User Avatar }
-
+
@(post.Writer.UserName) @@ -214,7 +218,7 @@

-
+
@@ -487,7 +491,7 @@ else
-
+
diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js index b6d1a2d975..59a148ef91 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/detail.js @@ -49,12 +49,17 @@ encodeURI(pageHeader + ' | ' + blogName) + '&' ); - - $(".copy-link").click(function() { - var copiedLink = $(this); - }); }; - + + $('#CopyLink').click(function (event) { + event.preventDefault(); + var $temp = $(''); + $('body').append($temp); + $temp.val(window.location.href).select(); + document.execCommand('copy'); + $temp.remove(); + }); + $('div .replyForm').hide(); $('div .editForm').hide(); diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css index 66328cb885..b24425f547 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Styles/blog.css @@ -321,8 +321,30 @@ div.vs-blog { div.vs-blog > .form-group { margin: 0 !important; } .last-post-title{ - font-size: 0.9rem; - font-weight: 550; + font-size: 15px; + line-height: 20px; + font-weight: 700; + letter-spacing: 0px; text-decoration: none; color: black; } +.last-post-image{ + width: 30px; + height: 30px; + border-top-left-radius: 50%; + border-top-right-radius: 50%; + border-bottom-right-radius: 50%; + border-bottom-left-radius: 50%; +} +.last-post-name{ + padding-right: 2px; + max-height: 16px; + padding-top: 0.5em; + padding-right: 0.5em; +} +#CopyLink{ + padding: 0; + border: none; + background: none; +} + diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml index 58ab94f310..d8fba6b491 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml @@ -15,6 +15,10 @@ ViewBag.Title = @Model.User.UserName.ToUpper() + " - " + L["Blogs"].Value; } +@section scripts { + +} + @section styles { } @@ -146,7 +150,7 @@ {
-
+ diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js new file mode 100644 index 0000000000..c20251820f --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js @@ -0,0 +1,12 @@ +$(function () { + debugger + var hash = window.location.hash; + if(hash === '#edit-profile'){ + console.log("asdasdsa") + $('#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 = ''; + } +}); \ No newline at end of file From eaec068e1b60aa5cb25e71e6f8eb6c73fc6f6086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= <98148844+onurpicakci@users.noreply.github.com> Date: Tue, 9 May 2023 13:47:08 +0300 Subject: [PATCH 09/52] refactoring --- .../Pages/Blogs/Posts/Detail.cshtml | 4 +- .../Pages/Members/Index.cshtml | 112 +++++++++--------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml index 790b04ccdf..a03bd22af3 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml @@ -131,7 +131,7 @@
-
+
@if (Model.Post.Writer != null) { @@ -165,7 +165,7 @@ }

-

Last Blog Posts

+

More from Blog

@for (var index = 0; index < Model.LatestPosts.Count && index < 5; index++) { if (Model.LatestPosts[index].Id != Model.Post.Id) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml index d8fba6b491..12ed3cc854 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.cshtml @@ -98,54 +98,63 @@
- @if (Model.Posts is not null && Model.Posts.Any()) - { -
+
- -
- @foreach (var post in Model.Posts) - { -
-
- - - - - - - @L["Blog"].Value.ToUpper() - -
-
- -

- - @post.Title - -

-

- - @post.Description.TruncateWithPostfix(150) - - @L["ReadMore"] -

-
-
-
- -
-
-
- } -
-
+ @if (Model.Posts is not null && Model.Posts.Any()) + { + +
+ @foreach (var post in Model.Posts) + { +
+
+ + + + + + + @L["Blog"].Value.ToUpper() + +
+
+ +

+ + @post.Title + +

+

+ + @post.Description.TruncateWithPostfix(150) + + @L["ReadMore"] +

+
+
+
+ +
+
+
+ } +
+
+ } + else + { +
+
+

@L["MemberNotPublishedPostYet"]

+
+
+ } @if (CurrentUser.UserName == Model.User.UserName) { @@ -184,15 +193,6 @@ }
- } - else - { -
-
-

@L["MemberNotPublishedPostYet"]

-
-
- }
\ No newline at end of file From fa96b44d8f67c6d12f3378a8c07794e9ce5b9108 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 11 May 2023 16:02:07 +0800 Subject: [PATCH 10/52] Refactor `ClaimsPrincipal` handle way of OpenIddict. Resolve #16529 --- .../POST.md | 6 ++++ docs/en/Modules/OpenIddict.md | 12 +++---- .../ExtensionGrants/MyTokenExtensionGrant.cs | 2 +- .../AbpOpenIddictAspNetCoreModule.cs | 4 +-- .../AbpOpenIddictClaimDestinationsManager.cs | 32 ------------------- .../AbpOpenIddictClaimDestinationsOptions.cs | 13 -------- ...nIddictClaimDestinationsProviderContext.cs | 20 ------------ ...IAbpOpenIddictClaimDestinationsProvider.cs | 8 ----- ...efaultOpenIddictClaimsPrincipalHandler.cs} | 6 ++-- ...OpenIddictClaimsPrincipalHandlerContext.cs | 21 ++++++++++++ .../AbpOpenIddictClaimsPrincipalManager.cs | 32 +++++++++++++++++++ .../AbpOpenIddictClaimsPrincipalOptions.cs | 13 ++++++++ .../IAbpOpenIddictClaimsPrincipalHandler.cs | 8 +++++ .../AbpOpenIdDictControllerBase.cs | 7 +--- .../Controllers/AuthorizeController.cs | 4 +-- .../TokenController.AuthorizationCode.cs | 2 +- .../Controllers/TokenController.DeviceCode.cs | 2 +- .../Controllers/TokenController.Password.cs | 2 +- .../TokenController.RefreshToken.cs | 2 +- 19 files changed, 99 insertions(+), 97 deletions(-) delete mode 100644 modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsManager.cs delete mode 100644 modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsOptions.cs delete mode 100644 modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsProviderContext.cs delete mode 100644 modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/IAbpOpenIddictClaimDestinationsProvider.cs rename modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/{ClaimDestinations/AbpDefaultOpenIddictClaimDestinationsProvider.cs => Claims/AbpDefaultOpenIddictClaimsPrincipalHandler.cs} (91%) create mode 100644 modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalHandlerContext.cs create mode 100644 modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalManager.cs create mode 100644 modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalOptions.cs create mode 100644 modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/IAbpOpenIddictClaimsPrincipalHandler.cs diff --git a/docs/en/Community-Articles/2022-11-14-How-to-add-a-custom-grant-type-in-OpenIddict/POST.md b/docs/en/Community-Articles/2022-11-14-How-to-add-a-custom-grant-type-in-OpenIddict/POST.md index 73a0d7589c..0401c31898 100644 --- a/docs/en/Community-Articles/2022-11-14-How-to-add-a-custom-grant-type-in-OpenIddict/POST.md +++ b/docs/en/Community-Articles/2022-11-14-How-to-add-a-custom-grant-type-in-OpenIddict/POST.md @@ -71,7 +71,13 @@ public class MyTokenExtensionGrant : ITokenExtensionGrant var claimsPrincipal = await userClaimsPrincipalFactory.CreateAsync(user); claimsPrincipal.SetScopes(principal.GetScopes()); claimsPrincipal.SetResources(await GetResourcesAsync(context, principal.GetScopes())); + + //abp version < 7.3 await context.HttpContext.RequestServices.GetRequiredService().SetAsync(principal); + + //For abp version >= 7.3 + await context.HttpContext.RequestServices.GetRequiredService().HandleAsync(context.Request, principal); + return new SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, claimsPrincipal); } diff --git a/docs/en/Modules/OpenIddict.md b/docs/en/Modules/OpenIddict.md index 74598ab1f8..db13d4b452 100644 --- a/docs/en/Modules/OpenIddict.md +++ b/docs/en/Modules/OpenIddict.md @@ -323,16 +323,16 @@ Configure(options => [Claims Principal Factory](https://docs.abp.io/en/abp/latest/Authorization#claims-principal-factory) can be used to add/remove claims to the `ClaimsPrincipal`. -The `AbpDefaultOpenIddictClaimDestinationsProvider` service will add `Name`, `Email,` and `Role` types of Claims to `access_token` and `id_token`, other claims are only added to `access_token` by default, and remove the `SecurityStampClaimType` secret claim of `Identity`. +The `AbpDefaultOpenIddictClaimsPrincipalHandler` service will add `Name`, `Email,` and `Role` types of Claims to `access_token` and `id_token`, other claims are only added to `access_token` by default, and remove the `SecurityStampClaimType` secret claim of `Identity`. -Create a service that inherits from `IAbpOpenIddictClaimDestinationsProvider` and add it to DI to fully control the destinations of claims. +Create a service that inherits from `IAbpOpenIddictClaimsPrincipalHandler` and add it to DI to fully control the destinations of claims. ```cs -public class MyClaimDestinationsProvider : IAbpOpenIddictClaimDestinationsProvider, ITransientDependency +public class MyClaimDestinationsHandler : IAbpOpenIddictClaimsPrincipalHandler, ITransientDependency { - public virtual Task SetDestinationsAsync(AbpOpenIddictClaimDestinationsProviderContext context) + public virtual Task HandleAsync(AbpOpenIddictClaimsPrincipalHandlerContext context) { - foreach (var claim in context.Claims) + foreach (var claim in context.Principal.Claims) { if (claim.Type == MyClaims.MyClaimsType) { @@ -351,7 +351,7 @@ public class MyClaimDestinationsProvider : IAbpOpenIddictClaimDestinationsProvid Configure(options => { - options.ClaimDestinationsProvider.Add(); + options.ClaimsPrincipalHandlers.Add(); }); ``` diff --git a/modules/openiddict/app/OpenIddict.Demo.Server/ExtensionGrants/MyTokenExtensionGrant.cs b/modules/openiddict/app/OpenIddict.Demo.Server/ExtensionGrants/MyTokenExtensionGrant.cs index 62e4cba0b3..b5167621ef 100644 --- a/modules/openiddict/app/OpenIddict.Demo.Server/ExtensionGrants/MyTokenExtensionGrant.cs +++ b/modules/openiddict/app/OpenIddict.Demo.Server/ExtensionGrants/MyTokenExtensionGrant.cs @@ -78,7 +78,7 @@ public class MyTokenExtensionGrant : ITokenExtensionGrant var claimsPrincipal = await userClaimsPrincipalFactory.CreateAsync(user); claimsPrincipal.SetScopes(principal.GetScopes()); claimsPrincipal.SetResources(await GetResourcesAsync(context, principal.GetScopes())); - await context.HttpContext.RequestServices.GetRequiredService().SetAsync(principal); + await context.HttpContext.RequestServices.GetRequiredService().HandleAsync(context.Request, principal); return new SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, claimsPrincipal); } diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/AbpOpenIddictAspNetCoreModule.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/AbpOpenIddictAspNetCoreModule.cs index 3ee5dbf126..23f41900b5 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/AbpOpenIddictAspNetCoreModule.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/AbpOpenIddictAspNetCoreModule.cs @@ -22,9 +22,9 @@ public class AbpOpenIddictAspNetCoreModule : AbpModule { AddOpenIddictServer(context.Services); - Configure(options => + Configure(options => { - options.ClaimDestinationsProvider.Add(); + options.ClaimsPrincipalHandlers.Add(); }); Configure(options => diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsManager.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsManager.cs deleted file mode 100644 index 2974f8ba1d..0000000000 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsManager.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using Volo.Abp.DependencyInjection; - -namespace Volo.Abp.OpenIddict; - -public class AbpOpenIddictClaimDestinationsManager : ISingletonDependency -{ - protected IServiceScopeFactory ServiceScopeFactory { get; } - protected IOptions Options { get; } - - public AbpOpenIddictClaimDestinationsManager(IServiceScopeFactory serviceScopeFactory, IOptions options) - { - ServiceScopeFactory = serviceScopeFactory; - Options = options; - } - - public virtual async Task SetAsync(ClaimsPrincipal principal) - { - using (var scope = ServiceScopeFactory.CreateScope()) - { - foreach (var providerType in Options.Value.ClaimDestinationsProvider) - { - var provider = (IAbpOpenIddictClaimDestinationsProvider)scope.ServiceProvider.GetRequiredService(providerType); - await provider.SetDestinationsAsync(new AbpOpenIddictClaimDestinationsProviderContext(scope.ServiceProvider, principal, principal.Claims.ToArray())); - } - } - } -} diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsOptions.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsOptions.cs deleted file mode 100644 index e6094dbc03..0000000000 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp.Collections; - -namespace Volo.Abp.OpenIddict; - -public class AbpOpenIddictClaimDestinationsOptions -{ - public ITypeList ClaimDestinationsProvider { get; } - - public AbpOpenIddictClaimDestinationsOptions() - { - ClaimDestinationsProvider = new TypeList(); - } -} diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsProviderContext.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsProviderContext.cs deleted file mode 100644 index ff5d993e95..0000000000 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpOpenIddictClaimDestinationsProviderContext.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Security.Claims; - -namespace Volo.Abp.OpenIddict; - -public class AbpOpenIddictClaimDestinationsProviderContext -{ - public IServiceProvider ScopeServiceProvider { get; } - - public ClaimsPrincipal Principal{ get;} - - public Claim[] Claims { get; } - - public AbpOpenIddictClaimDestinationsProviderContext(IServiceProvider scopeServiceProvider, ClaimsPrincipal principal, Claim[] claims) - { - ScopeServiceProvider = scopeServiceProvider; - Principal = principal; - Claims = claims; - } -} diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/IAbpOpenIddictClaimDestinationsProvider.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/IAbpOpenIddictClaimDestinationsProvider.cs deleted file mode 100644 index e499545163..0000000000 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/IAbpOpenIddictClaimDestinationsProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System.Threading.Tasks; - -namespace Volo.Abp.OpenIddict; - -public interface IAbpOpenIddictClaimDestinationsProvider -{ - Task SetDestinationsAsync(AbpOpenIddictClaimDestinationsProviderContext context); -} diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpDefaultOpenIddictClaimDestinationsProvider.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpDefaultOpenIddictClaimsPrincipalHandler.cs similarity index 91% rename from modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpDefaultOpenIddictClaimDestinationsProvider.cs rename to modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpDefaultOpenIddictClaimsPrincipalHandler.cs index b200dfc4a4..7a5b3d2835 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/ClaimDestinations/AbpDefaultOpenIddictClaimDestinationsProvider.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpDefaultOpenIddictClaimsPrincipalHandler.cs @@ -9,16 +9,16 @@ using Volo.Abp.Security.Claims; namespace Volo.Abp.OpenIddict; -public class AbpDefaultOpenIddictClaimDestinationsProvider : IAbpOpenIddictClaimDestinationsProvider, ITransientDependency +public class AbpDefaultOpenIddictClaimsPrincipalHandler : IAbpOpenIddictClaimsPrincipalHandler, ITransientDependency { - public virtual Task SetDestinationsAsync(AbpOpenIddictClaimDestinationsProviderContext context) + public virtual Task HandleAsync(AbpOpenIddictClaimsPrincipalHandlerContext context) { var securityStampClaimType = context .ScopeServiceProvider .GetRequiredService>().Value .ClaimsIdentity.SecurityStampClaimType; - foreach (var claim in context.Claims) + foreach (var claim in context.Principal.Claims) { if (claim.Type == AbpClaimTypes.TenantId) { diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalHandlerContext.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalHandlerContext.cs new file mode 100644 index 0000000000..314f3a63ed --- /dev/null +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalHandlerContext.cs @@ -0,0 +1,21 @@ +using System; +using System.Security.Claims; +using OpenIddict.Abstractions; + +namespace Volo.Abp.OpenIddict; + +public class AbpOpenIddictClaimsPrincipalHandlerContext +{ + public IServiceProvider ScopeServiceProvider { get; } + + public OpenIddictRequest OpenIddictRequest { get; } + + public ClaimsPrincipal Principal { get;} + + public AbpOpenIddictClaimsPrincipalHandlerContext(IServiceProvider scopeServiceProvider, OpenIddictRequest openIddictRequest, ClaimsPrincipal principal) + { + ScopeServiceProvider = scopeServiceProvider; + OpenIddictRequest = openIddictRequest; + Principal = principal; + } +} diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalManager.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalManager.cs new file mode 100644 index 0000000000..fa72e6c6bd --- /dev/null +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalManager.cs @@ -0,0 +1,32 @@ +using System.Security.Claims; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using OpenIddict.Abstractions; +using Volo.Abp.DependencyInjection; + +namespace Volo.Abp.OpenIddict; + +public class AbpOpenIddictClaimsPrincipalManager : ISingletonDependency +{ + protected IServiceScopeFactory ServiceScopeFactory { get; } + protected IOptions Options { get; } + + public AbpOpenIddictClaimsPrincipalManager(IServiceScopeFactory serviceScopeFactory, IOptions options) + { + ServiceScopeFactory = serviceScopeFactory; + Options = options; + } + + public virtual async Task HandleAsync(OpenIddictRequest openIddictRequest, ClaimsPrincipal principal) + { + using (var scope = ServiceScopeFactory.CreateScope()) + { + foreach (var providerType in Options.Value.ClaimsPrincipalHandlers) + { + var provider = (IAbpOpenIddictClaimsPrincipalHandler)scope.ServiceProvider.GetRequiredService(providerType); + await provider.HandleAsync(new AbpOpenIddictClaimsPrincipalHandlerContext(scope.ServiceProvider, openIddictRequest, principal)); + } + } + } +} diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalOptions.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalOptions.cs new file mode 100644 index 0000000000..b8931f6f41 --- /dev/null +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/AbpOpenIddictClaimsPrincipalOptions.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Collections; + +namespace Volo.Abp.OpenIddict; + +public class AbpOpenIddictClaimsPrincipalOptions +{ + public ITypeList ClaimsPrincipalHandlers { get; } + + public AbpOpenIddictClaimsPrincipalOptions() + { + ClaimsPrincipalHandlers = new TypeList(); + } +} diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/IAbpOpenIddictClaimsPrincipalHandler.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/IAbpOpenIddictClaimsPrincipalHandler.cs new file mode 100644 index 0000000000..3e2752e819 --- /dev/null +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Claims/IAbpOpenIddictClaimsPrincipalHandler.cs @@ -0,0 +1,8 @@ +using System.Threading.Tasks; + +namespace Volo.Abp.OpenIddict; + +public interface IAbpOpenIddictClaimsPrincipalHandler +{ + Task HandleAsync(AbpOpenIddictClaimsPrincipalHandlerContext context); +} diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AbpOpenIdDictControllerBase.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AbpOpenIdDictControllerBase.cs index d1321ad9e1..7e8f6386b9 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AbpOpenIdDictControllerBase.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AbpOpenIdDictControllerBase.cs @@ -25,7 +25,7 @@ public abstract class AbpOpenIdDictControllerBase : AbpController protected IOpenIddictAuthorizationManager AuthorizationManager => LazyServiceProvider.LazyGetRequiredService(); protected IOpenIddictScopeManager ScopeManager => LazyServiceProvider.LazyGetRequiredService(); protected IOpenIddictTokenManager TokenManager => LazyServiceProvider.LazyGetRequiredService(); - protected AbpOpenIddictClaimDestinationsManager OpenIddictClaimDestinationsManager => LazyServiceProvider.LazyGetRequiredService(); + protected AbpOpenIddictClaimsPrincipalManager OpenIddictClaimsPrincipalManager => LazyServiceProvider.LazyGetRequiredService(); protected AbpOpenIdDictControllerBase() { @@ -55,11 +55,6 @@ public abstract class AbpOpenIdDictControllerBase : AbpController return resources; } - protected virtual async Task SetClaimsDestinationsAsync(ClaimsPrincipal principal) - { - await OpenIddictClaimDestinationsManager.SetAsync(principal); - } - protected virtual async Task HasFormValueAsync(string name) { if (Request.HasFormContentType) diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AuthorizeController.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AuthorizeController.cs index ec764ab242..961252aae7 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AuthorizeController.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/AuthorizeController.cs @@ -132,7 +132,7 @@ public class AuthorizeController : AbpOpenIdDictControllerBase principal.SetAuthorizationId(await AuthorizationManager.GetIdAsync(authorization)); - await SetClaimsDestinationsAsync(principal); + await OpenIddictClaimsPrincipalManager.HandleAsync(request, principal); return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); @@ -227,7 +227,7 @@ public class AuthorizeController : AbpOpenIdDictControllerBase principal.SetScopes(request.GetScopes()); principal.SetResources(await GetResourcesAsync(request.GetScopes())); - await SetClaimsDestinationsAsync(principal); + await OpenIddictClaimsPrincipalManager.HandleAsync(request, principal); // Returning a SignInResult will ask OpenIddict to issue the appropriate access/identity tokens. return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.AuthorizationCode.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.AuthorizationCode.cs index 89a00f1a8a..58812f8111 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.AuthorizationCode.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.AuthorizationCode.cs @@ -44,7 +44,7 @@ public partial class TokenController })); } - await SetClaimsDestinationsAsync(principal); + await OpenIddictClaimsPrincipalManager.HandleAsync(request, principal); // Returning a SignInResult will ask OpenIddict to issue the appropriate access/identity tokens. return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.DeviceCode.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.DeviceCode.cs index cbe021854c..a581dbcf7b 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.DeviceCode.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.DeviceCode.cs @@ -44,7 +44,7 @@ public partial class TokenController })); } - await SetClaimsDestinationsAsync(principal); + await OpenIddictClaimsPrincipalManager.HandleAsync(request, principal); // Returning a SignInResult will ask OpenIddict to issue the appropriate access/identity tokens. return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.Password.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.Password.cs index dd9d46b2de..a91745b519 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.Password.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.Password.cs @@ -323,7 +323,7 @@ public partial class TokenController principal.SetScopes(request.GetScopes()); principal.SetResources(await GetResourcesAsync(request.GetScopes())); - await SetClaimsDestinationsAsync(principal); + await OpenIddictClaimsPrincipalManager.HandleAsync(request, principal); await IdentitySecurityLogManager.SaveAsync( new IdentitySecurityLogContext diff --git a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.RefreshToken.cs b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.RefreshToken.cs index c234ddd62e..e13cd3c595 100644 --- a/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.RefreshToken.cs +++ b/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.RefreshToken.cs @@ -44,7 +44,7 @@ public partial class TokenController })); } - await SetClaimsDestinationsAsync(principal); + await OpenIddictClaimsPrincipalManager.HandleAsync(request, principal); // Returning a SignInResult will ask OpenIddict to issue the appropriate access/identity tokens. return SignIn(principal, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); From 5ffc99a1ac6116f1d7c8ab62b6e64f3f144fbee0 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 11 May 2023 16:45:52 +0800 Subject: [PATCH 11/52] Add `Volo.Abp.Ddd.Domain.Shared package`. --- framework/Volo.Abp.sln | 7 +++++ .../FodyWeavers.xml | 3 ++ .../FodyWeavers.xsd | 30 +++++++++++++++++++ .../Volo.Abp.Ddd.Domain.Shared.csproj | 22 ++++++++++++++ .../Abp/Domain/AbpDddDomainSharedModule.cs | 14 +++++++++ .../AbpDistributedEntityEventOptions.cs | 0 .../AutoEntityDistributedEventSelectorList.cs | 0 .../Events/Distributed/EntityCreatedEto.cs | 0 .../Events/Distributed/EntityDeletedEto.cs | 0 .../Entities/Events/Distributed/EntityEto.cs | 0 .../Events/Distributed/EntityUpdatedEto.cs | 0 .../Distributed/EtoMappingDictionary.cs | 1 - .../Distributed/EtoMappingDictionaryItem.cs | 0 ...IAutoEntityDistributedEventSelectorList.cs | 0 .../Entities/Events/Distributed/IEntityEto.cs | 0 .../Events/Distributed/IEntityToEtoMapper.cs | 0 .../Volo.Abp.Ddd.Domain.csproj | 1 + .../Volo/Abp/Domain/AbpDddDomainModule.cs | 3 +- .../Volo.Abp.EventBus.Abstractions.csproj | 2 +- .../AbpEventBusAbstractionsModule.cs | 4 +++ .../Distributed/IDistributedEventBus.cs | 0 .../Abp/EventBus/Distributed/IEventInbox.cs | 0 .../Abp/EventBus/Distributed/IEventOutbox.cs | 0 .../EventBus/Distributed/IInboxProcessor.cs | 0 .../Abp/EventBus/Distributed/IOutboxSender.cs | 0 .../Distributed/ISupportsEventBoxes.cs | 0 .../Abp/EventBus/Distributed/InboxConfig.cs | 0 .../Distributed/InboxConfigDictionary.cs | 0 .../EventBus/Distributed/IncomingEventInfo.cs | 0 .../Abp/EventBus/Distributed/OutboxConfig.cs | 0 .../Distributed/OutboxConfigDictionary.cs | 0 .../EventBus/Distributed/OutgoingEventInfo.cs | 0 .../Volo/Abp/EventBus/IEventBus.cs | 0 .../Abp/EventBus/IEventDataMayHaveTenantId.cs | 0 ...EventDataWithInheritableGenericArgument.cs | 0 .../EventBus/IEventHandlerDisposeWrapper.cs | 0 .../Volo/Abp/EventBus/IEventHandlerFactory.cs | 0 .../Volo/Abp/EventBus/IEventHandlerInvoker.cs | 0 .../Volo/Abp/EventBus/Local/ILocalEventBus.cs | 0 nupkg/common.ps1 | 1 + ...anyName.MyProjectName.Domain.Shared.csproj | 1 + .../MyProjectNameDomainSharedModule.cs | 4 ++- 42 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xml create mode 100644 framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xsd create mode 100644 framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj create mode 100644 framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/AbpDddDomainSharedModule.cs rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs (100%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/AutoEntityDistributedEventSelectorList.cs (100%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/EntityCreatedEto.cs (100%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/EntityDeletedEto.cs (100%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs (100%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/EntityUpdatedEto.cs (100%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs (91%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs (100%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/IAutoEntityDistributedEventSelectorList.cs (100%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/IEntityEto.cs (100%) rename framework/src/{Volo.Abp.Ddd.Domain => Volo.Abp.Ddd.Domain.Shared}/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/IDistributedEventBus.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/IEventInbox.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/IEventOutbox.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/IInboxProcessor.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/IOutboxSender.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/InboxConfig.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/InboxConfigDictionary.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/IncomingEventInfo.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/OutboxConfig.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/OutboxConfigDictionary.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Distributed/OutgoingEventInfo.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/IEventBus.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/IEventDataWithInheritableGenericArgument.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/IEventHandlerDisposeWrapper.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/IEventHandlerFactory.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/IEventHandlerInvoker.cs (100%) rename framework/src/{Volo.Abp.EventBus => Volo.Abp.EventBus.Abstractions}/Volo/Abp/EventBus/Local/ILocalEventBus.cs (100%) diff --git a/framework/Volo.Abp.sln b/framework/Volo.Abp.sln index f98d2dd1a5..1c201237e3 100644 --- a/framework/Volo.Abp.sln +++ b/framework/Volo.Abp.sln @@ -437,6 +437,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Compone EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Ldap.Abstractions", "src\Volo.Abp.Ldap.Abstractions\Volo.Abp.Ldap.Abstractions.csproj", "{0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Ddd.Domain.Shared", "src\Volo.Abp.Ddd.Domain.Shared\Volo.Abp.Ddd.Domain.Shared.csproj", "{0858571B-CE73-4AD6-BD06-EC9F0714D8E9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1303,6 +1305,10 @@ Global {0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71}.Debug|Any CPU.Build.0 = Debug|Any CPU {0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71}.Release|Any CPU.ActiveCfg = Release|Any CPU {0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71}.Release|Any CPU.Build.0 = Release|Any CPU + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1523,6 +1529,7 @@ Global {E9492F9F-47E0-45A6-A51D-9949FEAA8543} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {8764DFAF-D13D-449A-9A5E-5D7F0B2D7FEF} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} {0F80E95C-41E6-4F23-94FF-FC9D0B8D5D71} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} + {0858571B-CE73-4AD6-BD06-EC9F0714D8E9} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xml b/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xml new file mode 100644 index 0000000000..bc5a74a236 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + diff --git a/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xsd b/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 0000000000..3f3946e282 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj new file mode 100644 index 0000000000..489d2cf271 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj @@ -0,0 +1,22 @@ + + + + + + + netstandard2.0;netstandard2.1;net7.0 + Volo.Abp.Ddd.Domain.Shared + Volo.Abp.Ddd.Domain.Shared + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + false + false + false + + + + + + + + + diff --git a/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/AbpDddDomainSharedModule.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/AbpDddDomainSharedModule.cs new file mode 100644 index 0000000000..3276f22310 --- /dev/null +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/AbpDddDomainSharedModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.EventBus.Abstractions; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; + +namespace Volo.Abp.Domain; + +[DependsOn( + typeof(AbpMultiTenancyModule), + typeof(AbpEventBusAbstractionsModule) +)] +public class AbpDddDomainSharedModule : AbpModule +{ + +} diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AbpDistributedEntityEventOptions.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/AutoEntityDistributedEventSelectorList.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AutoEntityDistributedEventSelectorList.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/AutoEntityDistributedEventSelectorList.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/AutoEntityDistributedEventSelectorList.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityCreatedEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityCreatedEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityCreatedEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityCreatedEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityDeletedEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityDeletedEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityDeletedEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityDeletedEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityUpdatedEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityUpdatedEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityUpdatedEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityUpdatedEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs similarity index 91% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs index 18c56bfca7..bb9e362ac2 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs +++ b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using Volo.Abp.EventBus.Distributed; namespace Volo.Abp.Domain.Entities.Events.Distributed; diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IAutoEntityDistributedEventSelectorList.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IAutoEntityDistributedEventSelectorList.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IAutoEntityDistributedEventSelectorList.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IAutoEntityDistributedEventSelectorList.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IEntityEto.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityEto.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IEntityEto.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityEto.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs b/framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs similarity index 100% rename from framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs rename to framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj b/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj index fd80a60544..c15f7c96a8 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj @@ -15,6 +15,7 @@ + diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs index 0b41fef1cf..536e31e51f 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/AbpDddDomainModule.cs @@ -22,7 +22,8 @@ namespace Volo.Abp.Domain; typeof(AbpObjectMappingModule), typeof(AbpExceptionHandlingModule), typeof(AbpSpecificationsModule), - typeof(AbpCachingModule) + typeof(AbpCachingModule), + typeof(AbpDddDomainSharedModule) )] public class AbpDddDomainModule : AbpModule { diff --git a/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj b/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj index 225b9b70ee..b61d8315c1 100644 --- a/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj +++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo.Abp.EventBus.Abstractions.csproj @@ -9,7 +9,7 @@ - + diff --git a/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Abstractions/AbpEventBusAbstractionsModule.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Abstractions/AbpEventBusAbstractionsModule.cs index 85cddf42b8..5d19fa21ba 100644 --- a/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Abstractions/AbpEventBusAbstractionsModule.cs +++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Abstractions/AbpEventBusAbstractionsModule.cs @@ -1,7 +1,11 @@ using Volo.Abp.Modularity; +using Volo.Abp.ObjectExtending; namespace Volo.Abp.EventBus.Abstractions; +[DependsOn( + typeof(AbpObjectExtendingModule) +)] public class AbpEventBusAbstractionsModule : AbpModule { diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IDistributedEventBus.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IDistributedEventBus.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IDistributedEventBus.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IDistributedEventBus.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventInbox.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IEventInbox.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventInbox.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IEventInbox.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventOutbox.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IEventOutbox.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IEventOutbox.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IEventOutbox.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IInboxProcessor.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IInboxProcessor.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IInboxProcessor.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IInboxProcessor.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IOutboxSender.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IOutboxSender.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IOutboxSender.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IOutboxSender.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/ISupportsEventBoxes.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/InboxConfig.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/InboxConfig.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/InboxConfig.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/InboxConfig.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/InboxConfigDictionary.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/InboxConfigDictionary.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/InboxConfigDictionary.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/InboxConfigDictionary.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IncomingEventInfo.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IncomingEventInfo.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/IncomingEventInfo.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/IncomingEventInfo.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxConfig.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutboxConfig.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxConfig.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutboxConfig.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxConfigDictionary.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutboxConfigDictionary.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutboxConfigDictionary.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutboxConfigDictionary.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutgoingEventInfo.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutgoingEventInfo.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/OutgoingEventInfo.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Distributed/OutgoingEventInfo.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventBus.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventBus.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventBus.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventBus.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventDataMayHaveTenantId.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataWithInheritableGenericArgument.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventDataWithInheritableGenericArgument.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventDataWithInheritableGenericArgument.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventDataWithInheritableGenericArgument.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerDisposeWrapper.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerDisposeWrapper.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerDisposeWrapper.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerDisposeWrapper.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerFactory.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerFactory.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerFactory.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerFactory.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerInvoker.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerInvoker.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventHandlerInvoker.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/IEventHandlerInvoker.cs diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/ILocalEventBus.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/ILocalEventBus.cs similarity index 100% rename from framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/ILocalEventBus.cs rename to framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/ILocalEventBus.cs diff --git a/nupkg/common.ps1 b/nupkg/common.ps1 index a9594343db..bf3cf46bad 100644 --- a/nupkg/common.ps1 +++ b/nupkg/common.ps1 @@ -164,6 +164,7 @@ $projects = ( "framework/src/Volo.Abp.Ddd.Application", "framework/src/Volo.Abp.Ddd.Application.Contracts", "framework/src/Volo.Abp.Ddd.Domain", + "framework/src/Volo.Abp.Ddd.Domain.Shared", "framework/src/Volo.Abp.DistributedLocking.Abstractions", "framework/src/Volo.Abp.DistributedLocking", "framework/src/Volo.Abp.DistributedLocking.Dapr", diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj index 6ad1317813..2c65ca90c5 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyCompanyName.MyProjectName.Domain.Shared.csproj @@ -10,6 +10,7 @@ + diff --git a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameDomainSharedModule.cs b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameDomainSharedModule.cs index 26e8c12d42..5c0c1cae56 100644 --- a/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameDomainSharedModule.cs +++ b/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.Domain.Shared/MyProjectNameDomainSharedModule.cs @@ -1,6 +1,7 @@ using Volo.Abp.Modularity; using Volo.Abp.Localization; using MyCompanyName.MyProjectName.Localization; +using Volo.Abp.Domain; using Volo.Abp.Localization.ExceptionHandling; using Volo.Abp.Validation; using Volo.Abp.Validation.Localization; @@ -9,7 +10,8 @@ using Volo.Abp.VirtualFileSystem; namespace MyCompanyName.MyProjectName; [DependsOn( - typeof(AbpValidationModule) + typeof(AbpValidationModule), + typeof(AbpDddDomainSharedModule) )] public class MyProjectNameDomainSharedModule : AbpModule { From 1d47ca092d4368cf0433ee287182885f7e6ed7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= Date: Thu, 11 May 2023 13:02:20 +0300 Subject: [PATCH 12/52] update rn doc --- docs/en/Getting-Started-React-Native.md | 35 ++++++++++++------------ docs/en/images/rn-options.png | Bin 0 -> 25436 bytes 2 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 docs/en/images/rn-options.png diff --git a/docs/en/Getting-Started-React-Native.md b/docs/en/Getting-Started-React-Native.md index df8fb355a5..a62512fb45 100644 --- a/docs/en/Getting-Started-React-Native.md +++ b/docs/en/Getting-Started-React-Native.md @@ -1,11 +1,11 @@ # Getting Started with the React Native -````json +```json //[doc-params] { - "Tiered": ["No", "Yes"] + "Tiered": ["No", "Yes"] } -```` +``` ABP platform provide basic [React Native](https://reactnative.dev/) startup template to develop mobile applications **integrated to your ABP based backends**. @@ -20,7 +20,6 @@ Please follow the steps below to prepare your development environment for React 3. **[Optional] Install VS Code:** [VS Code](https://code.visualstudio.com/) is a free, open-source IDE which works seamlessly with TypeScript. Although you can use any IDE including Visual Studio or Rider, VS Code will most likely deliver the best developer experience when it comes to React Native projects. 4. **Install an Emulator:** React Native applications need an Android emulator or an iOS simulator to run on your OS. See the [Android Studio Emulator](https://docs.expo.io/workflow/android-simulator/) or [iOS Simulator](https://docs.expo.io/workflow/ios-simulator/) on expo.io documentation to learn how to set up an emulator. - ## How to Start a New React Native Project You have multiple options to initiate a new React Native project that works with ABP: @@ -56,6 +55,7 @@ Please do the following: > When you are using OpenIddict, You should remove 'clientSecret' on Environment.js (if exists) and disable "HTTPS-only" settings. (Openiddict has default since Version 6.0) ### How to disable Https-only in Openiddict. + You should add this code on {{ if Tiered == "No" }}`MyProjectNameHttpApiHostModule`{{ else if Tiered == "Yes" }}`MyProjectNameAuthServerModule`{{ end }}. ```csharp @@ -79,26 +79,27 @@ A React Native application running on an Android emulator or a physical phone ** {{ if Tiered == "No"}} ![React Native host project local IP entry](images/rn-host-local-ip.png) -* Open the `appsettings.json` in the `.HttpApi.Host` folder. Replace the `localhost` address on the `SelfUrl` and `Authority` properties with your local IP address. -* Open the `launchSettings.json` in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. +- Open the `appsettings.json` in the `.HttpApi.Host` folder. Replace the `localhost` address on the `SelfUrl` and `Authority` properties with your local IP address. +- Open the `launchSettings.json` in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. {{ else if Tiered == "Yes" }} ![React Native tiered project local IP entry](images/rn-tiered-local-ip.png) -* Open the `appsettings.json` in the `.AuthServer` folder. Replace the `localhost` address on the `SelfUrl` property with your local IP address. -* Open the `launchSettings.json` in the `.AuthServer/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. -* Open the `appsettings.json` in the `.HttpApi.Host` folder. Replace the `localhost` address on the `Authority` property with your local IP address. -* Open the `launchSettings.json` in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. +- Open the `appsettings.json` in the `.AuthServer` folder. Replace the `localhost` address on the `SelfUrl` property with your local IP address. +- Open the `launchSettings.json` in the `.AuthServer/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. +- Open the `appsettings.json` in the `.HttpApi.Host` folder. Replace the `localhost` address on the `Authority` property with your local IP address. +- Open the `launchSettings.json` in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. {{ end }} Run the backend application as described in the [getting started document](Getting-Started.md). > You should turn off the "Https Restriction" if you're using OpenIddict as a central identity management solution. Because the IOS Simulator doesn't support self-signed certificates and OpenIddict is set to only work with HTTPS by default. + ## How to disable the Https-only settings of OpenIddict - Go to MyProjectNameHttpApiHostModule.cs under the host project. Add put these codes under the `PreConfigureServices` function. +Go to MyProjectNameHttpApiHostModule.cs under the host project. Add put these codes under the `PreConfigureServices` function. ```csharp #if DEBUG @@ -109,7 +110,6 @@ Run the backend application as described in the [getting started document](Getti #endif ``` - ## How to Configure & Run the React Native Application 1. Make sure the [database migration is complete](./Getting-Started?UI=NG&DB=EF&Tiered=No#create-the-database) and the [API is up and running](./Getting-Started?UI=NG&DB=EF&Tiered=No#run-the-application). @@ -128,21 +128,20 @@ Run the backend application as described in the [getting started document](Getti {{ end }} -4. Run `yarn start` or `npm start`. Wait Expo CLI to start. Expo CLI opens the management interface on the `http://localhost:19002/` address. +4. Run `yarn start` or `npm start`. Wait Expo CLI to print opitons. > The React Native application was generated with [Expo](https://expo.io/). Expo is a set of tools built around React Native to help you quickly start an app and, while it has many features. -![expo-interface](images/rn-expo-interface.png) +![expo-cli-options](images/rn-options.png) -In the above management interface, you can start the application with an Android emulator, an iOS simulator or a physical phone by the scan the QR code with the [Expo Client](https://expo.io/tools#client). +In the above image, you can start the application with an Android emulator, an iOS simulator or a physical phone by the scan the QR code with the [Expo Client](https://expo.io/tools#client) or choosing the option. ![React Native login screen on iPhone 11](images/rn-login-iphone.png) -Enter **admin** as the username and **1q2w3E*** as the password to login to the application. +Enter **admin** as the username and **1q2w3E\*** as the password to login to the application. The application is up and running. You can continue to develop your application based on this startup template. - ## See Also -* [React Native project structure](./Startup-Templates/Application#react-native) +- [React Native project structure](./Startup-Templates/Application#react-native) diff --git a/docs/en/images/rn-options.png b/docs/en/images/rn-options.png new file mode 100644 index 0000000000000000000000000000000000000000..810dda818354b1011082a377b4a6e19577a94726 GIT binary patch literal 25436 zcmce82UJtrx;4jw6%iFdP_O|?3sOY71wpA&0@76kq}LE?qM)K6pg`zNkS?GgL;^`f zq$NU7ng}5(gh1#C5CTc~ckrBd@4N4RoJC*7`gd25EX$VJ@xzI4wjiBI_lmIR`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h3HLP{>e|@q2>jkgoQ=>HTf2ItFvc zPCtFZQ_+hJ%YH zf>lL?9koAASTM)z)@Z`+g>p0CAM!u#XuFx4l+Q^nl*55y>fO{e+F2njUOJFp1gF{g z%U4!Q%x@C~`5mnXH%uCyDU^@vlqsgN6;lKbi1BHrBMgreraLK?v#Q@{Y~5-zhQ->L z($LYWx9?!LPP!>58CpjUe#jweC#H_(!#sQlDU-?wII=yQJWXhgE@?j? Date: Thu, 11 May 2023 14:34:52 +0300 Subject: [PATCH 13/52] remove unnecessary inputType --- .../src/lib/components/form-input/form-input.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/form-input/form-input.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/form-input/form-input.component.ts index 991383fe5a..8aa68a2047 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/form-input/form-input.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/form-input/form-input.component.ts @@ -36,7 +36,6 @@ export class FormInputComponent extends AbstractNgModelComponent { @Input() label = ''; @Input() labelClass = 'form-label'; @Input() inputPlaceholder = ''; - @Input() inputType = 'text'; @Input() inputStyle: | { [klass: string]: any; From 0967d31a19c1176cf4fdd25926a80de347fe3537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= Date: Thu, 11 May 2023 16:20:40 +0300 Subject: [PATCH 14/52] fix identity package build error --- npm/ng-packs/packages/identity/ng-package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/identity/ng-package.json b/npm/ng-packs/packages/identity/ng-package.json index a0824f39e5..68f95303e4 100644 --- a/npm/ng-packs/packages/identity/ng-package.json +++ b/npm/ng-packs/packages/identity/ng-package.json @@ -6,6 +6,7 @@ }, "allowedNonPeerDependencies": [ "@abp/ng.theme.shared", - "@abp/ng.permission-management" + "@abp/ng.permission-management", + "@abp/ng.components" ] } From 0cb497371c2a5123285425b5709ce51eef2ef48c Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 11 May 2023 22:09:52 +0800 Subject: [PATCH 15/52] Add `LocalEventHandlerOrderAttribute`. Resolve #16361 --- .../Local/LocalEventHandlerOrderAttribute.cs | 17 ++++++ .../Volo/Abp/EventBus/Local/LocalEventBus.cs | 15 ++++- .../Abp/EventBus/Local/EventBus_Order_Test.cs | 56 +++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/LocalEventHandlerOrderAttribute.cs create mode 100644 framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Order_Test.cs diff --git a/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/LocalEventHandlerOrderAttribute.cs b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/LocalEventHandlerOrderAttribute.cs new file mode 100644 index 0000000000..7900885e3e --- /dev/null +++ b/framework/src/Volo.Abp.EventBus.Abstractions/Volo/Abp/EventBus/Local/LocalEventHandlerOrderAttribute.cs @@ -0,0 +1,17 @@ +using System; + +namespace Volo.Abp.EventBus.Local; + +[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] +public class LocalEventHandlerOrderAttribute : Attribute +{ + ///

+ /// Handlers execute in ascending numeric value of the Order property. + /// + public int Order { get; set; } + + public LocalEventHandlerOrderAttribute(int order) + { + Order = order; + } +} diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs index 9570bf80e1..e1edf3b12f 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs @@ -10,6 +10,7 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.DependencyInjection; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; +using Volo.Abp.Reflection; using Volo.Abp.Threading; using Volo.Abp.Uow; @@ -140,9 +141,21 @@ public class LocalEventBus : EventBusBase, ILocalEventBus, ISingletonDependency { var handlerFactoryList = new List(); + var handlerWithTypes = new List>(); foreach (var handlerFactory in HandlerFactories.Where(hf => ShouldTriggerEventForHandler(eventType, hf.Key))) { - handlerFactoryList.Add(new EventTypeWithEventHandlerFactories(handlerFactory.Key, handlerFactory.Value)); + foreach (var factory in handlerFactory.Value) + { + handlerWithTypes.Add(new Tuple( + factory, + handlerFactory.Key, + ReflectionHelper.GetAttributesOfMemberOrDeclaringType(factory.GetHandler().EventHandler.GetType()).FirstOrDefault()?.Order ?? 0)); + } + } + + foreach (var handlerWithType in handlerWithTypes.OrderBy(x => x.Item3)) + { + handlerFactoryList.Add(new EventTypeWithEventHandlerFactories(handlerWithType.Item2, new List{ handlerWithType.Item1 })); } return handlerFactoryList.ToArray(); diff --git a/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Order_Test.cs b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Order_Test.cs new file mode 100644 index 0000000000..3bf8c3a7b6 --- /dev/null +++ b/framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/Local/EventBus_Order_Test.cs @@ -0,0 +1,56 @@ +using System.Threading.Tasks; +using Shouldly; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Entities.Events; +using Xunit; + +namespace Volo.Abp.EventBus.Local; + +public class EventBus_Order_Test : EventBusTestBase +{ + public static string HandlerExecuteOrder { get; set; } + + [Fact] + public async Task Handler_Should_Execute_By_Order() + { + HandlerExecuteOrder = ""; + await LocalEventBus.PublishAsync(new MyOrderEventHandlerEventData()); + HandlerExecuteOrder.ShouldBe("321"); + } + + public class MyOrderEventHandlerEventData + { + + } + + public class MyOrderEventHandler : ILocalEventHandler, ITransientDependency + { + public Task HandleEventAsync(MyOrderEventHandlerEventData eventData) + { + HandlerExecuteOrder += "1"; + return Task.CompletedTask; + } + } + + [LocalEventHandlerOrder(-2)] + public class MyOrderEventHandler2 : ILocalEventHandler, ITransientDependency + { + public Task HandleEventAsync(MyOrderEventHandlerEventData eventData) + { + HandlerExecuteOrder += "2"; + return Task.CompletedTask; + } + } + + [LocalEventHandlerOrder(-3)] + public class MyOrderEventHandler3 : ILocalEventHandler, ITransientDependency + { + public Task HandleEventAsync(MyOrderEventHandlerEventData eventData) + { + HandlerExecuteOrder += "3"; + return Task.CompletedTask; + } + } + +} From 60843a50cdcf5b2951c1ddc7a5df48852e0bde47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= Date: Fri, 12 May 2023 03:05:49 +0300 Subject: [PATCH 16/52] document form input component --- docs/en/UI/Angular/FormInput-Component.md | 43 ++++++++++++++++++++++ docs/en/UI/Angular/images/form-input.png | Bin 0 -> 5896 bytes 2 files changed, 43 insertions(+) create mode 100644 docs/en/UI/Angular/FormInput-Component.md create mode 100644 docs/en/UI/Angular/images/form-input.png diff --git a/docs/en/UI/Angular/FormInput-Component.md b/docs/en/UI/Angular/FormInput-Component.md new file mode 100644 index 0000000000..11b857ddb4 --- /dev/null +++ b/docs/en/UI/Angular/FormInput-Component.md @@ -0,0 +1,43 @@ +# Form Input Component + +The ABP FormInput Component is a reusable form input component for text type. + +It takes `label`, `labelClass` (default form-label), `inputId`,`inputPlaceholder`,`inputReadonly`,`inputClass` (default form-control) and `inputStyle` as input to customize component. Also, it emits `formBlur` and `formFocus` events when component gain or lose focus. + +# Usage + +ABP FormInput component is a part of the `ThemeSharedModule` module. If you've imported that module into your module, you don't need to import it again. If not, first import it as shown below: + +```ts +// my-feature.module.ts + +import { ThemeSharedModule } from "@abp/ng.theme.shared"; +import { FomrInputDemoComponent } from "./FomrInputDemoComponent.component"; + +@NgModule({ + imports: [ + ThemeSharedModule, + // ... + ], + declarations: [FomrInputDemoComponent], + // ... +}) +export class MyFeatureModule {} +``` + +Then, the `abp-form-input` component can be used. See the example below: + +```html +
+
+ +
+
+``` + +See the form input result below: + +![abp-form-input](./images/form-input.png) diff --git a/docs/en/UI/Angular/images/form-input.png b/docs/en/UI/Angular/images/form-input.png new file mode 100644 index 0000000000000000000000000000000000000000..73c9cfd74ccf777e26e75eb8e743bec72411811a GIT binary patch literal 5896 zcmds*S5OmBl!lRB#h`%FLV^MU0wO}_Eujd~m0qPOE%XvX7ef(@Ac)dY0TGanKqyiL zq=?iIdJQG?0HG|-KJCjs?99&W?880xo`2?_IcM&9IP=Bo>uNC3bI_BKkuhm$LJi5t zuIyjFqiLxxqf^wx#pQLy$52C+thAqN?J}WsR(Y&KMpmB0aB4?&nbW~F&3wqnSbYDT zE7MNEKr%A6Of9I2aiH}kj@j7QFOOzhOyZOsPToG3O&Kdf&(G2R6^*WH4Yr?Y<=M*j z)|SSyjZG;ymM#rj`jqsgx>x(oqz3&l%DAq`K6V>?16;)qOY8cYqY_Rp1)`;;XqqAP zb92%5DOGhZkz}0v8OLTa5n;`Ul~4j9fRNySetw>&4243~CTS1SQ7BZ5IJGPQfTk87 zj76a&!y|N|&`(zweZgQblWop*0N^{LD4NLoF7T7m7YJpnVI(dWg4%zUlJU za~NDy--yj^qNU@A&42l7C=z~Ksg|1g%$Jeer?YP-vs(#nnK@p& zYSSDmVCYP|xWx;uf3%UC?DX!OkFzt5Pp}*JI@pf`fPQ*^P^;mqKOgC}&LVO;N0%4; zM^r8>>_YorO)`t;&?*|CiyiI8cV)U&cV11gw=2*1l5yIM=Uqk1Dg))%nWwJD^I|A` zSCu~&kp~gnRkdL8hChF@#G7W-qAoN(xkbSIep?uz6Apeb&#$)#iI! zDJAmmGx?l#mc8um&YF@R;_3G)g*$aLR9~>zpDos-I^GNIz~&I$6E;O`b&=D1QX{$F z9ONp9srd*1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Nx~gUyF+dzQr{bt`@MP7t}KcV zv34nwIb?NPqK_rGnDCFimJj3MUVHi%m)NsDR6@_8l+omJpV<|`8=45ntK;%?|ILNJ zgoZ;F+7GHv5{<>tsIk4Ettx5 zQ73i8+qYRlSHv;p5h&D&K=TKFf>WAw%P-eu@ApUuv9HAAgL3WLR#E9eS_EQzg6V{e z{IWfVMPlEQ$*=>>8m9n7SBhQIYcegEF0@qD HHu66J^~51m literal 0 HcmV?d00001 From d19c21e1e040cc133cce35f776fc5e1cd44f4536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= Date: Fri, 12 May 2023 03:06:17 +0300 Subject: [PATCH 17/52] document checkbox component --- docs/en/UI/Angular/Checkbox-Component.md | 39 ++++++++++++++++++++ docs/en/UI/Angular/images/form-checkbox.png | Bin 0 -> 2723 bytes 2 files changed, 39 insertions(+) create mode 100644 docs/en/UI/Angular/Checkbox-Component.md create mode 100644 docs/en/UI/Angular/images/form-checkbox.png diff --git a/docs/en/UI/Angular/Checkbox-Component.md b/docs/en/UI/Angular/Checkbox-Component.md new file mode 100644 index 0000000000..e33611e471 --- /dev/null +++ b/docs/en/UI/Angular/Checkbox-Component.md @@ -0,0 +1,39 @@ +# Checkbox Component + +The ABP Checkbox Component is a reusable form input component for checkbox type. + +It takes `label`, `labelClass` (default form-check-label), `checkboxId`,`checkboxReadonly`,`checkboxReadonly` (default form-check-input) and `checkboxStyle` as input to customize component. Also, it emits `checkboxBlur` and `checkboxFocus` events when component gain or lose focus. + +# Usage + +ABP Checkbox component is a part of the `ThemeSharedModule` module. If you've imported that module into your module, you don't need to import it again. If not, first import it as shown below: + +```ts +// my-feature.module.ts + +import { ThemeSharedModule } from "@abp/ng.theme.shared"; +import { CheckboxDemoComponent } from "./CheckboxDemoComponent.component"; + +@NgModule({ + imports: [ + ThemeSharedModule, + // ... + ], + declarations: [CheckboxDemoComponent], + // ... +}) +export class MyFeatureModule {} +``` + +Then, the `abp-checkbox` component can be used. See the example below: + +```html +
+ + +
+``` + +See the checkbox input result below: + +![abp-form-input](./images/form-checkbox.png) diff --git a/docs/en/UI/Angular/images/form-checkbox.png b/docs/en/UI/Angular/images/form-checkbox.png new file mode 100644 index 0000000000000000000000000000000000000000..18d064c474fc889904deed0e1662cfd2685b0fe1 GIT binary patch literal 2723 zcmcJR_dgp78^vQ2wP(#57qw|?MYMt#MWdHeMQmDol@e`{P-@mFB_UR0U$Yc7LeSK# zS+z%KV~^;yUhn_#zCV1QbI$VzoX?4enH#bI1%LnmfW_EI|KXLkUZKZGe|38-f<>-` zD(Imh1W-LBw0RY1J#@`<0f5>R<})X{tIXtY^f(9r;0*pRRP*klVE_P7!&qO}GR$FX zmJP;bEyA#?lsdwGVFuJRgEh$5DfTTe6722~v3Z;oWs_W9<>>Oz5L+!C&_sRHl>w0s zQ>=H~!zUd+&Np1Nm!ai`!V(e~iVC63LP^VT?wIJLGakmp_Bn5E*t3jj74pul^cgad z=<*(MaNIsu3AeNyH)9v4zUY3Js+-bnt{?M10w1Anclt+HHnR&Z?)Kmu*?k&xux=I{ zsn3dvC&63<|25IY+a|&g%zj~>M z3SwB}AX3#mPrN2w2K??ojNt;=^L8m#JMwXg5SefrXFg}9PYNyPK1BO#xpCUZ7^{kd zG#QSs{d!9W9xfj!i0E$Hdudt>gjVEZ%}9|$ta;vC2i2q(WJyB5Z0gspFZHx*;_%9&s9P zO@~CG&W*z^Iwhm3Q*c#{IdE3XRBa^uxz_BTHSiq_(msc(9U8Ov88ZE>^)Z&)mMGT` zYbtR4Zi~2#sgRAnJu*zh|I8U)R!`4|5SlGz+!{4PN=1IQ+7-h#6#CH=kZGWU2-LsjURo-2)910u9L^U)kH)M%)_JW>20j~AD zSH5idlkKi55fn{jaY2HW);abl%*&VRVOkURU zN|vN5Jws$KM+Y=Is{@b81QkPNPU&?CC3RgKZNF-k^WL{$+$_1%xA;2w?NaJuP959(31Oy2rT;vbQ_Ju_4elWjV4MAs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M9X%x zzr3&htFida&^Bd*X3ZBrx2}hW3?-$VvS=CNf;>iYEM#RKvzuG#tQOq2 z9I>5`{VTUa5g{m-@^@UVk~5er!hrss;QsQZe+?kQb~rT5jeli_#CG`_po6nVqnl^W z9Xqi83vEj~qMZwvsktM@%iQ#jH%RfKu){T7wX%pepWXO%=4o9_c;CIcj#~W3>5X|V zlDt`;CbZNuWB;ma``}acr+1=D=m^-k-KVtxv7^}SZN=b*M(rOIY@nWyF^y1izPM)~ zu8yy>QndG?w4!*xNpEJ}4<>1c5T`)Z?YKsF9j2LH^u%vygE&Ay5C_Zu0j9;vHVW^w UcgBF|)vyE@8<^`?LmZ?31JKPLZ~y=R literal 0 HcmV?d00001 From 0cd91c5326b47fbf50ac876f4157e1c9f957ec55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= Date: Fri, 12 May 2023 03:07:05 +0300 Subject: [PATCH 18/52] fix card demo component name --- docs/en/UI/Angular/Card-Component.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/UI/Angular/Card-Component.md b/docs/en/UI/Angular/Card-Component.md index 861171c39e..ca056853ff 100644 --- a/docs/en/UI/Angular/Card-Component.md +++ b/docs/en/UI/Angular/Card-Component.md @@ -29,7 +29,7 @@ ABP Card Component is a part of the `ThemeSharedModule` module. If you've import // my-feature.module.ts import { ThemeSharedModule } from '@abp/ng.theme.shared'; -import { CardDemoComponent } from './chart-demo.component'; +import { CardDemoComponent } from './card-demo.component'; @NgModule({ imports: [ From 8e7f9aa836685768b68accf41571d3e1267c4076 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 12 May 2023 08:34:36 +0800 Subject: [PATCH 19/52] Update LocalEventBus.cs --- .../Volo/Abp/EventBus/Local/LocalEventBus.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs index e1edf3b12f..d73b2f8de9 100644 --- a/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs +++ b/framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs @@ -139,26 +139,19 @@ public class LocalEventBus : EventBusBase, ILocalEventBus, ISingletonDependency protected override IEnumerable GetHandlerFactories(Type eventType) { - var handlerFactoryList = new List(); - - var handlerWithTypes = new List>(); + var handlerFactoryList = new List>(); foreach (var handlerFactory in HandlerFactories.Where(hf => ShouldTriggerEventForHandler(eventType, hf.Key))) { foreach (var factory in handlerFactory.Value) { - handlerWithTypes.Add(new Tuple( + handlerFactoryList.Add(new Tuple( factory, handlerFactory.Key, ReflectionHelper.GetAttributesOfMemberOrDeclaringType(factory.GetHandler().EventHandler.GetType()).FirstOrDefault()?.Order ?? 0)); } } - foreach (var handlerWithType in handlerWithTypes.OrderBy(x => x.Item3)) - { - handlerFactoryList.Add(new EventTypeWithEventHandlerFactories(handlerWithType.Item2, new List{ handlerWithType.Item1 })); - } - - return handlerFactoryList.ToArray(); + return handlerFactoryList.OrderBy(x => x.Item3).Select(x => new EventTypeWithEventHandlerFactories(x.Item2, new List {x.Item1})).ToArray(); } private List GetOrCreateHandlerFactories(Type eventType) From 63eed883970778775905928deec28277e76b7798 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 12 May 2023 11:14:07 +0800 Subject: [PATCH 20/52] Show warning instead of crashing the application when a bundle script/style file not found. Resolve #14795 --- .../TagHelpers/AbpTagHelperResourceService.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs index 1190e1794d..04a8761534 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bundling/Volo/Abp/AspNetCore/Mvc/UI/Bundling/TagHelpers/AbpTagHelperResourceService.cs @@ -3,14 +3,13 @@ using Microsoft.AspNetCore.Razor.TagHelpers; using System; using System.Collections.Generic; using System.Diagnostics; +using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using Volo.Abp.AspNetCore.VirtualFileSystem; using Volo.Abp.DependencyInjection; namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers; @@ -68,7 +67,9 @@ public abstract class AbpTagHelperResourceService : ITransientDependency if (file == null || !file.Exists) { - throw new AbpException($"Could not find the bundle file '{bundleFile}' for the bundle '{bundleName}'!"); + Logger.LogError($"Could not find the bundle file '{bundleFile}' for the bundle '{bundleName}'!"); + AddErrorScript(viewContext, tagHelper, context, output, bundleFile, bundleName); + continue; } if (file.Length > 0) @@ -87,6 +88,11 @@ public abstract class AbpTagHelperResourceService : ITransientDependency protected abstract void AddHtmlTag(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, string file); + protected virtual void AddErrorScript(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, string file, string bundleName) + { + output.Content.AppendHtml($"{Environment.NewLine}"); + } + protected virtual string GenerateBundleName(List bundleItems) { return bundleItems.JoinAsString("|").ToMd5(); From 01a00589e8eb7323dc806d0c41bf25744930e444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= <98148844+onurpicakci@users.noreply.github.com> Date: Fri, 12 May 2023 08:50:08 +0300 Subject: [PATCH 21/52] a new method has been written for recent posts --- .../Volo/Blogging/Posts/IPostAppService.cs | 2 ++ .../Volo/Blogging/Posts/PostAppService.cs | 29 +++++++++++++++++++ .../Volo/Blogging/Posts/IPostRepository.cs | 2 ++ .../Volo/Blogging/Users/BlogUser.cs | 14 ++++----- .../Blogging/Posts/EfCorePostRepository.cs | 9 ++++++ .../PostsClientProxy.Generated.cs | 9 ++++++ .../Volo/Blogging/PostsController.cs | 7 +++++ .../Blogging/Posts/MongoPostRepository.cs | 10 +++++++ .../Pages/Blogs/Posts/Detail.cshtml | 4 +-- .../Pages/Blogs/Posts/Detail.cshtml.cs | 2 +- .../Volo.Blogging.Web/Pages/Members/Index.js | 2 -- 11 files changed, 78 insertions(+), 12 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/IPostAppService.cs b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/IPostAppService.cs index e4af45a345..2fbb5bd845 100644 --- a/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/IPostAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application.Contracts/Volo/Blogging/Posts/IPostAppService.cs @@ -23,5 +23,7 @@ namespace Volo.Blogging.Posts Task UpdateAsync(Guid id, UpdatePostDto input); Task> GetListByUserIdAsync(Guid userId); + + Task> GetLatestBlogPostsAsync(Guid blogId, int count); } } diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs index 0158dc0e5a..939dc29640 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs @@ -195,6 +195,35 @@ namespace Volo.Blogging.Posts return ObjectMapper.Map, List>(posts); } + public async Task> GetLatestBlogPostsAsync(Guid blogId, int count) + { + var posts = await PostRepository.GetLatestBlogPostsAsync(blogId, count); + var userDictionary = new Dictionary(); + var postDtos = new List(ObjectMapper.Map, List>(posts)); + + foreach (var postDto in postDtos) + { + if (postDto.CreatorId.HasValue) + { + if (!userDictionary.ContainsKey(postDto.CreatorId.Value)) + { + var creatorUser = await UserLookupService.FindByIdAsync(postDto.CreatorId.Value); + if (creatorUser != null) + { + userDictionary[creatorUser.Id] = ObjectMapper.Map(creatorUser); + } + } + + if (userDictionary.ContainsKey(postDto.CreatorId.Value)) + { + postDto.Writer = userDictionary[(Guid)postDto.CreatorId]; + } + } + } + + return new List(postDtos); + } + [Authorize(BloggingPermissions.Posts.Create)] public async Task CreateAsync(CreatePostDto input) { diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/IPostRepository.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/IPostRepository.cs index 33a6377264..d29d72fc8b 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/IPostRepository.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/IPostRepository.cs @@ -17,5 +17,7 @@ namespace Volo.Blogging.Posts Task> GetOrderedList(Guid blogId,bool descending = false, CancellationToken cancellationToken = default); Task> GetListByUserIdAsync(Guid userId, CancellationToken cancellationToken = default); + + Task> GetLatestBlogPostsAsync(Guid blogId, int count, CancellationToken cancellationToken = default); } } diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Users/BlogUser.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Users/BlogUser.cs index c7dfa77650..cbe530f11f 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Users/BlogUser.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Users/BlogUser.cs @@ -26,25 +26,25 @@ namespace Volo.Blogging.Users public virtual bool PhoneNumberConfirmed { get; protected set; } [CanBeNull] - public string WebSite { get; set; } + public virtual string WebSite { get; set; } [CanBeNull] - public string Twitter { get; set; } + public virtual string Twitter { get; set; } [CanBeNull] - public string Github { get; set; } + public virtual string Github { get; set; } [CanBeNull] - public string Linkedin { get; set; } + public virtual string Linkedin { get; set; } [CanBeNull] - public string Company { get; set; } + public virtual string Company { get; set; } [CanBeNull] - public string JobTitle { get; set; } + public virtual string JobTitle { get; set; } [CanBeNull] - public string Biography { get; set; } + public virtual string Biography { get; set; } protected BlogUser() { diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs index 48dfabb77e..98d2d76685 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/Posts/EfCorePostRepository.cs @@ -70,6 +70,15 @@ namespace Volo.Blogging.Posts return await query.ToListAsync(GetCancellationToken(cancellationToken)); } + public async Task> GetLatestBlogPostsAsync(Guid blogId, int count, CancellationToken cancellationToken = default) + { + var query = (await GetDbSetAsync()).Where(p => p.BlogId == blogId) + .OrderByDescending(p => p.CreationTime) + .Take(count); + + return await query.ToListAsync(GetCancellationToken(cancellationToken)); + } + public override async Task> WithDetailsAsync() { return (await GetQueryableAsync()).IncludeDetails(); diff --git a/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/PostsClientProxy.Generated.cs b/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/PostsClientProxy.Generated.cs index 697606f05c..7f730ee3f2 100644 --- a/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/PostsClientProxy.Generated.cs +++ b/modules/blogging/src/Volo.Blogging.HttpApi.Client/ClientProxies/PostsClientProxy.Generated.cs @@ -74,6 +74,15 @@ public partial class PostsClientProxy : ClientProxyBase, IPostA }); } + public Task> GetLatestBlogPostsAsync(Guid blogId, int count) + { + return RequestAsync>(nameof(GetLatestBlogPostsAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), blogId }, + { typeof(int), count } + }); + } + public virtual async Task DeleteAsync(Guid id) { await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue diff --git a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs index f2f31261a6..52d7a6426a 100644 --- a/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs +++ b/modules/blogging/src/Volo.Blogging.HttpApi/Volo/Blogging/PostsController.cs @@ -69,6 +69,13 @@ namespace Volo.Blogging return _postAppService.GetListByUserIdAsync(userId); } + [HttpGet] + [Route("{blogId}/latest/{count}")] + public Task> GetLatestBlogPostsAsync(Guid blogId, int count) + { + return _postAppService.GetLatestBlogPostsAsync(blogId, count); + } + [HttpDelete] [Route("{id}")] public Task DeleteAsync(Guid id) diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs index be6942eac2..eea6e82015 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/Posts/MongoPostRepository.cs @@ -4,6 +4,7 @@ using System.Threading; using System.Threading.Tasks; using MongoDB.Driver; using MongoDB.Driver.Linq; +using Nito.AsyncEx; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.MongoDB; using Volo.Abp.MongoDB; @@ -66,5 +67,14 @@ namespace Volo.Blogging.Posts return await query.ToListAsync(GetCancellationToken(cancellationToken)); } + + public async Task> GetLatestBlogPostsAsync(Guid blogId, int count, CancellationToken cancellationToken = default) + { + var query = (await GetMongoQueryableAsync(cancellationToken)).Where(x => x.BlogId == blogId) + .OrderByDescending(x => x.CreationTime) + .Take(count); + + return await query.ToListAsync(GetCancellationToken(cancellationToken)); + } } } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml index a03bd22af3..43ad9abc2f 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml @@ -439,12 +439,12 @@ } else { - @L["LeaveComment"] + @L["LeaveComment"] }

More from @CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.Post.Writer.UserName)

- @for (var index = 0; index < Model.PostsList.Count && index <= 5; index++) + @for (var index = 0; index < Model.PostsList.Count; index++) { if (Model.PostsList[index].Id != Model.Post.Id) { diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs index 49bef9c549..54d1a4e71d 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml.cs @@ -87,7 +87,7 @@ namespace Volo.Blogging.Pages.Blog.Posts Blog = await _blogAppService.GetByShortNameAsync(BlogShortName); Post = await _postAppService.GetForReadingAsync(new GetPostInput { BlogId = Blog.Id, Url = PostUrl }); PostsList = await _postAppService.GetListByUserIdAsync(Post.Writer.Id); - LatestPosts = (await _postAppService.GetListByBlogIdAndTagNameAsync(Blog.Id, TagName)).Items; + LatestPosts = await _postAppService.GetLatestBlogPostsAsync(Blog.Id, 5); CommentsWithReplies = await _commentAppService.GetHierarchicalListOfPostAsync(Post.Id); CountComments(); } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js index c20251820f..75f59564d2 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js @@ -1,8 +1,6 @@ $(function () { - debugger var hash = window.location.hash; if(hash === '#edit-profile'){ - console.log("asdasdsa") $('#all-posts-tab').removeClass('active'); $('#all-posts').removeClass('show').removeClass('active'); $('#edit-profile-tab').addClass('active'); From 3a8834931bf7191d5100b46ec33b395904b9e62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= <98148844+onurpicakci@users.noreply.github.com> Date: Fri, 12 May 2023 14:19:07 +0300 Subject: [PATCH 22/52] refactoring --- .../Volo/Blogging/Posts/PostAppService.cs | 27 ++++++++++--------- .../Pages/Blogs/Posts/Detail.cshtml | 18 ++++--------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs index 939dc29640..1983bd3cbf 100644 --- a/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs +++ b/modules/blogging/src/Volo.Blogging.Application/Volo/Blogging/Posts/PostAppService.cs @@ -203,21 +203,22 @@ namespace Volo.Blogging.Posts foreach (var postDto in postDtos) { - if (postDto.CreatorId.HasValue) + if (!postDto.CreatorId.HasValue) { - if (!userDictionary.ContainsKey(postDto.CreatorId.Value)) - { - var creatorUser = await UserLookupService.FindByIdAsync(postDto.CreatorId.Value); - if (creatorUser != null) - { - userDictionary[creatorUser.Id] = ObjectMapper.Map(creatorUser); - } - } + continue; + } - if (userDictionary.ContainsKey(postDto.CreatorId.Value)) - { - postDto.Writer = userDictionary[(Guid)postDto.CreatorId]; - } + if (userDictionary.TryGetValue(postDto.CreatorId.Value, out var creatorUserDto)) + { + postDto.Writer = creatorUserDto; + continue; + } + + var creatorUser = await UserLookupService.FindByIdAsync(postDto.CreatorId.Value); + if (creatorUser != null) + { + postDto.Writer = ObjectMapper.Map(creatorUser); + userDictionary[creatorUser.Id] = postDto.Writer; } } diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml index 43ad9abc2f..9c44b0feb2 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Detail.cshtml @@ -129,6 +129,11 @@
+
+

+ @Html.Raw(BloggingPageHelper.RenderMarkdownToHtml(Model.Post.Content)) +

+
@@ -210,19 +215,6 @@
-
-
-
-

- @Html.Raw(BloggingPageHelper.RenderMarkdownToHtml(Model.Post.Content)) -

-
-
-
- -
-
-
@if (Model.Post.Tags.Count > 0) From 18d84d1caeb57517f1aa208228a5231ab07c33e8 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Fri, 12 May 2023 15:30:42 +0300 Subject: [PATCH 23/52] Update ChangeThemeStep.cs --- .../Building/Steps/ChangeThemeStep.cs | 676 +++++------------- 1 file changed, 183 insertions(+), 493 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs index 31f209f98e..f05cb80df3 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs @@ -10,6 +10,10 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps; public class ChangeThemeStep : ProjectBuildPipelineStep { + private const string BasicTheme = "Basic"; + private const string LeptonXTheme = "LeptonX"; + private const string LeptonTheme = "Lepton"; + public override void Execute(ProjectBuildContext context) { if (!context.BuildArgs.Theme.HasValue) @@ -28,50 +32,53 @@ public class ChangeThemeStep : ProjectBuildPipelineStep } } - protected void ChangeToBasicTheme(ProjectBuildContext context) + protected virtual void ChangeToBasicTheme(ProjectBuildContext context) { var defaultThemeName = context.BuildArgs.TemplateName is AppTemplate.TemplateName or AppNoLayersTemplate.TemplateName - ? "LeptonXLite" - : "LeptonX"; - - #region MVC Projects + ? "LeptonXLite" : "LeptonX"; ChangeThemeToBasicForMvcProjects(context, defaultThemeName); + ChangeThemeToBasicForBlazorProjects(context, defaultThemeName); + ChangeThemeToBasicForBlazorServerProjects(context, defaultThemeName); + ChangeThemeToBasicForAngularProjects(context, defaultThemeName); + } - #endregion - - #region MyCompanyName.MyProjectName.Blazor + protected virtual void ChangeToLeptonTheme(ProjectBuildContext context) + { + //common + RenameLeptonXFolders(context, folderName: "Lepton"); + AddLeptonThemeManagementReferenceToProjects(context); + ChangeThemeToLeptonForMvcProjects(context); + ChangeThemeToLeptonForBlazorProjects(context); + ChangeThemeToLeptonForBlazorServerProjects(context); + ChangeThemeToLeptonForAngularProjects(context); + ConfigureLeptonManagementPackagesForNoLayersMvc(context, "/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.csproj", new[] { "Web", "HttpApi", "Application" }); + ChangeThemeToLeptonForNoLayersBlazorServerProjects(context); + ChangeThemeToLeptonForMauiBlazorProjects(context); + } + + private static void ChangeThemeToBasicForBlazorProjects(ProjectBuildContext context, string defaultThemeName) + { ReplacePackageReferenceWithProjectReference( context, "/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj", $"Volo.Abp.AspNetCore.Components.WebAssembly.{defaultThemeName}Theme", @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme\Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.csproj" - ); - - ChangeNamespaceAndKeyword( - context, - "/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs", - $"Volo.Abp.AspNetCore.Components.WebAssembly.{defaultThemeName}Theme", - "Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme", - $"AbpAspNetCoreComponentsWebAssembly{defaultThemeName}ThemeModule", - "AbpAspNetCoreComponentsWebAssemblyBasicThemeModule" ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs", - $"Volo.Abp.AspNetCore.Components.Web.{defaultThemeName}Theme.Themes.{defaultThemeName}", - "Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic", - $"AbpAspNetCoreComponentsWebAssembly{defaultThemeName}ThemeModule", - "AbpAspNetCoreComponentsWebAssemblyBasicThemeModule" + $"{defaultThemeName}Theme.Components", + "BasicTheme.Themes.Basic" ); - - ChangeNamespace( + + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs", - $"Volo.Abp.AspNetCore.Components.Web.{defaultThemeName}Theme.Components", - "Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic" + defaultThemeName, + BasicTheme ); ReplacePackageReferenceWithProjectReference( @@ -81,37 +88,23 @@ public class ChangeThemeStep : ProjectBuildPipelineStep @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" ); - ChangeNamespaceAndKeyword( + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.Host/MyProjectNameHostModule.cs", - $"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}.Bundling", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling", - $"{defaultThemeName}ThemeBundles.Styles.Global", - "BasicThemeBundles.Styles.Global" + defaultThemeName, + BasicTheme ); + } - ChangeNamespaceAndKeyword( - context, - "/MyCompanyName.MyProjectName.Host/MyProjectNameHostModule.cs", - $"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic", - $"AbpAspNetCoreMvcUi{defaultThemeName}ThemeModule", - "AbpAspNetCoreMvcUiBasicThemeModule" - ); - - #endregion - - #region Blazor.Server Projects - - ChangeThemeToBasicForBlazorProjects(context, defaultThemeName); - - #endregion - - #region Angular - + private static void ChangeThemeToBasicForAngularProjects(ProjectBuildContext context, string defaultThemeName) + { + if (context.BuildArgs.UiFramework != UiFramework.Angular) + { + return; + } + var angularPackageName = context.BuildArgs.TemplateName is AppTemplate.TemplateName or AppNoLayersTemplate.TemplateName - ? "@abp/ng.theme.lepton-x" - : "@volosoft/abp.ng.theme.lepton-x"; + ? "@abp/ng.theme.lepton-x" : "@volosoft/abp.ng.theme.lepton-x"; ReplaceImportPackage( context, @@ -126,7 +119,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep "SideMenuLayoutModule" ); - ReplaceMethodNames( + ReplaceAllKeywords( context, "/angular/src/app/app.module.ts", "ThemeLeptonXModule", @@ -139,102 +132,65 @@ public class ChangeThemeStep : ProjectBuildPipelineStep "node_modules/bootstrap-icons/font/bootstrap-icons.css" ); - if(defaultThemeName == "LeptonX") + if (defaultThemeName != "LeptonX") { - ReplaceMethodNames( - context, - "/angular/src/app/app.module.ts", - "HttpErrorComponent, ", - "" - ); - - ChangeModuleImportBetweenStatements( - context, - "/angular/src/app/app.module.ts", - "ThemeSharedModule.forRoot", - "AccountAdminConfigModule.forRoot", - "ThemeSharedModule.forRoot()," - ); + return; } - #endregion + ReplaceAllKeywords( + context, + "/angular/src/app/app.module.ts", + "HttpErrorComponent, ", + "" + ); + + ChangeModuleImportBetweenStatements( + context, + "/angular/src/app/app.module.ts", + "ThemeSharedModule.forRoot", + "AccountAdminConfigModule.forRoot", + "ThemeSharedModule.forRoot()," + ); } - protected void ChangeToLeptonTheme(ProjectBuildContext context) + private static void ChangeThemeToLeptonForBlazorProjects(ProjectBuildContext context) { - #region Common - - RenameLeptonXFolders(context, folderName: "Lepton"); - AddLeptonThemeManagementReferenceToProjects(context); - - #endregion - - #region MVC Projects - - ChangeThemeToLeptonForMvcProjects(context); - - #endregion - - #region MyCompanyName.MyProjectName.Blazor - ReplacePackageReferenceWithProjectReference( context, "/MyCompanyName.MyProjectName.Blazor/MyCompanyName.MyProjectName.Blazor.csproj", "Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXTheme", @"..\..\..\..\..\lepton-theme\src\Volo.Abp.AspNetCore.Components.WebAssembly.LeptonTheme\Volo.Abp.AspNetCore.Components.WebAssembly.LeptonTheme.csproj" ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs", - "Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components", - "Volo.Abp.AspNetCore.Components.Web.LeptonTheme.Components", - "AbpAspNetCoreComponentsWebAssemblyLeptonXThemeModule", - "AbpAspNetCoreComponentsWebAssemblyLeptonThemeModule" + LeptonXTheme, + LeptonTheme ); - ChangeNamespace( - context, - "/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs", - "Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXTheme", - "Volo.Abp.AspNetCore.Components.WebAssembly.LeptonTheme" - ); - ReplacePackageReferenceWithProjectReference( context, "/MyCompanyName.MyProjectName.Host/MyCompanyName.MyProjectName.Host.csproj", "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX", @"..\..\..\..\..\lepton-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton.csproj" ); - - ChangeNamespaceAndKeyword( - context, - "/MyCompanyName.MyProjectName.Host/MyProjectNameHostModule.cs", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX.Bundling", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton.Bundling", - "LeptonXThemeBundles.Styles.Global", - "LeptonThemeBundles.Styles.Global" - ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.Host/MyProjectNameHostModule.cs", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton", - "AbpAspNetCoreMvcUiLeptonXThemeModule", - "AbpAspNetCoreMvcUiLeptonThemeModule" + LeptonXTheme, + LeptonTheme ); + } - #endregion - - #region MyCompanyName.MyProjectName.Blazor.Server && MyCompanyName.MyProjectName.Blazor.Server.Tiered - - ChangeThemeToLeptonForBlazorServerProjects(context); - - #endregion - - #region Angular - + private static void ChangeThemeToLeptonForAngularProjects(ProjectBuildContext context) + { + if (context.BuildArgs.UiFramework != UiFramework.Angular) + { + return; + } + ReplaceImportPackage( context, "/angular/src/app/app.module.ts", @@ -247,8 +203,8 @@ public class ChangeThemeStep : ProjectBuildPipelineStep "/angular/src/app/app.module.ts", "SideMenuLayoutModule" ); - - ReplaceMethodNames( + + ReplaceAllKeywords( context, "/angular/src/app/app.module.ts", "ThemeLeptonXModule", @@ -260,30 +216,9 @@ public class ChangeThemeStep : ProjectBuildPipelineStep "/angular/angular.json", "node_modules/bootstrap-icons/font/bootstrap-icons.css" ); - - #endregion - - #region MyCompanyName.MyProjectName.Mvc && MyCompanyName.MyProjectName.Mvc.Mongo - - var projectNames = new[] {"Web", "HttpApi", "Application"}; - ConfigureLeptonManagementPackagesForNoLayersMvc(context, @"/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.csproj", projectNames); - - #endregion - - #region MyCompanyName.MyProjectName.Blazor.Server && MyCompanyName.MyProjectName.Blazor.Server.Mongo - (app-nolayers) - - ChangeThemeToLeptonForNoLayersBlazorServerProjects(context); - - #endregion - - #region MyCompanyName.MyProjectName.MauiBlazor - - ChangeThemeToLeptonForMauiBlazorProjects(context); - - #endregion } - private void ConfigureLeptonManagementPackagesForNoLayersMvc(ProjectBuildContext context, string targetProjectPath, string[] projectNames) + private static void ConfigureLeptonManagementPackagesForNoLayersMvc(ProjectBuildContext context, string targetProjectPath, IEnumerable projectNames) { var file = context.Files.FirstOrDefault(f => !f.Name.Contains("Test") && f.Name.Contains(targetProjectPath) && f.Name.Contains(".csproj")); if (file == null) @@ -304,7 +239,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep } } - private void ChangeThemeToLeptonForMvcProjects(ProjectBuildContext context) + private static void ChangeThemeToLeptonForMvcProjects(ProjectBuildContext context) { var projectNames = new[] { @@ -333,23 +268,12 @@ public class ChangeThemeStep : ProjectBuildPipelineStep "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX", @"..\..\..\..\..\lepton-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton.csproj" ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, moduleFile.Name, - "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX.Bundling", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton.Bundling", - "LeptonXThemeBundles.Styles.Global", - "LeptonThemeBundles.Styles.Global" - ); - - ChangeNamespaceAndKeyword( - context, - moduleFile.Name, - "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton", - "AbpAspNetCoreMvcUiLeptonXThemeModule", - "AbpAspNetCoreMvcUiLeptonThemeModule" + LeptonXTheme, + LeptonTheme ); RemoveLinesByStatement( @@ -360,7 +284,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep } } - private void AddLeptonThemeManagementReferenceToProjects(ProjectBuildContext context) + private static void AddLeptonThemeManagementReferenceToProjects(ProjectBuildContext context) { var projects = new Dictionary { @@ -396,7 +320,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep } } - private void AddUiProjectToProjects(Dictionary projects, ProjectBuildContext context) + private static void AddUiProjectToProjects(Dictionary projects, ProjectBuildContext context) { if (projects.IsNullOrEmpty()) { @@ -418,7 +342,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep } } - private void AddLeptonThemeManagementReference(ProjectBuildContext context, KeyValuePair projectInfo) + private static void AddLeptonThemeManagementReference(ProjectBuildContext context, KeyValuePair projectInfo) { var reference = $@"..\..\..\..\..\lepton-theme\src\Volo.Abp.LeptonTheme.Management.{projectInfo.Key}\Volo.Abp.LeptonTheme.Management.{projectInfo.Key}.csproj"; var projectFile = context.Files.FirstOrDefault(f => !f.Name.Contains("Test") && f.Name.Contains(projectInfo.Value) && f.Name.Contains(".csproj")); @@ -439,7 +363,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep underManagementFolder: projectInfo.Key != "HttpApi"); } - private void AddModuleDependency(FileEntry moduleFile, string projectName, string dependency, bool underManagementFolder = true) + private static void AddModuleDependency(FileEntry moduleFile, string projectName, string dependency, bool underManagementFolder = true) { var projectNames = new[] { "Blazor", "Blazor.Server", "Blazor.WebAssembly" }; @@ -460,11 +384,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep moduleFile.SetLines(lines); } - protected void ReplacePackageReferenceWithProjectReference( - ProjectBuildContext context, - string targetProjectFilePath, - string packageReference, - string projectReference) + private static void ReplacePackageReferenceWithProjectReference(ProjectBuildContext context, string targetProjectFilePath, string packageReference, string projectReference) { var file = context.Files.FirstOrDefault(x => x.Name.Contains(targetProjectFilePath)); if (file == null) @@ -485,97 +405,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep file.SetLines(lines); } - protected void ChangeNamespaceAndKeyword( - ProjectBuildContext context, - string targetModuleFilePath, - string oldNamespace, - string newNamespace, - string oldKeyword, - string newKeyword) - { - var file = context.Files.FirstOrDefault(x => x.Name.Contains(targetModuleFilePath)); - if (file == null) - { - return; - } - - file.NormalizeLineEndings(); - - var lines = file.GetLines(); - - for (var i = 0; i < lines.Length; i++) - { - if (lines[i].Contains($"using {oldNamespace}")) - { - lines[i] = lines[i].Replace($"using {oldNamespace}", $"using {newNamespace}"); - } - else if (lines[i].Contains(oldKeyword)) - { - lines[i] = lines[i].Replace(oldKeyword, newKeyword); - } - } - - file.SetLines(lines); - } - - protected void ChangeNamespace( - ProjectBuildContext context, - string targetModuleFilePath, - string oldNamespace, - string newNamespace) - { - var file = context.Files.FirstOrDefault(x => x.Name.Contains(targetModuleFilePath)); - if (file == null) - { - return; - } - - file.NormalizeLineEndings(); - - var lines = file.GetLines(); - for (var i = 0; i < lines.Length; i++) - { - if (lines[i].Contains($"using {oldNamespace}")) - { - lines[i] = lines[i].Replace($"using {oldNamespace}", $"using {newNamespace}"); - } - } - - file.SetLines(lines); - } - - protected void ChangeKeyword( - ProjectBuildContext context, - string targetModuleFilePath, - string oldKeyword, - string newKeyword) - { - var file = context.Files.FirstOrDefault(x => x.Name.Contains(targetModuleFilePath)); - if (file == null) - { - return; - } - - file.NormalizeLineEndings(); - - var lines = file.GetLines(); - - for (var i = 0; i < lines.Length; i++) - { - if (lines[i].Contains(oldKeyword)) - { - lines[i] = lines[i].Replace(oldKeyword, newKeyword); - } - } - - file.SetLines(lines); - } - - protected void ReplaceImportPackage( - ProjectBuildContext context, - string filePath, - string oldImportPackage, - string newImportPackage) + private static void ReplaceImportPackage(ProjectBuildContext context, string filePath, string oldImportPackage, string newImportPackage) { var file = context.Files.FirstOrDefault(x => x.Name.Contains(filePath)); if (file == null) @@ -584,6 +414,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep } file.NormalizeLineEndings(); + var lines = file.GetLines(); var lineIndex = lines.FindIndex(line => line.Contains($"from '{oldImportPackage}'")); if (lineIndex == -1) @@ -595,10 +426,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep file.SetLines(lines); } - protected void RemoveLinesByStatement( - ProjectBuildContext context, - string filePath, - string statement) + private static void RemoveLinesByStatement(ProjectBuildContext context, string filePath, string statement) { var file = context.Files.FirstOrDefault(x => x.Name.Contains(filePath)); if (file == null) @@ -620,12 +448,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep file.SetLines(lines.Where(x => x != null)); } - private void ChangeModuleImportBetweenStatements( - ProjectBuildContext context, - string filePath, - string firstStatement, - string lastStatement, - string newStatement) + private static void ChangeModuleImportBetweenStatements(ProjectBuildContext context, string filePath, string firstStatement, string lastStatement, string newStatement) { var file = context.Files.FirstOrDefault(x => x.Name.Contains(filePath)); if (file == null) @@ -651,36 +474,9 @@ public class ChangeThemeStep : ProjectBuildPipelineStep lines[i] = null; } - file.SetLines(lines.Where(x => x != null)); } - - protected void ReplaceMethodNames( - ProjectBuildContext context, - string filePath, - string oldMethodName, - string newMethodName) - { - var file = context.Files.FirstOrDefault(x => x.Name.Contains(filePath)); - if (file == null) - { - return; - } - - file.NormalizeLineEndings(); - - var lines = file.GetLines(); - for (var i = 0; i < lines.Length; i++) - { - if (lines[i].Contains(oldMethodName)) - { - lines[i] = lines[i].Replace(oldMethodName, newMethodName); - } - } - - file.SetLines(lines); - } - + private static void AddProjectReference(FileEntry file, string reference) { if (!file.Name.Contains(".csproj")) @@ -746,7 +542,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep splittedProjectFileName = splittedProjectFileName.Take(splittedProjectFileName.Length - 1).ToArray(); - var fileName = splittedProjectFileName?.Last(); + var fileName = splittedProjectFileName.Last(); if (fileName == null) { return null; @@ -767,14 +563,38 @@ public class ChangeThemeStep : ProjectBuildPipelineStep private static void RenameLeptonXFolders(ProjectBuildContext context, string folderName) { - var leptonXFiles = context.Files.Where(x => x.Name.Contains("LeptonX") && x.IsDirectory); - foreach (var file in leptonXFiles) + foreach (var file in context.Files.Where(x => x.Name.Contains("LeptonX") && x.IsDirectory)) { new MoveFolderStep(file.Name, file.Name.Replace("LeptonX", folderName)).Execute(context); } } - private void ChangeThemeToBasicForMvcProjects(ProjectBuildContext context, string defaultThemeName) + private static void ReplaceAllKeywords(ProjectBuildContext context, string targetModuleFilePath, string oldKeyword, string newKeyword) + { + var file = context.Files.FirstOrDefault(x => x.Name.Contains(targetModuleFilePath)); + if (file == null) + { + return; + } + + file.NormalizeLineEndings(); + + var lines = file.GetLines(); + + for (var i = 0; i < lines.Length; i++) + { + if (!lines[i].Contains(oldKeyword)) + { + continue;; + } + + lines[i] = lines[i].Replace(oldKeyword, newKeyword); + } + + file.SetLines(lines); + } + + private static void ChangeThemeToBasicForMvcProjects(ProjectBuildContext context, string defaultThemeName) { var projects = new Dictionary { @@ -794,28 +614,17 @@ public class ChangeThemeStep : ProjectBuildPipelineStep $"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}", @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic\Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.csproj" ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName{project.Key}/{project.Value}.cs", - $"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic", - $"AbpAspNetCoreMvcUi{defaultThemeName}ThemeModule", - "AbpAspNetCoreMvcUiBasicThemeModule" - ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName{project.Key}/{project.Value}.cs", - $"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}.Bundling", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling", - $"{defaultThemeName}ThemeBundles.Styles.Global", - "BasicThemeBundles.Styles.Global" + defaultThemeName, + BasicTheme ); } } - private void ChangeThemeToBasicForBlazorProjects(ProjectBuildContext context, string defaultThemeName) + private static void ChangeThemeToBasicForBlazorServerProjects(ProjectBuildContext context, string defaultThemeName) { var projects = new Dictionary { @@ -840,73 +649,34 @@ public class ChangeThemeStep : ProjectBuildPipelineStep $"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}", @"..\..\..\..\..\modules\basic-theme\src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj" ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{project.Key}/{project.Value}.cs", - $"Volo.Abp.AspNetCore.Components.Server.{defaultThemeName}Theme", - "Volo.Abp.AspNetCore.Components.Server.BasicTheme", - $"AbpAspNetCoreComponentsServer{defaultThemeName}ThemeModule", - "AbpAspNetCoreComponentsServerBasicThemeModule" - ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{project.Key}/{project.Value}.cs", - $"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic", - $"AbpAspNetCoreMvcUi{defaultThemeName}ThemeModule", - "AbpAspNetCoreMvcUiBasicThemeModule" - ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{project.Key}/{project.Value}.cs", - $"Volo.Abp.AspNetCore.Components.Server.{defaultThemeName}Theme.Bundling", - "Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling", - $"{defaultThemeName}ThemeBundles.Styles.Global", - "BasicThemeBundles.Styles.Global" - ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{project.Key}/{project.Value}.cs", - $"Volo.Abp.AspNetCore.Mvc.UI.Theme.{defaultThemeName}.Bundling", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling", - $"Blazor{defaultThemeName}ThemeBundles.Styles.Global", - "BlazorBasicThemeBundles.Styles.Global" - ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{project.Key}/Pages/_Host.cshtml", - $"Volo.Abp.AspNetCore.Components.Web.{defaultThemeName}Theme.Components", - "Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic", - $"Blazor{defaultThemeName}ThemeBundles.Styles.Global", - "BlazorBasicThemeBundles.Styles.Global" + $"{defaultThemeName}Theme.Components", + BasicTheme ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, - $"/MyCompanyName.MyProjectName.{project.Key}/Pages/_Host.cshtml", - $"Volo.Abp.AspNetCore.Components.Server.{defaultThemeName}Theme.Bundling", - "Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling", - $"Blazor{defaultThemeName}ThemeBundles.Scripts.Global", - "BlazorBasicThemeBundles.Scripts.Global" + $"/MyCompanyName.MyProjectName.{project.Key}/{project.Value}.cs", + defaultThemeName, + BasicTheme ); - - ChangeNamespace( + + ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{project.Key}/Pages/_Host.cshtml", - $"Volo.Abp.AspNetCore.Components.Web.{defaultThemeName}Theme.Themes.{defaultThemeName}", - "Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic" + defaultThemeName, + BasicTheme ); } } - private void ChangeThemeToLeptonForBlazorServerProjects(ProjectBuildContext context) + private static void ChangeThemeToLeptonForBlazorServerProjects(ProjectBuildContext context) { - var projectNames = new[] {"Blazor", "Blazor.Server.Tiered"}; + var projectNames = new[] { "Blazor", "Blazor.Server.Tiered" }; + foreach (var projectName in projectNames) { ReplacePackageReferenceWithProjectReference( @@ -922,59 +692,19 @@ public class ChangeThemeStep : ProjectBuildPipelineStep "Volo.Abp.AspNetCore.Components.Server.LeptonXTheme", @"..\..\..\..\..\lepton-theme\src\Volo.Abp.AspNetCore.Components.Server.LeptonTheme\Volo.Abp.AspNetCore.Components.Server.LeptonTheme.csproj" ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameBlazorModule.cs", - "Volo.Abp.AspNetCore.Components.Server.LeptonXTheme", - "Volo.Abp.AspNetCore.Components.Server.LeptonTheme", - "AbpAspNetCoreComponentsServerLeptonXThemeModule", - "AbpAspNetCoreComponentsServerLeptonThemeModule" - ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameBlazorModule.cs", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton", - "AbpAspNetCoreMvcUiLeptonXThemeModule", - "AbpAspNetCoreMvcUiLeptonThemeModule" - ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameBlazorModule.cs", - "Volo.Abp.AspNetCore.Components.Server.LeptonXTheme.Bundling", - "Volo.Abp.AspNetCore.Components.Server.LeptonTheme.Bundling", - "LeptonXThemeBundles.Styles.Global", - "LeptonThemeBundles.Styles.Global" + LeptonXTheme, + LeptonTheme ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameBlazorModule.cs", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX.Bundling", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton.Bundling", - "BlazorLeptonXThemeBundles.Styles.Global", - "BlazorLeptonThemeBundles.Styles.Global" - ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml", - "Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components", - "Volo.Abp.AspNetCore.Components.Web.LeptonTheme.Components", - "BlazorLeptonXThemeBundles.Styles.Global", - "BlazorLeptonThemeBundles.Styles.Global" - ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml", - "Volo.Abp.AspNetCore.Components.Server.LeptonXTheme.Bundling", - "Volo.Abp.AspNetCore.Components.Server.LeptonTheme.Bundling", - "BlazorLeptonXThemeBundles.Scripts.Global", - "BlazorLeptonThemeBundles.Scripts.Global" + LeptonXTheme, + LeptonTheme ); RemoveLinesByStatement( @@ -985,11 +715,11 @@ public class ChangeThemeStep : ProjectBuildPipelineStep } } - private void ChangeThemeToLeptonForNoLayersBlazorServerProjects(ProjectBuildContext context) + private static void ChangeThemeToLeptonForNoLayersBlazorServerProjects(ProjectBuildContext context) { var blazorServerProjects = new[] { "Blazor.Server", "HttpApi", "Application" }; - var projectNames = new[] { "Blazor.Server", "Blazor.Server.Mongo" }; + foreach (var projectName in projectNames) { ReplacePackageReferenceWithProjectReference( @@ -1006,67 +736,29 @@ public class ChangeThemeStep : ProjectBuildPipelineStep @"..\..\..\..\lepton-theme\src\Volo.Abp.AspNetCore.Components.Server.LeptonTheme\Volo.Abp.AspNetCore.Components.Server.LeptonTheme.csproj" ); - ConfigureLeptonManagementPackagesForNoLayersMvc(context, - $@"/MyCompanyName.MyProjectName.{projectName}/MyCompanyName.MyProjectName.{projectName}.csproj", - blazorServerProjects); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameModule.cs", - "Volo.Abp.AspNetCore.Components.Server.LeptonXTheme", - "Volo.Abp.AspNetCore.Components.Server.LeptonTheme", - "AbpAspNetCoreComponentsServerLeptonXThemeModule", - "AbpAspNetCoreComponentsServerLeptonThemeModule" - ); - - ChangeNamespaceAndKeyword( + ConfigureLeptonManagementPackagesForNoLayersMvc( context, - $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameModule.cs", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton", - "AbpAspNetCoreMvcUiLeptonXThemeModule", - "AbpAspNetCoreMvcUiLeptonThemeModule" - ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameModule.cs", - "Volo.Abp.AspNetCore.Components.Server.LeptonXTheme.Bundling", - "Volo.Abp.AspNetCore.Components.Server.LeptonTheme.Bundling", - "LeptonXThemeBundles.Styles.Global", - "LeptonThemeBundles.Styles.Global" + $@"/MyCompanyName.MyProjectName.{projectName}/MyCompanyName.MyProjectName.{projectName}.csproj", + blazorServerProjects ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameModule.cs", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX.Bundling", - "Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton.Bundling", - "BlazorLeptonXThemeBundles.Styles.Global", - "BlazorLeptonThemeBundles.Styles.Global" + LeptonXTheme, + LeptonTheme ); - - ChangeNamespaceAndKeyword( + + ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml", - "Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components", - "Volo.Abp.AspNetCore.Components.Web.LeptonTheme.Components", - "BlazorLeptonXThemeBundles.Styles.Global", - "BlazorLeptonThemeBundles.Styles.Global" - ); - - ChangeNamespaceAndKeyword( - context, - $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml", - "Volo.Abp.AspNetCore.Components.Server.LeptonXTheme.Bundling", - "Volo.Abp.AspNetCore.Components.Server.LeptonTheme.Bundling", - "BlazorLeptonXThemeBundles.Scripts.Global", - "BlazorLeptonThemeBundles.Scripts.Global" + LeptonXTheme, + LeptonTheme ); } } - private void ChangeThemeToLeptonForMauiBlazorProjects(ProjectBuildContext context) + private static void ChangeThemeToLeptonForMauiBlazorProjects(ProjectBuildContext context) { ReplacePackageReferenceWithProjectReference( context, @@ -1074,44 +766,42 @@ public class ChangeThemeStep : ProjectBuildPipelineStep "Volo.Abp.AspNetCore.Components.MauiBlazor.LeptonXTheme", @"..\..\..\..\..\lepton-theme\src\Volo.Abp.AspNetCore.Components.MauiBlazor.LeptonTheme\Volo.Abp.AspNetCore.Components.MauiBlazor.LeptonTheme.csproj" ); - - ChangeNamespaceAndKeyword( - context, - "/MyCompanyName.MyProjectName.MauiBlazor/MyProjectNameMauiBlazorModule.cs", - "Volo.Abp.AspNetCore.Components.MauiBlazor.LeptonXTheme", - "Volo.Abp.AspNetCore.Components.MauiBlazor.LeptonTheme", - "AbpAspNetCoreComponentsMauiBlazorLeptonXThemeModule", - "AbpAspNetCoreComponentsMauiBlazorLeptonThemeModule" - ); - - ChangeKeyword( + + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.MauiBlazor/MainPage.xaml", "clr-namespace:Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components;assembly=Volo.Abp.AspNetCore.Components.Web.LeptonXTheme", "clr-namespace:Volo.Abp.AspNetCore.Components.Web.LeptonTheme.Components;assembly=Volo.Abp.AspNetCore.Components.Web.LeptonTheme"); - ChangeKeyword( + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.MauiBlazor/MainPage.xaml", "leptonXTheme", "leptonTheme"); - ChangeKeyword( + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.MauiBlazor/Pages/Account/Login.razor", "Volo.Abp.AspNetCore.Components.MauiBlazor.LeptonXTheme.Components.AccountLayout", "Volo.Abp.AspNetCore.Components.MauiBlazor.LeptonTheme.Components.AccountLayout"); - ChangeKeyword( + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.MauiBlazor/Pages/Account/RedirectToLogout.razor", "LeptonXResource", "LeptonThemeManagementResource"); - ChangeKeyword( + ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.MauiBlazor/Pages/Account/RedirectToLogout.razor", "Volo.Abp.LeptonX.Shared.Localization", "Volo.Abp.LeptonTheme.Management.Localization"); + + ReplaceAllKeywords( + context, + "/MyCompanyName.MyProjectName.MauiBlazor/MyProjectNameMauiBlazorModule.cs", + LeptonXTheme, + LeptonTheme + ); } -} +} \ No newline at end of file From 525d223155fedd3871601b651545c0fa5b757af0 Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Fri, 12 May 2023 16:04:00 +0300 Subject: [PATCH 24/52] Update ChangeThemeStep.cs --- .../Building/Steps/ChangeThemeStep.cs | 136 +++++++----------- 1 file changed, 53 insertions(+), 83 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs index f05cb80df3..c303c1196a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs @@ -10,9 +10,10 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps; public class ChangeThemeStep : ProjectBuildPipelineStep { - private const string BasicTheme = "Basic"; - private const string LeptonXTheme = "LeptonX"; - private const string LeptonTheme = "Lepton"; + private const string Basic = "Basic"; + private const string LeptonXLite = "LeptonXLite"; + private const string LeptonX = "LeptonX"; + private const string Lepton = "Lepton"; public override void Execute(ProjectBuildContext context) { @@ -35,29 +36,41 @@ public class ChangeThemeStep : ProjectBuildPipelineStep protected virtual void ChangeToBasicTheme(ProjectBuildContext context) { var defaultThemeName = context.BuildArgs.TemplateName is AppTemplate.TemplateName or AppNoLayersTemplate.TemplateName - ? "LeptonXLite" : "LeptonX"; + ? LeptonXLite : LeptonX; ChangeThemeToBasicForMvcProjects(context, defaultThemeName); ChangeThemeToBasicForBlazorProjects(context, defaultThemeName); ChangeThemeToBasicForBlazorServerProjects(context, defaultThemeName); - ChangeThemeToBasicForAngularProjects(context, defaultThemeName); + ChangeThemeForAngularProjects(context, defaultThemeName, Basic, GetAngularPackageName(context.BuildArgs.Theme!.Value), GetAngularPackageName(Theme.Basic)); } protected virtual void ChangeToLeptonTheme(ProjectBuildContext context) { //common - RenameLeptonXFolders(context, folderName: "Lepton"); + RenameFolders(context, oldFolderName: LeptonX , newFolderName: Lepton); AddLeptonThemeManagementReferenceToProjects(context); ChangeThemeToLeptonForMvcProjects(context); ChangeThemeToLeptonForBlazorProjects(context); ChangeThemeToLeptonForBlazorServerProjects(context); - ChangeThemeToLeptonForAngularProjects(context); + ChangeThemeForAngularProjects(context, oldThemeName: LeptonX, Lepton, GetAngularPackageName(Theme.LeptonX), GetAngularPackageName(Theme.Lepton)); + ConfigureLeptonManagementPackagesForNoLayersMvc(context, "/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.csproj", new[] { "Web", "HttpApi", "Application" }); ChangeThemeToLeptonForNoLayersBlazorServerProjects(context); ChangeThemeToLeptonForMauiBlazorProjects(context); } + private static string GetAngularPackageName(Theme theme) + { + return theme switch + { + Theme.LeptonX => "@volosoft/abp.ng.theme.lepton-x", + Theme.LeptonXLite => "@abp/ng.theme.lepton-x", + Theme.Basic => "@abp/ng.theme.basic", + _ => string.Empty + }; + } + private static void ChangeThemeToBasicForBlazorProjects(ProjectBuildContext context, string defaultThemeName) { ReplacePackageReferenceWithProjectReference( @@ -78,7 +91,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep context, "/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs", defaultThemeName, - BasicTheme + Basic ); ReplacePackageReferenceWithProjectReference( @@ -92,47 +105,38 @@ public class ChangeThemeStep : ProjectBuildPipelineStep context, "/MyCompanyName.MyProjectName.Host/MyProjectNameHostModule.cs", defaultThemeName, - BasicTheme + Basic ); } - private static void ChangeThemeToBasicForAngularProjects(ProjectBuildContext context, string defaultThemeName) + private static void ChangeThemeForAngularProjects(ProjectBuildContext context, string oldThemeName, string newThemeName, string oldPackageName, string newPackageName) { if (context.BuildArgs.UiFramework != UiFramework.Angular) { return; } - var angularPackageName = context.BuildArgs.TemplateName is AppTemplate.TemplateName or AppNoLayersTemplate.TemplateName - ? "@abp/ng.theme.lepton-x" : "@volosoft/abp.ng.theme.lepton-x"; - ReplaceImportPackage( context, "/angular/src/app/app.module.ts", - angularPackageName, - "@abp/ng.theme.basic" + oldPackageName, + newPackageName ); - + RemoveLinesByStatement( context, "/angular/src/app/app.module.ts", "SideMenuLayoutModule" ); - + ReplaceAllKeywords( context, "/angular/src/app/app.module.ts", - "ThemeLeptonXModule", - "ThemeBasicModule" + $"Theme{oldThemeName}Module", + $"Theme{newThemeName}Module" ); - RemoveLinesByStatement( - context, - "/angular/angular.json", - "node_modules/bootstrap-icons/font/bootstrap-icons.css" - ); - - if (defaultThemeName != "LeptonX") + if (oldThemeName != LeptonX) { return; } @@ -165,8 +169,8 @@ public class ChangeThemeStep : ProjectBuildPipelineStep ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs", - LeptonXTheme, - LeptonTheme + LeptonX, + Lepton ); ReplacePackageReferenceWithProjectReference( @@ -179,42 +183,8 @@ public class ChangeThemeStep : ProjectBuildPipelineStep ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.Host/MyProjectNameHostModule.cs", - LeptonXTheme, - LeptonTheme - ); - } - - private static void ChangeThemeToLeptonForAngularProjects(ProjectBuildContext context) - { - if (context.BuildArgs.UiFramework != UiFramework.Angular) - { - return; - } - - ReplaceImportPackage( - context, - "/angular/src/app/app.module.ts", - "@volosoft/abp.ng.theme.lepton-x", - "@volo/abp.ng.theme.lepton" - ); - - RemoveLinesByStatement( - context, - "/angular/src/app/app.module.ts", - "SideMenuLayoutModule" - ); - - ReplaceAllKeywords( - context, - "/angular/src/app/app.module.ts", - "ThemeLeptonXModule", - "ThemeLeptonModule" - ); - - RemoveLinesByStatement( - context, - "/angular/angular.json", - "node_modules/bootstrap-icons/font/bootstrap-icons.css" + LeptonX, + Lepton ); } @@ -272,8 +242,8 @@ public class ChangeThemeStep : ProjectBuildPipelineStep ReplaceAllKeywords( context, moduleFile.Name, - LeptonXTheme, - LeptonTheme + LeptonX, + Lepton ); RemoveLinesByStatement( @@ -561,11 +531,11 @@ public class ChangeThemeStep : ProjectBuildPipelineStep return moduleName.Replace(".", ""); } - private static void RenameLeptonXFolders(ProjectBuildContext context, string folderName) + private static void RenameFolders(ProjectBuildContext context, string oldFolderName, string newFolderName) { - foreach (var file in context.Files.Where(x => x.Name.Contains("LeptonX") && x.IsDirectory)) + foreach (var file in context.Files.Where(x => x.Name.Contains(oldFolderName) && x.IsDirectory)) { - new MoveFolderStep(file.Name, file.Name.Replace("LeptonX", folderName)).Execute(context); + new MoveFolderStep(file.Name, file.Name.Replace(oldFolderName, newFolderName)).Execute(context); } } @@ -619,7 +589,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep context, $"/MyCompanyName.MyProjectName{project.Key}/{project.Value}.cs", defaultThemeName, - BasicTheme + Basic ); } } @@ -654,21 +624,21 @@ public class ChangeThemeStep : ProjectBuildPipelineStep context, $"/MyCompanyName.MyProjectName.{project.Key}/Pages/_Host.cshtml", $"{defaultThemeName}Theme.Components", - BasicTheme + Basic ); ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{project.Key}/{project.Value}.cs", defaultThemeName, - BasicTheme + Basic ); ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{project.Key}/Pages/_Host.cshtml", defaultThemeName, - BasicTheme + Basic ); } } @@ -696,15 +666,15 @@ public class ChangeThemeStep : ProjectBuildPipelineStep ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameBlazorModule.cs", - LeptonXTheme, - LeptonTheme + LeptonX, + Lepton ); ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml", - LeptonXTheme, - LeptonTheme + LeptonX, + Lepton ); RemoveLinesByStatement( @@ -745,15 +715,15 @@ public class ChangeThemeStep : ProjectBuildPipelineStep ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{projectName}/MyProjectNameModule.cs", - LeptonXTheme, - LeptonTheme + LeptonX, + Lepton ); ReplaceAllKeywords( context, $"/MyCompanyName.MyProjectName.{projectName}/Pages/_Host.cshtml", - LeptonXTheme, - LeptonTheme + LeptonX, + Lepton ); } } @@ -800,8 +770,8 @@ public class ChangeThemeStep : ProjectBuildPipelineStep ReplaceAllKeywords( context, "/MyCompanyName.MyProjectName.MauiBlazor/MyProjectNameMauiBlazorModule.cs", - LeptonXTheme, - LeptonTheme + LeptonX, + Lepton ); } } \ No newline at end of file From 8062236d94266aef8352a2a02104fb1585b38448 Mon Sep 17 00:00:00 2001 From: Hamza Albreem <94292623+braim23@users.noreply.github.com> Date: Fri, 12 May 2023 16:45:32 +0300 Subject: [PATCH 25/52] Quick Fix for the rn doc --- docs/en/Getting-Started-React-Native.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/en/Getting-Started-React-Native.md b/docs/en/Getting-Started-React-Native.md index a62512fb45..bc3c7ef419 100644 --- a/docs/en/Getting-Started-React-Native.md +++ b/docs/en/Getting-Started-React-Native.md @@ -79,17 +79,17 @@ A React Native application running on an Android emulator or a physical phone ** {{ if Tiered == "No"}} ![React Native host project local IP entry](images/rn-host-local-ip.png) -- Open the `appsettings.json` in the `.HttpApi.Host` folder. Replace the `localhost` address on the `SelfUrl` and `Authority` properties with your local IP address. -- Open the `launchSettings.json` in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. +- Open the `appsettings.json` file in the `.HttpApi.Host` folder. Replace the `localhost` address on the `SelfUrl` and `Authority` properties with your local IP address. +- Open the `launchSettings.json` file in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. {{ else if Tiered == "Yes" }} ![React Native tiered project local IP entry](images/rn-tiered-local-ip.png) -- Open the `appsettings.json` in the `.AuthServer` folder. Replace the `localhost` address on the `SelfUrl` property with your local IP address. -- Open the `launchSettings.json` in the `.AuthServer/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. -- Open the `appsettings.json` in the `.HttpApi.Host` folder. Replace the `localhost` address on the `Authority` property with your local IP address. -- Open the `launchSettings.json` in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. +- Open the `appsettings.json` file in the `.AuthServer` folder. Replace the `localhost` address on the `SelfUrl` property with your local IP address. +- Open the `launchSettings.json` file in the `.AuthServer/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. +- Open the `appsettings.json` file in the `.HttpApi.Host` folder. Replace the `localhost` address on the `Authority` property with your local IP address. +- Open the `launchSettings.json` file in the `.HttpApi.Host/Properties` folder. Replace the `localhost` address on the `applicationUrl` properties with your local IP address. {{ end }} @@ -99,7 +99,7 @@ Run the backend application as described in the [getting started document](Getti ## How to disable the Https-only settings of OpenIddict -Go to MyProjectNameHttpApiHostModule.cs under the host project. Add put these codes under the `PreConfigureServices` function. +Go to MyProjectNameHttpApiHostModule.cs under the host project. And put these codes under the `PreConfigureServices` function. ```csharp #if DEBUG @@ -128,13 +128,13 @@ Go to MyProjectNameHttpApiHostModule.cs under the host project. Add put these co {{ end }} -4. Run `yarn start` or `npm start`. Wait Expo CLI to print opitons. +4. Run `yarn start` or `npm start`. Wait for the Expo CLI to print the opitons. > The React Native application was generated with [Expo](https://expo.io/). Expo is a set of tools built around React Native to help you quickly start an app and, while it has many features. ![expo-cli-options](images/rn-options.png) -In the above image, you can start the application with an Android emulator, an iOS simulator or a physical phone by the scan the QR code with the [Expo Client](https://expo.io/tools#client) or choosing the option. +In the above image, you can start the application with an Android emulator, an iOS simulator or a physical phone by scanning the QR code with the [Expo Client](https://expo.io/tools#client) or choosing the option. ![React Native login screen on iPhone 11](images/rn-login-iphone.png) From 6fef25c797fdbb1bdf1fe13e5d4262fde2e1c920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= Date: Fri, 12 May 2023 16:45:47 +0300 Subject: [PATCH 26/52] tidy up formatting --- docs/en/UI/Angular/Checkbox-Component.md | 16 ++++++++++++++-- docs/en/UI/Angular/FormInput-Component.md | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/docs/en/UI/Angular/Checkbox-Component.md b/docs/en/UI/Angular/Checkbox-Component.md index e33611e471..15d2a418ae 100644 --- a/docs/en/UI/Angular/Checkbox-Component.md +++ b/docs/en/UI/Angular/Checkbox-Component.md @@ -2,7 +2,19 @@ The ABP Checkbox Component is a reusable form input component for checkbox type. -It takes `label`, `labelClass` (default form-check-label), `checkboxId`,`checkboxReadonly`,`checkboxReadonly` (default form-check-input) and `checkboxStyle` as input to customize component. Also, it emits `checkboxBlur` and `checkboxFocus` events when component gain or lose focus. +# Inputs + +- `label` +- `labelClass (default form-check-label)` +- `checkboxId` +- `checkboxReadonly` +- `checkboxReadonly (default form-check-input)` +- `checkboxStyle` + +# Outputs + +- `checkboxBlur` +- `checkboxFocus` # Usage @@ -36,4 +48,4 @@ Then, the `abp-checkbox` component can be used. See the example below: See the checkbox input result below: -![abp-form-input](./images/form-checkbox.png) +![abp-checkbox](./images/form-checkbox.png) diff --git a/docs/en/UI/Angular/FormInput-Component.md b/docs/en/UI/Angular/FormInput-Component.md index 11b857ddb4..a7a4bda0fd 100644 --- a/docs/en/UI/Angular/FormInput-Component.md +++ b/docs/en/UI/Angular/FormInput-Component.md @@ -2,7 +2,16 @@ The ABP FormInput Component is a reusable form input component for text type. -It takes `label`, `labelClass` (default form-label), `inputId`,`inputPlaceholder`,`inputReadonly`,`inputClass` (default form-control) and `inputStyle` as input to customize component. Also, it emits `formBlur` and `formFocus` events when component gain or lose focus. +# Inputs +* `label` +* `labelClass (default form-label)` +* `inputPlaceholder` +* `inputReadonly` +* `inputClass (default form-control)` + +# Outputs +* `formBlur` +* `formFocus` # Usage @@ -12,14 +21,14 @@ ABP FormInput component is a part of the `ThemeSharedModule` module. If you've i // my-feature.module.ts import { ThemeSharedModule } from "@abp/ng.theme.shared"; -import { FomrInputDemoComponent } from "./FomrInputDemoComponent.component"; +import { FormInputDemoComponent } from "./FomrInputDemoComponent.component"; @NgModule({ imports: [ ThemeSharedModule, // ... ], - declarations: [FomrInputDemoComponent], + declarations: [FormInputDemoComponent], // ... }) export class MyFeatureModule {} From b8e83f3952afe39a01329ffa359a2b6f73b75385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= Date: Fri, 12 May 2023 16:52:36 +0300 Subject: [PATCH 27/52] Update Checkbox-Component.md --- docs/en/UI/Angular/Checkbox-Component.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/UI/Angular/Checkbox-Component.md b/docs/en/UI/Angular/Checkbox-Component.md index 15d2a418ae..d85ba283e9 100644 --- a/docs/en/UI/Angular/Checkbox-Component.md +++ b/docs/en/UI/Angular/Checkbox-Component.md @@ -27,8 +27,8 @@ import { ThemeSharedModule } from "@abp/ng.theme.shared"; import { CheckboxDemoComponent } from "./CheckboxDemoComponent.component"; @NgModule({ - imports: [ - ThemeSharedModule, +imports: [ + ThemeSharedModule, // ... ], declarations: [CheckboxDemoComponent], From cadb7835a9d90c73790c34e17f26d0f4af3137a7 Mon Sep 17 00:00:00 2001 From: Masum ULU <49063256+masumulu28@users.noreply.github.com> Date: Fri, 12 May 2023 16:58:43 +0300 Subject: [PATCH 28/52] Update FormInput-Component.md --- docs/en/UI/Angular/FormInput-Component.md | 25 ++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/docs/en/UI/Angular/FormInput-Component.md b/docs/en/UI/Angular/FormInput-Component.md index a7a4bda0fd..07f72cefc2 100644 --- a/docs/en/UI/Angular/FormInput-Component.md +++ b/docs/en/UI/Angular/FormInput-Component.md @@ -18,18 +18,15 @@ The ABP FormInput Component is a reusable form input component for text type. ABP FormInput component is a part of the `ThemeSharedModule` module. If you've imported that module into your module, you don't need to import it again. If not, first import it as shown below: ```ts -// my-feature.module.ts - import { ThemeSharedModule } from "@abp/ng.theme.shared"; import { FormInputDemoComponent } from "./FomrInputDemoComponent.component"; @NgModule({ - imports: [ - ThemeSharedModule, - // ... - ], - declarations: [FormInputDemoComponent], - // ... + imports: [ + ThemeSharedModule, + // ... + ], + declarations: [FormInputDemoComponent], }) export class MyFeatureModule {} ``` @@ -38,12 +35,12 @@ Then, the `abp-form-input` component can be used. See the example below: ```html
-
- -
+
+ +
``` From a20540230432d2c67d0261f70274a477a8c649a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= Date: Fri, 12 May 2023 17:03:25 +0300 Subject: [PATCH 29/52] Update Checkbox-Component.md --- docs/en/UI/Angular/Checkbox-Component.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/en/UI/Angular/Checkbox-Component.md b/docs/en/UI/Angular/Checkbox-Component.md index d85ba283e9..f97181b423 100644 --- a/docs/en/UI/Angular/Checkbox-Component.md +++ b/docs/en/UI/Angular/Checkbox-Component.md @@ -27,12 +27,12 @@ import { ThemeSharedModule } from "@abp/ng.theme.shared"; import { CheckboxDemoComponent } from "./CheckboxDemoComponent.component"; @NgModule({ -imports: [ - ThemeSharedModule, - // ... - ], - declarations: [CheckboxDemoComponent], - // ... + imports: [ + ThemeSharedModule, + // ... + ], + declarations: [CheckboxDemoComponent], + // ... }) export class MyFeatureModule {} ``` @@ -41,8 +41,8 @@ Then, the `abp-checkbox` component can be used. See the example below: ```html
- - + +
``` From 6ae929ac740c6cbe3219505df57b914cb1c0effd Mon Sep 17 00:00:00 2001 From: Hamza Albreem <94292623+braim23@users.noreply.github.com> Date: Fri, 12 May 2023 17:15:44 +0300 Subject: [PATCH 30/52] Quick fix for the Checkbox-Component Doc --- docs/en/UI/Angular/Checkbox-Component.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/UI/Angular/Checkbox-Component.md b/docs/en/UI/Angular/Checkbox-Component.md index f97181b423..898f86732c 100644 --- a/docs/en/UI/Angular/Checkbox-Component.md +++ b/docs/en/UI/Angular/Checkbox-Component.md @@ -1,6 +1,6 @@ # Checkbox Component -The ABP Checkbox Component is a reusable form input component for checkbox type. +The ABP Checkbox Component is a reusable form input component for the checkbox type. # Inputs @@ -18,7 +18,7 @@ The ABP Checkbox Component is a reusable form input component for checkbox type. # Usage -ABP Checkbox component is a part of the `ThemeSharedModule` module. If you've imported that module into your module, you don't need to import it again. If not, first import it as shown below: +The ABP Checkbox component is a part of the `ThemeSharedModule` module. If you've imported that module into your module, there's no need to import it again. If not, then first import it as shown below: ```ts // my-feature.module.ts From aed61cc430e63f20836220621678aa0add938164 Mon Sep 17 00:00:00 2001 From: Hamza Albreem <94292623+braim23@users.noreply.github.com> Date: Fri, 12 May 2023 17:19:09 +0300 Subject: [PATCH 31/52] Quick fix for the FormInput-Component Doc --- docs/en/UI/Angular/FormInput-Component.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/UI/Angular/FormInput-Component.md b/docs/en/UI/Angular/FormInput-Component.md index 07f72cefc2..f1dedd824a 100644 --- a/docs/en/UI/Angular/FormInput-Component.md +++ b/docs/en/UI/Angular/FormInput-Component.md @@ -1,6 +1,6 @@ # Form Input Component -The ABP FormInput Component is a reusable form input component for text type. +The ABP FormInput Component is a reusable form input component for the text type. # Inputs * `label` @@ -15,7 +15,7 @@ The ABP FormInput Component is a reusable form input component for text type. # Usage -ABP FormInput component is a part of the `ThemeSharedModule` module. If you've imported that module into your module, you don't need to import it again. If not, first import it as shown below: +The ABP FormInput component is a part of the `ThemeSharedModule` module. If you've imported that module into your module, there's no need to import it again. If not, then first import it as shown below: ```ts import { ThemeSharedModule } from "@abp/ng.theme.shared"; From b335898a8c48a296c8a67bf9f1d0f2ec8829a664 Mon Sep 17 00:00:00 2001 From: Salih Date: Sun, 7 May 2023 15:49:25 +0300 Subject: [PATCH 32/52] Fix Mvc dynamic Form DateTimePicker Error --- .../bootstrap/dom-event-handlers.js | 21 +++++++++++-------- .../bootstrap/modal-manager.js | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js index 945df5d0c6..f62dbdb011 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js @@ -772,17 +772,20 @@ abp.event.on('abp.configurationInitialized', function () { abp.libs.bootstrapDatepicker.normalizeLanguageConfig(); }); + + abp.dom.initializers.initializeAll = function ($rootNode) { + abp.dom.initializers.initializeToolTips($rootNode.findWithSelf('[data-toggle="tooltip"]')); + abp.dom.initializers.initializePopovers($rootNode.findWithSelf('[data-toggle="popover"]')); + abp.dom.initializers.initializeTimeAgos($rootNode.findWithSelf('.timeago')); + abp.dom.initializers.initializeDatepickers($rootNode); + abp.dom.initializers.initializeDateRangePickers($rootNode); + abp.dom.initializers.initializeForms($rootNode.findWithSelf('form')); + abp.dom.initializers.initializeAutocompleteSelects($rootNode.findWithSelf('.auto-complete-select')); + $rootNode.findWithSelf('[data-auto-focus="true"]').first().findWithSelf('input,select').focus(); + }; $(function () { - abp.dom.initializers.initializeToolTips($('[data-toggle="tooltip"]')); - abp.dom.initializers.initializePopovers($('[data-toggle="popover"]')); - abp.dom.initializers.initializeTimeAgos($('.timeago')); - abp.dom.initializers.initializeDatepickers($(document)); - abp.dom.initializers.initializeDateRangePickers($(document)); - abp.dom.initializers.initializeForms($('form')); - abp.dom.initializers.initializeAutocompleteSelects($('.auto-complete-select')); - $('[data-auto-focus="true"]').first().findWithSelf('input,select').focus(); - + abp.dom.initializers.initializeAll($(document)); }); })(jQuery); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js index e524881176..9a19869050 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js @@ -66,6 +66,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f } function _initAndShowModal() { + abp.dom.initializers.initializeAll(_$modalContainer); _$modal = _$modalContainer.find('.modal'); _$form = _$modalContainer.find('form'); if (_$form.length) { From 1ee99e371013195289aa5849ed48658df795abd5 Mon Sep 17 00:00:00 2001 From: Salih Date: Sun, 7 May 2023 15:50:01 +0300 Subject: [PATCH 33/52] Fix single datepicker end date assignment bug --- .../bootstrap/dom-event-handlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js index f62dbdb011..8157778059 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js @@ -644,7 +644,7 @@ if (momentStartDate.isValid()) { picker.setStartDate(momentStartDate); } - if (momentEndDate.isValid()) { + if (momentEndDate.isValid() && !singleDatePicker) { picker.setEndDate(momentEndDate); } }); From 9209cafffcac37d901222764c9cca44bd54feb03 Mon Sep 17 00:00:00 2001 From: Salih Date: Mon, 8 May 2023 10:38:04 +0300 Subject: [PATCH 34/52] Fix DatePickerOptions --- .../DatePicker/AbpDatePickerBaseTagHelper.cs | 7 ++++++- .../AbpDatePickerBaseTagHelperService.cs | 14 +++++-------- .../bootstrap/dom-event-handlers.js | 21 +++++++++---------- .../bootstrap/modal-manager.js | 1 - 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelper.cs index 10923f25af..7f9c34fb7a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelper.cs @@ -9,7 +9,7 @@ public abstract class where TTagHelper : AbpDatePickerBaseTagHelper { - private readonly IAbpDatePickerOptions _abpDatePickerOptionsImplementation; + private IAbpDatePickerOptions _abpDatePickerOptionsImplementation; public string Label { get; set; } @@ -47,6 +47,11 @@ public abstract class { _abpDatePickerOptionsImplementation = new AbpDatePickerOptions(); } + + public void SetDatePickerOptions(IAbpDatePickerOptions options) + { + _abpDatePickerOptionsImplementation = options; + } public string PickerId { get => _abpDatePickerOptionsImplementation.PickerId; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs index c1ecc4b32d..3d7c857dbd 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs @@ -84,6 +84,11 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp AddReadOnlyAttribute(TagHelperOutput); AddPlaceholderAttribute(TagHelperOutput); AddInfoTextId(TagHelperOutput); + var optionsAttribute = GetAttributeAndModelExpression(out var modelExpression); + if (optionsAttribute != null) + { + TagHelper.SetDatePickerOptions(optionsAttribute.GetDatePickerOptions(modelExpression.ModelExplorer)); + } // Open and close button var openButtonContent = TagHelper.OpenButton @@ -426,15 +431,6 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp attrList.Add(attr); } - var optionsAttribute = GetAttributeAndModelExpression(out var modelExpression); - if (optionsAttribute != null) - { - foreach (var attr in ConvertDatePickerOptionsToAttributeList(optionsAttribute.GetDatePickerOptions(modelExpression.ModelExplorer))) - { - attrList.Add(attr); - } - } - AddBaseTagAttributes(attrList); return attrList; diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js index 8157778059..aec8582651 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js @@ -643,6 +643,7 @@ var momentEndDate = getMoment(endDate, options); if (momentStartDate.isValid()) { picker.setStartDate(momentStartDate); + picker.setEndDate(momentEndDate); } if (momentEndDate.isValid() && !singleDatePicker) { picker.setEndDate(momentEndDate); @@ -761,6 +762,7 @@ abp.dom.initializers.initializeForms(args.$el.findWithSelf('form'), true); abp.dom.initializers.initializeScript(args.$el); abp.dom.initializers.initializeAutocompleteSelects(args.$el.findWithSelf('.auto-complete-select')); + abp.dom.initializers.initializeDateRangePickers(args.$el); }); abp.dom.onNodeRemoved(function (args) { @@ -773,19 +775,16 @@ abp.libs.bootstrapDatepicker.normalizeLanguageConfig(); }); - abp.dom.initializers.initializeAll = function ($rootNode) { - abp.dom.initializers.initializeToolTips($rootNode.findWithSelf('[data-toggle="tooltip"]')); - abp.dom.initializers.initializePopovers($rootNode.findWithSelf('[data-toggle="popover"]')); - abp.dom.initializers.initializeTimeAgos($rootNode.findWithSelf('.timeago')); - abp.dom.initializers.initializeDatepickers($rootNode); - abp.dom.initializers.initializeDateRangePickers($rootNode); - abp.dom.initializers.initializeForms($rootNode.findWithSelf('form')); - abp.dom.initializers.initializeAutocompleteSelects($rootNode.findWithSelf('.auto-complete-select')); - $rootNode.findWithSelf('[data-auto-focus="true"]').first().findWithSelf('input,select').focus(); - }; $(function () { - abp.dom.initializers.initializeAll($(document)); + abp.dom.initializers.initializeToolTips($(document).findWithSelf('[data-toggle="tooltip"]')); + abp.dom.initializers.initializePopovers($(document).findWithSelf('[data-toggle="popover"]')); + abp.dom.initializers.initializeTimeAgos($(document).findWithSelf('.timeago')); + abp.dom.initializers.initializeDatepickers($(document)); + abp.dom.initializers.initializeDateRangePickers($(document)); + abp.dom.initializers.initializeForms($(document).findWithSelf('form')); + abp.dom.initializers.initializeAutocompleteSelects($(document).findWithSelf('.auto-complete-select')); + $(document).findWithSelf('[data-auto-focus="true"]').first().findWithSelf('input,select').focus(); }); })(jQuery); diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js index 9a19869050..e524881176 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/modal-manager.js @@ -66,7 +66,6 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f } function _initAndShowModal() { - abp.dom.initializers.initializeAll(_$modalContainer); _$modal = _$modalContainer.find('.modal'); _$form = _$modalContainer.find('form'); if (_$form.length) { From d90630d4e86b17b44d95a5ac164051ab2f7c8dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Can=20Y=C4=B1lmaz?= Date: Thu, 11 May 2023 16:20:40 +0300 Subject: [PATCH 35/52] fix identity package build error --- npm/ng-packs/packages/identity/ng-package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/identity/ng-package.json b/npm/ng-packs/packages/identity/ng-package.json index a0824f39e5..68f95303e4 100644 --- a/npm/ng-packs/packages/identity/ng-package.json +++ b/npm/ng-packs/packages/identity/ng-package.json @@ -6,6 +6,7 @@ }, "allowedNonPeerDependencies": [ "@abp/ng.theme.shared", - "@abp/ng.permission-management" + "@abp/ng.permission-management", + "@abp/ng.components" ] } From 02cdb681fb33e767eaa57c8afe5b793cf9b84e0e Mon Sep 17 00:00:00 2001 From: Salih Date: Mon, 15 May 2023 10:25:29 +0300 Subject: [PATCH 37/52] Update disabled input --- .../Form/DatePicker/AbpDatePickerBaseTagHelperService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs index 3d7c857dbd..6e5f0ad2f7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Form/DatePicker/AbpDatePickerBaseTagHelperService.cs @@ -587,7 +587,7 @@ public abstract class AbpDatePickerBaseTagHelperService : AbpTagHelp abpButtonTagHelper.ButtonType = AbpButtonType.Outline_Secondary; abpButtonTagHelper.Icon = icon; - abpButtonTagHelper.Disabled = TagHelper.IsDisabled; + abpButtonTagHelper.Disabled = TagHelper.IsDisabled || GetAttribute() != null; if (!visible) { From b5349424a7b1f42eab98a9d62b6f075fed15e694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= <98148844+onurpicakci@users.noreply.github.com> Date: Mon, 15 May 2023 10:51:32 +0300 Subject: [PATCH 38/52] Commercial.abp.io: Added localizations of new testimonials --- .../AbpIoLocalization/Commercial/Localization/Resources/en.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index c6521a6c56..325bbd35a6 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -539,6 +539,8 @@ "Pricing_Page_Testimonial_5": "ABP Framework is not only a framework, but it is also a guide for project development/management, because it provides DDD, GenericRepository, DI, Microservice, and Modularity training. Even if you are not going to use the framework itself, you can develop yourself with docs.abp.io which is well and professionally prepared (OpenIddict, Redis, Quartz etc.). Because many things are pre-built, it shortens project development time significantly (Such as login page, exception handling, data filtering, seeding, audit logging, localization, auto API controller etc.). As an example from our application, I have used Local Event Bus for stock control. So, I am able to manage order movements by writing stock handler. It is wonderful not to lose time for CreationTime, CreatorId. They are being filled automatically.", "Pricing_Page_Testimonial_6": "ABP Framework is a good framework but it needs time to understand the different layers, classes, and libraries it used (specially ABP). I spent a lot of time reading the code base, but ABP Commercial save us time to create the project specialty entities (AR) and the repository linked to each of them. I liked also the approach used in ABP is very mature, we know is based on DDD and monolith.", "Pricing_Page_Testimonial_7": "As a startup we need to iterate quickly and spend minimal time on boilerplate and non-core features.\nOur engineers range from highly experienced to junior engineers, we needed a common understanding and a way to share technical and domain knowledge, ABP allowed us to do this due to their great guides and documentation. \nThere are things we haven't had to worry about since they work out of the box with ABP. \nABP helped us streamline rapid prototyping and development, less than 4 weeks from feature inception to production. With all its premium features included in the license, ABP has given us, \"Startup in a Box\" on the Software Engineering Side.", + "Pricing_Page_Testimonial_8": "I would recommend ABP commercial to all those who want to expand the range of products available to their customers. It's fantastic when need to use a distributed enterprise enviroment (Angualr, WPF, Win&Linux). In addition to their products, we love their support, which makes our job faster and easier. We already know that we have found a great partner for the future who will support us in expanding our business.", + "Pricing_Page_Testimonial_9": "We are a company of 2 employees that's been in business for over 20 years.\nIn terms of our experience with ABP Commercial, we were approached by a client who requested that we develop a new human resources application in a modern environment to replace their 25-year-old Access application. We decided to transition from a desktop solution to a web-based one.\n\nAt the time, we had very little knowledge of web applications and .NET but we stumbled upon ABP Commercial, and with the help of ABP Framework, technical documentation, and ABP Suite, we were able to not only develop the application to the client's specifications but also successfully work within a .NET environment within a year.", "AbpBookDownloadArea_ClaimYourEBook": "Claim your Mastering ABP Framework E-Book", "AddMemberModal_Warning_1": "If the username you are trying to add doesn't exist in the system, please ask your team member to register on {0} and share the username of his/her account with you.", "MyOrganizations_Detail_WelcomeMessage": "Welcome to your organization, {0}", From aa65debbafc091c636ed9c44318ecd06836e24ff Mon Sep 17 00:00:00 2001 From: Salih Date: Mon, 15 May 2023 10:57:58 +0300 Subject: [PATCH 39/52] Update dom-event-handlers.js --- .../bootstrap/dom-event-handlers.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js index aec8582651..6501c23a14 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js @@ -777,14 +777,14 @@ $(function () { - abp.dom.initializers.initializeToolTips($(document).findWithSelf('[data-toggle="tooltip"]')); - abp.dom.initializers.initializePopovers($(document).findWithSelf('[data-toggle="popover"]')); - abp.dom.initializers.initializeTimeAgos($(document).findWithSelf('.timeago')); + abp.dom.initializers.initializeToolTips($('[data-toggle="tooltip"]')); + abp.dom.initializers.initializePopovers($('[data-toggle="popover"]')); + abp.dom.initializers.initializeTimeAgos($('.timeago')); abp.dom.initializers.initializeDatepickers($(document)); abp.dom.initializers.initializeDateRangePickers($(document)); - abp.dom.initializers.initializeForms($(document).findWithSelf('form')); - abp.dom.initializers.initializeAutocompleteSelects($(document).findWithSelf('.auto-complete-select')); - $(document).findWithSelf('[data-auto-focus="true"]').first().findWithSelf('input,select').focus(); + abp.dom.initializers.initializeForms($('form')); + abp.dom.initializers.initializeAutocompleteSelects($('.auto-complete-select')); + $('[data-auto-focus="true"]').first().findWithSelf('input,select').focus(); }); })(jQuery); From dce830d8e9f67d2d54c68832daf1167f85374164 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 15 May 2023 16:49:56 +0800 Subject: [PATCH 40/52] Support extra properties for users module --- .../Volo/Abp/Users/IUserData.cs | 3 ++- .../Volo/Abp/Users/UserData.cs | 10 ++++++++-- .../Volo/Abp/Users/UserEto.cs | 2 +- .../Volo/Abp/Users/AbpUserExtensions.cs | 3 ++- .../src/Volo.Abp.Users.Domain/Volo/Abp/Users/IUser.cs | 3 ++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/IUserData.cs b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/IUserData.cs index 66e2d2f4e8..8466c8d30e 100644 --- a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/IUserData.cs +++ b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/IUserData.cs @@ -1,9 +1,10 @@ using System; using JetBrains.Annotations; +using Volo.Abp.Data; namespace Volo.Abp.Users; -public interface IUserData +public interface IUserData : IHasExtraProperties { Guid Id { get; } diff --git a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserData.cs b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserData.cs index dbe0c7ab44..283d4993c8 100644 --- a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserData.cs +++ b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserData.cs @@ -1,9 +1,12 @@ using System; +using System.Collections.Generic; using JetBrains.Annotations; +using Volo.Abp.Data; +using Volo.Abp.ObjectExtending; namespace Volo.Abp.Users; -public class UserData : IUserData +public class UserData : ExtensibleObject, IUserData { public Guid Id { get; set; } @@ -42,6 +45,7 @@ public class UserData : IUserData PhoneNumber = userData.PhoneNumber; PhoneNumberConfirmed = userData.PhoneNumberConfirmed; TenantId = userData.TenantId; + ExtraProperties = userData.ExtraProperties; } public UserData( @@ -54,7 +58,8 @@ public class UserData : IUserData [CanBeNull] string phoneNumber = null, bool phoneNumberConfirmed = false, Guid? tenantId = null, - bool isActive = true) + bool isActive = true, + ExtraPropertyDictionary extraProperties = null) { Id = id; UserName = userName; @@ -66,5 +71,6 @@ public class UserData : IUserData PhoneNumber = phoneNumber; PhoneNumberConfirmed = phoneNumberConfirmed; TenantId = tenantId; + ExtraProperties = extraProperties; } } diff --git a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserEto.cs b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserEto.cs index e99befa225..663540169b 100644 --- a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserEto.cs +++ b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserEto.cs @@ -6,7 +6,7 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.Users; [EventName("Volo.Abp.Users.User")] -public class UserEto : IUserData, IHasExtraProperties, IMultiTenant +public class UserEto : IUserData, IMultiTenant { public Guid Id { get; set; } diff --git a/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/AbpUserExtensions.cs b/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/AbpUserExtensions.cs index 5bace83c1b..d026509dba 100644 --- a/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/AbpUserExtensions.cs +++ b/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/AbpUserExtensions.cs @@ -14,7 +14,8 @@ public static class AbpUserExtensions emailConfirmed: user.EmailConfirmed, phoneNumber: user.PhoneNumber, phoneNumberConfirmed: user.PhoneNumberConfirmed, - tenantId: user.TenantId + tenantId: user.TenantId, + extraProperties: user.ExtraProperties ); } } diff --git a/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/IUser.cs b/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/IUser.cs index 5fca8c32dc..689e60c242 100644 --- a/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/IUser.cs +++ b/modules/users/src/Volo.Abp.Users.Domain/Volo/Abp/Users/IUser.cs @@ -1,11 +1,12 @@ using System; using JetBrains.Annotations; +using Volo.Abp.Data; using Volo.Abp.Domain.Entities; using Volo.Abp.MultiTenancy; namespace Volo.Abp.Users; -public interface IUser : IAggregateRoot, IMultiTenant +public interface IUser : IAggregateRoot, IMultiTenant, IHasExtraProperties { string UserName { get; } From 43b9509d8e4bd7a4b09e8800be0db781a322cd5f Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 15 May 2023 16:52:43 +0800 Subject: [PATCH 41/52] Update UserData.cs --- .../Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserData.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserData.cs b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserData.cs index 283d4993c8..e08d6fbaf0 100644 --- a/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserData.cs +++ b/modules/users/src/Volo.Abp.Users.Abstractions/Volo/Abp/Users/UserData.cs @@ -6,7 +6,7 @@ using Volo.Abp.ObjectExtending; namespace Volo.Abp.Users; -public class UserData : ExtensibleObject, IUserData +public class UserData : IUserData { public Guid Id { get; set; } @@ -27,6 +27,8 @@ public class UserData : ExtensibleObject, IUserData public string PhoneNumber { get; set; } public bool PhoneNumberConfirmed { get; set; } + + public ExtraPropertyDictionary ExtraProperties { get; } public UserData() { From 2c3653aff354c8ad85c56dc7f06824361bf5b8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alper=20Ebi=C3=A7o=C4=9Flu?= <9526587+ebicoglu@users.noreply.github.com> Date: Mon, 15 May 2023 14:09:55 +0300 Subject: [PATCH 42/52] Update UserConsts.cs --- .../Volo/Blogging/Users/UserConsts.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Users/UserConsts.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Users/UserConsts.cs index 3ad08da0d2..3cd7dd2252 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Users/UserConsts.cs +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Users/UserConsts.cs @@ -10,13 +10,13 @@ public class UserConsts public const int MaxWebSiteLength = 256; - public const int MaxTwitterLength = 64; + public const int MaxTwitterLength = 128; - public const int MaxGithubLength = 64; + public const int MaxGithubLength = 256; - public const int MaxLinkedinLength = 64; + public const int MaxLinkedinLength = 256; - public const int MaxCompanyLength = 128; + public const int MaxCompanyLength = 256; - public const int MaxJobTitleLength = 32; -} \ No newline at end of file + public const int MaxJobTitleLength = 128; +} From 083ee84e4028ac2f4e4b7db3cf7194a58d307e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alper=20Ebi=C3=A7o=C4=9Flu?= <9526587+ebicoglu@users.noreply.github.com> Date: Mon, 15 May 2023 14:11:32 +0300 Subject: [PATCH 43/52] Update Index.js --- .../blogging/src/Volo.Blogging.Web/Pages/Members/Index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js index 75f59564d2..6cafed0455 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Members/Index.js @@ -1,10 +1,9 @@ $(function () { - var hash = window.location.hash; - if(hash === '#edit-profile'){ + 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 = ''; } -}); \ No newline at end of file +}); From 59f35359221e100d4bfe9cdbd8d3821651aa97fe Mon Sep 17 00:00:00 2001 From: Masum ULU <49063256+masumulu28@users.noreply.github.com> Date: Mon, 15 May 2023 14:41:57 +0300 Subject: [PATCH 44/52] add "perfect-scrollbar" to package.json --- npm/ng-packs/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index 7c594cf1a2..8f68f98e24 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -114,6 +114,7 @@ "nx": "15.2.1", "postcss": "^8.3.9", "postcss-import": "14.1.0", + "perfect-scrollbar": "^1.5.5", "postcss-preset-env": "7.5.0", "postcss-url": "10.1.3", "prettier": "2.7.1", From 88d15b28177f1041a4a99d3606e7526dbcf32631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= <98148844+onurpicakci@users.noreply.github.com> Date: Mon, 15 May 2023 16:07:23 +0300 Subject: [PATCH 45/52] Commercial.abp.io: localization added for new faq --- .../Commercial/Localization/Resources/en.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index 325bbd35a6..a0a6519bc3 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -834,6 +834,13 @@ "Volo.AbpIo.Commercial:040001": "API Access Key is incorrect.", "GetLepton": "Get Lepton Now", "MyOrganizations_Detail_LicenseStartDate": "License Start Date", - "MyOrganizations_Detail_LicenseExpiryDate": "Expiry Date" + "MyOrganizations_Detail_LicenseExpiryDate": "Expiry Date", + "BlazoriseSupport": "How do I get the Blazorise license key and support from the Blazorise team?", + "BlazoriseSupportExplanation": "Follow the steps below to get support from the Blazorise team and get your Blazorise license key:", + "BlazoriseSupportExplanation1": "Sign up for a new account at blazorise.com/support/register with the same email address as your abp.io account. Leave the \"License Key\" entry blank. It must be the same email address as your email account on abp.io.", + "BlazoriseSupportExplanation2": "Verify your email address by checking your email box. Check your spam box if you don't see an email in your inbox!", + "BlazoriseSupportExplanation3": "Log into the Blazorise support website at blazorise.com/support/login.", + "BlazoriseSupportExplanation4": "If you have an active ABP Commercial license, you will also have a Blazorise PRO license. You can get your Blazorise license key at blazorise.com/support/user/manage/license.", + "BlazoriseSupportExplanation5": "You can post your questions on the support website and generate a product token for your application." } } From a01c13d62625e41c2e960e679499a5184412f0ab Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Mon, 15 May 2023 16:35:07 +0300 Subject: [PATCH 46/52] Update en.json --- .../Commercial/Localization/Resources/en.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index a0a6519bc3..22ed6a604e 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -837,10 +837,10 @@ "MyOrganizations_Detail_LicenseExpiryDate": "Expiry Date", "BlazoriseSupport": "How do I get the Blazorise license key and support from the Blazorise team?", "BlazoriseSupportExplanation": "Follow the steps below to get support from the Blazorise team and get your Blazorise license key:", - "BlazoriseSupportExplanation1": "Sign up for a new account at blazorise.com/support/register with the same email address as your abp.io account. Leave the \"License Key\" entry blank. It must be the same email address as your email account on abp.io.", + "BlazoriseSupportExplanation1": "Sign up for a new account at blazorise.com/support/register with the same email address as your abp.io account. Leave the \"License Key\" entry blank. It must be the same email address as your email account on abp.io.", "BlazoriseSupportExplanation2": "Verify your email address by checking your email box. Check your spam box if you don't see an email in your inbox!", - "BlazoriseSupportExplanation3": "Log into the Blazorise support website at blazorise.com/support/login.", - "BlazoriseSupportExplanation4": "If you have an active ABP Commercial license, you will also have a Blazorise PRO license. You can get your Blazorise license key at blazorise.com/support/user/manage/license.", + "BlazoriseSupportExplanation3": "Log into the Blazorise support website at blazorise.com/support/login.", + "BlazoriseSupportExplanation4": "If you have an active ABP Commercial license, you will also have a Blazorise PRO license. You can get your Blazorise license key at blazorise.com/support/user/manage/license.", "BlazoriseSupportExplanation5": "You can post your questions on the support website and generate a product token for your application." } } From 106596d6e82045e3a56f82168e489f03c2ad7d34 Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Mon, 15 May 2023 16:37:15 +0300 Subject: [PATCH 47/52] Update en.json --- .../Commercial/Localization/Resources/en.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index 22ed6a604e..9efe75ad7e 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -837,10 +837,10 @@ "MyOrganizations_Detail_LicenseExpiryDate": "Expiry Date", "BlazoriseSupport": "How do I get the Blazorise license key and support from the Blazorise team?", "BlazoriseSupportExplanation": "Follow the steps below to get support from the Blazorise team and get your Blazorise license key:", - "BlazoriseSupportExplanation1": "Sign up for a new account at blazorise.com/support/register with the same email address as your abp.io account. Leave the \"License Key\" entry blank. It must be the same email address as your email account on abp.io.", + "BlazoriseSupportExplanation1": "Sign up for a new account at blazorise.com/support/register with the same email address as your abp.io account. Leave the \"License Key\" entry blank. It must be the same email address as your email account on abp.io.", "BlazoriseSupportExplanation2": "Verify your email address by checking your email box. Check your spam box if you don't see an email in your inbox!", - "BlazoriseSupportExplanation3": "Log into the Blazorise support website at blazorise.com/support/login.", - "BlazoriseSupportExplanation4": "If you have an active ABP Commercial license, you will also have a Blazorise PRO license. You can get your Blazorise license key at blazorise.com/support/user/manage/license.", + "BlazoriseSupportExplanation3": "Log into the Blazorise support website at blazorise.com/support/login.", + "BlazoriseSupportExplanation4": "If you have an active ABP Commercial license, you will also have a Blazorise PRO license. You can get your Blazorise license key at blazorise.com/support/user/manage/license.", "BlazoriseSupportExplanation5": "You can post your questions on the support website and generate a product token for your application." } } From 5e358c02d324b167e7f8f0fa02ba4ce9e1ff93d1 Mon Sep 17 00:00:00 2001 From: Ebicoglu Date: Mon, 15 May 2023 17:22:02 +0300 Subject: [PATCH 48/52] add Code Of Conduct. issue volosoft/vs-internal#1215 --- CODE_OF_CONDUCT.md | 94 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..247193db89 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ +# Contributor Covenant Code of Conduct + +## Preamble + +The ABP Framework was created to implement common generic web application features in a common code base. This approach helps developers to decouple line of business application features from their custom business logic. Besides, the ABP Framework helps create MVPs and kick-start your project as quickly as possible. All the contributors try to save valuable time by automating repetitive tasks at the framework level. This code of conduct has been adopted by many [other open source communities](http://contributor-covenant.org/adopters/) and we feel it expresses our values well. + + + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + + + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +- Focusing on what is best not just for us as individuals but for the overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others’ private information, such as a physical or email address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + + + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct and will communicate reasons for moderation decisions when appropriate. + + + +## Scope + +This Code of Conduct applies within all community spaces and when an individual officially represents the community in public spaces. Examples of representing our community include: + +- Using an official e-mail address. +- Posting via an official social media account. +- Acting as an appointed representative at an online or offline event. + + + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [info@abp.io](mailto:info@abp.io). All complaints will be reviewed and investigated promptly and fairly. All community leaders must to respect the privacy and security of the reporter of any incident. + + + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact:** Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence:** A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact:** A violation through a single incident or series of actions. + +**Consequence:** A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period. This includes avoiding interactions in community spaces and external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact:** A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence:** A temporary ban from any interaction or public communication with the community for a specified period. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact:** Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence:** A permanent ban from any sort of public interaction within the community. + + + +## Attribution + +This document is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. +Community Impact Guidelines were inspired by [Mozilla’s code of conduct enforcement ladder](https://github.com/mozilla/diversity). +For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. +Translations are available at https://www.contributor-covenant.org/translations. From a56cd147e21310a69d487027106741a617f4f88b Mon Sep 17 00:00:00 2001 From: Ebicoglu Date: Mon, 15 May 2023 17:30:00 +0300 Subject: [PATCH 49/52] add Code of Conduct. Issue volosoft/vs-internal#1215 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b588e0cba4..03f1a15374 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![NuGet (with prereleases)](https://img.shields.io/nuget/vpre/Volo.Abp.Core.svg?style=flat-square)](https://www.nuget.org/packages/Volo.Abp.Core) [![MyGet (nightly builds)](https://img.shields.io/myget/abp-nightly/vpre/Volo.Abp.svg?style=flat-square)](https://docs.abp.io/en/abp/latest/Nightly-Builds) [![NuGet Download](https://img.shields.io/nuget/dt/Volo.Abp.Core.svg?style=flat-square)](https://www.nuget.org/packages/Volo.Abp.Core) - +[![Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](https://github.com/abpframework/abp/blob/dev/CODE_OF_CONDUCT.md) [![ABP Discord server](https://img.shields.io/discord/951497912645476422?label=Discord)](https://discord.gg/abp) ABP Framework is a complete **infrastructure** based on **ASP.NET Core** to create **modern web applications** and **APIs** by following the software development **best practices** and the **latest technologies**. Check out https://abp.io From e07eaa44f8413c81ff54a45e98219c49111fa67a Mon Sep 17 00:00:00 2001 From: Ebicoglu Date: Mon, 15 May 2023 18:02:04 +0300 Subject: [PATCH 50/52] add CLA signed badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 03f1a15374..f1f941f794 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![MyGet (nightly builds)](https://img.shields.io/myget/abp-nightly/vpre/Volo.Abp.svg?style=flat-square)](https://docs.abp.io/en/abp/latest/Nightly-Builds) [![NuGet Download](https://img.shields.io/nuget/dt/Volo.Abp.Core.svg?style=flat-square)](https://www.nuget.org/packages/Volo.Abp.Core) [![Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](https://github.com/abpframework/abp/blob/dev/CODE_OF_CONDUCT.md) +[![CLA Signed](https://cla-assistant.io/readme/badge/abpframework/abp)](https://cla-assistant.io/abpframework/abp) [![ABP Discord server](https://img.shields.io/discord/951497912645476422?label=Discord)](https://discord.gg/abp) ABP Framework is a complete **infrastructure** based on **ASP.NET Core** to create **modern web applications** and **APIs** by following the software development **best practices** and the **latest technologies**. Check out https://abp.io From 8e173757ea5c56c10f6457c134d1bcc0bf1512fa Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 16 May 2023 13:11:06 +0800 Subject: [PATCH 51/52] Add `UpdateDockerImagesStep`. --- .../Microservice/MicroserviceTemplateBase.cs | 6 +++++ .../Microservice/UpdateDockerImagesStep.cs | 25 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/UpdateDockerImagesStep.cs diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs index 88fc0dfcbe..b8d320fb45 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs @@ -25,6 +25,7 @@ public abstract class MicroserviceTemplateBase : TemplateInfo RandomizeStringEncryption(context, steps); RandomizeAuthServerPassPhrase(context, steps); UpdateNuGetConfig(context, steps); + UpdateDockerImages(context, steps); ConfigureTheme(context, steps); return steps; @@ -221,4 +222,9 @@ public abstract class MicroserviceTemplateBase : TemplateInfo { steps.Add(new RandomizeAuthServerPassPhraseStep()); } + + private static void UpdateDockerImages(ProjectBuildContext context, List steps) + { + steps.Add(new UpdateDockerImagesStep("/etc/docker/docker-compose.infrastructure.yml")); + } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/UpdateDockerImagesStep.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/UpdateDockerImagesStep.cs new file mode 100644 index 0000000000..752503c871 --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/UpdateDockerImagesStep.cs @@ -0,0 +1,25 @@ +using System.Linq; +using System.Runtime.InteropServices; +using Volo.Abp.Cli.ProjectBuilding.Building; +using Volo.Abp.Cli.ProjectBuilding.Files; + +namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice; + +public class UpdateDockerImagesStep : ProjectBuildPipelineStep +{ + private readonly string _ymlFilePath; + + public UpdateDockerImagesStep(string ymlFilePath) + { + _ymlFilePath = ymlFilePath; + } + + public override void Execute(ProjectBuildContext context) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && RuntimeInformation.OSArchitecture == Architecture.Arm64) + { + var file = context.Files.FirstOrDefault(f => f.Name == _ymlFilePath); + file?.ReplaceText("mcr.microsoft.com/mssql/server:2019-latest", "mcr.microsoft.com/azure-sql-edge"); + } + } +} From 780e97fb0f06f69404244e2d0da58e3aa6a13860 Mon Sep 17 00:00:00 2001 From: selman koc <64414348+skoc10@users.noreply.github.com> Date: Tue, 16 May 2023 09:39:19 +0300 Subject: [PATCH 52/52] Update common.props --- common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.props b/common.props index f130f4bc7f..adfdf9a213 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 7.2.1 + 7.2.2 $(NoWarn);CS1591;CS0436 https://abp.io/assets/abp_nupkg.png https://abp.io/