From b4593b44131cfee7761f8af6f35e8445d59ecca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20Altu=C4=9F?= Date: Mon, 19 Dec 2022 09:23:02 +0300 Subject: [PATCH 1/5] proxy generation support nested Dto on get request (#15122) --- .../packages/schematics/src/models/method.ts | 14 ++++++-------- .../packages/schematics/src/utils/methods.ts | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/npm/ng-packs/packages/schematics/src/models/method.ts b/npm/ng-packs/packages/schematics/src/models/method.ts index d54d4303b9..6e86853ec0 100644 --- a/npm/ng-packs/packages/schematics/src/models/method.ts +++ b/npm/ng-packs/packages/schematics/src/models/method.ts @@ -1,10 +1,10 @@ import { eBindingSourceId, eMethodModifier } from '../enums'; import { camel, camelizeHyphen } from '../utils/text'; -import { getParamName } from '../utils/methods'; +import { getParamName, getParamValueName } from '../utils/methods'; import { ParameterInBody } from './api-definition'; import { Property } from './model'; import { Omissible } from './util'; -import {VOLO_REMOTE_STREAM_CONTENT} from "../constants"; +import { VOLO_REMOTE_STREAM_CONTENT } from '../constants'; // eslint-disable-next-line @typescript-eslint/no-var-requires const shouldQuote = require('should-quote'); @@ -48,12 +48,10 @@ export class Body { registerActionParameter = (param: ParameterInBody) => { const { bindingSourceId, descriptorName, jsonName, name, nameOnMethod } = param; const camelName = camel(name); - const paramName = jsonName || camelName; + const paramName = jsonName || shouldQuote(name) ? name : camelName; let value = camelizeHyphen(nameOnMethod); if (descriptorName) { - value = shouldQuote(paramName) - ? `${descriptorName}['${paramName}']` - : `${descriptorName}.${paramName}`; + value = getParamValueName(paramName, descriptorName); } switch (bindingSourceId) { @@ -79,8 +77,8 @@ export class Body { this.setUrlQuotes(); } - isBlobMethod(){ - return this.responseTypeWithNamespace === VOLO_REMOTE_STREAM_CONTENT + isBlobMethod() { + return this.responseTypeWithNamespace === VOLO_REMOTE_STREAM_CONTENT; } private setUrlQuotes() { diff --git a/npm/ng-packs/packages/schematics/src/utils/methods.ts b/npm/ng-packs/packages/schematics/src/utils/methods.ts index 7b7547b9e1..4c2684f1c0 100644 --- a/npm/ng-packs/packages/schematics/src/utils/methods.ts +++ b/npm/ng-packs/packages/schematics/src/utils/methods.ts @@ -1,4 +1,19 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires +import { camel } from './text'; + const shouldQuote = require('should-quote'); export const getParamName = (paramName: string) => shouldQuote(paramName) ? `["${paramName}"]` : paramName; + +// check dot exists in param name and camelize access continuously +export const getParamValueName = (paramName: string, descriptorName: string) => { + if (paramName.includes('.')) { + const splitted = paramName.split('.'); + const param = splitted.map(x => (shouldQuote(x) ? `[${x}]` : `.${camel(x)}`)).join(''); + return `${descriptorName}${param}`; + } + if (shouldQuote(paramName)) { + return `${descriptorName}['${paramName}']`; + } + return `${descriptorName}.${paramName}`; +}; From 754424d9b22ba6a897ccd50501cc99afcc34a2da Mon Sep 17 00:00:00 2001 From: braim23 <94292623+braim23@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:40:33 +0300 Subject: [PATCH 2/5] Embedded YouTube Videos to Index.md --- docs/en/Tutorials/Todo/Index.md | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/en/Tutorials/Todo/Index.md b/docs/en/Tutorials/Todo/Index.md index c036b2068b..d5c94829e3 100644 --- a/docs/en/Tutorials/Todo/Index.md +++ b/docs/en/Tutorials/Todo/Index.md @@ -14,6 +14,40 @@ This is a single-part quick-start tutorial to build a simple todo application wi You can find the source code of the completed application [here](https://github.com/abpframework/abp-samples/tree/master/TodoApp). +This documentation has a tutorial on **YouTube**!! You can watch it here: + +{{if UI=="MVC" && DB =="EF"}} + + + +{{else if UI=="Blazor" && DB=="EF"}} + + + +{{else if UI=="BlazorServer" && DB=="EF"}} + + + +{{else if UI=="NG" && DB=="EF"}} + + + +{{else if UI=="MVC" && DB=="Mongo"}} + + + +{{else if UI=="BlazorServer" && DB=="Mongo"}} + + + +{{else if UI=="Blazor" && DB=="Mongo"}} + + + +{{else if UI=="NG" && DB=="Mongo"}} + + + ## Pre-Requirements * An IDE (e.g. [Visual Studio](https://visualstudio.microsoft.com/vs/)) that supports [.NET 6.0+](https://dotnet.microsoft.com/download/dotnet) development. From 7a142689314422d9f74b21a933127e55416f0ddc Mon Sep 17 00:00:00 2001 From: braim23 <94292623+braim23@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:48:58 +0300 Subject: [PATCH 3/5] added the missing {{end}} --- docs/en/Tutorials/Todo/Index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/Tutorials/Todo/Index.md b/docs/en/Tutorials/Todo/Index.md index d5c94829e3..eb8c57a8f0 100644 --- a/docs/en/Tutorials/Todo/Index.md +++ b/docs/en/Tutorials/Todo/Index.md @@ -48,6 +48,8 @@ This documentation has a tutorial on **YouTube**!! You can watch it here: +{{end}} + ## Pre-Requirements * An IDE (e.g. [Visual Studio](https://visualstudio.microsoft.com/vs/)) that supports [.NET 6.0+](https://dotnet.microsoft.com/download/dotnet) development. From 2a6dc8bd9c65d34bea229c09775f470ec25ee5a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alper=20Ebi=C3=A7o=C4=9Flu?= <9526587+ebicoglu@users.noreply.github.com> Date: Mon, 19 Dec 2022 16:33:26 +0300 Subject: [PATCH 4/5] add "video" --- docs/en/Tutorials/Todo/Index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Tutorials/Todo/Index.md b/docs/en/Tutorials/Todo/Index.md index eb8c57a8f0..5f80393c95 100644 --- a/docs/en/Tutorials/Todo/Index.md +++ b/docs/en/Tutorials/Todo/Index.md @@ -14,7 +14,7 @@ This is a single-part quick-start tutorial to build a simple todo application wi You can find the source code of the completed application [here](https://github.com/abpframework/abp-samples/tree/master/TodoApp). -This documentation has a tutorial on **YouTube**!! You can watch it here: +This documentation has a video tutorial on **YouTube**!! You can watch it here: {{if UI=="MVC" && DB =="EF"}} From aefff7d6548cb20f5f52e80d05240cc42ec0d76c Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:10:11 +0000 Subject: [PATCH 5/5] Update Docs.md --- docs/en/Modules/Docs.md | 44 ++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/docs/en/Modules/Docs.md b/docs/en/Modules/Docs.md index 4777275cd6..94b50aea58 100644 --- a/docs/en/Modules/Docs.md +++ b/docs/en/Modules/Docs.md @@ -28,7 +28,9 @@ If you do not have an existing ABP project, this step shows you how to create a It is recommended to use ABP CLI to create new projects. Use the following command: -`abp new Acme.MyProject` +```bash +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. @@ -66,7 +68,9 @@ Docs module packages are hosted on NuGet. There are 4 packages that needs be to It is recommended to use the ABP CLI to install the module, open the CMD window in the solution file (`.sln`) directory, and run the following command: -`abp add-module Volo.Docs` +```bash +abp add-module Volo.Docs +``` #### 3.2- Manually install @@ -74,19 +78,27 @@ Or you can also manually install nuget package to each project: * Install [Volo.Docs.Domain](https://www.nuget.org/packages/Volo.Docs.Domain/) nuget package to `Acme.MyProject.Domain` project. - `Install-Package Volo.Docs.Domain` + ```bash + Install-Package Volo.Docs.Domain + ``` * Install [Volo.Docs.EntityFrameworkCore](https://www.nuget.org/packages/Volo.Docs.EntityFrameworkCore/) nuget package to `Acme.MyProject.EntityFrameworkCore` project. - `Install-Package Volo.Docs.EntityFrameworkCore` + ```bash + Install-Package Volo.Docs.EntityFrameworkCore + ``` * Install [Volo.Docs.Application](https://www.nuget.org/packages/Volo.Docs.Application/) nuget package to `Acme.MyProject.Application` project. - `Install-Package Volo.Docs.Application` + ```bash + Install-Package Volo.Docs.Application + ``` * Install [Volo.Docs.Web](https://www.nuget.org/packages/Volo.Docs.Domain/) nuget package to `Acme.MyProject.Web` project. - `Install-Package Volo.Docs.Web` + ```bash + Install-Package Volo.Docs.Web + ``` ##### 3.2.1- Adding Module Dependencies @@ -258,7 +270,7 @@ If you choose Entity Framework as your database provider, you need to configure The default route for Docs module is; -``` +```txt /Documents ``` @@ -307,7 +319,7 @@ The new menu item for Docs Module is added to the menu. Run your web application You will see a warning says; -``` +```txt There are no projects yet! ``` @@ -487,14 +499,14 @@ For example [Getting-Started.md](https://github.com/abpio/abp-commercial-docs/bl ``` ..... -​````json +​```json //[doc-params] { "UI": ["MVC","NG"], "DB": ["EF", "Mongo"], "Tiered": ["Yes", "No"] } -​```` +​``` ........ ``` @@ -507,7 +519,7 @@ Now you can use **Scriban** syntax to create sections in your document. For example: -```` +```txt {{ if UI == "NG" }} * `-u` argument specifies the UI framework, `angular` in this case. @@ -526,13 +538,13 @@ For example: {{ end }} -```` +``` You can also use variables in a text, adding **_Value** postfix to its key: -```` +```txt This document assumes that you prefer to use **{{ UI_Value }}** as the UI framework and **{{ DB_Value }}** as the database provider. -```` +``` Also, **Document_Language_Code** and **Document_Version** keys are pre-defined if you want to get the language code or the version of the current document (This may be useful for creating links that redirects to another documentation system in another domain). @@ -603,7 +615,7 @@ Finally a new Docs Module is added to your project which is feeded with GitHub. The Docs module supports full-text search using Elastic Search. It is not enabled by default. You can configure `DocsElasticSearchOptions` to enable it. -``` +```csharp Configure(options => { options.Enable = true; @@ -616,7 +628,7 @@ The `Index` is automatically created after the application starts if the `Index` `DefaultElasticClientProvider` is responsible for creating `IElasticClient`. By default, it reads Elastic Search's `Url` from `IConfiguration`. If your `IElasticClient` needs additional configuration, please use override `IElasticClientProvider` service and replace it in the [dependency injection](../Dependency-Injection.md) system. -``` +```json { "ElasticSearch": { "Url": "http://localhost:9200"