From 0eedcb28310aada11e0f9feba9612f0a9cc82a03 Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Mon, 24 Jan 2022 16:42:57 +0300 Subject: [PATCH 01/10] Add new localizations for abp.io website --- .../Www/Localization/Resources/en.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json index ac7158b2e3..0eb592b895 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Www/Localization/Resources/en.json @@ -40,11 +40,11 @@ "Theming": "Theming", "ThemingExplanationShort": "Use and customize the bootstrap-based standard UI theme or create your own.", "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", "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.", - "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.", "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.", @@ -82,7 +82,7 @@ "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.", "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", "BasedOnFamiliarToolsExplanation": "Built on and integrated with popular tools you already know. Low learning curve, easy adaptation, comfortable development.", "ORMIndependent": "ORM Independent", @@ -114,7 +114,7 @@ "AspectOrientedProgramming": "Aspect Oriented Programming", "DependencyInjection": "Dependency Injection", "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",- "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.", @@ -316,6 +316,9 @@ "SelectUIFramework": "Select UI Framework", "SelectDatabaseProvider": "Select Database Provider", "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" } } From 572a9974053a0e60568ebe53c8f98428bd40b213 Mon Sep 17 00:00:00 2001 From: berkansasmaz Date: Tue, 25 Jan 2022 18:00:03 +0300 Subject: [PATCH 02/10] Add missing localizations --- .../Commercial/Localization/Resources/en.json | 4 +++- .../Community/Localization/Resources/en.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index 5e7906ae4f..bd4aa3a4f1 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -431,8 +431,10 @@ "LeptonXSemiDark": "LeptonX Semi-Dark", "BuiltOnBs5Library": "Built on Bootstrap 5 library", "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", + "MultipleLayoutOptions": "Multiple layout options", + "EasilyInstallAndUpgrade": "Easily install and upgrade", "SupportForum": "Support Forum", "TrustedBy": "Trusted By", "OurPricing": "Our Pricing Date: Thu, 27 Jan 2022 09:44:31 +0800 Subject: [PATCH 03/10] Blazor UI: Dropdown right-aligned --- .../Themes/Basic/LoginDisplay.razor | 2 +- .../Themes/Basic/LoginDisplay.razor | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor index adc42e8da3..0fc99ce980 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.BasicTheme/Themes/Basic/LoginDisplay.razor @@ -10,7 +10,7 @@ @inject IStringLocalizer L - + @if (CurrentTenant.Name != null) { diff --git a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor index 1b084a60ce..8512815a26 100644 --- a/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor +++ b/modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor @@ -10,7 +10,7 @@ @inject IStringLocalizer UiLocalizer - + @if (CurrentTenant.Name != null) { @@ -37,4 +37,4 @@ @UiLocalizer["Login"] - \ No newline at end of file + From 7e855dba1e47532dda7f9c49b02d73da4463f620 Mon Sep 17 00:00:00 2001 From: berkansasmaz Date: Thu, 27 Jan 2022 14:40:16 +0300 Subject: [PATCH 04/10] Add missing localization --- .../Commercial/Localization/Resources/en.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json index 4dce6058e6..602f62102d 100644 --- a/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json +++ b/abp_io/AbpIoLocalization/AbpIoLocalization/Commercial/Localization/Resources/en.json @@ -484,6 +484,7 @@ "BackOfficeApplication": "Back Office Application", "BackOfficeApplicationExplanation": "The actual web application of your system, with multiple UI framework options. You can create any kind of business application.", "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.", + "Volo.AbpIo.Domain:070000": "Organization name cannot contain spaces!" } } From d8a112f52dba2d6a9ecf6af99ac2f7e2dfccce97 Mon Sep 17 00:00:00 2001 From: Maximiliano Jabase Date: Fri, 28 Jan 2022 11:03:24 -0300 Subject: [PATCH 05/10] propose small grammar detail fixes --- docs/en/Application-Services.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/en/Application-Services.md b/docs/en/Application-Services.md index e0f7ef2560..3593b43845 100644 --- a/docs/en/Application-Services.md +++ b/docs/en/Application-Services.md @@ -61,7 +61,7 @@ public class Book : AggregateRoot * `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`. -> 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 @@ -124,13 +124,13 @@ public class BookAppService : ApplicationService, IBookAppService ## 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. ## 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. @@ -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). -> 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: @@ -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 public class DistrictKey From d4ffd9cc17fac3e7f045c7b27429bd498d56a14e Mon Sep 17 00:00:00 2001 From: enisn Date: Mon, 31 Jan 2022 10:50:16 +0300 Subject: [PATCH 06/10] Create PageLayout --- .../Layout/PageLayout.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs new file mode 100644 index 0000000000..9c0d89f70a --- /dev/null +++ b/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 BreadcrumbItems { get; set; } = new(); + + public virtual List ToolbarItems { get; set; } = new(); +} \ No newline at end of file From 27a90399351cf30a380f9150820555bc6ec3a80f Mon Sep 17 00:00:00 2001 From: enisn Date: Mon, 31 Jan 2022 11:11:00 +0300 Subject: [PATCH 07/10] Create PageHeaderOptions.cs --- .../Layout/PageHeaderOptions.cs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeaderOptions.cs diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeaderOptions.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeaderOptions.cs new file mode 100644 index 0000000000..b61e53aab5 --- /dev/null +++ b/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; +} From ab67dcfc026edd8cfba637c75f45af5e68c252dc Mon Sep 17 00:00:00 2001 From: enisn Date: Mon, 31 Jan 2022 11:11:22 +0300 Subject: [PATCH 08/10] Implement PageHeaderOptions & PageLayout --- .../Layout/PageHeader.razor | 50 ++++++++++++------- .../Layout/PageHeader.razor.cs | 22 ++++++-- 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor index d874da0901..755adadb9e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor @@ -1,9 +1,17 @@ @using Blazorise +@using Microsoft.Extensions.Options + +@inject IOptions Options + - -

