Browse Source

Merge branch 'abpframework:dev' into dev

pull/19740/head
Tiago Viana 2 years ago
committed by GitHub
parent
commit
b0e541ea3f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 52
      Directory.Packages.props
  2. 3
      abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en.json
  3. 85
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/POST.md
  4. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/access-abp-framework-mvc-project.png
  5. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/add-environment-variables.png
  6. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/azure-container-abp.png
  7. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/azure-resources.png
  8. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/azure-sql-database-connection-strings.png
  9. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/build-docker-image.png
  10. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/check-job-status.png
  11. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/create-azure-container-apps-job.png
  12. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/create-azure-container-apps.png
  13. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/deploy-docker-image.png
  14. BIN
      docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/docker-hub-repository.png
  15. 6
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/en.json
  16. 9
      npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.html
  17. 2
      npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts
  18. 22
      npm/ng-packs/packages/core/src/lib/services/localization.service.ts
  19. 17
      npm/ng-packs/packages/core/src/lib/tokens/compare-func.token.ts
  20. 4
      npm/ng-packs/packages/oauth/src/lib/strategies/auth-code-flow-strategy.ts
  21. 2
      npm/ng-packs/packages/theme-shared/src/lib/adapters/time.adapter.ts
  22. 2
      npm/ng-packs/packages/theme-shared/src/lib/services/authentication-error-handler.service.ts
  23. 22
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Client/Menus/MyProjectNameMenuContributor.cs
  24. 20
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Tiered.Client/Menus/MyProjectNameMenuContributor.cs
  25. 79
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Tiered/Menus/MyProjectNameMenuContributor.cs
  26. 10
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Tiered/Menus/MyProjectNameMenus.cs
  27. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Tiered/MyProjectNameBlazorModule.cs
  28. 51
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp/Menus/MyProjectNameMenuContributor.cs
  29. 10
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp/Menus/MyProjectNameMenus.cs
  30. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp/MyProjectNameBlazorModule.cs
  31. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
  32. 3
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj

52
Directory.Packages.props

@ -49,36 +49,36 @@
<PackageVersion Include="Magick.NET-Q16-AnyCPU" Version="13.4.0" />
<PackageVersion Include="MailKit" Version="4.3.0" />
<PackageVersion Include="Markdig.Signed" Version="0.33.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authorization" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Authorization" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.25" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.4" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.5.0" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
@ -123,7 +123,7 @@
<PackageVersion Include="OpenIddict.Server.AspNetCore" Version="5.5.0" />
<PackageVersion Include="OpenIddict.Validation.AspNetCore" Version="5.5.0" />
<PackageVersion Include="OpenIddict.Validation.ServerIntegration" Version="5.5.0" />
<PackageVersion Include="Oracle.EntityFrameworkCore" Version="8.21.121" />
<PackageVersion Include="Oracle.EntityFrameworkCore" Version="8.23.40" />
<PackageVersion Include="Polly" Version="8.2.0" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />

3
abp_io/AbpIoLocalization/AbpIoLocalization/Account/Localization/Resources/en.json

@ -12,6 +12,7 @@
"CommunityWebSite": "ABP community website",
"ManageAccount": "My Account | ABP.IO",
"ManageYourProfile": "Manage your profile",
"ReturnToApplication": "Return to application"
"ReturnToApplication": "Return to application",
"IdentityUserNotAvailable:Deleted": "This email address is not available. Reason: Already deleted."
}
}

85
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/POST.md

