Browse Source

Merge branch 'dev' into blazor-ui

pull/5399/head
Halil İbrahim Kalkan 6 years ago
parent
commit
147546df1e
  1. 0
      LICENSE.md
  2. 5
      common.props
  3. 36
      docs/en/Blog-Posts/2020-09-07 Angular-Service-Proxies/POST.md
  4. 19
      docs/en/CLI.md
  5. 18
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/Using-DevExtreme-Components-With-The-ABP-Fremework.md
  6. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/both-example-result.png
  7. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-app-contract.png
  8. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-application.png
  9. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-final.png
  10. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-web.png
  11. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devexp-result.gif
  12. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devextreme-js.png
  13. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/gulp.png
  14. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/initial-project.png
  15. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-app-contract.png
  16. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-application.png
  17. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-final.png
  18. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-web.png
  19. 0
      docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/wwwroot-lib.png
  20. 13
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsScriptContributor.cs
  21. 13
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsStyleContributor.cs
  22. 16
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/StarRatingSvg/StarRatingSvgScriptContributor.cs
  23. 13
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/StarRatingSvg/StarRatingSvgStyleContributor.cs
  24. 10
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs
  25. 1
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs
  26. 76
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs
  27. 3
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs
  28. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs
  29. 68
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/PackagePreviewSwitcher.cs
  30. 1
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
  31. 1
      framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json
  32. 46
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/abp/luxon/abp.luxon.js
  33. 4
      npm/ng-packs/packages/schematics/src/commands/api/index.ts
  34. 6
      npm/ng-packs/packages/schematics/src/commands/proxy/index.ts
  35. 10
      npm/ng-packs/packages/schematics/src/utils/common.ts
  36. 6
      npm/packs/cropperjs/abp.resourcemapping.js
  37. 12
      npm/packs/cropperjs/package.json
  38. 2
      npm/packs/luxon/package.json
  39. 6
      npm/packs/star-rating-svg/abp.resourcemapping.js
  40. 12
      npm/packs/star-rating-svg/package.json
  41. 5
      nupkg/pack.ps1
  42. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml

0
LICENSE → LICENSE.md

5
common.props

@ -4,12 +4,13 @@
<Version>3.1.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<PackageIconUrl>https://abp.io/assets/abp_nupkg.png</PackageIconUrl>
<PackageProjectUrl>https://abp.io</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/abpframework/abp/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://abp.io/</PackageProjectUrl>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/abpframework/abp/</RepositoryUrl>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" />
<None Include="LICENSE.md" Pack="true" PackagePath=""/>
</ItemGroup>
</Project>

36
docs/en/Blog-Posts/2020-09-07 Angular-Service-Proxies/POST.md