@Title

-
- @if (BreadcrumbItems.Any()) + @if(Options.Value.RenderPageTitle) + { + +

@PageLayout.Title

+
+ } + + @if (Options.Value.RenderBreadcrumbs && PageLayout.BreadcrumbItems.Any()) { @@ -15,7 +23,7 @@
} - @foreach (var item in BreadcrumbItems) + @foreach (var item in PageLayout.BreadcrumbItems) { @@ -30,19 +38,23 @@ } - - - @if (Toolbar == null) - { - @ChildContent - } + + @if(Options.Value.RenderToolbar) + { + + + @if (Toolbar == null) + { + @ChildContent + } - @foreach (var toolbarItemRender in ToolbarItemRenders) - { - - @toolbarItemRender - - } - - + @foreach (var toolbarItemRender in ToolbarItemRenders) + { + + @toolbarItemRender + + } + + + } diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs index fd6bd50942..10fbc3bfb7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor.cs +++ b/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; } - [Parameter] - public string Title { get; set; } + [Inject] + 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] public bool BreadcrumbShowHome { get; set; } = true; @@ -25,15 +28,17 @@ public partial class PageHeader : ComponentBase [Parameter] public RenderFragment ChildContent { get; set; } - [Parameter] - public List BreadcrumbItems { get; set; } + [Parameter] // TODO: Consider removing this property in future and use only PageLayout. + public List BreadcrumbItems { + get => PageLayout.BreadcrumbItems; + set => PageLayout.BreadcrumbItems = value; + } [Parameter] public PageToolbar Toolbar { get; set; } public PageHeader() { - BreadcrumbItems = new List(); ToolbarItemRenders = new List(); } @@ -45,6 +50,13 @@ public partial class PageHeader : ComponentBase var toolbarItems = await PageToolbarManager.GetItemsAsync(Toolbar); ToolbarItemRenders.Clear(); + if (!Options.Value.RenderToolbar) + { + PageLayout.ToolbarItems.Clear(); + PageLayout.ToolbarItems.AddRange(toolbarItems); + return; + } + foreach (var item in toolbarItems) { var sequence = 0; From e9c081325cac00875218e442261ab9c927110aa6 Mon Sep 17 00:00:00 2001 From: enisn Date: Mon, 31 Jan 2022 11:11:42 +0300 Subject: [PATCH 09/10] Update documentation --- docs/en/UI/Blazor/Page-Header.md | 15 +++++++++++++ docs/en/UI/Blazor/Page-Layout.md | 36 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 docs/en/UI/Blazor/Page-Layout.md diff --git a/docs/en/UI/Blazor/Page-Header.md b/docs/en/UI/Blazor/Page-Header.md index 59748b717a..b4801511bb 100644 --- a/docs/en/UI/Blazor/Page-Header.md +++ b/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) +--- + +## Options +Rendering can be enabled or disabled for each section of PageHeader via using `PageHeaderOptions`. + +```csharp + Configure(options => + { + options.RenderPageTitle = false; + options.RenderBreadcrumbs = false; + options.RenderToolbar = false; + }); +``` + +*All values are **true** by default. If the PageHeaderOptions isn's configured, each section will be rendered.* \ No newline at end of file diff --git a/docs/en/UI/Blazor/Page-Layout.md b/docs/en/UI/Blazor/Page-Layout.md new file mode 100644 index 0000000000..61d91d66af --- /dev/null +++ b/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))); +} +``` \ No newline at end of file From 9fb2f850e46c59991c7727ffb33ef57c07034b3a Mon Sep 17 00:00:00 2001 From: enisn Date: Mon, 31 Jan 2022 11:35:20 +0300 Subject: [PATCH 10/10] Fix typo at Page-Header.md --- docs/en/UI/Blazor/Page-Header.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/UI/Blazor/Page-Header.md b/docs/en/UI/Blazor/Page-Header.md index b4801511bb..29cb006bd3 100644 --- a/docs/en/UI/Blazor/Page-Header.md +++ b/docs/en/UI/Blazor/Page-Header.md @@ -102,4 +102,4 @@ Rendering can be enabled or disabled for each section of PageHeader via using `P }); ``` -*All values are **true** by default. If the PageHeaderOptions isn's configured, each section will be rendered.* \ No newline at end of file +*All values are **true** by default. If the PageHeaderOptions isn't configured, each section will be rendered.* \ No newline at end of file