Browse Source

Merge branch 'rel-7.0' into auto-merge/rel-6-0/1652

pull/15401/head
Halil İbrahim Kalkan 3 years ago
committed by GitHub
parent
commit
50bd65360c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/en/Modules/Account.md
  2. 2
      docs/en/Modules/Audit-Logging.md
  3. 2
      docs/en/Modules/Background-Jobs.md
  4. 2
      docs/en/Modules/Docs.md
  5. 2
      docs/en/Modules/Feature-Management.md
  6. 2
      docs/en/Modules/Identity.md
  7. 2
      docs/en/Modules/IdentityServer.md
  8. 2
      docs/en/Modules/OpenIddict.md
  9. 2
      docs/en/Modules/Permission-Management.md
  10. 2
      docs/en/Startup-Templates/Application-Single-Layer.md
  11. 2
      docs/en/Startup-Templates/Application.md
  12. 2
      docs/en/Startup-Templates/Module.md
  13. BIN
      docs/en/Tutorials/Todo/Single-Layer/todo-single-layer-ui-initial.png
  14. BIN
      docs/en/Tutorials/Todo/todo-list.png
  15. BIN
      docs/en/Tutorials/Todo/todo-ui-initial.png
  16. 14
      docs/en/UI/Angular/Quick-Start.md
  17. 4
      framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo.Abp.EntityFrameworkCore.MySQL.csproj
  18. 8
      framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LanguageInfo.cs
  19. 2
      modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Authorizations/EfCoreOpenIddictAuthorizationRepository.cs
  20. 2
      modules/openiddict/src/Volo.Abp.OpenIddict.MongoDB/Volo/Abp/OpenIddict/Authorizations/MongoOpenIddictAuthorizationRepository.cs
  21. 7
      npm/ng-packs/packages/core/src/lib/core.module.ts
  22. 11
      npm/ng-packs/packages/core/src/lib/tests/initial-utils.spec.ts
  23. 3
      npm/ng-packs/packages/oauth/src/lib/tests/api.interceptor.spec.ts
  24. 29
      npm/ng-packs/packages/oauth/src/lib/tests/initial-utils.spec.ts

2
docs/en/Modules/Account.md

