mirror of https://github.com/abpframework/abp.git
51 changed files with 491 additions and 287 deletions
@ -0,0 +1,8 @@ |
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.WebApp; |
|||
|
|||
/// <summary>
|
|||
/// This class is used to indicate that the AddBlazorWebAppTieredServices method has been called for compatibility with the old template code
|
|||
/// </summary>
|
|||
internal sealed class AddBlazorWebAppTieredServicesHasBeenCalled |
|||
{ |
|||
} |
|||
@ -1 +1 @@ |
|||
.dataTable{width:100% !important;border-spacing:0 !important;}.table td,.table th{padding:8px 10px;}.dataTable tbody tr td button{cursor:pointer;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li{cursor:pointer;} |
|||
.dataTable{width:100%!important;border-spacing:0!important}.table td,.table th{padding:8px 10px}.dataTable tbody tr td button{cursor:pointer}.dataTable tbody tr td div.dropdown ul.dropdown-menu li{cursor:pointer}.abp-action-button ui.dropdown-menu[data-popper-reference-hidden]{visibility:hidden;pointer-events:none} |
|||
@ -0,0 +1,13 @@ |
|||
using System; |
|||
using MongoDB.Bson; |
|||
|
|||
namespace Volo.Abp.MongoDB; |
|||
|
|||
public class AbpGuidCustomBsonTypeMapper : ICustomBsonTypeMapper |
|||
{ |
|||
public bool TryMapToBsonValue(object value, out BsonValue bsonValue) |
|||
{ |
|||
bsonValue = new BsonBinaryData((Guid)value, GuidRepresentation.Standard); |
|||
return true; |
|||
} |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Shouldly; |
|||
using Xunit; |
|||
|
|||
namespace Volo.Abp.Json; |
|||
|
|||
[Collection("AbpJsonNewtonsoftJsonTest")] |
|||
public class AbpNewtonsoftSerializerProviderTests : AbpJsonNewtonsoftJsonTestBase |
|||
{ |
|||
protected IJsonSerializer JsonSerializer; |
|||
|
|||
public AbpNewtonsoftSerializerProviderTests() |
|||
{ |
|||
JsonSerializer = GetRequiredService<IJsonSerializer>(); |
|||
} |
|||
|
|||
public class File |
|||
{ |
|||
public string FileName { get; set; } |
|||
|
|||
public Dictionary<string, int> ExtraProperties { get; set; } |
|||
} |
|||
|
|||
[Fact] |
|||
public void Serialize_Deserialize_Test() |
|||
{ |
|||
var defaultIndent = " "; // Default indent is 2 spaces
|
|||
var newLine = Environment.NewLine; |
|||
var file = new File() |
|||
{ |
|||
FileName = "abp", |
|||
ExtraProperties = new Dictionary<string, int>() |
|||
{ |
|||
{ "One", 1 }, |
|||
{ "Two", 2 } |
|||
} |
|||
}; |
|||
|
|||
var json = JsonSerializer.Serialize(file, camelCase: true); |
|||
json.ShouldBe("{\"fileName\":\"abp\",\"extraProperties\":{\"One\":1,\"Two\":2}}"); |
|||
|
|||
json = JsonSerializer.Serialize(file, camelCase: true, indented: true); |
|||
json.ShouldBe($"{{{newLine}{defaultIndent}\"fileName\": \"abp\",{newLine}{defaultIndent}\"extraProperties\": {{{newLine}{defaultIndent}{defaultIndent}\"One\": 1,{newLine}{defaultIndent}{defaultIndent}\"Two\": 2{newLine}{defaultIndent}}}{newLine}}}"); |
|||
|
|||
json = JsonSerializer.Serialize(file, camelCase: false); |
|||
json.ShouldBe("{\"FileName\":\"abp\",\"ExtraProperties\":{\"One\":1,\"Two\":2}}"); |
|||
|
|||
json = JsonSerializer.Serialize(file, camelCase: false, indented: true); |
|||
json.ShouldBe($"{{{newLine}{defaultIndent}\"FileName\": \"abp\",{newLine}{defaultIndent}\"ExtraProperties\": {{{newLine}{defaultIndent}{defaultIndent}\"One\": 1,{newLine}{defaultIndent}{defaultIndent}\"Two\": 2{newLine}{defaultIndent}}}{newLine}}}"); |
|||
} |
|||
} |
|||
@ -1,27 +1,12 @@ |
|||
{ |
|||
"iisSettings": { |
|||
"windowsAuthentication": false, |
|||
"anonymousAuthentication": true, |
|||
"iisExpress": { |
|||
"applicationUrl": "http://localhost:51339", |
|||
"sslPort": 0 |
|||
} |
|||
}, |
|||
"profiles": { |
|||
"IIS Express": { |
|||
"commandName": "IISExpress", |
|||
"launchBrowser": true, |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
}, |
|||
"Volo.AbpIo.Commercial.Web": { |
|||
"Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo": { |
|||
"commandName": "Project", |
|||
"launchBrowser": true, |
|||
"applicationUrl": "http://localhost:5000", |
|||
"applicationUrl": "https://localhost:5000", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,18 +0,0 @@ |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo; |
|||
|
|||
public class Startup |
|||
{ |
|||
public void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddApplication<AbpAspNetCoreMvcUiBootstrapDemoModule>(); |
|||
} |
|||
|
|||
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) |
|||
{ |
|||
app.InitializeApplication(); |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
using Microsoft.AspNetCore.Builder; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo; |
|||
|
|||
public class Startup |
|||
{ |
|||
public void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddApplication<AbpAspNetCoreMvcUiThemeBasicDemoModule>(); |
|||
} |
|||
|
|||
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) |
|||
{ |
|||
app.InitializeApplication(); |
|||
} |
|||
} |
|||
@ -0,0 +1 @@ |
|||
export * from './lazy-translate.pipe'; |
|||
@ -0,0 +1,20 @@ |
|||
import { LocalizationService, ConfigStateService } from '@abp/ng.core'; |
|||
import { inject, Pipe, PipeTransform } from '@angular/core'; |
|||
import { Observable, filter, take, switchMap, shareReplay } from 'rxjs'; |
|||
|
|||
@Pipe({ |
|||
name: 'abpLazyTranslate', |
|||
}) |
|||
export class LazyTranslatePipe implements PipeTransform { |
|||
private localizationService = inject(LocalizationService); |
|||
private configStateService = inject(ConfigStateService); |
|||
|
|||
transform(key: string): Observable<string> { |
|||
return this.configStateService.getAll$().pipe( |
|||
filter(config => !!config.localization), |
|||
take(1), |
|||
switchMap(() => this.localizationService.get(key)), |
|||
shareReplay({ bufferSize: 1, refCount: true }), |
|||
); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue