Browse Source

Merge branch 'dev' into berkan/include-ABP-book

pull/11482/head
albert 5 years ago
committed by GitHub
parent
commit
b6ad1eb854
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json
  2. 4
      abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json
  3. 13
      abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json
  4. 10
      docs/en/Application-Services.md
  5. 15
      docs/en/UI/Blazor/Page-Header.md
  6. 36
      docs/en/UI/Blazor/Page-Layout.md
  7. 50
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor
  8. 22
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs
  9. 8
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeaderOptions.cs
  10. 16
      framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs
  11. 2
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor
  12. 4
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor

7
abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json

@ -433,8 +433,10 @@
"LeptonXSemiDark": "LeptonX Semi-Dark", "LeptonXSemiDark": "LeptonX Semi-Dark",
"BuiltOnBs5Library": "Built on Bootstrap 5 library", "BuiltOnBs5Library": "Built on Bootstrap 5 library",
"FullyCompatibleWithBs5": "100% compatible with Bootstrap 5 HTML structure and CSS classes", "FullyCompatibleWithBs5": "100% compatible with Bootstrap 5 HTML structure and CSS classes",
"ResponsiveAndMobileCompatible": "Responsive & mobile-compatible", "ResponsiveAndMobileCompatible": "Responsive, mobile-compatible, RTL support",
"ProvidesStylesForDatatables": "Provides styles for Datatables", "ProvidesStylesForDatatables": "Provides styles for Datatables",
"MultipleLayoutOptions": "Multiple layout options",
"EasilyInstallAndUpgrade": "Easily install and upgrade",
"SupportForum": "Support Forum", "SupportForum": "Support Forum",
"TrustedBy": "Trusted By", "TrustedBy": "Trusted By",
"OurPricing": "Our <span class=\"gradient-commercial\">Pricing</span", "OurPricing": "Our <span class=\"gradient-commercial\">Pricing</span",
@ -486,6 +488,7 @@
"LandingWebsite": "Landing Website", "LandingWebsite": "Landing Website",
"LandingWebsiteExplanation": "A generic landing/public website that can be used for several purposes, like introducing your company, selling your products, etc.", "LandingWebsiteExplanation": "A generic landing/public website that can be used for several purposes, like introducing your company, selling your products, etc.",
"ABPFrameworkEBook": "E-Book: Mastering ABP Framework", "ABPFrameworkEBook": "E-Book: Mastering ABP Framework",
"MasteringAbpFrameworkEBookDescription": "Included within your ABP Commercial license" "MasteringAbpFrameworkEBookDescription": "Included within your ABP Commercial license",
"Volo.AbpIo.Domain:070000": "Organization name cannot contain spaces!"
} }
} }

4
abp_io/AbpIoLocalization/AbpIoLocalization/Community/Localization/Resources/en.json

@ -85,7 +85,9 @@
"CommunityPostRequestErrorMessage": "Could not get the latest post request from Github.", "CommunityPostRequestErrorMessage": "Could not get the latest post request from Github.",
"PostRequestFromGithubIssue": "There aren't any post requests now.", "PostRequestFromGithubIssue": "There aren't any post requests now.",
"LatestPosts": "Latest Posts", "LatestPosts": "Latest Posts",
"ArticleRequests": "Post Requests", "ArticleRequests": "Request a content",
"ArticleRequestsDescription": "Want to see a specific content here? You can ask the community to create it!",
"LatestContentRequests": "Latest content requests",
"AllPostRequests": "See All Post Requests", "AllPostRequests": "See All Post Requests",
"SubscribeToTheNewsletter": "Subscribe to the Newsletter", "SubscribeToTheNewsletter": "Subscribe to the Newsletter",
"NewsletterEmailDefinition": "Get information about happenings in ABP, such as new releases, free sources, posts, and more.", "NewsletterEmailDefinition": "Get information about happenings in ABP, such as new releases, free sources, posts, and more.",

13
abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json

@ -40,11 +40,11 @@
"Theming": "Theming", "Theming": "Theming",
"ThemingExplanationShort": "Use and customize the bootstrap-based standard UI theme or create your own.", "ThemingExplanationShort": "Use and customize the bootstrap-based standard UI theme or create your own.",
"BootstrapTagHelpersDynamicForms": "Bootstrap Tag Helpers & Dynamic Forms", "BootstrapTagHelpersDynamicForms": "Bootstrap Tag Helpers & Dynamic Forms",
"BootstrapTagHelpersDynamicFormsExplanation": "Instead of manually writing the repeating details of bootstrap components, Use ABP's tag helpers to simplify them and take advantage of the IntelliSense. Quickly build UI forms based on a C# model using the dynamic form tag helper.", "BootstrapTagHelpersDynamicFormsExplanation": "Instead of manually writing the repeating details of bootstrap components, use ABP's tag helpers to simplify them and take advantage of the IntelliSense. Quickly build UI forms based on a C# model using the dynamic form tag helper.",
"HTTPAPIsDynamicProxies": "HTTP APIs & Dynamic Proxies", "HTTPAPIsDynamicProxies": "HTTP APIs & Dynamic Proxies",
"HTTPAPIsDynamicProxiesExplanation": "Automatically expose application services as REST style HTTP APIs, and consume them with dynamic JavaScript and C# proxies.", "HTTPAPIsDynamicProxiesExplanation": "Automatically expose application services as REST style HTTP APIs, and consume them with dynamic JavaScript and C# proxies.",
"CompleteArchitectureInfo": "Modern architecture to create maintainable software solutions.", "CompleteArchitectureInfo": "Modern architecture to create maintainable software solutions.",
"DomainDrivenDesignBasedLayeringModelExplanation": "Helps implement a DDD based layered architecture and builds a maintainable code base.", "DomainDrivenDesignBasedLayeringModelExplanation": "Helps implement a DDD based layered architecture and build a maintainable code base.",
"DomainDrivenDesignBasedLayeringModelExplanationCont": "Provides startup templates, abstractions, base classes, services, documentation and guides to help you develop your application based on DDD patterns & principles.", "DomainDrivenDesignBasedLayeringModelExplanationCont": "Provides startup templates, abstractions, base classes, services, documentation and guides to help you develop your application based on DDD patterns & principles.",
"MicroserviceCompatibleModelExplanation": "The core framework & pre-built modules are designed with microservice architecture in mind.", "MicroserviceCompatibleModelExplanation": "The core framework & pre-built modules are designed with microservice architecture in mind.",
"MicroserviceCompatibleModelExplanationCont": "Provides infrastructure, integrations, samples and documentation to implement microservice solutions easier, while it doesn\u2019t bring additional complexity if you want a monolithic application.", "MicroserviceCompatibleModelExplanationCont": "Provides infrastructure, integrations, samples and documentation to implement microservice solutions easier, while it doesn\u2019t bring additional complexity if you want a monolithic application.",
@ -82,7 +82,7 @@
"CLI_CommandLineInterface": "CLI (Command Line Interface)", "CLI_CommandLineInterface": "CLI (Command Line Interface)",
"CLI_CommandLineInterfaceExplanation": "Includes a CLI to help you automate the creation of new projects and the addition of new modules.", "CLI_CommandLineInterfaceExplanation": "Includes a CLI to help you automate the creation of new projects and the addition of new modules.",
"StartupTemplates": "Startup Templates", "StartupTemplates": "Startup Templates",
"StartupTemplatesExplanation": "Various startup templates provide a fully configured solution to jump start your development.", "StartupTemplatesExplanation": "ABP’s application startup template provides a fully configured solution to jump start your development.",
"BasedOnFamiliarTools": "Based on Familiar Tools", "BasedOnFamiliarTools": "Based on Familiar Tools",
"BasedOnFamiliarToolsExplanation": "Built on and integrated with popular tools you already know. Low learning curve, easy adaptation, comfortable development.", "BasedOnFamiliarToolsExplanation": "Built on and integrated with popular tools you already know. Low learning curve, easy adaptation, comfortable development.",
"ORMIndependent": "ORM Independent", "ORMIndependent": "ORM Independent",
@ -114,7 +114,7 @@
"AspectOrientedProgramming": "Aspect Oriented Programming", "AspectOrientedProgramming": "Aspect Oriented Programming",
"DependencyInjection": "Dependency Injection", "DependencyInjection": "Dependency Injection",
"DependencyInjectionByConventions": "Dependency Injection by Conventions", "DependencyInjectionByConventions": "Dependency Injection by Conventions",
"ABPCLIExplanation": "ABP CLI (Command Line Interface) is a command line tool to perform some common operations for ABP based solutions.", "ABPCLIExplanation": "ABP CLI (Command Line Interface) is a command line tool to automate some common operations for ABP based solutions.",
"ModularityExplanation": "ABP provides a complete infrastructure to build your own application modules that may have entities, services, database integration, APIs, UI components and so on..", //TODO: strong "your own application modules",- "ModularityExplanation": "ABP provides a complete infrastructure to build your own application modules that may have entities, services, database integration, APIs, UI components and so on..", //TODO: strong "your own application modules",-
"MultiTenancyExplanation": "ABP framework doesn't only support developing multi-tenant applications, but also makes your code mostly unaware of the multi-tenancy.", "MultiTenancyExplanation": "ABP framework doesn't only support developing multi-tenant applications, but also makes your code mostly unaware of the multi-tenancy.",
"MultiTenancyExplanation2": "Can automatically determine the current tenant, isolate data of different tenants from each other.", "MultiTenancyExplanation2": "Can automatically determine the current tenant, isolate data of different tenants from each other.",
@ -315,6 +315,9 @@
"SelectUIFramework": "Select UI Framework", "SelectUIFramework": "Select UI Framework",
"SelectDatabaseProvider": "Select Database Provider", "SelectDatabaseProvider": "Select Database Provider",
"SelectDatabaseManagementSystem": "Select Database Management System", "SelectDatabaseManagementSystem": "Select Database Management System",
"InstallingTheABPCLI": "Installing the ABP CLI" "InstallingTheABPCLI": "Installing the ABP CLI",
"CreateYourProjectNow": "Create Your Project Now",
"OrderOn": "Order on {0}",
"DownloadFreeDDDBook": "Download Free DDD Book"
} }
} }

10
docs/en/Application-Services.md

@ -61,7 +61,7 @@ public class Book : AggregateRoot<Guid>
* `Book` entity has a `MaxNameLength` that defines the maximum length of the `Name` property. * `Book` entity has a `MaxNameLength` that defines the maximum length of the `Name` property.
* `Book` constructor and `ChangeName` method to ensure that the `Name` is always a valid value. Notice that `Name`'s setter is not `public`. * `Book` constructor and `ChangeName` method to ensure that the `Name` is always a valid value. Notice that `Name`'s setter is not `public`.
> ABP does not force you to design your entities like that. It just can have public get/set for all properties. It's your decision to full implement DDD practices. > ABP does not force you to design your entities like that. It just can have public get/set for all properties. It's your decision to fully implement DDD practices.
### IBookAppService Interface ### IBookAppService Interface
@ -124,13 +124,13 @@ public class BookAppService : ApplicationService, IBookAppService
## Data Transfer Objects ## Data Transfer Objects
Application services gets and returns DTOs instead of entities. ABP does not force this rule. However, exposing entities to presentation layer (or to remote clients) have significant problems and not suggested. Application services get and return DTOs instead of entities. ABP does not force this rule. However, exposing entities to the presentation layer (or to remote clients) has significant problems and is not suggested.
See the [DTO documentation](Data-Transfer-Objects.md) for more. See the [DTO documentation](Data-Transfer-Objects.md) for more.
## Object to Object Mapping ## Object to Object Mapping
The `CreateAsync` method above manually creates a `Book` entity from given `CreateBookDto` object. Because the `Book` entity enforces it (we designed it like that). The `CreateAsync` method above manually creates a `Book` entity from given `CreateBookDto` object, because the `Book` entity enforces it (we designed it like that).
However, in many cases, it's very practical to use **auto object mapping** to set properties of an object from a similar object. ABP provides an [object to object mapping](Object-To-Object-Mapping.md) infrastructure to make this even easier. However, in many cases, it's very practical to use **auto object mapping** to set properties of an object from a similar object. ABP provides an [object to object mapping](Object-To-Object-Mapping.md) infrastructure to make this even easier.
@ -239,7 +239,7 @@ public interface IBookAppService :
`ICrudAppService` has generic arguments to get the primary key type of the entity and the DTO types for the CRUD operations (it does not get the entity type since the entity type is not exposed to the clients use this interface). `ICrudAppService` has generic arguments to get the primary key type of the entity and the DTO types for the CRUD operations (it does not get the entity type since the entity type is not exposed to the clients use this interface).
> Creating interface for an application service is a good practice, but not required by the ABP Framework. You can skip the interface part. > Creating an interface for an application service is good practice, but not required by the ABP Framework. You can skip the interface part.
`ICrudAppService` declares the following methods: `ICrudAppService` declares the following methods:
@ -359,7 +359,7 @@ public class DistrictAppService
} }
```` ````
This implementation requires you to create a class represents your composite key: This implementation requires you to create a class that represents your composite key:
````csharp ````csharp
public class DistrictKey public class DistrictKey

15
docs/en/UI/Blazor/Page-Header.md

@ -88,3 +88,18 @@ An example render result can be:
![breadcrumbs-example](../../images/page-header-toolbar-blazor.png) ![breadcrumbs-example](../../images/page-header-toolbar-blazor.png)
---
## Options
Rendering can be enabled or disabled for each section of PageHeader via using `PageHeaderOptions`.
```csharp
Configure<PageHeaderOptions>(options =>
{
options.RenderPageTitle = false;
options.RenderBreadcrumbs = false;
options.RenderToolbar = false;
});
```
*All values are **true** by default. If the PageHeaderOptions isn't configured, each section will be rendered.*

36
docs/en/UI/Blazor/Page-Layout.md

@ -0,0 +1,36 @@
# Page Layout
PageLayout is used to define page-specific elements across application.
## Title
Title is used to render page title in the PageHeader.
```csharp
@inject PageLayout PageLayout
@{
PageLayout.Title = "My Page Title";
}
```
## BreadCrumbs
BreadCrumbItems are used to render breadcrumbs in the PageHeader.
```csharp
@inject PageLayout PageLayout
@{
PageLayout.BreadcrumbItems.Add(new BlazoriseUI.BreadcrumbItem("My Page", "/my-page"));
}
```
## Toolbar
ToolbarItems are used to render action toolbar items in the PageHeader.
Check out [Page Toolbar](https://docs.abp.io/en/abp/latest/UI/Blazor/Page-Header#page-toolbar)
```csharp
@inject PageLayout PageLayout
@{
PageLayout.ToolbarItems.Add(new PageToolbars.PageToolbarItem(typeof(MyButtonComponent)));
}
```

50
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor

@ -1,9 +1,17 @@
@using Blazorise @using Blazorise
@using Microsoft.Extensions.Options
@inject IOptions<PageHeaderOptions> Options
<Row Class="entry-row"> <Row Class="entry-row">
<Column ColumnSize="ColumnSize.IsAuto"> @if(Options.Value.RenderPageTitle)
<h1 class="content-header-title">@Title</h1> {
</Column> <Column ColumnSize="ColumnSize.IsAuto">
@if (BreadcrumbItems.Any()) <h1 class="content-header-title">@PageLayout.Title</h1>
</Column>
}
@if (Options.Value.RenderBreadcrumbs && PageLayout.BreadcrumbItems.Any())
{ {
<Column ColumnSize="ColumnSize.IsAuto.OnWidescreen" Padding="Padding.Is0.FromLeft.OnWidescreen"> <Column ColumnSize="ColumnSize.IsAuto.OnWidescreen" Padding="Padding.Is0.FromLeft.OnWidescreen">
<Breadcrumb Mode="@(BreadcrumbShowCurrent ? BreadcrumbMode.Auto : BreadcrumbMode.None)"> <Breadcrumb Mode="@(BreadcrumbShowCurrent ? BreadcrumbMode.Auto : BreadcrumbMode.None)">
@ -15,7 +23,7 @@
</BreadcrumbLink> </BreadcrumbLink>
</BreadcrumbItem> </BreadcrumbItem>
} }
@foreach (var item in BreadcrumbItems) @foreach (var item in PageLayout.BreadcrumbItems)
{ {
<BreadcrumbItem> <BreadcrumbItem>
<BreadcrumbLink To="@item.Url"> <BreadcrumbLink To="@item.Url">
@ -30,19 +38,23 @@
</Breadcrumb> </Breadcrumb>
</Column> </Column>
} }
<Column>
<Row Class="justify-content-end mx-n1"> @if(Options.Value.RenderToolbar)
@if (Toolbar == null) {
{ <Column>
@ChildContent <Row Class="justify-content-end mx-n1">
} @if (Toolbar == null)
{
@ChildContent
}
@foreach (var toolbarItemRender in ToolbarItemRenders) @foreach (var toolbarItemRender in ToolbarItemRenders)
{ {
<Column ColumnSize="ColumnSize.IsAuto" Class="px-1 pt-2"> <Column ColumnSize="ColumnSize.IsAuto" Class="px-1 pt-2">
@toolbarItemRender @toolbarItemRender
</Column> </Column>
} }
</Row> </Row>
</Column> </Column>
}
</Row> </Row>

22
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs

@ -13,8 +13,11 @@ public partial class PageHeader : ComponentBase
public IPageToolbarManager PageToolbarManager { get; set; } public IPageToolbarManager PageToolbarManager { get; set; }
[Parameter] [Inject]
public string Title { get; set; } public PageLayout PageLayout { get; private set; }
[Parameter] // TODO: Consider removing this property in future and use only PageLayout.
public string Title { get => PageLayout.Title; set => PageLayout.Title = value; }
[Parameter] [Parameter]
public bool BreadcrumbShowHome { get; set; } = true; public bool BreadcrumbShowHome { get; set; } = true;
@ -25,15 +28,17 @@ public partial class PageHeader : ComponentBase
[Parameter] [Parameter]
public RenderFragment ChildContent { get; set; } public RenderFragment ChildContent { get; set; }
[Parameter] [Parameter] // TODO: Consider removing this property in future and use only PageLayout.
public List<BreadcrumbItem> BreadcrumbItems { get; set; } public List<BreadcrumbItem> BreadcrumbItems {
get => PageLayout.BreadcrumbItems;
set => PageLayout.BreadcrumbItems = value;
}
[Parameter] [Parameter]
public PageToolbar Toolbar { get; set; } public PageToolbar Toolbar { get; set; }
public PageHeader() public PageHeader()
{ {
BreadcrumbItems = new List<BreadcrumbItem>();
ToolbarItemRenders = new List<RenderFragment>(); ToolbarItemRenders = new List<RenderFragment>();
} }
@ -45,6 +50,13 @@ public partial class PageHeader : ComponentBase
var toolbarItems = await PageToolbarManager.GetItemsAsync(Toolbar); var toolbarItems = await PageToolbarManager.GetItemsAsync(Toolbar);
ToolbarItemRenders.Clear(); ToolbarItemRenders.Clear();
if (!Options.Value.RenderToolbar)
{
PageLayout.ToolbarItems.Clear();
PageLayout.ToolbarItems.AddRange(toolbarItems);
return;
}
foreach (var item in toolbarItems) foreach (var item in toolbarItems)
{ {
var sequence = 0; var sequence = 0;

8
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeaderOptions.cs

@ -0,0 +1,8 @@
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout;
public class PageHeaderOptions
{
public bool RenderPageTitle { get; set; } = true;
public bool RenderBreadcrumbs { get; set; } = true;
public bool RenderToolbar { get; set; } = true;
}

16
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs

@ -0,0 +1,16 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Components.Web.Theming.PageToolbars;
using Volo.Abp.BlazoriseUI;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Layout;
public class PageLayout : IScopedDependency
{
// TODO: Consider using this property for setting Page Title too.
public virtual string Title { get; set; }
public virtual List<BreadcrumbItem> BreadcrumbItems { get; set; } = new();
public virtual List<PageToolbarItem> ToolbarItems { get; set; } = new();
}

2
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor

@ -10,7 +10,7 @@
@inject IStringLocalizer<AbpUiResource> L @inject IStringLocalizer<AbpUiResource> L
<AuthorizeView> <AuthorizeView>
<Authorized> <Authorized>
<Dropdown> <Dropdown RightAligned="true">
<DropdownToggle Color="Color.None"> <DropdownToggle Color="Color.None">
@if (CurrentTenant.Name != null) @if (CurrentTenant.Name != null)
{ {

4
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor

@ -10,7 +10,7 @@
@inject IStringLocalizer<AbpUiResource> UiLocalizer @inject IStringLocalizer<AbpUiResource> UiLocalizer
<AuthorizeView> <AuthorizeView>
<Authorized> <Authorized>
<Dropdown> <Dropdown RightAligned="true">
<DropdownToggle Color="Color.None"> <DropdownToggle Color="Color.None">
@if (CurrentTenant.Name != null) @if (CurrentTenant.Name != null)
{ {
@ -37,4 +37,4 @@
<NotAuthorized> <NotAuthorized>
<a class="nav-link" href="authentication/login">@UiLocalizer["Login"]</a> <a class="nav-link" href="authentication/login">@UiLocalizer["Login"]</a>
</NotAuthorized> </NotAuthorized>
</AuthorizeView> </AuthorizeView>

Loading…
Cancel
Save