@ -26,34 +26,58 @@ dotnet tool update -g Volo.Abp.Cli
> If you've created your project with version 3.1 or later, you can skip this part since it will be already installed in your solution.
<<<<<<< HEAD
For the solution was created before v3.1, follow the steps below to configure your angular project:
* Add `@abp/ng.schematics` package to the `devDependencies` of the Angular project (run the following command in the root folder of the angular application):
=======
For a solution that was created before v3.1, follow the steps below to configure the angular application:
* Add `@abp/ng.schematics` package to the `devDependencies` of the Angular project. Run the following command in the root folder of the angular application:
>>>>>>> dev
````bash
npm install @abp/ng.schematics --save-dev
````
<<<<<<< HEAD
- Add `rootNamespace` entry into the `/apis/default/` section in the `/src/environments/environment.ts`, as shown below:
=======
- Add `rootNamespace` entry into the `apis/default` section in the `/src/environments/environment.ts`, as shown below:
>>>>>>> dev
```json
apis: {
default: {
...
<<<<<<< HEAD
rootNamespace: 'Acme.BookStore' //<-- ADD THIS
=======
rootNamespace: 'Acme.BookStore'
>>>>>>> dev
},
}
```
<<<<<<< HEAD
`Acme.BookStore` should be replaced by the root namespace of your .NET project. This ensures to not create unnecessary nested folders while creating the service proxy code.
=======
`Acme.BookStore` should be replaced by the root namespace of your .NET project. This ensures to not create unnecessary nested folders while creating the service proxy code. This value is `AngularProxyDemo` for the example solution explained below.
>>>>>>> dev
## Basic Usage
### Project Creation
<<<<<<< HEAD
Assuming you've created your project with the Angular UI.
Example (using the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI)):
=======
> If you already have a solution, you can skip this section.
You need to [create](https://abp.io/get-started) your solution with the Angular UI. You can use the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) to create a new solution:
>>>>>>> dev
````bash
abp new AngularProxyDemo -u angular
@ -63,7 +87,11 @@ abp new AngularProxyDemo -u angular
The backend application must be up and running to be able to use the service proxy code generation system.
<<<<<<< HEAD
> See the [getting started](https://docs.abp.io/en/abp/latest/Getting-Started?UI=NG&DB=EF&Tiered=No) guide if you don't know how create and to run the project.
=======
> See the [getting started](https://docs.abp.io/en/abp/latest/Getting-Started?UI=NG&DB=EF&Tiered=No) guide if you don't know details of creating and running the solution.
>>>>>>> dev
### Backend
@ -124,13 +152,21 @@ It simply returns a list of books. You probably want to get the books from a dat
### HTTP API
<<<<<<< HEAD
Thanks to the conventional API controllers system of the ABP Framework, we don't have too develop API controllers manually. Just **run the backend (*HttpApi.Host*) application** that shows the [Swagger UI](https://swagger.io/tools/swagger-ui/) by default. You will see the GET API for the books:
=======
Thanks to the [auto API controllers](https://docs.abp.io/en/abp/latest/API/Auto-API-Controllers) system of the ABP Framework, we don't have to develop API controllers manually. Just **run the backend (*HttpApi.Host*) application** that shows the [Swagger UI](https://swagger.io/tools/swagger-ui/) by default. You will see the **GET** API for the books:
>>>>>>> dev
![swagger-book-list](swagger-book-list.png)
### Service Proxy Generation
<<<<<<< HEAD
Open a command line in the root folder of the Angular application and execute the following command:
=======
Open a **command line** in the **root folder of the Angular application** and execute the following command:
>>>>>>> dev
````bash
abp generate-proxy

19
docs/en/CLI.md

@ -16,6 +16,12 @@ To update an existing installation:
dotnet tool update -g Volo.Abp.Cli
````
## Global Options
While each command may have a set of options, there are some global options those can be used with any command;
* `--skip-cli-version-check`: Skips to check the latest version of the ABP CLI. If you don't specify, it will check the latest version and shows a warning message if there is a newer version of the ABP CLI.
## Commands
Here, the list of all available commands before explaining their details:
@ -181,6 +187,13 @@ Usage:
abp generate-proxy
````
#### Options
* `--module` or `-m`: Specifies the name of the backend module you wish to generate proxies for. Default value: `app`.
* `--source` or `-s`: Specifies the Angular project name to resolve the root namespace & API definition URL from. Default value: `defaultProject`.
* `--target` or `-t`: Specifies the Angular project name to place generated code in. Default value: `defaultProject`.
* `--prompt` or `-p`: Asks the options from the command line prompt (for the unspecified options).
> See the [Angular Service Proxies document](UI/Angular/Service-Proxies.md) for more.
@ -196,7 +209,7 @@ abp switch-to-preview [options]
#### Options
`--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory.
* `--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory.
### switch-to-nightly
@ -211,7 +224,7 @@ abp switch-to-nightly [options]
#### Options
`--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory.
* `--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory.
### switch-to-stable
@ -224,7 +237,7 @@ abp switch-to-stable [options]
````
#### Options
`--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory.
* `--solution-directory` or `-sd`: Specifies the directory. The solution should be in that directory or in any of its sub directories. If not specified, default is the current directory.
### translate

18
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/Using-DevExtreme-In-ABP-Based-Application.md → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/Using-DevExtreme-Components-With-The-ABP-Fremework.md

@ -1,9 +1,11 @@
## Using DevExtreme with ABP Based Applications
## Using DevExtreme Components With the ABP Fremework
Hi, in this step by step article, I will show you how to integrate DevExtreme components into ABP Framework based applications.
Hi, in this step by step article, I will show you how to integrate [DevExtreme](https://js.devexpress.com/) components into ABP Framework-based applications.
![both-example-result](both-example-result.png)
*(A screenshot from the example application developed in this article)*
## Create the Project
ABP Framework offers startup templates to get into the business faster. We can download a new startup template using [ABP CLI](https://docs.abp.io/en/abp/latest/CLI):
@ -151,7 +153,7 @@ namespace DevExtremeSample.Web.Bundling
}
```
As you see, the `DevExtremeScriptContributor` is depends on `JQueryScriptContributor` which adds JQuery related files before the DevExpress packages (see the [bundling system](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Bundling-Minification) for details).
As you see, the `DevExtremeScriptContributor` depends on `JQueryScriptContributor` which adds JQuery related files before the DevExpress packages (see the [bundling system](https://docs.abp.io/en/abp/latest/UI/AspNetCore/Bundling-Minification) for details).
#### Create DevExtremeJsViewComponent
@ -184,7 +186,7 @@ namespace DevExtremeSample.Web.Components.DevExtremeJs
<abp-script type="typeof(DevExtremeScriptContributor)" />
```
Your final Web project should be like as the following:
Your final Web project should be like the following:
![devextreme-js](devextreme-js.png)
@ -204,7 +206,7 @@ Configure<AbpLayoutHookOptions>(options =>
#### Known Issue: Uncaught TypeError: MutationObserver.observe: Argument 1 is not an object.
> This issue does exists in the ABP Framework v3.0 and earlier versions. If you are using ABP Framework v3.1 or a latter version, you can skip this section.
> This issue does exist in the ABP Framework v3.0 and earlier versions. If you are using ABP Framework v3.1 or a later version, you can skip this section.
When you run your `*.Web` project, you will see an exception (`Uncaught TypeError: MutationObserver.observe: Argument 1 is not an object.`) at your console.
@ -265,7 +267,7 @@ I've used an in-memory list to store data for this example, instead of a real da
#### JSON Serialization
You can see some `JsonProperty` attributes on the DTO properties. I uses these attributes because DevExtreme example expects `PascalCase` property names in the serialized JSON that is sent to the client. But ABP Framework & ASP.NET Core conventionally uses `camelCase` property names on JSON serialization. Adding these `JsonProperty` attributes ensures that the related properties are serialized as `PascalCase`.
You can see some `JsonProperty` attributes on the DTO properties. I use these attributes because DevExtreme example expects `PascalCase` property names in the serialized JSON that is sent to the client. But ABP Framework & ASP.NET Core conventionally uses `camelCase` property names on JSON serialization. Adding these `JsonProperty` attributes ensures that the related properties are serialized as `PascalCase`.
#### DevExtreme Components vs Application Service Methods
@ -300,3 +302,7 @@ Html.DevExtreme().DataGrid<Order>()
.Key("OrderID")
)
```
## Conclusion
In this article, I've explained how to use [DevExtreme](https://js.devexpress.com/) components in your application. ABP Framework is designed so that it can work with any UI library/framework.

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/both-example-result.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/both-example-result.png

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 123 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-app-contract.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-app-contract.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-application.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-application.png

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-final.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-final.png

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/data-grid-web.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/data-grid-web.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/devexp-result.gif → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devexp-result.gif

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/devextreme-js.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/devextreme-js.png

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/gulp.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/gulp.png

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/initial-project.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/initial-project.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-app-contract.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-app-contract.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-application.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-application.png

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-final.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-final.png

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/tree-list-web.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/tree-list-web.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
docs/en/Community-Articles/2020-08-18-DevExtreme-With-ABP/wwwroot-lib.png → docs/en/Community-Articles/2020-08-18-Using-DevExtreme-Components-With-The-ABP-Fremework/wwwroot-lib.png

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

13
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsScriptContributor.cs

@ -0,0 +1,13 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using System.Collections.Generic;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.CropperJs
{
public class CropperJsScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/cropperjs/js/cropper.min.js");
}
}
}

13
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/CropperJs/CropperJsStyleContributor.cs

@ -0,0 +1,13 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.CropperJs
{
public class CropperJsStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/cropperjs/css/cropper.min.css");
}
}
}

16
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/StarRatingSvg/StarRatingSvgScriptContributor.cs

@ -0,0 +1,16 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.StarRatingSvg
{
[DependsOn(typeof(JQueryScriptContributor))]
public class StarRatingSvgScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/star-rating-svg/js/jquery.star-rating-svg.min.js");
}
}
}