@ -0,0 +1,85 @@
# Deploy Your ABP Framework MVC Project to Azure Container Apps
![](azure-container-abp.png)
In this article, we will show the seamless deployment of an ABP Framework MVC project to Azure Container Apps. enabling you to deploy and run containerized applications without the hassle of managing the infrastructure underneath. It provides an uncomplicated and cost-effective method for deploying and scaling your applications.
### Getting Started with ABP Framework MVC and Azure Container Apps
To get started, you will need an ABP Framework MVC project that you want to deploy. If you don't have one, you can [create a new project using the ABP CLI](https://docs.abp.io/en/abp/latest/Startup-Templates/Application). You will also need [an Azure subscription](https://azure.microsoft.com) and [an Azure SQL database](https://azure.microsoft.com/en-gb/products/azure-sql).
Before creating Azure container apps resources and deploying the ABP Framework MVC project, I show you how you can effortlessly create Docker images and push them to Docker Hub, leveraging the pre-configured Docker file and scripts that come with the ABP MVC framework.
### Creating a Docker Image for ABP Framework MVC
To create a Docker image for your ABP Framework MVC project, navigate to `etc/build/build-images-locally.ps1` and fix the script to match your Docker Hub username and image name. Then, run the script to build the Docker image locally.
![Build Docker Image](build-docker-image.png)
Next, check the Docker Hub repository to confirm that the image has been pushed successfully.
![Docker Hub Repository](docker-hub-repository.png)
### Deploying to Azure Container Apps
Now that you have Docker images for your ABP Framework MVC project, you can proceed to deploy it to Azure Container Apps. To do this, navigate to the Azure portal and create a new Azure Container Apps resource. Ypu will not need just an Azure Container Apps resource, but also an Azure Container Apps Job resource to migrate the database schema and seed data for your ABP Framework MVC project.
![Create Azure Container Apps](create-azure-container-apps.png)
#### Step 1: Deploy the Docker Image
Firstly, create a new Azure Container Apps resource without environment variables. You will need web url so that you can set it as an environment variable in the next step. Then, check the deployment status to confirm that the deployment was successful.
![Deploy Docker Image](deploy-docker-image.png)
#### Step 2: Migrate Database Schema and Seed Data
Secondly, create a new Azure Container Apps Job resource to migrate the database schema and seed data. You can do this by creating a new job with the following environment variables:
```text
ConnectionStrings__Default - Server=tcp:demoabpapp.database.windows.net,1433;Initial Catalog=mvcapppro;Persist Security Info=False;User ID=demoapppro;Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
OpenIddict__Applications__mvcapppro_Web__RootUrl - https://mvcwebapp.victoriousgrass-8b06438d.northeurope.azurecontainerapps.io
To get ConnectionStrings of Sql Database and url of the web app, you can navigate to the Azure portal and check the properties of the Azure SQL database and Azure Container Apps resource.
```
![Azure SQL Database Connection Strings](azure-sql-database-connection-strings.png)
![Create Azure Container Apps Job](create-azure-container-apps-job.png)
Finally, check the job status to confirm that the database migration and seeding were successful. You can connect to the Azure SQL database to verify that the schema and seed data have been applied.
![Check Job Status](check-job-status.png)
#### Step 3: Edit the Azure Container Apps Resource
After completing these steps, you have to edit the Azure Container Apps resource to add the required environment variables for your ABP Framework MVC project. You can do this by adding the following environment variables:
```text
App__SelfUrl - https://mvcwebapp.victoriousgrass-8b06438d.northeurope.azurecontainerapps.io
ASPNETCORE_URLS - http://+:80
AuthServer__Authority - https://mvcwebapp.victoriousgrass-8b06438d.northeurope.azurecontainerapps.io
ConnectionStrings__Default - Server=tcp:demoabpapp.database.windows.net,1433;Initial Catalog=mvcapppro;Persist Security Info=False;User ID=demoapppro;Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
```
![Add Environment Variables](add-environment-variables.png)
#### Step 4: Create a New Deployment
Once you have added the environment variables, save and create a new deployment to apply the changes. You can now access your ABP Framework MVC project running on Azure Container Apps by navigating to the URL provided in the environment variables.
![Access ABP Framework MVC Project](access-abp-framework-mvc-project.png)
You can see the Azure resources created for the ABP Framework MVC project deployment that includes the Azure Container Apps resource, Azure Container Apps Job resource, and Azure SQL database.
![Azure Resources](azure-resources.png)
### Conclusion
Azure Container Apps provides a simple and cost-effective way to deploy and scale your ABP Framework MVC projects without managing the underlying infrastructure. By following the steps outlined in this article, you can seamlessly deploy your ABP Framework MVC projects to Azure Container Apps and enjoy the benefits it offers.
I hope you found this article helpful. If you have any questions or feedback, please feel free to leave a comment below.

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/access-abp-framework-mvc-project.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 KiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/add-environment-variables.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/azure-container-abp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/azure-resources.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/azure-sql-database-connection-strings.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/build-docker-image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/check-job-status.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 KiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/create-azure-container-apps-job.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/create-azure-container-apps.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/deploy-docker-image.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

