Browse Source

Merge branch 'rel-4.0' into maliming/patch-AbpOptionsFactory

pull/6368/head
maliming 6 years ago
parent
commit
8d01580376
  1. 28
      docs/en/CSRF-Anti-Forgery.md
  2. 1269
      docs/en/Domain-Driven-Design-Implementation-Guide.md
  3. 14
      docs/en/Domain-Driven-Design.md
  4. 4
      docs/en/Getting-Started.md
  5. 2
      docs/en/Migration-Guides/Abp-4_0-Blazor.md
  6. 33
      docs/en/Migration-Guides/Abp-4_0.md
  7. 4
      docs/en/UI/Blazor/Theming.md
  8. 4
      docs/en/docs-nav.json
  9. 6
      framework/src/Volo.Abp.BlazoriseUI/AbpBlazoriseModule.cs
  10. 19
      framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/Generators/ProxyScriptingJsFuncHelper.cs
  11. 17
      npm/ng-packs/packages/core/src/lib/proxy/README.md
  12. 4555
      npm/ng-packs/packages/core/src/lib/proxy/generate-proxy.json
  13. 3
      npm/ng-packs/packages/core/src/lib/proxy/index.ts
  14. 2
      npm/ng-packs/packages/core/src/lib/proxy/pages/abp/index.ts
  15. 26
      npm/ng-packs/packages/core/src/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.ts
  16. 1
      npm/ng-packs/packages/core/src/lib/proxy/pages/abp/multi-tenancy/index.ts
  17. 2
      npm/ng-packs/packages/core/src/lib/proxy/pages/index.ts
  18. 2
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/index.ts
  19. 20
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.ts
  20. 1
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/index.ts
  21. 19
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.ts
  22. 4
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/index.ts
  23. 96
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/models.ts
  24. 1
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/index.ts
  25. 87
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.ts
  26. 4
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/index.ts
  27. 1
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/index.ts
  28. 16
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.ts
  29. 2
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/index.ts
  30. 1
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/index.ts
  31. 79
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts
  32. 5
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/index.ts
  33. 1
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/index.ts
  34. 7
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/models.ts
  35. 5
      npm/ng-packs/packages/core/src/lib/proxy/volo/abp/models.ts
  36. 2
      npm/ng-packs/packages/core/src/lib/proxy/volo/index.ts
  37. 2
      npm/ng-packs/packages/core/src/lib/tests/date-utils.spec.ts
  38. 4
      npm/ng-packs/packages/core/src/lib/tests/replaceable-template.directive.spec.ts
  39. 146
      npm/ng-packs/packages/theme-shared/extensions/src/lib/models/internal/object-extensions.ts
  40. 10
      npm/ng-packs/packages/theme-shared/extensions/src/lib/utils/enum.util.ts
  41. 5
      npm/ng-packs/packages/theme-shared/extensions/src/lib/utils/localization.util.ts
  42. 27
      npm/ng-packs/packages/theme-shared/extensions/src/lib/utils/state.util.ts
  43. 4
      npm/ng-packs/packages/theme-shared/extensions/src/lib/utils/validation.util.ts
  44. 69
      npm/ng-packs/packages/theme-shared/extensions/src/tests/enum.util.spec.ts
  45. 120
      npm/ng-packs/packages/theme-shared/extensions/src/tests/state.util.spec.ts
  46. 2
      npm/ng-packs/packages/theme-shared/extensions/src/tests/validation.util.spec.ts
  47. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs
  48. 1
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs

28
docs/en/CSRF-Anti-Forgery.md

