From ad739124c2a87af008a3c0664fdc7c1e741fec87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 16 Aug 2019 11:34:01 +0300 Subject: [PATCH 01/12] Update Post.md --- docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md b/docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md index 408e94d6b4..73b43327da 100644 --- a/docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md +++ b/docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md @@ -1,6 +1,6 @@ # ABP v0.19 Release with Angular UI Option -ABP v0.19 has been released with [~90 issues](https://github.com/abpframework/abp/milestone/17?closed=1) resolved and [600+ commits](https://github.com/abpframework/abp/compare/0.18.1...0.19.0) pushed. +ABP v0.19 has been released with [90 issues](https://github.com/abpframework/abp/milestone/17?closed=1) resolved and [650+ commits](https://github.com/abpframework/abp/compare/0.18.1...0.19.0) pushed. ## New Features From 714b2d72ab6b18f3592c9703effd5009db4cda37 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 16 Aug 2019 14:52:06 +0300 Subject: [PATCH 02/12] fix docs projects combobox link bug --- .../src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index dfebfe2532..5e155b7389 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -179,7 +179,7 @@ namespace Volo.Docs.Pages.Documents.Project ProjectSelectItems = projects.Items.Select(p => new SelectListItem { Text = p.Name, - Value = p.Id != Project.Id ? "/documents/" + LanguageCode + "/" + p.ShortName + "/" + DocsAppConsts.Latest : null, + Value = p.Id != Project.Id ? "/" + DocumentsUrlPrefix + LanguageCode + "/" + p.ShortName + "/" + DocsAppConsts.Latest : null, Selected = p.Id == Project.Id }).ToList(); } From 2cdfbb22fc18551b4e06a75f894f9c082dc4fbbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 16 Aug 2019 15:07:43 +0300 Subject: [PATCH 03/12] Update docs-nav.json --- docs/en/Index.md | 5 +++-- docs/en/Startup-Templates/Application.md | 3 ++- docs/en/docs-nav.json | 26 ++++++++++++++++++++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/docs/en/Index.md b/docs/en/Index.md index d911bf66e2..b40efffb9d 100644 --- a/docs/en/Index.md +++ b/docs/en/Index.md @@ -6,7 +6,7 @@ Explore the left navigation menu to deep dive in the documentation. ## Project Status -ABP is the **next generation** of the open source [ASP.NET Boilerplate](https://aspnetboilerplate.com/) framework. It's currently in early preview stage and not ready to use in production. The documentation is still in progress and it is far from complete. +ABP is the **next generation** of the open source [ASP.NET Boilerplate](https://aspnetboilerplate.com/) framework. It's currently in preview stage and not ready to use in production. The documentation is still in progress and it is far from complete. For short-term and production level applications, it's suggested to use [ASP.NET Boilerplate](https://aspnetboilerplate.com/) framework which has rich feature set, mature, actively maintained and up-to-date. @@ -14,7 +14,8 @@ For short-term and production level applications, it's suggested to use [ASP.NET Easiest way to start a new project with ABP is to use the startup templates: -* [ASP.NET Core MVC Template](Getting-Started-AspNetCore-MVC-Template.md) +* [ASP.NET Core MVC (Razor Pages) UI Template](Getting-Started-AspNetCore-MVC-Template.md) +* [Angular UI Template](Getting-Started-Angular-Template.md) If you want to start from scratch (with an empty project) then manually install the ABP Framework and use the following tutorials: diff --git a/docs/en/Startup-Templates/Application.md b/docs/en/Startup-Templates/Application.md index 83950ddd0e..1fbf1be8e2 100644 --- a/docs/en/Startup-Templates/Application.md +++ b/docs/en/Startup-Templates/Application.md @@ -5,7 +5,8 @@ This template provides a layered application structure based on the [Domain Driven Design](../Domain-Driven-Design.md) (DDD) practices. This document explains the solution structure and projects in details. If you want to start quickly, follow the guides below: * See [Getting Started With the ASP.NET Core MVC Template](../Getting-Started-AspNetCore-MVC-Template.md) to create a new solution and run it for this template (uses MVC as the UI framework and Entity Framework Core as the database provider). -* See the [ASP.NET Core MVC Tutorial](../Tutorials/AspNetCore-Mvc/Part-I.md) to learn how to develop applications using this template (uses MVC as the UI framework and Entity Framework Core as the database provider). +* See the [ASP.NET Core MVC Application Development Tutorial](../Tutorials/AspNetCore-Mvc/Part-I.md) to learn how to develop applications using this template (uses MVC as the UI framework and Entity Framework Core as the database provider). +* See the [Angular Application Development Tutorial](../Tutorials/Angular/Part-I.md) to learn how to develop applications using this template (uses Angular as the UI framework and MongoDB as the database provider). ## How to Start With? diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 103556823e..7e20d4db75 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -7,8 +7,12 @@ "text": "From Startup Templates", "items": [ { - "text": "ASP.NET Core MVC", + "text": "Application with MVC (Razor Pages) UI", "path": "Getting-Started-AspNetCore-MVC-Template.md" + }, + { + "text": "Application with Angular UI", + "path": "Getting-Started-Angular-Template.md" } ] }, @@ -34,8 +38,12 @@ "text": "Application Development", "items": [ { - "text": "With ASP.NET Core MVC", + "text": "With ASP.NET Core MVC UI", "path": "Tutorials/AspNetCore-Mvc/Part-I.md" + }, + { + "text": "With Angular UI", + "path": "Tutorials/Angular/Part-I.md" } ] } @@ -264,6 +272,20 @@ } ] }, + { + "text": "Startup Templates", + "path": "Startup-Templates/Index.md", + "items": [ + { + "text": "Application", + "path": "Startup-Templates/Application.md" + }, + { + "text": "Module", + "path": "Startup-Templates/Application.md" + } + ] + }, { "text": "Samples", "items": [ From d8eb1fda902e74caf84d71a830e13e453dbb0caa Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 16 Aug 2019 15:10:51 +0300 Subject: [PATCH 04/12] Docs option for projects combobox --- .../docs/app/VoloDocs.Web/Pages/Index.cshtml.cs | 4 ++-- modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs | 2 +- .../Areas/Documents/TagHelpers/TreeTagHelper.cs | 8 ++++---- .../{DocsUrlOptions.cs => DocsOptions.cs} | 8 +++++++- modules/docs/src/Volo.Docs.Web/DocsWebModule.cs | 6 +++--- .../Markdown/MarkdownDocumentToHtmlConverter.cs | 10 +++++----- .../Volo.Docs.Web/Pages/Documents/Index.cshtml.cs | 8 ++++---- .../Pages/Documents/Project/Index.cshtml | 2 +- .../Pages/Documents/Project/Index.cshtml.cs | 14 +++++++++++--- 9 files changed, 38 insertions(+), 24 deletions(-) rename modules/docs/src/Volo.Docs.Web/{DocsUrlOptions.cs => DocsOptions.cs} (70%) diff --git a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs index 9404233493..48c810f7e1 100644 --- a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs +++ b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs @@ -8,9 +8,9 @@ namespace VoloDocs.Web.Pages { public class IndexModel : PageModel { - private readonly DocsUrlOptions _urlOptions; + private readonly DocsOptions _urlOptions; - public IndexModel(IOptions urlOptions) + public IndexModel(IOptions urlOptions) { _urlOptions = urlOptions.Value; } diff --git a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs index b87f3b12f7..77dbaff275 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs +++ b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs @@ -62,7 +62,7 @@ namespace VoloDocs.Web var hostingEnvironment = context.Services.GetHostingEnvironment(); var configuration = context.Services.GetConfiguration(); - Configure(options => + Configure(options => { options.RoutePrefix = null; }); diff --git a/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs b/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs index 00189be260..7e3cf53830 100644 --- a/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs +++ b/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs @@ -13,7 +13,7 @@ namespace Volo.Docs.Areas.Documents.TagHelpers [HtmlTargetElement("ul", Attributes = "root-node")] public class TreeTagHelper : TagHelper { - private readonly DocsUrlOptions _urlOptions; + private readonly DocsOptions _options; private const string LiItemTemplateWithLink = @"
  • {2}{3}
  • "; @@ -41,9 +41,9 @@ namespace Volo.Docs.Areas.Documents.TagHelpers [HtmlAttributeName("language")] public string LanguageCode { get; set; } - public TreeTagHelper(IOptions urlOptions) + public TreeTagHelper(IOptions urlOptions) { - _urlOptions = urlOptions.Value; + _options = urlOptions.Value; } public override void Process(TagHelperContext context, TagHelperOutput output) @@ -142,7 +142,7 @@ namespace Volo.Docs.Areas.Documents.TagHelpers return "javascript:;"; } - var prefix = _urlOptions.RoutePrefix; + var prefix = _options.RoutePrefix; return prefix + LanguageCode + "/" + ProjectName + "/" + Version + "/" + pathWithoutFileExtension; } diff --git a/modules/docs/src/Volo.Docs.Web/DocsUrlOptions.cs b/modules/docs/src/Volo.Docs.Web/DocsOptions.cs similarity index 70% rename from modules/docs/src/Volo.Docs.Web/DocsUrlOptions.cs rename to modules/docs/src/Volo.Docs.Web/DocsOptions.cs index 67c11864ff..d8bf9f62a9 100644 --- a/modules/docs/src/Volo.Docs.Web/DocsUrlOptions.cs +++ b/modules/docs/src/Volo.Docs.Web/DocsOptions.cs @@ -2,7 +2,7 @@ namespace Volo.Docs { - public class DocsUrlOptions + public class DocsOptions { private string _routePrefix = "documents"; @@ -15,6 +15,12 @@ namespace Volo.Docs set => _routePrefix = value; } + /// + /// Allows user to see a combobox in user interface for swapping across projects + /// Default value: True; + /// + public bool ShowProjectsComboboxInUi = true; + private string GetFormattedRoutePrefix() { if (string.IsNullOrWhiteSpace(_routePrefix)) diff --git a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs index ea2c3447e6..35574a2d51 100644 --- a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs +++ b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs @@ -41,11 +41,11 @@ namespace Volo.Docs Configure(options => { - var urlOptions = context.Services - .GetRequiredServiceLazy>() + var docsOptions = context.Services + .GetRequiredServiceLazy>() .Value.Value; - var routePrefix = urlOptions.RoutePrefix; + var routePrefix = docsOptions.RoutePrefix; options.Conventions.AddPageRoute("/Documents/Project/Index", routePrefix + "{projectName}"); options.Conventions.AddPageRoute("/Documents/Project/Index", routePrefix + "{languageCode}/{projectName}"); diff --git a/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs b/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs index ed3f2802e2..b0fc185e29 100644 --- a/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs +++ b/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs @@ -14,13 +14,13 @@ namespace Volo.Docs.Markdown public const string Type = "md"; private readonly IMarkdownConverter _markdownConverter; - private readonly DocsUrlOptions _urlOptions; + private readonly DocsOptions _options; public MarkdownDocumentToHtmlConverter(IMarkdownConverter markdownConverter, - IOptions urlOptions) + IOptions urlOptions) { _markdownConverter = markdownConverter; - _urlOptions = urlOptions.Value; + _options = urlOptions.Value; } private const string MdLinkFormat = "[{0}]({1}{2}/{3}/{4}{5}/{6})"; @@ -73,7 +73,7 @@ namespace Volo.Docs.Markdown return string.Format( MdLinkFormat, displayText, - _urlOptions.RoutePrefix, + _options.RoutePrefix, languageCode, projectShortName, version, @@ -101,7 +101,7 @@ namespace Volo.Docs.Markdown return string.Format( MdLinkFormat, displayText, - _urlOptions.RoutePrefix, + _options.RoutePrefix, languageCode, projectShortName, version, diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs index 15697f466c..f958d3d409 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs @@ -15,19 +15,19 @@ namespace Volo.Docs.Pages.Documents public IReadOnlyList Projects { get; set; } private readonly IProjectAppService _projectAppService; - private readonly DocsUrlOptions _urlOptions; + private readonly DocsOptions _options; public IndexModel( IProjectAppService projectAppService, - IOptions urlOptions) + IOptions urlOptions) { _projectAppService = projectAppService; - _urlOptions = urlOptions.Value; + _options = urlOptions.Value; } public async Task OnGetAsync() { - DocumentsUrlPrefix = _urlOptions.RoutePrefix; + DocumentsUrlPrefix = _options.RoutePrefix; var listResult = await _projectAppService.GetListAsync(); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml index 23c46063cc..e0d8d9f02c 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml @@ -76,7 +76,7 @@
    - @if (Model.ProjectSelectItems.Count > 1) + @if (Model.ShowProjectsCombobox && Model.ProjectSelectItems.Count > 1) {
    diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 5e155b7389..8d72e75fe7 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -52,18 +52,20 @@ namespace Volo.Docs.Pages.Documents.Project public string DocumentsUrlPrefix { get; set; } + public bool ShowProjectsCombobox { get; set; } + public bool DocumentLanguageIsDifferent { get; set; } private readonly IDocumentAppService _documentAppService; private readonly IDocumentToHtmlConverterFactory _documentToHtmlConverterFactory; private readonly IProjectAppService _projectAppService; - private readonly DocsUrlOptions _options; + private readonly DocsOptions _options; public IndexModel( IDocumentAppService documentAppService, IDocumentToHtmlConverterFactory documentToHtmlConverterFactory, IProjectAppService projectAppService, - IOptions options) + IOptions options) { _documentAppService = documentAppService; _documentToHtmlConverterFactory = documentToHtmlConverterFactory; @@ -74,6 +76,7 @@ namespace Volo.Docs.Pages.Documents.Project public async Task OnGetAsync() { DocumentsUrlPrefix = _options.RoutePrefix; + ShowProjectsCombobox = _options.ShowProjectsComboboxInUi; if (IsDocumentCultureDifferentThanCurrent()) { @@ -81,7 +84,12 @@ namespace Volo.Docs.Pages.Documents.Project } await SetProjectAsync(); - await SetProjectsAsync(); + + if (ShowProjectsCombobox) + { + await SetProjectsAsync(); + } + await SetVersionAsync(); await SetLanguageList(); From 2662db842ea2b90e0ceb990512a120bca1cc23eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 16 Aug 2019 15:30:07 +0300 Subject: [PATCH 05/12] Update Post.md --- docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md b/docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md index 73b43327da..eec70c5566 100644 --- a/docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md +++ b/docs/en/Blog-Posts/2019-08-16 v0_19_Release/Post.md @@ -1,4 +1,4 @@ -# ABP v0.19 Release with Angular UI Option +# ABP v0.19 Release With New Angular UI ABP v0.19 has been released with [90 issues](https://github.com/abpframework/abp/milestone/17?closed=1) resolved and [650+ commits](https://github.com/abpframework/abp/compare/0.18.1...0.19.0) pushed. From 73e15af58f467b57d25c6c08755367cb5bd3da63 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 16 Aug 2019 15:33:01 +0300 Subject: [PATCH 06/12] fix blogging localization resolves #1651 --- .../Volo/Blogging/BloggingDomainSharedModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs index 04c2993860..e923251245 100644 --- a/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs +++ b/modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/BloggingDomainSharedModule.cs @@ -22,7 +22,7 @@ namespace Volo.Blogging options.Resources .Add("en") .AddBaseTypes(typeof(AbpValidationResource)) - .AddVirtualJson("/Localization/Resources"); + .AddVirtualJson("Volo/Blogging/Localization/Resources"); }); } } From f1f029b2b8fe0d4ee690b77e69dd2678303ecf83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 16 Aug 2019 15:47:44 +0300 Subject: [PATCH 07/12] Update Part-I.md --- docs/en/Tutorials/Angular/Part-I.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Tutorials/Angular/Part-I.md b/docs/en/Tutorials/Angular/Part-I.md index 9d47418170..f9c645e825 100644 --- a/docs/en/Tutorials/Angular/Part-I.md +++ b/docs/en/Tutorials/Angular/Part-I.md @@ -20,7 +20,7 @@ Create a new project named `Acme.BookStore` by selecting the Angular as the UI f This is how the layered solution structure looks after it's created: -![bookstore-backend-solution](images\bookstore-backend-solution-v2.png) +![bookstore-backend-solution](images/bookstore-backend-solution-v2.png) > You can see the [Application template document](../../Startup-Templates/Application.md) to understand the solution structure in details. However, you will understand the basics with this tutorial. From 0e9e2d2354116dd90d33a73e5a1a9461cc8912b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Fri, 16 Aug 2019 15:55:14 +0300 Subject: [PATCH 08/12] Update Part-I.md --- docs/en/Tutorials/Angular/Part-I.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/en/Tutorials/Angular/Part-I.md b/docs/en/Tutorials/Angular/Part-I.md index f9c645e825..88b5c8539e 100644 --- a/docs/en/Tutorials/Angular/Part-I.md +++ b/docs/en/Tutorials/Angular/Part-I.md @@ -342,7 +342,7 @@ Run `yarn start`, wait Angular to run the application and open `http://localhost Open the `app-routing.module.ts` and replace `books` as shown below: -```typescript +```js import { ApplicationLayoutComponent } from '@abp/ng.theme.basic';- //... @@ -380,7 +380,7 @@ yarn ng generate component books/book-list Import the `SharedModule` to the `BooksModule` to reuse some components and services defined in: -```typescript +```js import { SharedModule } from '../shared/shared.module'; @NgModule({ @@ -395,7 +395,7 @@ export class BooksModule {} Then, update the `routes` in the `books-routing.module.ts` to add the new book-list component: -```typescript +```js import { BookListComponent } from './book-list/book-list.component'; const routes: Routes = [ @@ -425,7 +425,7 @@ yarn ng generate ngxs-schematic:state books This command creates several new files and edits `app.modules.ts` to import the `NgxsModule` with the new state: -```typescript +```js // app.module.ts import { BooksState } from './store/states/books.state'; @@ -446,7 +446,7 @@ First, create data types to map data returning from the backend (you can check s Modify the `books.ts` as shown below: -```typescript +```js export namespace Books { export interface State { books: Response; @@ -497,7 +497,7 @@ yarn ng generate service books/shared/books Modify `books.service.ts` as shown below: -```typescript +```js import { Injectable } from '@angular/core'; import { RestService } from '@abp/ng.core'; import { Books } from '../../store/models'; @@ -522,7 +522,7 @@ Added the `get` method to get the list of books by performing an HTTP request to Replace `books.actions.ts` content as shown below: -```typescript +```js export class GetBooks { static readonly type = '[Books] Get'; } @@ -532,7 +532,7 @@ export class GetBooks { Open the `books.state.ts` and change the file as shown below: -```typescript +```js import { State, Action, StateContext, Selector } from '@ngxs/store'; import { GetBooks } from '../actions/books.actions'; import { Books } from '../models/books'; @@ -572,7 +572,7 @@ Added the `GetBooks` action that uses the `BookService` defined above to get the Modify the `book-list.component.ts` as shown below: -```typescript +```js import { Component, OnInit } from '@angular/core'; import { Store, Select } from '@ngxs/store'; import { BooksState } from '../../store/states'; From 7922273bf5385a1420a815ae33de871beedca981 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Fri, 16 Aug 2019 16:02:20 +0300 Subject: [PATCH 09/12] docs: fix code highlight --- docs/en/Tutorials/Angular/Part-I.md | 18 +++++----- docs/en/Tutorials/Angular/Part-II.md | 52 ++++++++++++++-------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/en/Tutorials/Angular/Part-I.md b/docs/en/Tutorials/Angular/Part-I.md index 88b5c8539e..6e4916dc8a 100644 --- a/docs/en/Tutorials/Angular/Part-I.md +++ b/docs/en/Tutorials/Angular/Part-I.md @@ -342,7 +342,7 @@ Run `yarn start`, wait Angular to run the application and open `http://localhost Open the `app-routing.module.ts` and replace `books` as shown below: -```js +```ts import { ApplicationLayoutComponent } from '@abp/ng.theme.basic';- //... @@ -380,7 +380,7 @@ yarn ng generate component books/book-list Import the `SharedModule` to the `BooksModule` to reuse some components and services defined in: -```js +```ts import { SharedModule } from '../shared/shared.module'; @NgModule({ @@ -395,7 +395,7 @@ export class BooksModule {} Then, update the `routes` in the `books-routing.module.ts` to add the new book-list component: -```js +```ts import { BookListComponent } from './book-list/book-list.component'; const routes: Routes = [ @@ -425,7 +425,7 @@ yarn ng generate ngxs-schematic:state books This command creates several new files and edits `app.modules.ts` to import the `NgxsModule` with the new state: -```js +```ts // app.module.ts import { BooksState } from './store/states/books.state'; @@ -446,7 +446,7 @@ First, create data types to map data returning from the backend (you can check s Modify the `books.ts` as shown below: -```js +```ts export namespace Books { export interface State { books: Response; @@ -497,7 +497,7 @@ yarn ng generate service books/shared/books Modify `books.service.ts` as shown below: -```js +```ts import { Injectable } from '@angular/core'; import { RestService } from '@abp/ng.core'; import { Books } from '../../store/models'; @@ -522,7 +522,7 @@ Added the `get` method to get the list of books by performing an HTTP request to Replace `books.actions.ts` content as shown below: -```js +```ts export class GetBooks { static readonly type = '[Books] Get'; } @@ -532,7 +532,7 @@ export class GetBooks { Open the `books.state.ts` and change the file as shown below: -```js +```ts import { State, Action, StateContext, Selector } from '@ngxs/store'; import { GetBooks } from '../actions/books.actions'; import { Books } from '../models/books'; @@ -572,7 +572,7 @@ Added the `GetBooks` action that uses the `BookService` defined above to get the Modify the `book-list.component.ts` as shown below: -```js +```ts import { Component, OnInit } from '@angular/core'; import { Store, Select } from '@ngxs/store'; import { BooksState } from '../../store/states'; diff --git a/docs/en/Tutorials/Angular/Part-II.md b/docs/en/Tutorials/Angular/Part-II.md index 80a7e21a32..98d79d4600 100644 --- a/docs/en/Tutorials/Angular/Part-II.md +++ b/docs/en/Tutorials/Angular/Part-II.md @@ -18,7 +18,7 @@ In this section, you will learn how to create a new modal dialog form to create Create an interface, named `CreateUpdateBookInput` in the `books.ts` as shown below: -```typescript +```ts export namespace Books { //... export interface CreateUpdateBookInput { @@ -36,7 +36,7 @@ export namespace Books { Open the `books.service.ts` and add a new method, named `create` to perform an HTTP POST request to the server: -```typescript +```ts create(createBookInput: Books.CreateUpdateBookInput): Observable { return this.restService.request({ method: 'POST', @@ -52,7 +52,7 @@ create(createBookInput: Books.CreateUpdateBookInput): Observable { Add the `CreateUpdateBook` action to the `books.actions.ts` as shown below: -```typescript +```ts import { Books } from '../models'; export class CreateUpdateBook { @@ -63,7 +63,7 @@ export class CreateUpdateBook { Open `books.state.ts` and define the `save` method that will listen to a `CreateUpdateBook` action to create a book: -```typescript +```ts import { ... , CreateUpdateBook } from '../actions/books.actions'; import { ... , switchMap } from 'rxjs/operators'; //... @@ -118,7 +118,7 @@ Add a button, labeled `New book` to show the modal: Open the `book-list.component.ts` and add `isModalOpen` variable and `createBook` method to show/hide the modal. -```typescript +```ts isModalOpen = false; //... @@ -136,7 +136,7 @@ createBook() { Add a `form` variable and inject a `FormBuilder` service to the `book-list.component.ts` as shown below (remember add the import statement). -```typescript +```ts import { FormGroup, FormBuilder } from '@angular/forms'; form: FormGroup; @@ -151,7 +151,7 @@ constructor( Add the `buildForm` method to create book form. -```typescript +```ts buildForm() { this.form = this.fb.group({ name: ['', Validators.required], @@ -167,7 +167,7 @@ buildForm() { Modify the `createBook` method as shown below: -```typescript +```ts createBook() { this.buildForm(); this.isModalOpen = true; @@ -220,7 +220,7 @@ Open `book-list.component.html` and add the form in the body template of the mod Open the `book-list.component.ts` and then create an array, named `bookTypeArr`: -```typescript +```ts //... form: FormGroup; @@ -231,7 +231,7 @@ bookTypeArr = Object.keys(Books.BookType).filter( The `bookTypeArr` contains the fields of the `BookType` enum. Resulting array is shown below: -```js +```ts ['Adventure', 'Biography', 'Dystopia', 'Fantastic' ...] ``` @@ -241,7 +241,7 @@ This array was used in the previous form template (in the `ngFor` loop). You need to import `NgbDatepickerModule` to the `books.module.ts`: -```typescript +```ts import { NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap'; @NgModule({ @@ -255,7 +255,7 @@ export class BooksModule {} Then open the `book-list.component.html` and add `providers` as shown below: -```typescript +```ts import { NgbDateNativeAdapter, NgbDateAdapter } from '@ng-bootstrap/ng-bootstrap'; @Component({ @@ -292,7 +292,7 @@ This adds a save button to the bottom area of the modal: Then define a `save` method in the `BookListComponent`: -```typescript +```ts save() { if (this.form.invalid) { return; @@ -311,7 +311,7 @@ save() { Open the `books.service.ts` and then add the `getById` and `update` methods. -```typescript +```ts getById(id: string): Observable { return this.restService.request({ method: 'GET', @@ -332,7 +332,7 @@ update(updateBookInput: Books.CreateUpdateBookInput, id: string): Observable, action: CreateUpdateBook) { let request; @@ -360,7 +360,7 @@ save(ctx: StateContext, action: CreateUpdateBook) { Inject `BooksService` dependency by adding it to the `book-list.component.ts` constructor and add a variable named `selectedBook`. -```typescript +```ts import { BooksService } from '../shared/books.service'; //... selectedBook = {} as Books.Book; @@ -373,7 +373,7 @@ constructor( `booksService` is used to get the editing book to prepare the form. Modify the `buildForm` method to reuse the same form while editing a book. -```typescript +```ts buildForm() { this.form = this.fb.group({ name: [this.selectedBook.name || '', Validators.required], @@ -386,7 +386,7 @@ buildForm() { Add the `editBook` method as shown below: -```typescript +```ts editBook(id: string) { this.booksService.getById(id).subscribe(book => { this.selectedBook = book; @@ -400,7 +400,7 @@ Added `editBook` method to get the editing book, build the form and show the mod Now, add the `selectedBook` definition to `createBook` method to reuse the same form while creating a new book: -```typescript +```ts createBook() { this.selectedBook = {} as Books.Book; //... @@ -409,7 +409,7 @@ Now, add the `selectedBook` definition to `createBook` method to reuse the same Modify the `save` method to pass the id of the selected book as shown below: -```typescript +```ts save() { if (this.form.invalid) { return; @@ -489,7 +489,7 @@ Update the modal header to change the title based on the current operation: Open `books.service.ts` and add a `delete` method to delete a book with the `id` by performing an HTTP request to the related endpoint: -```typescript +```ts delete(id: string): Observable { return this.restService.request({ method: 'DELETE', @@ -502,7 +502,7 @@ delete(id: string): Observable { Add an action named `DeleteBook` to `books.actions.ts`: -```typescript +```ts export class DeleteBook { static readonly type = '[Books] Delete'; constructor(public id: string) {} @@ -511,7 +511,7 @@ export class DeleteBook { Open the `books.state.ts` and add the `delete` method that will listen to the `DeleteBook` action to delete a book: -```typescript +```ts import { ... , DeleteBook } from '../actions/books.actions'; //... @Action(DeleteBook) @@ -544,7 +544,7 @@ The final actions dropdown UI looks like below: Open `book-list.component.ts` and inject the `ConfirmationService`. -```typescript +```ts import { ConfirmationService } from '@abp/ng.theme.shared'; //... constructor( @@ -557,7 +557,7 @@ constructor( Add a delete method to the `BookListComponent`: -```typescript +```ts import { ... , DeleteBook } from '../../store/actions'; import { ... , Toaster } from '@abp/ng.theme.shared'; //... From e1a9eee0b8e23339785bbbe2086ef4ed267a6f02 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Fri, 16 Aug 2019 16:12:34 +0300 Subject: [PATCH 10/12] docs: change code blocks types --- docs/en/Tutorials/Angular/Part-I.md | 18 +++++----- docs/en/Tutorials/Angular/Part-II.md | 52 ++++++++++++++-------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/en/Tutorials/Angular/Part-I.md b/docs/en/Tutorials/Angular/Part-I.md index 6e4916dc8a..88b5c8539e 100644 --- a/docs/en/Tutorials/Angular/Part-I.md +++ b/docs/en/Tutorials/Angular/Part-I.md @@ -342,7 +342,7 @@ Run `yarn start`, wait Angular to run the application and open `http://localhost Open the `app-routing.module.ts` and replace `books` as shown below: -```ts +```js import { ApplicationLayoutComponent } from '@abp/ng.theme.basic';- //... @@ -380,7 +380,7 @@ yarn ng generate component books/book-list Import the `SharedModule` to the `BooksModule` to reuse some components and services defined in: -```ts +```js import { SharedModule } from '../shared/shared.module'; @NgModule({ @@ -395,7 +395,7 @@ export class BooksModule {} Then, update the `routes` in the `books-routing.module.ts` to add the new book-list component: -```ts +```js import { BookListComponent } from './book-list/book-list.component'; const routes: Routes = [ @@ -425,7 +425,7 @@ yarn ng generate ngxs-schematic:state books This command creates several new files and edits `app.modules.ts` to import the `NgxsModule` with the new state: -```ts +```js // app.module.ts import { BooksState } from './store/states/books.state'; @@ -446,7 +446,7 @@ First, create data types to map data returning from the backend (you can check s Modify the `books.ts` as shown below: -```ts +```js export namespace Books { export interface State { books: Response; @@ -497,7 +497,7 @@ yarn ng generate service books/shared/books Modify `books.service.ts` as shown below: -```ts +```js import { Injectable } from '@angular/core'; import { RestService } from '@abp/ng.core'; import { Books } from '../../store/models'; @@ -522,7 +522,7 @@ Added the `get` method to get the list of books by performing an HTTP request to Replace `books.actions.ts` content as shown below: -```ts +```js export class GetBooks { static readonly type = '[Books] Get'; } @@ -532,7 +532,7 @@ export class GetBooks { Open the `books.state.ts` and change the file as shown below: -```ts +```js import { State, Action, StateContext, Selector } from '@ngxs/store'; import { GetBooks } from '../actions/books.actions'; import { Books } from '../models/books'; @@ -572,7 +572,7 @@ Added the `GetBooks` action that uses the `BookService` defined above to get the Modify the `book-list.component.ts` as shown below: -```ts +```js import { Component, OnInit } from '@angular/core'; import { Store, Select } from '@ngxs/store'; import { BooksState } from '../../store/states'; diff --git a/docs/en/Tutorials/Angular/Part-II.md b/docs/en/Tutorials/Angular/Part-II.md index 98d79d4600..61e3232a1b 100644 --- a/docs/en/Tutorials/Angular/Part-II.md +++ b/docs/en/Tutorials/Angular/Part-II.md @@ -18,7 +18,7 @@ In this section, you will learn how to create a new modal dialog form to create Create an interface, named `CreateUpdateBookInput` in the `books.ts` as shown below: -```ts +```js export namespace Books { //... export interface CreateUpdateBookInput { @@ -36,7 +36,7 @@ export namespace Books { Open the `books.service.ts` and add a new method, named `create` to perform an HTTP POST request to the server: -```ts +```js create(createBookInput: Books.CreateUpdateBookInput): Observable { return this.restService.request({ method: 'POST', @@ -52,7 +52,7 @@ create(createBookInput: Books.CreateUpdateBookInput): Observable { Add the `CreateUpdateBook` action to the `books.actions.ts` as shown below: -```ts +```js import { Books } from '../models'; export class CreateUpdateBook { @@ -63,7 +63,7 @@ export class CreateUpdateBook { Open `books.state.ts` and define the `save` method that will listen to a `CreateUpdateBook` action to create a book: -```ts +```js import { ... , CreateUpdateBook } from '../actions/books.actions'; import { ... , switchMap } from 'rxjs/operators'; //... @@ -118,7 +118,7 @@ Add a button, labeled `New book` to show the modal: Open the `book-list.component.ts` and add `isModalOpen` variable and `createBook` method to show/hide the modal. -```ts +```js isModalOpen = false; //... @@ -136,7 +136,7 @@ createBook() { Add a `form` variable and inject a `FormBuilder` service to the `book-list.component.ts` as shown below (remember add the import statement). -```ts +```js import { FormGroup, FormBuilder } from '@angular/forms'; form: FormGroup; @@ -151,7 +151,7 @@ constructor( Add the `buildForm` method to create book form. -```ts +```js buildForm() { this.form = this.fb.group({ name: ['', Validators.required], @@ -167,7 +167,7 @@ buildForm() { Modify the `createBook` method as shown below: -```ts +```js createBook() { this.buildForm(); this.isModalOpen = true; @@ -220,7 +220,7 @@ Open `book-list.component.html` and add the form in the body template of the mod Open the `book-list.component.ts` and then create an array, named `bookTypeArr`: -```ts +```js //... form: FormGroup; @@ -231,7 +231,7 @@ bookTypeArr = Object.keys(Books.BookType).filter( The `bookTypeArr` contains the fields of the `BookType` enum. Resulting array is shown below: -```ts +```js ['Adventure', 'Biography', 'Dystopia', 'Fantastic' ...] ``` @@ -241,7 +241,7 @@ This array was used in the previous form template (in the `ngFor` loop). You need to import `NgbDatepickerModule` to the `books.module.ts`: -```ts +```js import { NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap'; @NgModule({ @@ -255,7 +255,7 @@ export class BooksModule {} Then open the `book-list.component.html` and add `providers` as shown below: -```ts +```js import { NgbDateNativeAdapter, NgbDateAdapter } from '@ng-bootstrap/ng-bootstrap'; @Component({ @@ -292,7 +292,7 @@ This adds a save button to the bottom area of the modal: Then define a `save` method in the `BookListComponent`: -```ts +```js save() { if (this.form.invalid) { return; @@ -311,7 +311,7 @@ save() { Open the `books.service.ts` and then add the `getById` and `update` methods. -```ts +```js getById(id: string): Observable { return this.restService.request({ method: 'GET', @@ -332,7 +332,7 @@ update(updateBookInput: Books.CreateUpdateBookInput, id: string): Observable, action: CreateUpdateBook) { let request; @@ -360,7 +360,7 @@ save(ctx: StateContext, action: CreateUpdateBook) { Inject `BooksService` dependency by adding it to the `book-list.component.ts` constructor and add a variable named `selectedBook`. -```ts +```js import { BooksService } from '../shared/books.service'; //... selectedBook = {} as Books.Book; @@ -373,7 +373,7 @@ constructor( `booksService` is used to get the editing book to prepare the form. Modify the `buildForm` method to reuse the same form while editing a book. -```ts +```js buildForm() { this.form = this.fb.group({ name: [this.selectedBook.name || '', Validators.required], @@ -386,7 +386,7 @@ buildForm() { Add the `editBook` method as shown below: -```ts +```js editBook(id: string) { this.booksService.getById(id).subscribe(book => { this.selectedBook = book; @@ -400,7 +400,7 @@ Added `editBook` method to get the editing book, build the form and show the mod Now, add the `selectedBook` definition to `createBook` method to reuse the same form while creating a new book: -```ts +```js createBook() { this.selectedBook = {} as Books.Book; //... @@ -409,7 +409,7 @@ Now, add the `selectedBook` definition to `createBook` method to reuse the same Modify the `save` method to pass the id of the selected book as shown below: -```ts +```js save() { if (this.form.invalid) { return; @@ -489,7 +489,7 @@ Update the modal header to change the title based on the current operation: Open `books.service.ts` and add a `delete` method to delete a book with the `id` by performing an HTTP request to the related endpoint: -```ts +```js delete(id: string): Observable { return this.restService.request({ method: 'DELETE', @@ -502,7 +502,7 @@ delete(id: string): Observable { Add an action named `DeleteBook` to `books.actions.ts`: -```ts +```js export class DeleteBook { static readonly type = '[Books] Delete'; constructor(public id: string) {} @@ -511,7 +511,7 @@ export class DeleteBook { Open the `books.state.ts` and add the `delete` method that will listen to the `DeleteBook` action to delete a book: -```ts +```js import { ... , DeleteBook } from '../actions/books.actions'; //... @Action(DeleteBook) @@ -544,7 +544,7 @@ The final actions dropdown UI looks like below: Open `book-list.component.ts` and inject the `ConfirmationService`. -```ts +```js import { ConfirmationService } from '@abp/ng.theme.shared'; //... constructor( @@ -557,7 +557,7 @@ constructor( Add a delete method to the `BookListComponent`: -```ts +```js import { ... , DeleteBook } from '../../store/actions'; import { ... , Toaster } from '@abp/ng.theme.shared'; //... From 63ff62415b1edda5f7570255e4f01fad1bfc1a73 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 16 Aug 2019 16:16:56 +0300 Subject: [PATCH 11/12] =?UTF-8?q?renaming=20DocsOptions=20to=20DocsUiOptio?= =?UTF-8?q?ns=20and=20ShowProjectsComboboxInU=C4=B1=20to=20ShowProjectsCom?= =?UTF-8?q?bobox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs | 10 +++++----- modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs | 2 +- .../Areas/Documents/TagHelpers/TreeTagHelper.cs | 8 ++++---- .../Volo.Docs.Web/{DocsOptions.cs => DocsUiOptions.cs} | 4 ++-- modules/docs/src/Volo.Docs.Web/DocsWebModule.cs | 2 +- .../Markdown/MarkdownDocumentToHtmlConverter.cs | 10 +++++----- .../src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs | 8 ++++---- .../Pages/Documents/Project/Index.cshtml.cs | 10 +++++----- 8 files changed, 27 insertions(+), 27 deletions(-) rename modules/docs/src/Volo.Docs.Web/{DocsOptions.cs => DocsUiOptions.cs} (90%) diff --git a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs index 48c810f7e1..b127db4b3f 100644 --- a/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs +++ b/modules/docs/app/VoloDocs.Web/Pages/Index.cshtml.cs @@ -8,19 +8,19 @@ namespace VoloDocs.Web.Pages { public class IndexModel : PageModel { - private readonly DocsOptions _urlOptions; + private readonly DocsUiOptions _urlUiOptions; - public IndexModel(IOptions urlOptions) + public IndexModel(IOptions urlOptions) { - _urlOptions = urlOptions.Value; + _urlUiOptions = urlOptions.Value; } public IActionResult OnGet() { //TODO: Create HomeController & Index instead of Page. Otherwise, we have an empty Index.cshtml file. - if (!_urlOptions.RoutePrefix.IsNullOrWhiteSpace()) + if (!_urlUiOptions.RoutePrefix.IsNullOrWhiteSpace()) { - return Redirect("." + _urlOptions.RoutePrefix); + return Redirect("." + _urlUiOptions.RoutePrefix); } return Page(); diff --git a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs index 77dbaff275..85738e6ff9 100644 --- a/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs +++ b/modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs @@ -62,7 +62,7 @@ namespace VoloDocs.Web var hostingEnvironment = context.Services.GetHostingEnvironment(); var configuration = context.Services.GetConfiguration(); - Configure(options => + Configure(options => { options.RoutePrefix = null; }); diff --git a/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs b/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs index 7e3cf53830..afb61eadd3 100644 --- a/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs +++ b/modules/docs/src/Volo.Docs.Web/Areas/Documents/TagHelpers/TreeTagHelper.cs @@ -13,7 +13,7 @@ namespace Volo.Docs.Areas.Documents.TagHelpers [HtmlTargetElement("ul", Attributes = "root-node")] public class TreeTagHelper : TagHelper { - private readonly DocsOptions _options; + private readonly DocsUiOptions _uiOptions; private const string LiItemTemplateWithLink = @"
  • {2}{3}
  • "; @@ -41,9 +41,9 @@ namespace Volo.Docs.Areas.Documents.TagHelpers [HtmlAttributeName("language")] public string LanguageCode { get; set; } - public TreeTagHelper(IOptions urlOptions) + public TreeTagHelper(IOptions urlOptions) { - _options = urlOptions.Value; + _uiOptions = urlOptions.Value; } public override void Process(TagHelperContext context, TagHelperOutput output) @@ -142,7 +142,7 @@ namespace Volo.Docs.Areas.Documents.TagHelpers return "javascript:;"; } - var prefix = _options.RoutePrefix; + var prefix = _uiOptions.RoutePrefix; return prefix + LanguageCode + "/" + ProjectName + "/" + Version + "/" + pathWithoutFileExtension; } diff --git a/modules/docs/src/Volo.Docs.Web/DocsOptions.cs b/modules/docs/src/Volo.Docs.Web/DocsUiOptions.cs similarity index 90% rename from modules/docs/src/Volo.Docs.Web/DocsOptions.cs rename to modules/docs/src/Volo.Docs.Web/DocsUiOptions.cs index d8bf9f62a9..4b4ab6a3b4 100644 --- a/modules/docs/src/Volo.Docs.Web/DocsOptions.cs +++ b/modules/docs/src/Volo.Docs.Web/DocsUiOptions.cs @@ -2,7 +2,7 @@ namespace Volo.Docs { - public class DocsOptions + public class DocsUiOptions { private string _routePrefix = "documents"; @@ -19,7 +19,7 @@ namespace Volo.Docs /// Allows user to see a combobox in user interface for swapping across projects /// Default value: True; /// - public bool ShowProjectsComboboxInUi = true; + public bool ShowProjectsCombobox = true; private string GetFormattedRoutePrefix() { diff --git a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs index 35574a2d51..f128aacfd1 100644 --- a/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs +++ b/modules/docs/src/Volo.Docs.Web/DocsWebModule.cs @@ -42,7 +42,7 @@ namespace Volo.Docs Configure(options => { var docsOptions = context.Services - .GetRequiredServiceLazy>() + .GetRequiredServiceLazy>() .Value.Value; var routePrefix = docsOptions.RoutePrefix; diff --git a/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs b/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs index b0fc185e29..0915be10c2 100644 --- a/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs +++ b/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs @@ -14,13 +14,13 @@ namespace Volo.Docs.Markdown public const string Type = "md"; private readonly IMarkdownConverter _markdownConverter; - private readonly DocsOptions _options; + private readonly DocsUiOptions _uiOptions; public MarkdownDocumentToHtmlConverter(IMarkdownConverter markdownConverter, - IOptions urlOptions) + IOptions urlOptions) { _markdownConverter = markdownConverter; - _options = urlOptions.Value; + _uiOptions = urlOptions.Value; } private const string MdLinkFormat = "[{0}]({1}{2}/{3}/{4}{5}/{6})"; @@ -73,7 +73,7 @@ namespace Volo.Docs.Markdown return string.Format( MdLinkFormat, displayText, - _options.RoutePrefix, + _uiOptions.RoutePrefix, languageCode, projectShortName, version, @@ -101,7 +101,7 @@ namespace Volo.Docs.Markdown return string.Format( MdLinkFormat, displayText, - _options.RoutePrefix, + _uiOptions.RoutePrefix, languageCode, projectShortName, version, diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs index f958d3d409..9e21ec22de 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Index.cshtml.cs @@ -15,19 +15,19 @@ namespace Volo.Docs.Pages.Documents public IReadOnlyList Projects { get; set; } private readonly IProjectAppService _projectAppService; - private readonly DocsOptions _options; + private readonly DocsUiOptions _uiOptions; public IndexModel( IProjectAppService projectAppService, - IOptions urlOptions) + IOptions urlOptions) { _projectAppService = projectAppService; - _options = urlOptions.Value; + _uiOptions = urlOptions.Value; } public async Task OnGetAsync() { - DocumentsUrlPrefix = _options.RoutePrefix; + DocumentsUrlPrefix = _uiOptions.RoutePrefix; var listResult = await _projectAppService.GetListAsync(); diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index 8d72e75fe7..c61f2c33c8 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -59,24 +59,24 @@ namespace Volo.Docs.Pages.Documents.Project private readonly IDocumentAppService _documentAppService; private readonly IDocumentToHtmlConverterFactory _documentToHtmlConverterFactory; private readonly IProjectAppService _projectAppService; - private readonly DocsOptions _options; + private readonly DocsUiOptions _uiOptions; public IndexModel( IDocumentAppService documentAppService, IDocumentToHtmlConverterFactory documentToHtmlConverterFactory, IProjectAppService projectAppService, - IOptions options) + IOptions options) { _documentAppService = documentAppService; _documentToHtmlConverterFactory = documentToHtmlConverterFactory; _projectAppService = projectAppService; - _options = options.Value; + _uiOptions = options.Value; } public async Task OnGetAsync() { - DocumentsUrlPrefix = _options.RoutePrefix; - ShowProjectsCombobox = _options.ShowProjectsComboboxInUi; + DocumentsUrlPrefix = _uiOptions.RoutePrefix; + ShowProjectsCombobox = _uiOptions.ShowProjectsCombobox; if (IsDocumentCultureDifferentThanCurrent()) { From 22f7acbadb207eee14e89481b67a0b52414246ca Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 19 Aug 2019 09:50:48 +0300 Subject: [PATCH 12/12] docs: fix file name --- docs/en/Tutorials/Angular/Part-II.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Tutorials/Angular/Part-II.md b/docs/en/Tutorials/Angular/Part-II.md index 61e3232a1b..ed6afcb947 100644 --- a/docs/en/Tutorials/Angular/Part-II.md +++ b/docs/en/Tutorials/Angular/Part-II.md @@ -253,7 +253,7 @@ import { NgbDatepickerModule } from '@ng-bootstrap/ng-bootstrap'; export class BooksModule {} ``` -Then open the `book-list.component.html` and add `providers` as shown below: +Then open the `book-list.component.ts` and add `providers` as shown below: ```js import { NgbDateNativeAdapter, NgbDateAdapter } from '@ng-bootstrap/ng-bootstrap';