BIN
docs/en/Community-Articles/2024-05-07-Azure-Container-Apps-Deployment-with-ABP/docker-hub-repository.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

6
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/Localization/en.json

@ -85,11 +85,11 @@
"AuditLogSettingsGeneral": "General",
"AuditLogSettingsGlobal": "Global",
"DisplayName:IsPeriodicDeleterEnabled": "Enable clean up service system wide",
"Description:IsPeriodicDeleterEnabled": "If this option is disable the periodic deleter won't work. Audit logs won't be deleted automatically.",
"Description:IsPeriodicDeleterEnabled": "If this option is disabled the periodic deleter won't work. Audit logs won't be deleted automatically.",
"DisplayName:GlobalIsExpiredDeleterEnabled": "Enable clean up service for all tenants and host",
"Description:GlobalIsExpiredDeleterEnabled": "If this option is enable all tenants and host expired items deleted automatically. Unless has a specific setting.",
"Description:GlobalIsExpiredDeleterEnabled": "If this option is enabled all the tenants and the host expired items will be deleted automatically unless it has a specific setting.",
"DisplayName:IsExpiredDeleterEnabled": "Enable clean up service",
"Description:IsExpiredDeleterEnabled": "If this option is enable expired items deleted automatically.",
"Description:IsExpiredDeleterEnabled": "If this option is enabled the expired items will be deleted automatically.",
"DisplayName:ExpiredDeleterPeriod": "Expired item deletion period",
"Description:ExpiredDeleterPeriod": "Set the number of days after which expired items will be automatically deleted.",
"ExpiredDeleterPeriodUnit": "day(s)",

9
npm/ng-packs/packages/components/extensible/src/lib/components/extensible-form/extensible-form-prop.component.html