13
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/StarRatingSvg/StarRatingSvgStyleContributor.cs

@ -0,0 +1,13 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.StarRatingSvg
{
public class StarRatingSvgStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/star-rating-svg/css/star-rating-svg.css");
}
}
}

10
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/CliService.cs

@ -41,9 +41,13 @@ namespace Volo.Abp.Cli
{
Logger.LogInformation("ABP CLI (https://abp.io)");
await CheckCliVersionAsync();
var commandLineArgs = CommandLineArgumentParser.Parse(args);
if (!commandLineArgs.Options.ContainsKey("skip-cli-version-check"))
{
await CheckCliVersionAsync();
}
var commandType = CommandSelector.Select(commandLineArgs);
using (var scope = ServiceScopeFactory.CreateScope())
@ -72,7 +76,7 @@ namespace Volo.Abp.Cli
var currentCliVersion = await GetCurrentCliVersion(assembly);
var updateChannel = GetUpdateChannel(currentCliVersion);
Logger.LogInformation($"Version {currentCliVersion} ({updateChannel} channel)");
Logger.LogInformation($"Version {currentCliVersion} ({updateChannel})");
try
{

1
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs

@ -115,7 +115,6 @@ namespace Volo.Abp.Cli.Commands
throw new CliUsageException(sb.ToString());
}
public static class Options
{
public static class Project

76
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs

@ -2,7 +2,6 @@ using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Volo.Abp.Cli.Args;
using Volo.Abp.Cli.Utils;
@ -17,7 +16,31 @@ namespace Volo.Abp.Cli.Commands
CheckAngularJsonFile();
CheckNgSchematics();
CmdHelper.RunCmd("npx ng g @abp/ng.schematics:proxy");
var prompt = commandLineArgs.Options.ContainsKey("p") || commandLineArgs.Options.ContainsKey("prompt");
var defaultValue = prompt ? null : "__default";
var module = commandLineArgs.Options.GetOrNull(Options.Module.Short, Options.Module.Long) ?? defaultValue;
var source = commandLineArgs.Options.GetOrNull(Options.Source.Short, Options.Source.Long) ?? defaultValue;
var target = commandLineArgs.Options.GetOrNull(Options.Target.Short, Options.Target.Long) ?? defaultValue;
var commandBuilder = new StringBuilder("npx ng g @abp/ng.schematics:proxy");
if (module != null)
{
commandBuilder.Append($" --module {module}");
}
if (source != null)
{
commandBuilder.Append($" --source {source}");
}
if (target != null)
{
commandBuilder.Append($" --target {target}");
}
CmdHelper.RunCmd(commandBuilder.ToString());
return Task.CompletedTask;
}
@ -29,20 +52,21 @@ namespace Volo.Abp.Cli.Commands
if (!File.Exists(packageJsonPath))
{
throw new CliUsageException(
"package.json file not found" +
Environment.NewLine +
GetUsageInfo()
"package.json file not found" +
Environment.NewLine +
GetUsageInfo()
);
}
var schematicsPackageNode = (string) JObject.Parse(File.ReadAllText(packageJsonPath))["devDependencies"]?["@abp/ng.schematics"];
var schematicsPackageNode =
(string) JObject.Parse(File.ReadAllText(packageJsonPath))["devDependencies"]?["@abp/ng.schematics"];
if (schematicsPackageNode == null)
{
throw new CliUsageException(
"\"@abp/ng.schematics\" NPM package should be installed to the devDependencies before running this command!" +
Environment.NewLine +
GetUsageInfo()
"\"@abp/ng.schematics\" NPM package should be installed to the devDependencies before running this command!" +
Environment.NewLine +
GetUsageInfo()
);
}
}
@ -69,9 +93,12 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine("");
sb.AppendLine(" abp generate-proxy");
sb.AppendLine("");
sb.AppendLine("Examples:");
sb.AppendLine("Options:");
sb.AppendLine("");
sb.AppendLine(" abp generate-proxy");
sb.AppendLine("-m|--module <module-name> (default: 'app') The name of the backend module you wish to generate proxies for.");
sb.AppendLine("-s|--source <source-name> (default: 'defaultProject') Angular project name to resolve the root namespace & API definition URL from.");
sb.AppendLine("-t|--target <target-name> (default: 'defaultProject') Angular project name to place generated code in.");
sb.AppendLine("-p|--prompt Asks the options from the command line prompt (for the missing options)");
sb.AppendLine("");
sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI");
@ -82,5 +109,32 @@ namespace Volo.Abp.Cli.Commands
{
return "Generates Angular service proxies and DTOs to consume HTTP APIs.";
}
public static class Options
{
public static class Module
{
public const string Short = "m";
public const string Long = "module";
}
public static class Source
{
public const string Short = "s";
public const string Long = "source";
}
public static class Target
{
public const string Short = "t";
public const string Long = "target";
}
public static class Prompt
{
public const string Short = "p";
public const string Long = "prompt";
}
}
}
}