@ -117,3 +117,31 @@ You don't need to make anything unless you need to change the `AntiforgeryOption
})
export class AppModule {}
```
**Note:** XSRF-TOKEN is only valid if both frontend application and APIs run on the same domain. Therefore, when you make a request, you should use a relative path.
For example, let's say your APIs is hosted at `https://testdomain.com/ws`
and your angular application is hosted at `https://testdomain.com/admin`
So if your API request should look like this `https://testdomain.com/ws/api/identity/users`
your `environment.prod.ts` has to be as follows:
```typescript
export const environment = {
production: true,
// ....
apis: {
default: {
url: '/ws', // <- just use the context root here
// ...
},
},
} as Config.Environment;
```
Let's talk about why.
First, take a look at [Angular's code](https://github.com/angular/angular/blob/master/packages/common/http/src/xsrf.ts#L81)
It does not intercept any request that starts with `http://` or `https://`. There is a good reason for that. Any cross-site request does not need this token for security. This verification is only valid if the request is made to the same domain from which the web page is served. So, simply put, if you serve everything from a single domain, you just use a relative path.

1269
docs/en/Domain-Driven-Design-Implementation-Guide.md

File diff suppressed because it is too large

14
docs/en/Domain-Driven-Design.md

@ -10,7 +10,7 @@ ABP framework provides an **infrastructure** to make **Domain Driven Design** ba
> - Basing complex designs on a model of the domain;
> - Initiating a creative collaboration between technical and domain experts to iteratively refine a conceptual model that addresses particular domain problems.
### Layers
## Layers & Building Blocks
ABP follows DDD principles and patterns to achieve a layered application model which consists of four fundamental layers:
@ -19,11 +19,7 @@ ABP follows DDD principles and patterns to achieve a layered application model w
- **Domain Layer**: Includes business objects and the core (domain) business rules. This is the heart of the application.
- **Infrastructure Layer**: Provides generic technical capabilities that support higher layers mostly using 3rd-party libraries.
DDD mostly interest in the **Domain** and the **Application** layers, rather than the Infrastructure and the Presentation layers.
## Contents
See the following documents to learn what ABP Framework provides to you to implement DDD in your project.
DDD mostly interest in the **Domain** and the **Application** layers, rather than the Infrastructure and the Presentation layers. The following documents explains the **infrastructure** provided by the ABP Framework to implement **Building Blocks** of the DDD:
* **Domain Layer**
* [Entities & Aggregate Roots](Entities.md)
@ -34,4 +30,8 @@ See the following documents to learn what ABP Framework provides to you to imple
* **Application Layer**
* [Application Services](Application-Services.md)
* [Data Transfer Objects (DTOs)](Data-Transfer-Objects.md)
* [Unit of Work](Unit-Of-Work.md)
* [Unit of Work](Unit-Of-Work.md)
## The Ultimate DDD Implementation Guide
See the [Implementing Domain Driven Design](Domain-Driven-Design-Implementation-Guide.md) guide as a **complete reference**. The Guide explains the Domain Driven Design and introduces explicit **rules and examples** to give a deep understanding of the **implementation details**.

4
docs/en/Getting-Started.md

@ -34,8 +34,12 @@ The following tools should be installed on your development machine:
<sup id="f-editor"><b>1</b></sup> _You can use another editor instead of Visual Studio as long as it supports .NET Core and ASP.NET Core._ <sup>[↩](#a-editor)</sup>
{{ if UI != "Blazor" }}
<sup id="f-yarn"><b>2</b></sup> _Yarn v2 works differently and is not supported._ <sup>[↩](#a-yarn)</sup>
{{ end }}
### Install the ABP CLI
[ABP CLI](./CLI.md) is a command line interface that is used to automate some common tasks for ABP based solutions.

2
docs/en/Migration-Guides/Abp-4_0-Blazor.md

@ -27,7 +27,7 @@ using Volo.Abp.Bundling;
namespace MyCompanyName.MyProjectName.Blazor
{
public class MyProjectNameBundleContributer : IBundleContributer
public class MyProjectNameBundleContributor : IBundleContributor
{
public void AddScripts(BundleContext context)
{

33
docs/en/Migration-Guides/Abp-4_0.md

@ -219,7 +219,38 @@ These properties implemented with `protected set` in the `Entity` and `Aggregate
`IHasExtraProperties.ExtraProperties` was a regular `Dictionary<string, object>`. With the version 4.0, it is replaced with `ExtraPropertyDictionary` class which inherits the `Dictionary<string, object>`.
Most of the applications don't be affected by this change. If you've directly implemented this interface, replace the standard dictionary the the `ExtraPropertyDictionary`.
Most of the applications don't be affected by this change. If you've directly implemented this interface, replace the standard dictionary to the `ExtraPropertyDictionary`.
## Other Changes
### IdentityOptions Usage
Previously, when you inject `IOptions<IdentityOptions>`, you get a dynamically overridden options value. For example, when you get `IdentityOptions.Password.RequiredLength`, the value is being changed based on the setting (`IdentitySettingNames.Password.RequiredLength`) of the current tenant. That means `IdentityOptions` changes per tenant. However, this caused an [issue](https://github.com/abpframework/abp/issues/6318) and we [had to change](https://github.com/abpframework/abp/pull/6333) the usage.
With the version 4.0, you need to inject `IOptions<IdentityOptions>` and call the new `SetAsync` method before using it, to be able to override the options by the settings. Otherwise, you get the default (statically configured) values of the options.
Example usage:
````csharp
public class MyService : ITransientDependency
{
private readonly IOptions<IdentityOptions> _options;
public MyService(IOptions<IdentityOptions> options)
{
_options = options;
}
public async Task DoItAsync()
{
await _options.SetAsync();
var requiredLength = _options.Value.Password.RequiredLength;
}
}
````
Pre-built modules already handles this. However, if you have used `IdentityOptions` directly in your code, you also need to follow this new pattern.
## ASP.NET Core MVC / Razor Pages UI

4
docs/en/UI/Blazor/Theming.md

@ -67,7 +67,7 @@ The easiest way to create a new theme is to copy the [Basic Theme Source Code](h
### Global Styles / Scripts
A theme generally needs to add a global style to the page. ABP provides a system to manage the [Global Styles and Scripts](Global-Scripts-Styles.md). A theme can implement the `IBundleContributer` to add global style or script files to the page.
A theme generally needs to add a global style to the page. ABP provides a system to manage the [Global Styles and Scripts](Global-Scripts-Styles.md). A theme can implement the `IBundleContributor` to add global style or script files to the page.
**Example: Adding a style to the page**
@ -76,7 +76,7 @@ using Volo.Abp.Bundling;
namespace MyTheme
{
public class MyThemeBundleContributer : IBundleContributer
public class MyThemeBundleContributor : IBundleContributor
{
public void AddScripts(BundleContext context)
{

4
docs/en/docs-nav.json

@ -377,6 +377,10 @@
"path": "Unit-Of-Work.md"
}
]
},
{
"text": "Guide: Implementing DDD",
"path": "Domain-Driven-Design-Implementation-Guide.md"
}
]
},

6
framework/src/Volo.Abp.BlazoriseUI/AbpBlazoriseModule.cs

@ -17,8 +17,10 @@ namespace Volo.Abp.BlazoriseUI
private void ConfigureBlazorise(ServiceConfigurationContext context)
{
context.Services
.AddBlazorise();
context.Services.AddBlazorise(options =>
{
options.DelayTextOnKeyPress = true;
});
context.Services.AddSingleton(typeof(AbpBlazorMessageLocalizerHelper<>));
}

19
framework/src/Volo.Abp.Http/Volo/Abp/Http/ProxyScripting/Generators/ProxyScriptingJsFuncHelper.cs

@ -110,9 +110,11 @@ namespace Volo.Abp.Http.ProxyScripting.Generators
public static string GetParamNameInJsFunc(ParameterApiDescriptionModel parameterInfo)
{
var parameterInfoName = string.Join(".", parameterInfo.Name.Split(".").Select(x => NormalizeJsVariableName(x.ToCamelCase())));
return parameterInfo.Name == parameterInfo.NameOnMethod
? NormalizeJsVariableName(parameterInfo.Name.ToCamelCase(), ".")
: NormalizeJsVariableName(parameterInfo.NameOnMethod.ToCamelCase()) + "." + NormalizeJsVariableName(parameterInfo.Name.ToCamelCase(), ".");
? parameterInfoName
: NormalizeJsVariableName(parameterInfo.NameOnMethod.ToCamelCase()) + "." + parameterInfoName;
}
public static string CreateJsObjectLiteral(ParameterApiDescriptionModel[] parameters, int indent = 0)
@ -133,9 +135,11 @@ namespace Volo.Abp.Http.ProxyScripting.Generators
public static string GetFormPostParamNameInJsFunc(ParameterApiDescriptionModel parameterInfo)
{
var parameterInfoName = string.Join(".", parameterInfo.Name.Split(".").Select(x => NormalizeJsVariableName(x.ToCamelCase())));
return parameterInfo.Name == parameterInfo.NameOnMethod
? NormalizeJsVariableName((parameterInfo.DescriptorName + parameterInfo.Name).ToCamelCase(), ".")
: NormalizeJsVariableName(parameterInfo.NameOnMethod.ToCamelCase()) + "." + NormalizeJsVariableName((parameterInfo.DescriptorName + parameterInfo.Name).ToCamelCase(), ".");
? parameterInfoName
: NormalizeJsVariableName(parameterInfo.NameOnMethod.ToCamelCase()) + "." + parameterInfoName;
}
public static string CreateJsFormPostData(ParameterApiDescriptionModel[] parameters, int indent)
@ -158,12 +162,9 @@ namespace Volo.Abp.Http.ProxyScripting.Generators
public static string GenerateJsFuncParameterList(ActionApiDescriptionModel action, string ajaxParametersName)
{
var paramsIsFromForm = action.Parameters.Any(x => x.BindingSourceId == ParameterBindingSources.Form);
var methodParamNames = paramsIsFromForm
? action.Parameters.Select(p => p.DescriptorName + p.Name).Distinct().ToList()
: action.ParametersOnMethod.Select(p => p.Name).Distinct().ToList();
var methodParamNames = action.ParametersOnMethod.Select(p => p.Name).Distinct().ToList();
methodParamNames.Add(ajaxParametersName);
return methodParamNames.Select(prmName => NormalizeJsVariableName(prmName.ToCamelCase())).JoinAsString(", ");
}
}
}
}

17
npm/ng-packs/packages/core/src/lib/proxy/README.md

@ -0,0 +1,17 @@
# Proxy Generation Output
This directory includes the output of the latest proxy generation.
The files and folders in it will be overwritten when proxy generation is run again.
Therefore, please do not place your own content in this folder.
In addition, `generate-proxy.json` works like a lock file.
It includes information used by the proxy generator, so please do not delete or modify it.
Finally, the name of the files and folders should not be changed for two reasons:
- Proxy generator will keep creating them at those paths and you will have multiple copies of the same content.
- ABP Suite generates files which include imports from this folder.
> **Important Notice:** If you are building a module and are planning to publish to npm,
> some of the generated proxies are likely to be exported from public-api.ts file. In such a case,
> please make sure you export files directly and not from barrel exports. In other words,
> do not include index.ts exports in your public-api.ts exports.

4555
npm/ng-packs/packages/core/src/lib/proxy/generate-proxy.json

File diff suppressed because it is too large

3
npm/ng-packs/packages/core/src/lib/proxy/index.ts

@ -0,0 +1,3 @@
import * as Pages from './pages';
import * as Volo from './volo';
export { Pages, Volo };

2
npm/ng-packs/packages/core/src/lib/proxy/pages/abp/index.ts

@ -0,0 +1,2 @@
import * as MultiTenancy from './multi-tenancy';
export { MultiTenancy };

26
npm/ng-packs/packages/core/src/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.ts

@ -0,0 +1,26 @@
import { RestService } from '@abp/ng.core';
import { Injectable } from '@angular/core';
import type { FindTenantResultDto } from '../../../volo/abp/asp-net-core/mvc/multi-tenancy/models';
@Injectable({
providedIn: 'root',
})
export class AbpTenantService {
apiName = 'abp';
findTenantById = (id: string) =>
this.restService.request<any, FindTenantResultDto>({
method: 'GET',
url: `/api/abp/multi-tenancy/tenants/by-id/${id}`,
},
{ apiName: this.apiName });
findTenantByName = (name: string) =>
this.restService.request<any, FindTenantResultDto>({
method: 'GET',
url: `/api/abp/multi-tenancy/tenants/by-name/${name}`,
},
{ apiName: this.apiName });
constructor(private restService: RestService) {}
}

1
npm/ng-packs/packages/core/src/lib/proxy/pages/abp/multi-tenancy/index.ts

@ -0,0 +1 @@
export * from './abp-tenant.service';

2
npm/ng-packs/packages/core/src/lib/proxy/pages/index.ts

@ -0,0 +1,2 @@
import * as Abp from './abp';
export { Abp };

2
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/index.ts

@ -0,0 +1,2 @@
import * as Mvc from './mvc';
export { Mvc };

20
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.ts

@ -0,0 +1,20 @@
import { RestService } from '@abp/ng.core';
import { Injectable } from '@angular/core';
import type { ApplicationApiDescriptionModel, ApplicationApiDescriptionModelRequestDto } from '../../../http/modeling/models';
@Injectable({
providedIn: 'root',
})
export class AbpApiDefinitionService {
apiName = 'abp';
getByModel = (model: ApplicationApiDescriptionModelRequestDto) =>
this.restService.request<any, ApplicationApiDescriptionModel>({
method: 'GET',
url: '/api/abp/api-definition',
params: { includeTypes: model.includeTypes },
},
{ apiName: this.apiName });
constructor(private restService: RestService) {}
}

1
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/index.ts

@ -0,0 +1 @@
export * from './abp-api-definition.service';

19
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.ts

@ -0,0 +1,19 @@
import type { ApplicationConfigurationDto } from './models';
import { RestService } from '@abp/ng.core';
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class AbpApplicationConfigurationService {
apiName = 'abp';
get = () =>
this.restService.request<any, ApplicationConfigurationDto>({
method: 'GET',
url: '/api/abp/application-configuration',
},
{ apiName: this.apiName });
constructor(private restService: RestService) {}
}

4
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/index.ts

@ -0,0 +1,4 @@
import * as ObjectExtending from './object-extending';
export * from './abp-application-configuration.service';
export * from './models';
export { ObjectExtending };

96
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/models.ts

@ -0,0 +1,96 @@
import type { CurrentTenantDto, MultiTenancyInfoDto } from '../multi-tenancy/models';
import type { ObjectExtensionsDto } from './object-extending/models';
import type { LanguageInfo } from '../../../localization/models';
import type { NameValue } from '../../../models';
export interface ApplicationAuthConfigurationDto {
policies: Record<string, boolean>;
grantedPolicies: Record<string, boolean>;
}
export interface ApplicationConfigurationDto {
localization: ApplicationLocalizationConfigurationDto;
auth: ApplicationAuthConfigurationDto;
setting: ApplicationSettingConfigurationDto;
currentUser: CurrentUserDto;
features: ApplicationFeatureConfigurationDto;
multiTenancy: MultiTenancyInfoDto;
currentTenant: CurrentTenantDto;
timing: TimingDto;
clock: ClockDto;
objectExtensions: ObjectExtensionsDto;
}
export interface ApplicationFeatureConfigurationDto {
values: Record<string, string>;
}
export interface ApplicationLocalizationConfigurationDto {
values: Record<string, Dictionary<string, string>>;
languages: LanguageInfo[];
currentCulture: CurrentCultureDto;
defaultResourceName?: string;
languagesMap: Record<string, NameValue[]>;
languageFilesMap: Record<string, NameValue[]>;
}
export interface ApplicationSettingConfigurationDto {
values: Record<string, string>;
}
export interface ClockDto {
kind?: string;
}
export interface CurrentCultureDto {
displayName?: string;
englishName?: string;
threeLetterIsoLanguageName?: string;
twoLetterIsoLanguageName?: string;
isRightToLeft: boolean;
cultureName?: string;
name?: string;
nativeName?: string;
dateTimeFormat: DateTimeFormatDto;
}
export interface CurrentUserDto {
isAuthenticated: boolean;
id?: string;
tenantId?: string;
userName?: string;
name?: string;
surName?: string;
email?: string;
emailVerified: boolean;
phoneNumber?: string;
phoneNumberVerified: boolean;
roles: string[];
}
export interface DateTimeFormatDto {
calendarAlgorithmType?: string;
dateTimeFormatLong?: string;
shortDatePattern?: string;
fullDateTimePattern?: string;
dateSeparator?: string;
shortTimePattern?: string;
longTimePattern?: string;
}
export interface IanaTimeZone {
timeZoneName?: string;
}
export interface TimeZone {
iana: IanaTimeZone;
windows: WindowsTimeZone;
}
export interface TimingDto {
timeZone: TimeZone;
}
export interface WindowsTimeZone {
timeZoneId?: string;
}

1
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/index.ts

@ -0,0 +1 @@
export * from './models';

87
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.ts

@ -0,0 +1,87 @@
export interface EntityExtensionDto {
properties: Record<string, ExtensionPropertyDto>;
configuration: Record<string, object>;
}
export interface ExtensionEnumDto {
fields: ExtensionEnumFieldDto[];
localizationResource?: string;
}
export interface ExtensionEnumFieldDto {
name?: string;
value: object;
}
export interface ExtensionPropertyApiCreateDto {
isAvailable: boolean;
}
export interface ExtensionPropertyApiDto {
onGet: ExtensionPropertyApiGetDto;
onCreate: ExtensionPropertyApiCreateDto;
onUpdate: ExtensionPropertyApiUpdateDto;
}
export interface ExtensionPropertyApiGetDto {
isAvailable: boolean;
}
export interface ExtensionPropertyApiUpdateDto {
isAvailable: boolean;
}
export interface ExtensionPropertyAttributeDto {
typeSimple?: string;
config: Record<string, object>;
}
export interface ExtensionPropertyDto {
type?: string;
typeSimple?: string;
displayName: LocalizableStringDto;
api: ExtensionPropertyApiDto;
ui: ExtensionPropertyUiDto;
attributes: ExtensionPropertyAttributeDto[];
configuration: Record<string, object>;
defaultValue: object;
}
export interface ExtensionPropertyUiDto {
onTable: ExtensionPropertyUiTableDto;
onCreateForm: ExtensionPropertyUiFormDto;
onEditForm: ExtensionPropertyUiFormDto;
lookup: ExtensionPropertyUiLookupDto;
}
export interface ExtensionPropertyUiFormDto {
isVisible: boolean;
}
export interface ExtensionPropertyUiLookupDto {
url?: string;
resultListPropertyName?: string;
displayPropertyName?: string;
valuePropertyName?: string;
filterParamName?: string;
}
export interface ExtensionPropertyUiTableDto {
isVisible: boolean;
}
export interface LocalizableStringDto {
name?: string;
resource?: string;
}
export interface ModuleExtensionDto {
entities: Record<string, EntityExtensionDto>;
configuration: Record<string, object>;
}
export interface ObjectExtensionsDto {
modules: Record<string, ModuleExtensionDto>;
enums: Record<string, ExtensionEnumDto>;
}

4
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/index.ts

@ -0,0 +1,4 @@
import * as ApiExploring from './api-exploring';
import * as ApplicationConfigurations from './application-configurations';
import * as MultiTenancy from './multi-tenancy';
export { ApiExploring, ApplicationConfigurations, MultiTenancy };

1
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/index.ts

@ -0,0 +1 @@
export * from './models';

16
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.ts

@ -0,0 +1,16 @@
export interface FindTenantResultDto {
success: boolean;
tenantId?: string;
name?: string;
}
export interface CurrentTenantDto {
id?: string;
name?: string;
isAvailable: boolean;
}
export interface MultiTenancyInfoDto {
isEnabled: boolean;
}

2
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/index.ts

@ -0,0 +1,2 @@
import * as Modeling from './modeling';
export { Modeling };

1
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/index.ts

@ -0,0 +1 @@
export * from './models';

79
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/http/modeling/models.ts

@ -0,0 +1,79 @@
export interface ActionApiDescriptionModel {
uniqueName?: string;
name?: string;
httpMethod?: string;
url?: string;
supportedVersions: string[];
parametersOnMethod: MethodParameterApiDescriptionModel[];
parameters: ParameterApiDescriptionModel[];
returnValue: ReturnValueApiDescriptionModel;
}
export interface ApplicationApiDescriptionModel {
modules: Record<string, ModuleApiDescriptionModel>;
types: Record<string, TypeApiDescriptionModel>;
}
export interface ApplicationApiDescriptionModelRequestDto {
includeTypes: boolean;
}
export interface ControllerApiDescriptionModel {
controllerName?: string;
type?: string;
interfaces: ControllerInterfaceApiDescriptionModel[];
actions: Record<string, ActionApiDescriptionModel>;
}
export interface ControllerInterfaceApiDescriptionModel {
type?: string;
}
export interface MethodParameterApiDescriptionModel {
name?: string;
typeAsString?: string;
type?: string;
typeSimple?: string;
isOptional: boolean;
defaultValue: object;
}
export interface ModuleApiDescriptionModel {
rootPath?: string;
remoteServiceName?: string;
controllers: Record<string, ControllerApiDescriptionModel>;
}
export interface ParameterApiDescriptionModel {
nameOnMethod?: string;
name?: string;
type?: string;
typeSimple?: string;
isOptional: boolean;
defaultValue: object;
constraintTypes: string[];
bindingSourceId?: string;
descriptorName?: string;
}
export interface PropertyApiDescriptionModel {
name?: string;
type?: string;
typeSimple?: string;
isRequired: boolean;
}
export interface ReturnValueApiDescriptionModel {
type?: string;
typeSimple?: string;
}
export interface TypeApiDescriptionModel {
baseType?: string;
isEnum: boolean;
enumNames: string[];
enumValues: object[];
genericArguments: string[];
properties: PropertyApiDescriptionModel[];
}

5
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/index.ts

@ -0,0 +1,5 @@
import * as AspNetCore from './asp-net-core';
import * as Http from './http';
import * as Localization from './localization';
export * from './models';
export { AspNetCore, Http, Localization };

1
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/index.ts

@ -0,0 +1 @@
export * from './models';

7
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/localization/models.ts

@ -0,0 +1,7 @@
export interface LanguageInfo {
cultureName?: string;
uiCultureName?: string;
displayName?: string;
flagIcon?: string;
}

5
npm/ng-packs/packages/core/src/lib/proxy/volo/abp/models.ts

@ -0,0 +1,5 @@
export interface NameValue<T = string> {
name: string;
value: T;
}

2
npm/ng-packs/packages/core/src/lib/proxy/volo/index.ts

@ -0,0 +1,2 @@
import * as Abp from './abp';
export { Abp };

2
npm/ng-packs/packages/core/src/lib/tests/date-utils.spec.ts

@ -19,7 +19,7 @@ describe('Date Utils', () => {
let config: ConfigStateService;
beforeEach(() => {
config = new ConfigStateService(undefined);
config = new ConfigStateService();
});
describe('#getShortDateFormat', () => {

4
npm/ng-packs/packages/core/src/lib/tests/replaceable-template.directive.spec.ts

@ -8,7 +8,7 @@ import { ReplaceableComponentsService } from '../services/replaceable-components
@Component({
selector: 'abp-default-component',
template: ` <p>default</p> `,
template: ' <p>default</p> ',
exportAs: 'abpDefaultComponent',
})
class DefaultComponent implements OnInit {
@ -34,7 +34,7 @@ class DefaultComponent implements OnInit {
@Component({
selector: 'abp-external-component',
template: ` <p>external</p> `,
template: ' <p>external</p> ',
})
class ExternalComponent {
constructor(

146
npm/ng-packs/packages/theme-shared/extensions/src/lib/models/internal/object-extensions.ts

@ -3,37 +3,150 @@ import { EntityPropList } from '../entity-props';
import { FormPropList } from '../form-props';
import { PropContributorCallbacks } from '../props';
export interface EntityExtensionDto {
properties: Record<string, ExtensionPropertyDto>;
configuration: Record<string, object>;
}
export interface ExtensionEnumDto {
fields: ExtensionEnumFieldDto[];
localizationResource?: string;
transformed?: any;
}
export interface ExtensionEnumFieldDto {
name?: string;
value: any;
}
export interface ExtensionPropertyApiCreateDto {
isAvailable: boolean;
}
export interface ExtensionPropertyApiDto {
onGet: ExtensionPropertyApiGetDto;
onCreate: ExtensionPropertyApiCreateDto;
onUpdate: ExtensionPropertyApiUpdateDto;
}
export interface ExtensionPropertyApiGetDto {
isAvailable: boolean;
}
export interface ExtensionPropertyApiUpdateDto {
isAvailable: boolean;
}
export interface ExtensionPropertyAttributeDto {
typeSimple?: string;
config: Record<string, any>;
}
export interface ExtensionPropertyDto {
type?: string;
typeSimple?: ePropType;
displayName: LocalizableStringDto;
api: ExtensionPropertyApiDto;
ui: ExtensionPropertyUiDto;
attributes: ExtensionPropertyAttributeDto[];
configuration: Record<string, any>;
defaultValue: any;
}
export interface ExtensionPropertyUiDto {
onTable: ExtensionPropertyUiTableDto;
onCreateForm: ExtensionPropertyUiFormDto;
onEditForm: ExtensionPropertyUiFormDto;
lookup: ExtensionPropertyUiLookupDto;
}
export interface ExtensionPropertyUiFormDto {
isVisible: boolean;
}
export interface ExtensionPropertyUiLookupDto {
url?: string;
resultListPropertyName?: string;
displayPropertyName?: string;
valuePropertyName?: string;
filterParamName?: string;
}
export interface ExtensionPropertyUiTableDto {
isSortable?: boolean;
isVisible: boolean;
}
export interface LocalizableStringDto {
name?: string;
resource?: string;
}
export interface ModuleExtensionDto {
entities: Record<string, EntityExtensionDto>;
configuration: Record<string, object>;
}
export interface ObjectExtensionsDto {
modules: Record<string, ModuleExtensionDto>;
enums: Record<string, ExtensionEnumDto>;
}
export interface PropContributors<T = any> {
prop: PropContributorCallbacks<EntityPropList<T>>;
createForm: PropContributorCallbacks<FormPropList<T>>;
editForm: PropContributorCallbacks<FormPropList<T>>;
}
/**
* @deprecated To be deleted in v4.2.
*/
export interface Config {
objectExtensions: Item;
}
/**
* @deprecated Use ObjectExtensionsDto. To be deleted in v4.2.
*/
export interface Item {
modules: Modules;
enums: Enums;
}
/**
* @deprecated Use Record<string, ModuleExtensionDto>. To be deleted in v4.2.
*/
export type Modules = Configuration<Module>;
/**
* @deprecated Use ModuleExtensionDto. To be deleted in v4.2.
*/
export interface Module {
configuration: Configuration;
entities: Entities;
}
/**
* @deprecated Use Record<string, EntityExtensionDto>. To be deleted in v4.2.
*/
export type Entities = Configuration<Entity>;
/**
* @deprecated Use EntityExtensionDto. To be deleted in v4.2.
*/
export interface Entity {
configuration: Configuration;
properties: Properties;
}
/**
* @deprecated Use Record<string, ExtensionPropertyDto>. To be deleted in v4.2.
*/
export type Properties = Configuration<Property>;
/**
* @deprecated Use ExtensionPropertyDto. To be deleted in v4.2.
*/
export interface Property {
type: string;
typeSimple: ePropType;
@ -45,51 +158,84 @@ export interface Property {
defaultValue?: any;
}
/**
* @deprecated Use LocalizableStringDto. To be deleted in v4.2.
*/
export interface DisplayName {
name: string;
resource: string;
}
/**
* @deprecated Use ExtensionPropertyApiDto. To be deleted in v4.2.
*/
export interface Api {
onGet: ApiConfig;
onCreate: ApiConfig;
onUpdate: ApiConfig;
}
/**
* @deprecated Use ExtensionPropertyApiCreateDto. To be deleted in v4.2.
*/
export interface ApiConfig {
isAvailable: boolean;
}
/**
* @deprecated Use ExtensionPropertyUiDto. To be deleted in v4.2.
*/
export interface Ui {
onTable: UiPropConfig;
onCreateForm: UiFormConfig;
onEditForm: UiFormConfig;
}
/**
* @deprecated Use ExtensionPropertyUiTableDto. To be deleted in v4.2.
*/
export interface UiPropConfig {
isSortable: boolean;
isVisible: boolean;
}
/**
* @deprecated Use ExtensionPropertyUiFormDto. To be deleted in v4.2.
*/
export interface UiFormConfig {
isVisible: boolean;
}
/**
* @deprecated Use ExtensionPropertyAttributeDto. To be deleted in v4.2.
*/
export interface Attribute {
typeSimple: string;
config: Configuration;
}
/**
* @deprecated To be deleted in v4.2.
*/
export type Configuration<T = any> = Record<string, T>;
/**
* @deprecated Use Record<string, ExtensionEnumDto>. To be deleted in v4.2.
*/
export type Enums = Record<string, Enum>;
/**
* @deprecated Use ExtensionEnumDto. To be deleted in v4.2.
*/
export interface Enum {
fields: EnumMember[];
localizationResource?: string;
transformed?: any;
}
/**
* @deprecated Use ExtensionEnumFieldDto. To be deleted in v4.2.
*/
export interface EnumMember {
name: string;
value: any;

10
npm/ng-packs/packages/theme-shared/extensions/src/lib/utils/enum.util.ts

@ -5,11 +5,11 @@ import { EXTRA_PROPERTIES_KEY } from '../constants/extra-properties';
import { ObjectExtensions } from '../models/object-extensions';
import { PropCallback } from '../models/props';
export function createEnum(members: ObjectExtensions.EnumMember[]) {
export function createEnum(members: ObjectExtensions.ExtensionEnumFieldDto[]) {
const enumObject: any = {};
members.forEach(({ name, value }) => {
enumObject[(enumObject[name] = value)] = name;
enumObject[(enumObject[name] = value as any)] = name;
});
return enumObject;
@ -17,7 +17,7 @@ export function createEnum(members: ObjectExtensions.EnumMember[]) {
export function createEnumValueResolver<T = any>(
enumType: string,
lookupEnum: ObjectExtensions.Enum,
lookupEnum: ObjectExtensions.ExtensionEnumDto,
propName: string,
): PropCallback<T, Observable<string>> {
return data => {
@ -32,7 +32,7 @@ export function createEnumValueResolver<T = any>(
export function createEnumOptions<T = any>(
enumType: string,
lookupEnum: ObjectExtensions.Enum,
lookupEnum: ObjectExtensions.ExtensionEnumDto,
): PropCallback<T, Observable<ABP.Option<any>[]>> {
return data => {
const l10n = data.getInjected(LocalizationService);
@ -55,7 +55,7 @@ function createLocalizationStream(l10n: LocalizationService, mapTarget: any) {
function createEnumLocalizer(
l10n: LocalizationService,
enumType: string,
lookupEnum: ObjectExtensions.Enum,
lookupEnum: ObjectExtensions.ExtensionEnumDto,
): (key: string) => string {
const resource = lookupEnum.localizationResource;
const shortType = getShortEnumType(enumType);

5
npm/ng-packs/packages/theme-shared/extensions/src/lib/utils/localization.util.ts

@ -6,7 +6,10 @@ export function createDisplayNameLocalizationPipeKeyGenerator(
) {
const generateLocalizationPipeKey = createLocalizationPipeKeyGenerator(localization);
return (displayName: ObjectExtensions.DisplayName, fallback: ObjectExtensions.DisplayName) => {
return (
displayName: ObjectExtensions.LocalizableStringDto,
fallback: ObjectExtensions.LocalizableStringDto,
) => {
if (displayName && displayName.name)
return generateLocalizationPipeKey(
[displayName.resource],

27
npm/ng-packs/packages/theme-shared/extensions/src/lib/utils/state.util.ts

@ -13,7 +13,7 @@ import { getValidatorsFromProperty } from './validation.util';
function selectObjectExtensions(
configState: ConfigStateService,
): Observable<ObjectExtensions.Item> {
): Observable<ObjectExtensions.ObjectExtensionsDto> {
return configState.getOne$('objectExtensions');
}
@ -25,9 +25,9 @@ function selectLocalization(
function selectEnums(
configState: ConfigStateService,
): Observable<Record<string, ObjectExtensions.Enum>> {
): Observable<Record<string, ObjectExtensions.ExtensionEnumDto>> {
return selectObjectExtensions(configState).pipe(
map((extensions: ObjectExtensions.Item) =>
map((extensions: ObjectExtensions.ObjectExtensionsDto) =>
Object.keys(extensions.enums).reduce((acc, key) => {
const { fields, localizationResource } = extensions.enums[key];
acc[key] = {
@ -36,23 +36,24 @@ function selectEnums(
transformed: createEnum(fields),
};
return acc;
}, {} as ObjectExtensions.Enums),
}, {} as Record<string, ObjectExtensions.ExtensionEnumDto>),
),
);
}
export function getObjectExtensionEntitiesFromStore(
configState: ConfigStateService,
moduleKey: ModuleKey,
moduleKey: string,
) {
return selectObjectExtensions(configState).pipe(
map(extensions => {
if (!extensions) return null;
return (extensions.modules[moduleKey] || ({} as ObjectExtensions.Module)).entities;
return (extensions.modules[moduleKey] || ({} as ObjectExtensions.ModuleExtensionDto))
.entities;
}),
map(entities => (isUndefined(entities) ? {} : entities)),
filter<ObjectExtensions.Entities>(Boolean),
filter<Entities>(Boolean),
take(1),
);
}
@ -68,12 +69,12 @@ export function mapEntitiesToContributors<T = any>(
const generateDisplayName = createDisplayNameLocalizationPipeKeyGenerator(localization);
return Object.keys(entities).reduce(
(acc, key: keyof ObjectExtensions.Entities) => {
(acc, key: keyof Entities) => {
acc.prop[key] = [];
acc.createForm[key] = [];
acc.editForm[key] = [];
const entity: ObjectExtensions.Entity = entities[key];
const entity: ObjectExtensions.EntityExtensionDto = entities[key];
if (!entity) return acc;
const properties = entity.properties;
@ -103,10 +104,10 @@ export function mapEntitiesToContributors<T = any>(
function createPropertiesToContributorsMapper<T = any>(
generateDisplayName: DisplayNameGeneratorFn,
resource: string,
enums: Record<string, ObjectExtensions.Enum>,
enums: Record<string, ObjectExtensions.ExtensionEnumDto>,
) {
return (
properties: Record<string, ObjectExtensions.Property>,
properties: Record<string, ObjectExtensions.ExtensionPropertyDto>,
contributors: ObjectExtensions.PropContributors<T>,
key: string,
) => {
@ -169,7 +170,7 @@ function createPropertiesToContributorsMapper<T = any>(
};
}
function getTypeFromProperty(property: ObjectExtensions.Property): ePropType {
function getTypeFromProperty(property: ObjectExtensions.ExtensionPropertyDto): ePropType {
return (property.typeSimple.replace(/\?$/, '') as string) as ePropType;
}
@ -178,4 +179,4 @@ function isUndefined(obj: any): obj is undefined {
}
type DisplayNameGeneratorFn = ReturnType<typeof createDisplayNameLocalizationPipeKeyGenerator>;
type ModuleKey = keyof ObjectExtensions.Modules;
type Entities = Record<string, ObjectExtensions.EntityExtensionDto>;

4
npm/ng-packs/packages/theme-shared/extensions/src/lib/utils/validation.util.ts

@ -2,7 +2,9 @@ import { AbpValidators } from '@abp/ng.core';
import { ValidatorFn } from '@angular/forms';
import { ObjectExtensions } from '../models/object-extensions';
export function getValidatorsFromProperty(property: ObjectExtensions.Property): ValidatorFn[] {
export function getValidatorsFromProperty(
property: ObjectExtensions.ExtensionPropertyDto,
): ValidatorFn[] {
const validators: ValidatorFn[] = [];
property.attributes.forEach(attr => {

69
npm/ng-packs/packages/theme-shared/extensions/src/tests/enum.util.spec.ts

@ -1,6 +1,5 @@
import { LocalizationService } from '@abp/ng.core';
import { Store } from '@ngxs/store';
import { BehaviorSubject, Subject } from 'rxjs';
import { ConfigStateService, LocalizationService } from '@abp/ng.core';
import { BehaviorSubject } from 'rxjs';
import { take } from 'rxjs/operators';
import { PropData } from '../lib/models/props';
import { createEnum, createEnumOptions, createEnumValueResolver } from '../lib/utils/enum.util';
@ -25,6 +24,19 @@ class MockPropData<R = any> extends PropData<R> {
}
}
const mockL10n = {
values: {
Default: {
'Enum:MyEnum.foo': 'Foo',
'MyEnum.bar': 'Bar',
baz: 'Baz',
},
},
defaultResourceName: 'Default',
currentCulture: null,
languages: [],
};
describe('Enum Utils', () => {
describe('#createEnum', () => {
const enumFromFields = createEnum(fields);
@ -43,27 +55,6 @@ describe('Enum Utils', () => {
});
describe('#createEnumValueResolver', () => {
const service = new LocalizationService(
mockSessionState,
({
selectSnapshot: () => ({
values: {
Default: {
'Enum:MyEnum.foo': 'Foo',
'MyEnum.bar': 'Bar',
baz: 'Baz',
},
},
defaultResourceName: 'Default',
currentCulture: null,
languages: [],
}),
} as unknown) as Store,
null,
null,
null,
);
test.each`
value | expected
${1} | ${'Foo'}
@ -72,6 +63,7 @@ describe('Enum Utils', () => {
`(
'should create a resolver that returns observable $expected when enum value is $value',
async ({ value, expected }) => {
const service = createMockLocalizationService();
const valueResolver = createEnumValueResolver(
'MyCompanyName.MyProjectName.MyEnum',
{
@ -92,28 +84,8 @@ describe('Enum Utils', () => {
});
describe('#createEnumOptions', () => {
const service = new LocalizationService(
mockSessionState,
({
selectSnapshot: () => ({
values: {
Default: {
'Enum:MyEnum.foo': 'Foo',
'MyEnum.bar': 'Bar',
baz: 'Baz',
},
},
defaultResourceName: 'Default',
currentCulture: null,
languages: [],
}),
} as unknown) as Store,
null,
null,
null,
);
it('should create a generator that returns observable options from enums', async () => {
const service = createMockLocalizationService();
const options = createEnumOptions('MyCompanyName.MyProjectName.MyEnum', {
fields,
localizationResource: null,
@ -133,3 +105,10 @@ describe('Enum Utils', () => {
});
});
});
function createMockLocalizationService() {
const configState = new ConfigStateService();
configState.setState({ localization: mockL10n } as any);
return new LocalizationService(mockSessionState, null, null, null, configState, null);
}

120
npm/ng-packs/packages/theme-shared/extensions/src/tests/state.util.spec.ts

@ -1,8 +1,4 @@
import { ApplicationConfiguration, ConfigState } from '@abp/ng.core';
import { HttpClient } from '@angular/common/http';
import { SpectatorService } from '@ngneat/spectator';
import { createServiceFactory } from '@ngneat/spectator/jest';
import { NgxsModule, Store } from '@ngxs/store';
import { ConfigStateService } from '@abp/ng.core';
import { of } from 'rxjs';
import { take } from 'rxjs/operators';
import { ePropType } from '../lib/enums/props.enum';
@ -13,40 +9,30 @@ import {
getObjectExtensionEntitiesFromStore,
mapEntitiesToContributors,
} from '../lib/utils/state.util';
import { OAuthService } from 'angular-oauth2-oidc';
describe('State Utils', () => {
let spectator: SpectatorService<Store>;
let store: Store;
const createService = createServiceFactory({
service: Store,
imports: [NgxsModule.forRoot([ConfigState])],
mocks: [HttpClient, OAuthService],
});
beforeEach(() => {
spectator = createService();
store = spectator.service;
store.reset(createMockState());
});
const configState = new ConfigStateService();
configState.setState(createMockState() as any);
describe('State Utils', () => {
describe('#getObjectExtensionEntitiesFromStore', () => {
it('should return observable entities of an existing module', async () => {
const entities = await getObjectExtensionEntitiesFromStore(store, 'Identity').toPromise();
const entities = await getObjectExtensionEntitiesFromStore(
configState,
'Identity',
).toPromise();
expect('Role' in entities).toBe(true);
});
it('should return observable empty object if module does not exist', async () => {
const entities = await getObjectExtensionEntitiesFromStore(store, 'Saas').toPromise();
const entities = await getObjectExtensionEntitiesFromStore(configState, 'Saas').toPromise();
expect(entities).toEqual({});
});
it('should not emit when object extensions do not exist', done => {
store.reset({ ConfigState: {} });
const emptyConfigState = new ConfigStateService();
const emit = jest.fn();
getObjectExtensionEntitiesFromStore(store, 'Identity').subscribe(emit);
getObjectExtensionEntitiesFromStore(emptyConfigState, 'Identity').subscribe(emit);
setTimeout(() => {
expect(emit).not.toHaveBeenCalled();
@ -58,7 +44,7 @@ describe('State Utils', () => {
describe('#mapEntitiesToContributors', () => {
it('should return contributors from given entities', async () => {
const contributors = await of(createMockEntities())
.pipe(mapEntitiesToContributors(store, 'AbpIdentity'), take(1))
.pipe(mapEntitiesToContributors(configState, 'AbpIdentity'), take(1))
.toPromise();
const propList = new EntityPropList();
@ -86,50 +72,48 @@ describe('State Utils', () => {
});
});
function createMockState(): MockState {
function createMockState() {
return {
ConfigState: {
objectExtensions: {
modules: {
Identity: {
entities: createMockEntities(),
configuration: null,
},
},
enums: {
'MyCompanyName.MyProjectName.MyEnum': {
fields: [
{
name: 'MyEnumValue0',
value: 0,
},
{
name: 'MyEnumValue1',
value: 1,
},
{
name: 'MyEnumValue2',
value: 2,
},
],
localizationResource: null,
},
objectExtensions: {
modules: {
Identity: {
entities: createMockEntities(),
configuration: null,
},
},
localization: {
values: {
Default: {},
AbpIdentity: {},
enums: {
'MyCompanyName.MyProjectName.MyEnum': {
fields: [
{
name: 'MyEnumValue0',
value: 0,
},
{
name: 'MyEnumValue1',
value: 1,
},
{
name: 'MyEnumValue2',
value: 2,
},
],
localizationResource: null,
},
defaultResourceName: 'Default',
currentCulture: null,
languages: [],
},
},
localization: {
values: {
Default: {},
AbpIdentity: {},
},
defaultResourceName: 'Default',
currentCulture: null,
languages: [],
},
};
}
function createMockEntities(): ObjectExtensions.Entities {
function createMockEntities(): Record<string, ObjectExtensions.EntityExtensionDto> {
return {
Role: {
properties: {
@ -159,6 +143,7 @@ function createMockEntities(): ObjectExtensions.Entities {
onEditForm: {
isVisible: true,
},
lookup: {},
},
attributes: [
{
@ -174,6 +159,7 @@ function createMockEntities(): ObjectExtensions.Entities {
},
],
configuration: {},
defaultValue: null,
},
IsHero: {
type: 'System.Boolean',
@ -201,9 +187,11 @@ function createMockEntities(): ObjectExtensions.Entities {
onEditForm: {
isVisible: true,
},
lookup: {},
},
attributes: [],
configuration: {},
defaultValue: null,
},
AsOf: {
type: 'System.Date',
@ -234,9 +222,11 @@ function createMockEntities(): ObjectExtensions.Entities {
onEditForm: {
isVisible: false,
},
lookup: {},
},
attributes: [],
configuration: {},
defaultValue: null,
},
MyEnum: {
type: 'MyCompanyName.MyProjectName.MyEnum',
@ -264,6 +254,7 @@ function createMockEntities(): ObjectExtensions.Entities {
onEditForm: {
isVisible: false,
},
lookup: {},
},
attributes: [
{
@ -294,10 +285,3 @@ function createMockEntities(): ObjectExtensions.Entities {
ClaimType: null,
};
}
interface MockState {
ConfigState: {
localization: ApplicationConfiguration.Localization;
objectExtensions: ObjectExtensions.Item;
};
}

2
npm/ng-packs/packages/theme-shared/extensions/src/tests/validation.util.spec.ts

@ -12,7 +12,7 @@ describe('Validation Utils', () => {
config: {},
},
],
} as ObjectExtensions.Property;
} as ObjectExtensions.ExtensionPropertyDto;
expect(getValidatorsFromProperty(property)[0]).toBe(Validators.email);
});

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

@ -62,7 +62,6 @@ namespace MyCompanyName.MyProjectName.Blazor
private void ConfigureBlazorise(ServiceConfigurationContext context)
{
context.Services
.AddBlazorise()
.AddBootstrapProviders()
.AddFontAwesomeIcons();
}

1
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs

@ -61,7 +61,6 @@ namespace MyCompanyName.MyProjectName.Blazor.Host
private void ConfigureBlazorise(ServiceConfigurationContext context)
{
context.Services
.AddBlazorise()
.AddBootstrapProviders()
.AddFontAwesomeIcons();
}

Loading…
Cancel
Save