@ -21,11 +21,9 @@
class="form-control"
/>
}
@case ('hidden') {
<input [formControlName]="prop.name" type="hidden" />
}
@case ('checkbox') {
<div class="form-check" validationTarget>
<input
@ -42,7 +40,6 @@
></ng-template>
</div>
}
@case ('select') {
<ng-template [ngTemplateOutlet]="label"></ng-template>
<select
@ -59,7 +56,6 @@
}
</select>
}
@case ('multiselect') {
<ng-template [ngTemplateOutlet]="label"></ng-template>
<select
@ -77,7 +73,6 @@
}
</select>
}
@case ('typeahead') {
<ng-template [ngTemplateOutlet]="label"></ng-template>
<div #typeahead class="position-relative" validationStyle validationTarget>
@ -100,7 +95,6 @@
<input [formControlName]="prop.name" type="hidden" />
</div>
}
@case ('date') {
<ng-template [ngTemplateOutlet]="label"></ng-template>
<input
@ -118,12 +112,10 @@
<ng-template [ngTemplateOutlet]="label"></ng-template>
<ngb-timepicker [formControlName]="prop.name"></ngb-timepicker>
}
@case ('dateTime') {
<ng-template [ngTemplateOutlet]="label"></ng-template>
<abp-extensible-date-time-picker [prop]="prop" [meridian]="meridian$ | async" />
}
@case ('textarea') {
<ng-template [ngTemplateOutlet]="label"></ng-template>
<textarea
@ -135,7 +127,6 @@
class="form-control"
></textarea>
}
@case ('passwordinputgroup') {
<ng-template [ngTemplateOutlet]="label"></ng-template>
<div class="input-group form-group" validationTarget>

2
npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts

@ -207,7 +207,7 @@ export class ExtensibleTableComponent<R = any> implements OnChanges {
}
hasAvailableActions(index, data): boolean {
const { permission, visible } = this.actionList.get(index).value;
const { permission, visible } = this.actionList.get(index)?.value || {};
let isActionAvailable = this.permissionService.getGrantedPolicy(permission);
if (data && data.record) {
isActionAvailable &&= visible(data);

22
npm/ng-packs/packages/core/src/lib/services/localization.service.ts

@ -99,7 +99,7 @@ export class LocalizationService {
return local;
}),
filter(Boolean)
filter(Boolean),
)
.subscribe(val => this.localizations$.next(val));
}
@ -211,9 +211,12 @@ export class LocalizationService {
key: string | LocalizationWithDefault,
...interpolateParams: string[]
) {
if (!key) key = '';
let defaultValue = '';
if (!key) {
return defaultValue;
}
if (typeof key !== 'string') {
defaultValue = key.defaultValue;
key = key.key;
@ -265,7 +268,10 @@ export class LocalizationService {
}
}
function recursivelyMergeBaseResources(baseResourceName: string, source: ResourceDto): ApplicationLocalizationResourceDto {
function recursivelyMergeBaseResources(
baseResourceName: string,
source: ResourceDto,
): ApplicationLocalizationResourceDto {
const item = source[baseResourceName];
if (item.baseResources.length === 0) {
@ -280,10 +286,12 @@ function recursivelyMergeBaseResources(baseResourceName: string, source: Resourc
}
function mergeResourcesWithBaseResource(resource: ResourceDto): ResourceDto {
const entities: Array<[string, ApplicationLocalizationResourceDto]> = Object.keys(resource).map(key => {
const newValue = recursivelyMergeBaseResources(key, resource);
return [key, newValue];
});
const entities: Array<[string, ApplicationLocalizationResourceDto]> = Object.keys(resource).map(
key => {
const newValue = recursivelyMergeBaseResources(key, resource);
return [key, newValue];
},
);
return entities.reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});
}

17
npm/ng-packs/packages/core/src/lib/tokens/compare-func.token.ts

@ -1,5 +1,5 @@
import { InjectionToken, inject } from '@angular/core';
import { SortableItem } from '../models';
import type { SortableItem } from '../models';
import { LocalizationService } from '../services';
export const SORT_COMPARE_FUNC = new InjectionToken<(a: SortableItem, b: SortableItem) => number>(
@ -9,23 +9,24 @@ export const SORT_COMPARE_FUNC = new InjectionToken<(a: SortableItem, b: Sortabl
export function compareFuncFactory() {
const localizationService = inject(LocalizationService);
const fn = (a: SortableItem, b: SortableItem) => {
const aName = localizationService.instant(a.name);
const bName = localizationService.instant(b.name);
const aNumber = a.order;
const bNumber = b.order;
if (aNumber > bNumber) return 1;
if (aNumber < bNumber) return -1;
if (a.id > b.id) return 1;
if (a.id < b.id) return -1;
if (!Number.isInteger(aNumber)) return 1;
if (!Number.isInteger(bNumber)) return -1;
if (aNumber > bNumber) return 1;
if (aNumber < bNumber) return -1;
const aName = localizationService.instant(a.name);
const bName = localizationService.instant(b.name);
if (aName > bName) return 1;
if (aName < bName) return -1;
if (a.id > b.id) return 1;
if (a.id < b.id) return -1;
return 0;
};

4
npm/ng-packs/packages/oauth/src/lib/strategies/auth-code-flow-strategy.ts

@ -51,6 +51,10 @@ export class AuthCodeFlowStrategy extends AuthFlowStrategy {
logout(queryParams?: Params) {
this.rememberMeService.remove();
if (queryParams?.noRedirectToLogoutUrl) {
this.router.navigate(['/']);
return from(this.oAuthService.revokeTokenAndLogout(true));
}
return from(this.oAuthService.revokeTokenAndLogout(this.getCultureParams(queryParams)));
}

2
npm/ng-packs/packages/theme-shared/src/lib/adapters/time.adapter.ts

@ -24,7 +24,7 @@ export class TimeAdapter extends NgbTimeAdapter<string | Date> {
if (!value) return '';
const date = new Date(0, 0, 1, value.hour, value.minute, value.second);
const formattedDate = formatDate(date, 'HH:mm', 'en');
const formattedDate = formatDate(date, 'HH:mm:ss', 'en');
return formattedDate;
}

2
npm/ng-packs/packages/theme-shared/src/lib/services/authentication-error-handler.service.ts

@ -17,7 +17,7 @@ export class AbpAuthenticationErrorHandler implements CustomHttpErrorHandlerServ
execute() {
this.configStateService.refreshAppState().subscribe(({ currentUser }) => {
if (!currentUser.isAuthenticated) {
this.authService.logout();
this.authService.logout({ noRedirectToLogoutUrl: true });
}
});
}

22
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Client/Menus/MyProjectNameMenuContributor.cs

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy;
@ -65,15 +66,22 @@ public class MyProjectNameMenuContributor : IMenuContributor
private Task ConfigureUserMenuAsync(MenuConfigurationContext context)
{
if (!OperatingSystem.IsBrowser())
{
return Task.CompletedTask;
}
var authServerUrl = _configuration["AuthServer:Authority"] ?? "";
var accountStringLocalizer = context.GetLocalizer<AccountResource>();
context.Menu.AddItem(new ApplicationMenuItem(
"Account.Manage",
accountStringLocalizer["MyAccount"],
$"Account/Manage",
icon: "fa fa-cog",
order: 1000,
null).RequireAuthenticated());
"Account.Manage",
accountStringLocalizer["MyAccount"],
$"{authServerUrl.EnsureEndsWith('/')}Account/Manage",
icon: "fa fa-cog",
order: 1000,
target: "_blank")
.RequireAuthenticated());
return Task.CompletedTask;
}

20
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Tiered.Client/Menus/MyProjectNameMenuContributor.cs

@ -66,16 +66,22 @@ public class MyProjectNameMenuContributor : IMenuContributor
private Task ConfigureUserMenuAsync(MenuConfigurationContext context)
{
var accountStringLocalizer = context.GetLocalizer<AccountResource>();
if (!OperatingSystem.IsBrowser())
{
return Task.CompletedTask;
}
var authServerUrl = _configuration["AuthServer:Authority"] ?? "";
var accountStringLocalizer = context.GetLocalizer<AccountResource>();
context.Menu.AddItem(new ApplicationMenuItem(
"Account.Manage",
accountStringLocalizer["MyAccount"],
$"{authServerUrl.EnsureEndsWith('/')}Account/Manage",
icon: "fa fa-cog",
order: 1000,
target: "_blank").RequireAuthenticated());
"Account.Manage",
accountStringLocalizer["MyAccount"],
$"{authServerUrl.EnsureEndsWith('/')}Account/Manage",
icon: "fa fa-cog",
order: 1000,
target: "_blank")
.RequireAuthenticated());
return Task.CompletedTask;
}

79
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Tiered/Menus/MyProjectNameMenuContributor.cs

@ -1,79 +0,0 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy;
using Volo.Abp.Account.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Identity.Blazor;
using Volo.Abp.SettingManagement.Blazor.Menus;
using Volo.Abp.TenantManagement.Blazor.Navigation;
using Volo.Abp.UI.Navigation;
namespace MyCompanyName.MyProjectName.Blazor.WebApp.Tiered.Menus;
public class MyProjectNameMenuContributor : IMenuContributor
{
private readonly IConfiguration _configuration;
public MyProjectNameMenuContributor(IConfiguration configuration)
{
_configuration = configuration;
}
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
await ConfigureMainMenuAsync(context);
}
else if (context.Menu.Name == StandardMenus.User)
{
await ConfigureUserMenuAsync(context);
}
}
private Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
var administration = context.Menu.GetAdministration();
var l = context.GetLocalizer<MyProjectNameResource>();
context.Menu.Items.Insert(
0,
new ApplicationMenuItem(
MyProjectNameMenus.Home,
l["Menu:Home"],
"/",
icon: "fas fa-home",
order: 0
)
);
if (MultiTenancyConsts.IsEnabled)
{
administration.SetSubItemOrder(TenantManagementMenuNames.GroupName, 1);
}
else
{
administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName);
}
administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2);
administration.SetSubItemOrder(SettingManagementMenus.GroupName, 3);
return Task.CompletedTask;
}
private Task ConfigureUserMenuAsync(MenuConfigurationContext context)
{
var l = context.GetLocalizer<MyProjectNameResource>();
var accountStringLocalizer = context.GetLocalizer<AccountResource>();
var authServerUrl = _configuration["AuthServer:Authority"] ?? "";
context.Menu.AddItem(new ApplicationMenuItem("Account.Manage", accountStringLocalizer["MyAccount"],
$"{authServerUrl.EnsureEndsWith('/')}Account/Manage?returnUrl={_configuration["App:SelfUrl"]}", icon: "fa fa-cog", order: 1000, null, "_blank").RequireAuthenticated());
context.Menu.AddItem(new ApplicationMenuItem("Account.Logout", l["Logout"], url: "~/Account/Logout", icon: "fa fa-power-off", order: int.MaxValue - 1000).RequireAuthenticated());
return Task.CompletedTask;
}
}