3
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs

@ -86,8 +86,7 @@ namespace Volo.Abp.Cli.NuGet
versions = versions.Where(x => !x.IsPrerelease).ToList();
}
var semanticVersions = versions.ToList();
return semanticVersions.Any() ? semanticVersions.Max() : null;
return versions.Any() ? versions.Max() : null;
}
}

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs

@ -236,7 +236,7 @@ namespace Volo.Abp.Cli.ProjectModification
}
}
if (version == currentVersion)
if (string.IsNullOrEmpty(version) || version == currentVersion)
{
return false;
}
@ -275,6 +275,12 @@ namespace Volo.Abp.Cli.ProjectModification
? versionList.First()
: versionList.FirstOrDefault(v => !SemanticVersion.Parse(v).IsPrerelease);
if (string.IsNullOrEmpty(newVersion))
{
_fileVersionStorage[package.Name] = newVersion;
return newVersion;
}
var newVersionWithPrefix = $"~{newVersion}";
_fileVersionStorage[package.Name] = newVersionWithPrefix;

68
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/PackagePreviewSwitcher.cs

@ -31,6 +31,7 @@ namespace Volo.Abp.Cli.ProjectModification
{
var solutionPath = GetSolutionPath(commandLineArgs);
var solutionFolder = GetSolutionFolder(commandLineArgs);
var solutionAngularFolder = GetSolutionAngularFolder(solutionFolder);
await _nugetPackagesVersionUpdater.UpdateSolutionAsync(
solutionPath,
@ -40,42 +41,74 @@ namespace Volo.Abp.Cli.ProjectModification
solutionFolder,
false,
true);
if (solutionAngularFolder != null)
{
await _npmPackagesUpdater.Update(
solutionAngularFolder,
false,
true);
}
}
public async Task SwitchToNightlyPreview(CommandLineArgs commandLineArgs)
{
var solutionPath = GetSolutionPath(commandLineArgs);
var solutionFolder = GetSolutionFolder(commandLineArgs);
var solutionAngularFolder = GetSolutionAngularFolder(solutionFolder);
_packageSourceManager.Add(solutionFolder, "ABP Nightly", "https://www.myget.org/F/abp-nightly/api/v3/index.json");
await _nugetPackagesVersionUpdater.UpdateSolutionAsync(
solutionPath,
true);
if (solutionPath != null)
{
await _nugetPackagesVersionUpdater.UpdateSolutionAsync(
solutionPath,
true);
}
await _npmPackagesUpdater.Update(
solutionFolder,
true);
if (solutionAngularFolder != null)
{
await _npmPackagesUpdater.Update(
solutionAngularFolder,
true);
}
}
public async Task SwitchToStable(CommandLineArgs commandLineArgs)
{
var solutionPath = GetSolutionPath(commandLineArgs);
var solutionFolder = GetSolutionFolder(commandLineArgs);
var solutionAngularFolder = GetSolutionAngularFolder(solutionFolder);
_packageSourceManager.Remove(solutionFolder, "ABP Nightly");
await _nugetPackagesVersionUpdater.UpdateSolutionAsync(
solutionPath,
false,
false,
true);
if (solutionPath != null)
{
await _nugetPackagesVersionUpdater.UpdateSolutionAsync(
solutionPath,
false,
false,
true);
}
await _npmPackagesUpdater.Update(
solutionFolder,
false,
false,
true);
if (solutionAngularFolder != null)
{
await _npmPackagesUpdater.Update(
solutionAngularFolder,
false,
false,
true);
}
}
private string GetSolutionPath(CommandLineArgs commandLineArgs)
@ -99,7 +132,7 @@ namespace Volo.Abp.Cli.ProjectModification
}
}
Logger.LogError("There is no solution or more that one solution in current directory.");
Logger.LogWarning("There is no solution or more that one solution in current directory.");
return null;
}
@ -112,6 +145,23 @@ namespace Volo.Abp.Cli.ProjectModification
?? Directory.GetCurrentDirectory();
}
private string GetSolutionAngularFolder(string solutionFolder)
{
var upperAngularPath = Path.Combine(Directory.GetParent(solutionFolder)?.FullName ?? "", "angular");
if (Directory.Exists(upperAngularPath))
{
return upperAngularPath;
}
var innerAngularPath = Path.Combine(solutionFolder, "angular");
if (Directory.Exists(innerAngularPath))
{
return innerAngularPath;
}
return null;
}
public static class Options
{
public static class SolutionDirectory

1
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json

@ -17,6 +17,7 @@
"Error": "Error",
"AreYouSure": "Are you sure?",
"Cancel": "Cancel",
"Clear": "Clear",
"Yes": "Yes",
"No": "No",
"Ok": "Ok",

1
framework/src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json

@ -17,6 +17,7 @@
"Error": "Hata",
"AreYouSure": "Emin misiniz?",
"Cancel": "Vazgeç",
"Clear": "Temizle",
"Yes": "Evet",
"No": "Hayır",
"Ok": "Tamam",

46
modules/cms-kit/host/Volo.CmsKit.Web.Unified/wwwroot/libs/abp/luxon/abp.luxon.js

@ -0,0 +1,46 @@
var abp = abp || {};
(function () {
if (!luxon) {
throw "abp/luxon library requires the luxon library included to the page!";
}
/* TIMING *************************************************/
abp.timing = abp.timing || {};
var setObjectValue = function (obj, property, value) {
if (typeof property === "string") {
property = property.split('.');
}
if (property.length > 1) {
var p = property.shift();
setObjectValue(obj[p], property, value);
} else {
obj[property[0]] = value;
}
}
var getObjectValue = function (obj, property) {
return property.split('.').reduce((a, v) => a[v], obj)
}
abp.timing.convertFieldsToIsoDate = function (form, fields) {
for (var field of fields) {
var dateTime = luxon.DateTime
.fromFormat(
getObjectValue(form, field),
abp.localization.currentCulture.dateTimeFormat.shortDatePattern,
{locale: abp.localization.currentCulture.cultureName}
);
if (!dateTime.invalid) {
setObjectValue(form, field, dateTime.toFormat("yyyy-MM-dd HH:mm:ss"))
}
}
return form;
}
})(jQuery);

4
npm/ng-packs/packages/schematics/src/commands/api/index.ts

@ -23,13 +23,15 @@ import {
getRootNamespace,
interpolate,
ModelGeneratorParams,
removeDefaultPlaceholders,
resolveProject,
serializeParameters,
} from '../../utils';
import * as cases from '../../utils/text';
import { Schema as GenerateProxySchema } from './schema';
export default function(params: GenerateProxySchema) {
export default function(schema: GenerateProxySchema) {
const params = removeDefaultPlaceholders(schema);
const moduleName = strings.camelize(params.module || 'app');
return chain([

6
npm/ng-packs/packages/schematics/src/commands/proxy/index.ts

@ -13,11 +13,13 @@ import {
createApiDefinitionSaver,
getApiDefinition,
getSourceUrl,
removeDefaultPlaceholders,
resolveProject,
} from '../../utils';
import { Schema as GenerateProxySchema } from './schema';
export default function(params: GenerateProxySchema) {
export default function(schema: GenerateProxySchema) {
const params = removeDefaultPlaceholders(schema);
const moduleName = strings.camelize(params.module || 'app');
return chain([
@ -32,7 +34,7 @@ export default function(params: GenerateProxySchema) {
data,
`${targetPath}/shared/api-definition.json`,
);
const createApi = schematic('api', params);
const createApi = schematic('api', schema);
return branchAndMerge(chain([saveApiDefinition, createApi]));
},

10
npm/ng-packs/packages/schematics/src/utils/common.ts

@ -23,3 +23,13 @@ export function readFileInTree(tree: Tree, filePath: string): ts.SourceFile {
const text = buffer.toString('utf-8');
return ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true);
}
export function removeDefaultPlaceholders<T>(oldParams: T) {
const newParams: Record<string, any> = {};
Object.entries(oldParams).forEach(([key, value]) => {
newParams[key] = value === '__default' ? undefined : value;
});
return newParams as T;
}

6
npm/packs/cropperjs/abp.resourcemapping.js

@ -0,0 +1,6 @@
module.exports = {
mappings: {
"@node_modules/cropperjs/dist/cropper.min.js": "@libs/cropperjs/js/",
"@node_modules/cropperjs/dist/cropper.min.css": "@libs/cropperjs/css/",
},
};

12
npm/packs/cropperjs/package.json

@ -0,0 +1,12 @@
{
"version": "3.0.5",
"name": "@abp/cropperjs",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/core": "~3.0.5",
"cropperjs": "^1.5.7"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

2
npm/packs/luxon/package.json

@ -5,7 +5,7 @@
"access": "public"
},
"dependencies": {
"@abp/core": "~3.0.5",
"@abp/core": "~3.1.0-rc.2",
"luxon": "^1.24.1"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"

6
npm/packs/star-rating-svg/abp.resourcemapping.js

@ -0,0 +1,6 @@
module.exports = {
mappings: {
"@node_modules/star-rating-svg/dist/*.min.js": "@libs/star-rating-svg/js/",
"@node_modules/star-rating-svg/src/css/*.css": "@libs/star-rating-svg/css/",
},
};

12
npm/packs/star-rating-svg/package.json

@ -0,0 +1,12 @@
{
"version": "3.1.0-rc.2",
"name": "@abp/star-rating-svg",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@abp/jquery": "~3.1.0-rc.2",
"star-rating-svg": "^3.5.0"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431"
}

5
nupkg/pack.ps1

@ -11,6 +11,8 @@ foreach($solution in $solutions) {
foreach($project in $projects) {
$projectFolder = Join-Path $rootFolder $project
Copy-Item (Join-Path $rootFolder "LICENSE.md") -Destination $projectFolder
# Create nuget pack
Set-Location $projectFolder
@ -26,7 +28,8 @@ foreach($project in $projects) {
$projectName = $project.Substring($project.LastIndexOf("/") + 1)
$projectPackPath = Join-Path $projectFolder ("/bin/Release/" + $projectName + ".*.nupkg")
Move-Item $projectPackPath $packFolder
Remove-Item (Join-Path $projectFolder "LICENSE.md")
}
# Go back to the pack folder

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Pages/Index.cshtml

@ -21,9 +21,7 @@
<p>@L["LongWelcomeMessage"]</p>
@if (!CurrentUser.IsAuthenticated)
{
<form method="POST">
<input type="submit" asp-page-handler="Login" value="LOGIN" class="btn btn-login" />
</form>
<a abp-button="Primary" href="~/Account/Login" class="px-4"><i class="fa fa-sign-in"></i> @L["Login"]</a>
}
<hr />
<p class="text-right"><a href="https://abp.io?ref=tmpl" target="_blank">abp.io</a></p>

Loading…
Cancel
Save