@ -6,7 +6,7 @@ This module is based on [Microsoft's Identity library](https://docs.microsoft.co
## How to Install
This module comes as pre-installed (as NuGet/NPM packages) when you [create a new solution](https://abp.io/get-started) with the ABP Framework. You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
This module comes as pre-installed (as NuGet/NPM packages). You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
### The Source Code

2
docs/en/Modules/Audit-Logging.md

@ -6,7 +6,7 @@ The Audit Logging Module basically implements the `IAuditingStore` to save the a
## How to Install
This module comes as pre-installed (as NuGet/NPM packages) when you [create a new solution](https://abp.io/get-started) with the ABP Framework. You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
This module comes as pre-installed (as NuGet/NPM packages). You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
### The Source Code

2
docs/en/Modules/Background-Jobs.md

@ -6,7 +6,7 @@ The Background Jobs module implements the `IBackgroundJobStore` interface and ma
## How to Install
This module comes as pre-installed (as NuGet/NPM packages) when you [create a new solution](https://abp.io/get-started) with the ABP Framework. You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
This module comes as pre-installed (as NuGet/NPM packages). You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
### The Source Code

2
docs/en/Modules/Docs.md

@ -32,7 +32,7 @@ It is recommended to use ABP CLI to create new projects. Use the following comma
abp new Acme.MyProject
```
You can also navigate to https://abp.io/get-started. Enter your project name as `Acme.MyProject`, other use default options.
You can also generate a CLI command from [get started page](https://abp.io/get-started). Enter your project name as `Acme.MyProject`, other use default options.
Note that this document covers `Entity Framework Core` provider but you can also select `MongoDB` as your database provider.

2
docs/en/Modules/Feature-Management.md

@ -6,7 +6,7 @@ The Feature Management module implements the `IFeatureManagementStore` interface
## How to Install
This module comes as pre-installed (as NuGet/NPM packages) when you [create a new solution](https://abp.io/get-started) with the ABP Framework. You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
This module comes as pre-installed (as NuGet/NPM packages). You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
### The Source Code

2
docs/en/Modules/Identity.md

@ -4,7 +4,7 @@ Identity module is used to manage roles, users and their permissions, based on t
## How to Install
This module comes as pre-installed (as NuGet/NPM packages) when you [create a new solution](https://abp.io/get-started) with the ABP Framework. You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
This module comes as pre-installed (as NuGet/NPM packages). You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
### The Source Code

2
docs/en/Modules/IdentityServer.md

@ -4,7 +4,7 @@ IdentityServer module provides a full integration with the [IdentityServer](http
## How to Install
This module comes as pre-installed (as NuGet/NPM packages) when you [create a new solution](https://abp.io/get-started) with the ABP Framework. You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
This module comes as pre-installed (as NuGet/NPM packages). You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
### The Source Code

2
docs/en/Modules/OpenIddict.md

@ -4,7 +4,7 @@ OpenIddict module provides an integration with the [OpenIddict](https://github.c
## How to Install
This module comes as pre-installed (as NuGet/NPM packages) when you [create a new solution](https://abp.io/get-started) with the ABP Framework. You can continue to use it as a package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
This module comes as pre-installed (as NuGet/NPM packages). You can continue to use it as a package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
### The Source Code

2
docs/en/Modules/Permission-Management.md

@ -6,7 +6,7 @@ This module implements the `IPermissionStore` to store and manage permissions va
## How to Install
This module comes as pre-installed (as NuGet/NPM packages) when you [create a new solution](https://abp.io/get-started) with the ABP Framework. You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
This module comes as pre-installed (as NuGet/NPM packages). You can continue to use it as package and get updates easily, or you can include its source code into your solution (see `get-source` [CLI](../CLI.md) command) to develop your custom module.
### The Source Code

2
docs/en/Startup-Templates/Application-Single-Layer.md

@ -10,7 +10,7 @@ ABP's [Application Startup Template](Application.md) provides a well-organized a
## How to Start with It?
You can use the [ABP CLI](../CLI.md) to create a new project using this startup template. Alternatively, you can directly create & download this startup template from the [Get Started](https://abp.io/get-started) page. In this section, we will use the ABP CLI.
You can use the [ABP CLI](../CLI.md) to create a new project using this startup template. Alternatively, you can generate a CLI command for this startup template from the [Get Started](https://abp.io/get-started) page. In this section, we will use the ABP CLI.
Firstly, install the ABP CLI if you haven't installed it before:

2
docs/en/Startup-Templates/Application.md

@ -11,7 +11,7 @@ This document explains **the solution structure** and projects in details. If yo
## How to Start With?
You can use the [ABP CLI](../CLI.md) to create a new project using this startup template. Alternatively, you can directly create & download from the [Get Started](https://abp.io/get-started) page. CLI approach is used here.
You can use the [ABP CLI](../CLI.md) to create a new project using this startup template. Alternatively, you can generate a CLI command from the [Get Started](https://abp.io/get-started) page. CLI approach is used here.
First, install the ABP CLI if you haven't installed it before:

2
docs/en/Startup-Templates/Module.md

@ -4,7 +4,7 @@ This template can be used to create a **reusable [application module](../Modules
## How to Start With?
You can use the [ABP CLI](../CLI.md) to create a new project using this startup template. Alternatively, you can directly create & download from the [Get Started](https://abp.io/get-started) page. CLI approach is used here.
You can use the [ABP CLI](../CLI.md) to create a new project using this startup template. Alternatively, you can generate a CLI command from the [Get Started](https://abp.io/get-started) page. CLI approach is used here.
First, install the ABP CLI if you haven't installed before:

BIN
docs/en/Tutorials/Todo/Single-Layer/todo-single-layer-ui-initial.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

After

Width:  |  Height:  |  Size: 256 KiB

BIN
docs/en/Tutorials/Todo/todo-list.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 23 KiB

BIN
docs/en/Tutorials/Todo/todo-ui-initial.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 23 KiB

14
docs/en/UI/Angular/Quick-Start.md

@ -37,19 +37,9 @@ This command will prepare a solution with an Angular and a .NET Core project in
To continue reading without checking other methods, visit [Angular project structure section](#angular-project-structure).
### 2. Direct Download
### 2. Generating a CLI Command from Get Started Page
You may [download a solution scaffold directly on ABP.io](https://abp.io/get-started) if you are more comfortable with GUI or simply want to try ABP without installing the CLI.
Please do the following:
1. Click on the "DIRECT DOWNLOAD" tab.
2. Fill out the short form about your project.
3. Click on the "Create now" button.
...and a customized download will start in a few seconds.
To avoid IDE warnings, run `yarn` or `npm install` in the Angular root folder before you continue to the next section. It is not imperative but recommended.
You can generate a CLI command on the [get started page of the abp.io website](https://abp.io/get-started). Then, use the command on your terminal to create a new [Startup Template](../../Startup-Templates/Index.md).
## Angular Project Structure

4
framework/src/Volo.Abp.EntityFrameworkCore.MySQL/Volo.Abp.EntityFrameworkCore.MySQL.csproj

@ -19,8 +19,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(MicrosoftEntityFrameworkCorePackageVersion)" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0-silver.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
</ItemGroup>
</Project>

8
framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LanguageInfo.cs

@ -1,4 +1,5 @@
using System;
using System.Globalization;
using JetBrains.Annotations;
namespace Volo.Abp.Localization;
@ -15,9 +16,13 @@ public class LanguageInfo : ILanguageInfo
[NotNull]
public virtual string DisplayName { get; protected set; }
[NotNull]
public virtual string TwoLetterISOLanguageName { get; protected set; }
[CanBeNull]
public virtual string FlagIcon { get; set; }
protected LanguageInfo()
{
@ -49,5 +54,8 @@ public class LanguageInfo : ILanguageInfo
DisplayName = !displayName.IsNullOrWhiteSpace()
? displayName
: cultureName;
TwoLetterISOLanguageName = new CultureInfo(cultureName)
.TwoLetterISOLanguageName;
}
}

2
modules/openiddict/src/Volo.Abp.OpenIddict.EntityFrameworkCore/Volo/Abp/OpenIddict/Authorizations/EfCoreOpenIddictAuthorizationRepository.cs

@ -89,6 +89,6 @@ public class EfCoreOpenIddictAuthorizationRepository : EfCoreRepository<IOpenIdd
where authorization.CreationDate < date
where authorization.Status != OpenIddictConstants.Statuses.Valid ||
(authorization.Type == OpenIddictConstants.AuthorizationTypes.AdHoc && authorizationToken == null)
select authorization).ToListAsync(cancellationToken: cancellationToken);
select authorization).OrderBy(x => x.Id).Take(count).ToListAsync(cancellationToken: cancellationToken);
}
}

2
modules/openiddict/src/Volo.Abp.OpenIddict.MongoDB/Volo/Abp/OpenIddict/Authorizations/MongoOpenIddictAuthorizationRepository.cs

@ -77,6 +77,8 @@ public class MongoOpenIddictAuthorizationRepository : MongoDbRepository<OpenIddi
.Where(x => x.CreationDate < date)
.Where(x => x.Status != OpenIddictConstants.Statuses.Valid ||
(x.Type == OpenIddictConstants.AuthorizationTypes.AdHoc && !tokens.Contains(x.Id)))
.OrderBy(x => x.Id)
.Take(count)
.ToListAsync(cancellationToken: cancellationToken);
}
}

7
npm/ng-packs/packages/core/src/lib/core.module.ts

@ -33,8 +33,9 @@ import { getInitialData, localeInitializer } from './utils/initial-utils';
import { ShortDateTimePipe } from './pipes/short-date-time.pipe';
import { ShortTimePipe } from './pipes/short-time.pipe';
import { ShortDatePipe } from './pipes/short-date.pipe';
import { QUEUE_MANAGER } from './tokens/queue.token';
import { DefaultQueueManager } from './utils/queue';
import { IncludeLocalizationResourcesProvider } from './providers/include-localization-resources.provider';
import { AuthGuard } from './abstracts/auth.guard';
/**
* BaseCoreModule is the module that holds
@ -171,6 +172,10 @@ export class CoreModule {
useValue: localizationContributor(options.localizations),
deps: [LocalizationService],
},
{
provide: QUEUE_MANAGER,
useClass: DefaultQueueManager,
},
IncludeLocalizationResourcesProvider,
],
};

11
npm/ng-packs/packages/core/src/lib/tests/initial-utils.spec.ts

@ -12,6 +12,7 @@ import { getInitialData, localeInitializer } from '../utils/initial-utils';
import * as environmentUtils from '../utils/environment-utils';
import * as multiTenancyUtils from '../utils/multi-tenancy-utils';
import { RestService } from '../services/rest.service';
import { CHECK_AUTHENTICATION_STATE_FN_KEY } from '../tokens/check-authentication-state';
const environment = { oAuthConfig: { issuer: 'test' } };
@ -41,6 +42,10 @@ describe('InitialUtils', () => {
registerLocaleFn: () => Promise.resolve(),
},
},
{
provide: CHECK_AUTHENTICATION_STATE_FN_KEY,
useValue: () => {},
},
],
});
@ -51,6 +56,9 @@ describe('InitialUtils', () => {
const environmentService = spectator.inject(EnvironmentService);
const configStateService = spectator.inject(ConfigStateService);
const sessionStateService = spectator.inject(SessionStateService);
//const checkAuthenticationState = spectator.inject(CHECK_AUTHENTICATION_STATE_FN_KEY);
const authService = spectator.inject(AuthService);
const parseTenantFromUrlSpy = jest.spyOn(multiTenancyUtils, 'parseTenantFromUrl');
const getRemoteEnvSpy = jest.spyOn(environmentUtils, 'getRemoteEnv');
@ -65,7 +73,7 @@ describe('InitialUtils', () => {
const configRefreshAppStateSpy = jest.spyOn(configStateService, 'refreshAppState');
configRefreshAppStateSpy.mockReturnValue(of(appConfigRes));
const sessionSetTenantSpy = jest.spyOn(sessionStateService, 'setTenant');
const authServiceInitSpy = jest.spyOn(authService, 'init');
const configStateGetOneSpy = jest.spyOn(configStateService, 'getOne');
configStateGetOneSpy.mockReturnValue(appConfigRes.currentTenant);
@ -79,6 +87,7 @@ describe('InitialUtils', () => {
expect(configRefreshAppStateSpy).toHaveBeenCalled();
expect(environmentSetStateSpy).toHaveBeenCalledWith(environment);
expect(sessionSetTenantSpy).toHaveBeenCalledWith(appConfigRes.currentTenant);
expect(authServiceInitSpy).toHaveBeenCalled();
});
});

3
npm/ng-packs/packages/oauth/src/lib/tests/api.interceptor.spec.ts

@ -3,8 +3,7 @@ import { SpyObject } from '@ngneat/spectator';
import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest';
import { OAuthService } from 'angular-oauth2-oidc';
import { Subject, timer } from 'rxjs';
import { ApiInterceptor } from '../interceptors/api.interceptor';
import { HttpWaitService, SessionStateService, TENANT_KEY } from '@abp/ng.core';
import { ApiInterceptor, HttpWaitService, SessionStateService, TENANT_KEY } from '@abp/ng.core';
describe('ApiInterceptor', () => {
let spectator: SpectatorService<ApiInterceptor>;

29
npm/ng-packs/packages/oauth/src/lib/tests/initial-utils.spec.ts

@ -9,10 +9,8 @@ import {
ConfigStateService,
AbpApplicationConfigurationService,
SessionStateService,
ApplicationConfigurationDto,
} from '@abp/ng.core';
import * as clearOAuthStorageDefault from '../utils/clear-o-auth-storage';
import { of } from 'rxjs';
import { checkAccessToken } from '../utils/check-access-token';
const environment = { oAuthConfig: { issuer: 'test' } };
@ -49,33 +47,6 @@ describe('InitialUtils', () => {
beforeEach(() => (spectator = createComponent()));
describe('#getInitialData', () => {
let mockInjector;
let configStateService;
let authService;
beforeEach(() => {
mockInjector = {
get: spectator.inject,
};
configStateService = spectator.inject(ConfigStateService);
authService = spectator.inject(AuthService);
});
test('should called configStateService.refreshAppState', async () => {
const configRefreshAppStateSpy = jest.spyOn(configStateService, 'refreshAppState');
const appConfigRes = {
currentTenant: { id: 'test', name: 'testing' },
} as ApplicationConfigurationDto;
configRefreshAppStateSpy.mockReturnValue(of(appConfigRes));
// Todo: refactor it
// await initFactory(mockInjector)();
expect(configRefreshAppStateSpy).toHaveBeenCalled();
});
});
describe('#checkAccessToken', () => {
let injector;
let injectorSpy;

Loading…
Cancel
Save