10
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Tiered/Menus/MyProjectNameMenus.cs

@ -1,10 +0,0 @@
namespace MyCompanyName.MyProjectName.Blazor.WebApp.Tiered.Menus;
public class MyProjectNameMenus
{
private const string Prefix = "MyProjectName";
public const string Home = Prefix + ".Home";
//Add your menu items here...
}

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp.Tiered/MyProjectNameBlazorModule.cs

@ -16,6 +16,7 @@ using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
using Microsoft.OpenApi.Models;
using MyCompanyName.MyProjectName.Blazor.WebApp.Tiered.Client;
using MyCompanyName.MyProjectName.Blazor.WebApp.Tiered.Client.Menus;
using MyCompanyName.MyProjectName.Blazor.WebApp.Tiered.Components;
using MyCompanyName.MyProjectName.Blazor.WebApp.Tiered.Menus;
using MyCompanyName.MyProjectName.Localization;

51
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp/Menus/MyProjectNameMenuContributor.cs

@ -1,51 +0,0 @@
using System.Threading.Tasks;
using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy;
using Volo.Abp.Identity.Blazor;
using Volo.Abp.SettingManagement.Blazor.Menus;
using Volo.Abp.TenantManagement.Blazor.Navigation;
using Volo.Abp.UI.Navigation;
namespace MyCompanyName.MyProjectName.Blazor.WebApp.Menus;
public class MyProjectNameMenuContributor : IMenuContributor
{
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
await ConfigureMainMenuAsync(context);
}
}
private Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
var administration = context.Menu.GetAdministration();
var l = context.GetLocalizer<MyProjectNameResource>();
context.Menu.Items.Insert(
0,
new ApplicationMenuItem(
MyProjectNameMenus.Home,
l["Menu:Home"],
"/",
icon: "fas fa-home",
order: 0
)
);
if (MultiTenancyConsts.IsEnabled)
{
administration.SetSubItemOrder(TenantManagementMenuNames.GroupName, 1);
}
else
{
administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName);
}
administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2);
administration.SetSubItemOrder(SettingManagementMenus.GroupName, 3);
return Task.CompletedTask;
}
}

10
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp/Menus/MyProjectNameMenus.cs

@ -1,10 +0,0 @@
namespace MyCompanyName.MyProjectName.Blazor.WebApp.Menus;
public class MyProjectNameMenus
{
private const string Prefix = "MyProjectName";
public const string Home = Prefix + ".Home";
//Add your menu items here...
}

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.WebApp/MyProjectNameBlazorModule.cs

@ -11,8 +11,8 @@ using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using MyCompanyName.MyProjectName.Blazor.WebApp.Client;
using MyCompanyName.MyProjectName.Blazor.WebApp.Client.Menus;
using MyCompanyName.MyProjectName.Blazor.WebApp.Components;
using MyCompanyName.MyProjectName.Blazor.WebApp.Menus;
using MyCompanyName.MyProjectName.EntityFrameworkCore;
using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy;
@ -226,7 +226,7 @@ public class MyProjectNameBlazorModule : AbpModule
{
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new MyProjectNameMenuContributor());
options.MenuContributors.Add(new MyProjectNameMenuContributor(context.Services.GetConfiguration()));
});
}

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj

@ -16,6 +16,9 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.0" />
<PackageReference Include="DistributedLock.Redis" Version="1.0.2" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="7.5.1" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.5.1" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.5.1" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy\Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Caching.StackExchangeRedis\Volo.Abp.Caching.StackExchangeRedis.csproj" />

3
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj

@ -17,6 +17,9 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="7.5.1" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.5.1" />
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.5.1" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Caching.StackExchangeRedis\Volo.Abp.Caching.StackExchangeRedis.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy\Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj" />

Loading…
Cancel
Save