From e1f285547548371739edf5ba7ebbd35825772b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20Ali=20=C3=96ZKAYA?= Date: Fri, 9 Sep 2022 09:13:50 +0300 Subject: [PATCH 1/6] Add LeptonX Lite Blazor docs --- docs/en/Themes/LeptonXLite/Blazor.md | 311 +++++++++++++++++++++++++++ 1 file changed, 311 insertions(+) diff --git a/docs/en/Themes/LeptonXLite/Blazor.md b/docs/en/Themes/LeptonXLite/Blazor.md index 636c33ef28..269abe5952 100644 --- a/docs/en/Themes/LeptonXLite/Blazor.md +++ b/docs/en/Themes/LeptonXLite/Blazor.md @@ -122,6 +122,37 @@ builder.RootComponents.Add("#ApplicationContainer"); ## Customization +### Layout + +* Create a razor page, like `MyMainLayout.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +@using Volo.Abp.DependencyInjection + +@inherits MainLayout +@attribute [ExposeServices(typeof(MainLayout))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMainLayout.razor.cs`, in your blazor application as shown below: see below: + +```csharp +[ExposeServices(typeof(MainLayout))] +[Dependency(ReplaceServices = true) +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + public partial class MyMainLayout + { + public string Name = "My Main Layout"; + } +} +``` + +> Don't forget to repeated same attributes from the razor page! + ### Toolbars LeptonX Lite includes separeted toolbars for desktop & mobile. You can manage toolbars independently. Toolbar names can be accessible in the **LeptonXLiteToolbars** class. @@ -150,3 +181,283 @@ public async Task ConfigureToolbarAsync(IToolbarConfigurationContext context) > _You can visit the [Toolbars Documentation](https://docs.abp.io/en/abp/latest/UI/Blazor/Toolbars) for better understanding._ {{end}} + +## Components + +LeptonX Blazor built on the basis of components. You can use the components in your application as you wish, or you can customize components with overriding the components. If you want to override a component please follow the steps. + +### Branding Component + +The **brand component** is a simple component that can be used to display your brand. It contains a **logo** and a **company name**. + + + +* Create a razor page, like `MyBrandingComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +@using Volo.Abp.DependencyInjection + +@inherits Branding +@attribute [ExposeServices(typeof(Branding))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyBrandingComponent.razor.cs`, in your blazor application as shown below: see below: + +```csharp +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + public partial class MyBrandingComponent + { + public string Name = "My Branding Component"; + } +} +``` + +### Breadcrumb Component + +On websites that have a lot of pages, **breadcrumb navigation** can greatly **enhance the way users find their way** around. In terms of **usability**, breadcrumbs reduce the number of actions a website **visitor** needs to take in order to get to a **higher-level page**, and they **improve** the **findability** of **website sections** and **pages**. + + + +* Create a razor page, like `MyBreadcrumbsComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +@using Volo.Abp.DependencyInjection + +@inherits Breadcrumbs +@attribute [ExposeServices(typeof(Breadcrumbs))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyBreadcrumbsComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(Breadcrumbs))] + [Dependency(ReplaceServices = true)] + public partial class MyBreadcrumbsComponent + { + public string Name = "My Breadcrumbs Component"; + } +} +``` + +### Main Menu Component + +Sidebar menus have been used as **a directory for Related Pages** to a **Service** offering, **Navigation** items to a **specific service** or topic and even just as **Links** the user may be interested in. + + + +* Create a razor page, like `MyMainMenuComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Navigation; +@using Volo.Abp.DependencyInjection + +@inherits MainMenu +@attribute [ExposeServices(typeof(MainMenu))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMainMenu.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Navigation; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(MainMenu))] + [Dependency(ReplaceServices = true)] + public partial class MainMenu + { + public string Name = "My Main Menu Component"; + } +} +``` + +> The **main menu** renders menu items **dynamic**. The **menu item** is a **razor component** named `MainMenuItem.razor.cs` in the same namespace with **main menu** and you can **override it** like main menu. + +### Toolbar Items Component + +Toolbar items are used to add **extra functionality to the toolbar**. The toolbar is a **horizontal bar** that **contains** a group of **toolbar items**. + +* Create a razor page, like `MyToolbarItemsComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +@using Volo.Abp.DependencyInjection + +@inherits ToolbarItemsComponent +@attribute [ExposeServices(typeof(ToolbarItemsComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyToolbarItemsComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(ToolbarItemsComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyToolbarItemsComponent + { + public string Name = "My Toolbar Items Component"; + } +} +``` + +### Language Switch Component + +Think about a **multi-lingual** website and the first thing that could **hit your mind** is **the language switch component**. A **navigation bar** is a **great place** to **embed a language switch**. By embedding the language switch in the navigation bar of your website, you would **make it simpler** for users to **find it** and **easily** switch the **language** **without trying to locate it across the website.** + + + +* Create a razor page, like `MyLanguageSwitchComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +@using Volo.Abp.DependencyInjection + +@inherits LanguageSwitchComponent +@attribute [ExposeServices(typeof(LanguageSwitchComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyLanguageSwitchComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(LanguageSwitchComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyLanguageSwitchComponent + { + public string Name = "My Language Switch Component"; + } +} +``` + +### Mobile Language Switch Component + +The **mobile** **language switch component** is used to switch the language of the website **on mobile devices**. The mobile language switch component is a **dropdown menu** that **contains all the languages** of the website. + + + +* Create a razor page, like `MyMobilLanguageSwitchComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +@using Volo.Abp.DependencyInjection + +@inherits MobilLanguageSwitchComponent +@attribute [ExposeServices(typeof(MobilLanguageSwitchComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMobilLanguageSwitchComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(MobilLanguageSwitchComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyMobilLanguageSwitchComponent + { + public string Name = "My Mobil Language Switch Component"; + } +} +``` + +### User Menu Component + +The **User Menu** is the **menu** that **drops down** when you **click your name** or **profile picture** in the **upper right corner** of your page (**in the toolbar**). It drops down options such as **Settings**, **Logout**, etc. + + + +* Create a razor page, like `MyUserMenuComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +@using Volo.Abp.DependencyInjection + +@inherits MobilLanguageSwitchComponent +@attribute [ExposeServices(typeof(MobilLanguageSwitchComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyUserMenuComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(UserMenuComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyUserMenuComponent + { + public string Name = "My User Menu Component"; + } +} +``` + +### Mobile User Menu Component + +The **mobile user menu component** is used to display the **user menu on mobile devices**. The mobile user menu component is a **dropdown menu** that contains all the **options** of the **user menu**. + + + +* Create a razor page, like `MyMobileUserMenuComponent.razor`, in your blazor application as shown below: + +```html +@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +@using Volo.Abp.DependencyInjection + +@inherits MobilUserMenuComponent +@attribute [ExposeServices(typeof(MobilUserMenuComponent))] +@attribute [Dependency(ReplaceServices = true)] + +@Name +``` + +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMobileUserMenuComponent.razor.cs`, in your blazor application as shown below: +```csharp +using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Themes.LeptonXLite.Toolbar; +using Volo.Abp.DependencyInjection; + +namespace LeptonXLite.DemoApp.Blazor.MyComponents +{ + [ExposeServices(typeof(MobileUserMenuComponent))] + [Dependency(ReplaceServices = true)] + public partial class MyMobileUserMenuComponent + { + public string Name = "My Mobile User Menu Component"; + } +} +``` From 197fdce8c9d2ca68c375fd62c907c6b8e704539e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20Ali=20=C3=96ZKAYA?= Date: Fri, 9 Sep 2022 10:11:52 +0300 Subject: [PATCH 2/6] Refactor LeptonX Lite Blazor docs --- docs/en/Themes/LeptonXLite/Blazor.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/en/Themes/LeptonXLite/Blazor.md b/docs/en/Themes/LeptonXLite/Blazor.md index 269abe5952..9cbb81ea38 100644 --- a/docs/en/Themes/LeptonXLite/Blazor.md +++ b/docs/en/Themes/LeptonXLite/Blazor.md @@ -192,6 +192,8 @@ The **brand component** is a simple component that can be used to display your b +#### How to Override Branding Component + * Create a razor page, like `MyBrandingComponent.razor`, in your blazor application as shown below: ```html @@ -223,6 +225,8 @@ On websites that have a lot of pages, **breadcrumb navigation** can greatly **en +#### How to Override BreadCrumb Component + * Create a razor page, like `MyBreadcrumbsComponent.razor`, in your blazor application as shown below: ```html @@ -258,6 +262,8 @@ Sidebar menus have been used as **a directory for Related Pages** to a **Service +#### How to Override Main Menu Component + * Create a razor page, like `MyMainMenuComponent.razor`, in your blazor application as shown below: ```html @@ -293,6 +299,8 @@ namespace LeptonXLite.DemoApp.Blazor.MyComponents Toolbar items are used to add **extra functionality to the toolbar**. The toolbar is a **horizontal bar** that **contains** a group of **toolbar items**. +#### How to Override Toolbar Items Component + * Create a razor page, like `MyToolbarItemsComponent.razor`, in your blazor application as shown below: ```html @@ -328,6 +336,8 @@ Think about a **multi-lingual** website and the first thing that could **hit you +#### How to Override Language Switch Component + * Create a razor page, like `MyLanguageSwitchComponent.razor`, in your blazor application as shown below: ```html @@ -363,6 +373,8 @@ The **mobile** **language switch component** is used to switch the language of t +#### How to Override Mobile Language Switch Component + * Create a razor page, like `MyMobilLanguageSwitchComponent.razor`, in your blazor application as shown below: ```html @@ -398,6 +410,8 @@ The **User Menu** is the **menu** that **drops down** when you **click your name +#### How to Override User Menu Component + * Create a razor page, like `MyUserMenuComponent.razor`, in your blazor application as shown below: ```html @@ -433,6 +447,8 @@ The **mobile user menu component** is used to display the **user menu on mobile +#### How to override the Mobile User Menu Component + * Create a razor page, like `MyMobileUserMenuComponent.razor`, in your blazor application as shown below: ```html From 96f1446b9e6b68cea7656badd1ab3c2aad9e63b1 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 13 Sep 2022 15:29:15 +0800 Subject: [PATCH 3/6] Cache a `scope` with multiple `ApiResource`. Fix #13982 --- .../Volo/Abp/IdentityServer/ResourceStore.cs | 29 ++++++++++++------- .../ResourceStore_Cache_Tests.cs | 6 ++-- .../AbpIdentityServerTestDataBuilder.cs | 1 + 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs index 51862d7597..f9988a377e 100644 --- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs +++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/ResourceStore.cs @@ -31,6 +31,7 @@ public class ResourceStore : IResourceStore protected IDistributedCache IdentityResourceCache { get; } protected IDistributedCache ApiScopeCache { get; } protected IDistributedCache ApiResourceCache { get; } + protected IDistributedCache> ApiResourcesCache { get; } protected IDistributedCache ResourcesCache { get; } protected IdentityServerOptions Options { get; } @@ -42,6 +43,7 @@ public class ResourceStore : IResourceStore IDistributedCache identityResourceCache, IDistributedCache apiScopeCache, IDistributedCache apiResourceCache, + IDistributedCache> apiResourcesCache, IDistributedCache resourcesCache, IOptions options) { @@ -52,6 +54,7 @@ public class ResourceStore : IResourceStore IdentityResourceCache = identityResourceCache; ApiScopeCache = apiScopeCache; ApiResourceCache = apiResourceCache; + ApiResourcesCache = apiResourcesCache; ResourcesCache = resourcesCache; Options = options.Value; } @@ -91,16 +94,22 @@ public class ResourceStore : IResourceStore /// public virtual async Task> FindApiResourcesByScopeNameAsync(IEnumerable scopeNames) { - return (await GetCacheItemsAsync( - ApiResourceCache, - scopeNames, - async keys => await ApiResourceRepository.GetListByScopesAsync(keys, includeDetails: true), - (models, cacheKeyPrefix) => - { - return models - .Select(model => model.Scopes.Select(scope => new KeyValuePair(AddCachePrefix(scope, cacheKeyPrefix), model)).ToList()) - .Where(scopes => scopes.Any()).Cast>>().ToList(); - }, ApiResourceScopeNameCacheKeyPrefix)).DistinctBy(x => x.Name); + var cacheItems = await ApiResourcesCache.GetManyAsync(AddCachePrefix(scopeNames, ApiResourceScopeNameCacheKeyPrefix)); + if (cacheItems.All(x => x.Value != null)) + { + return cacheItems.SelectMany(x => x.Value).DistinctBy(x => x.Name); + } + + var otherKeys = RemoveCachePrefix(cacheItems.Where(x => x.Value == null).Select(x => x.Key), ApiResourceScopeNameCacheKeyPrefix).ToArray(); + var otherModels = ObjectMapper.Map, List>(await ApiResourceRepository.GetListByScopesAsync(otherKeys, includeDetails: true)); + + var otherCacheItems = otherKeys.Select(otherKey => new KeyValuePair>(AddCachePrefix(otherKey, ApiResourceScopeNameCacheKeyPrefix), otherModels)).ToList(); + await ApiResourcesCache.SetManyAsync(otherCacheItems, new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = Options.Caching.ClientStoreExpiration + }); + + return cacheItems.Where(x => x.Value != null).SelectMany(x => x.Value).Concat(otherModels).DistinctBy(x => x.Name); } /// diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs index b33b8aa580..20b8ff8689 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/ResourceStore_Cache_Tests.cs @@ -51,14 +51,14 @@ public class ResourceStore_Cache_Tests : AbpIdentityServerDomainTestBase { var apiResources1 = (await _resourceStore.FindApiResourcesByScopeNameAsync(new[] { "Test-ApiResource-ApiScope-Name-1" })).ToList(); apiResources1.ShouldNotBeEmpty(); - apiResources1.Count.ShouldBe(1); - apiResources1.First().Name.ShouldBe("Test-ApiResource-Name-1"); + apiResources1.Count.ShouldBe(2); + apiResources1.ShouldContain(x => x.Name == "Test-ApiResource-Name-1"); var apiResources2 = (await _resourceStore.FindApiResourcesByScopeNameAsync(new[] { "Test-ApiResource-ApiScope-Name-1", "Test-ApiResource-ApiScope-Name-2", nameof(ApiResourceScope.Scope) })).ToList(); apiResources2.ShouldNotBeEmpty(); apiResources2.Count.ShouldBe(2); apiResources2.ShouldContain(x => x.Name == "Test-ApiResource-Name-1"); - apiResources2.ShouldContain(x => x.Name == apiResources1.First().Name); + apiResources2.ShouldContain(x => x.Name == "NewApiResource1"); } [Fact] diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs index eaf8aabf58..e6344f9c6f 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestDataBuilder.cs @@ -87,6 +87,7 @@ public class AbpIdentityServerTestDataBuilder : ITransientDependency apiResource.DisplayName = nameof(apiResource.DisplayName); apiResource.AddScope(nameof(ApiResourceScope.Scope)); + apiResource.AddScope("Test-ApiResource-ApiScope-Name-1"); apiResource.AddUserClaim(nameof(ApiResourceClaim.Type)); apiResource.AddSecret(nameof(ApiResourceSecret.Value)); From a3e8d4e92367a9b9c8bdfc7f4534177aa0a91d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 14 Sep 2022 09:53:34 +0300 Subject: [PATCH 4/6] Set Dapr HttpEndpoint only if provided Otherwise, the default value will be used and fine for most scenarios. --- .../Volo/Abp/Http/Client/Dapr/AbpInvocationHandler.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpInvocationHandler.cs b/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpInvocationHandler.cs index a3397b55e4..e13c6dbb04 100644 --- a/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpInvocationHandler.cs +++ b/framework/src/Volo.Abp.Http.Client.Dapr/Volo/Abp/Http/Client/Dapr/AbpInvocationHandler.cs @@ -9,6 +9,9 @@ public class AbpInvocationHandler : InvocationHandler, ITransientDependency { public AbpInvocationHandler(IOptions daprOptions) { - DaprEndpoint = daprOptions.Value.HttpEndpoint; + if (!daprOptions.Value.HttpEndpoint.IsNullOrWhiteSpace()) + { + DaprEndpoint = daprOptions.Value.HttpEndpoint; + } } } \ No newline at end of file From 0518ba48be3c3754d53e32b3ad2f2eef3079c140 Mon Sep 17 00:00:00 2001 From: Hamza Albreem <94292623+braim23@users.noreply.github.com> Date: Wed, 14 Sep 2022 11:01:14 +0300 Subject: [PATCH 5/6] quick fix --- docs/en/Themes/LeptonXLite/Blazor.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/en/Themes/LeptonXLite/Blazor.md b/docs/en/Themes/LeptonXLite/Blazor.md index 9cbb81ea38..0e32aa9825 100644 --- a/docs/en/Themes/LeptonXLite/Blazor.md +++ b/docs/en/Themes/LeptonXLite/Blazor.md @@ -137,7 +137,7 @@ builder.RootComponents.Add("#ApplicationContainer"); @Name ``` -* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMainLayout.razor.cs`, in your blazor application as shown below: see below: +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyMainLayout.razor.cs`, in your blazor application as shown below: ```csharp [ExposeServices(typeof(MainLayout))] @@ -151,7 +151,7 @@ namespace LeptonXLite.DemoApp.Blazor.MyComponents } ``` -> Don't forget to repeated same attributes from the razor page! +> Don't forget to remove the repeated attributes from the razor page! ### Toolbars LeptonX Lite includes separeted toolbars for desktop & mobile. You can manage toolbars independently. Toolbar names can be accessible in the **LeptonXLiteToolbars** class. @@ -184,7 +184,7 @@ public async Task ConfigureToolbarAsync(IToolbarConfigurationContext context) ## Components -LeptonX Blazor built on the basis of components. You can use the components in your application as you wish, or you can customize components with overriding the components. If you want to override a component please follow the steps. +LeptonX Blazor is built on the basis of components. You can use the components in your application as you wish, or you can customize the components by overriding them. If you want to override a component please follow the steps. ### Branding Component @@ -207,7 +207,7 @@ The **brand component** is a simple component that can be used to display your b @Name ``` -* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyBrandingComponent.razor.cs`, in your blazor application as shown below: see below: +* If you prefer to use a code-behind file for the C# code of your component, create a razor component, like `MyBrandingComponent.razor.cs`, in your blazor application as shown below: ```csharp namespace LeptonXLite.DemoApp.Blazor.MyComponents @@ -225,7 +225,7 @@ On websites that have a lot of pages, **breadcrumb navigation** can greatly **en -#### How to Override BreadCrumb Component +#### How to Override the BreadCrumb Component * Create a razor page, like `MyBreadcrumbsComponent.razor`, in your blazor application as shown below: @@ -258,11 +258,11 @@ namespace LeptonXLite.DemoApp.Blazor.MyComponents ### Main Menu Component -Sidebar menus have been used as **a directory for Related Pages** to a **Service** offering, **Navigation** items to a **specific service** or topic and even just as **Links** the user may be interested in. +Sidebar menus have been used as **a directory for Related Pages** for a **Service** offering, **Navigation** items for a **specific service** or topic and even just as **Links** the user may be interested in. -#### How to Override Main Menu Component +#### How to Override the Main Menu Component * Create a razor page, like `MyMainMenuComponent.razor`, in your blazor application as shown below: @@ -293,13 +293,13 @@ namespace LeptonXLite.DemoApp.Blazor.MyComponents } ``` -> The **main menu** renders menu items **dynamic**. The **menu item** is a **razor component** named `MainMenuItem.razor.cs` in the same namespace with **main menu** and you can **override it** like main menu. +> The **main menu** renders the menu items **dynamically**. The **menu item** is a **razor component** named `MainMenuItem.razor.cs` in the same namespace with **main menu** and you can **override it** like the main menu. ### Toolbar Items Component Toolbar items are used to add **extra functionality to the toolbar**. The toolbar is a **horizontal bar** that **contains** a group of **toolbar items**. -#### How to Override Toolbar Items Component +#### How to Override the Toolbar Items Component * Create a razor page, like `MyToolbarItemsComponent.razor`, in your blazor application as shown below: @@ -336,7 +336,7 @@ Think about a **multi-lingual** website and the first thing that could **hit you -#### How to Override Language Switch Component +#### How to Override the Language Switch Component * Create a razor page, like `MyLanguageSwitchComponent.razor`, in your blazor application as shown below: @@ -373,7 +373,7 @@ The **mobile** **language switch component** is used to switch the language of t -#### How to Override Mobile Language Switch Component +#### How to Override the Mobile Language Switch Component * Create a razor page, like `MyMobilLanguageSwitchComponent.razor`, in your blazor application as shown below: @@ -399,7 +399,7 @@ namespace LeptonXLite.DemoApp.Blazor.MyComponents [Dependency(ReplaceServices = true)] public partial class MyMobilLanguageSwitchComponent { - public string Name = "My Mobil Language Switch Component"; + public string Name = "My Mobile Language Switch Component"; } } ``` @@ -410,7 +410,7 @@ The **User Menu** is the **menu** that **drops down** when you **click your name -#### How to Override User Menu Component +#### How to Override the User Menu Component * Create a razor page, like `MyUserMenuComponent.razor`, in your blazor application as shown below: From 62165449dd6c6c3ace57e2b264ad4f2abcc521f8 Mon Sep 17 00:00:00 2001 From: maliming Date: Thu, 15 Sep 2022 10:39:52 +0800 Subject: [PATCH 6/6] Fix Identity Server unit tests. --- .../Cache/IdentityServerCacheItemInvalidator_Tests.cs | 9 ++++++--- .../Clients/IdentityResourceStore_Tests.cs | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs index 6d0b8a3b19..a464fcc75f 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Cache/IdentityServerCacheItemInvalidator_Tests.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading.Tasks; using IdentityServer4.Models; using IdentityServer4.Services; using IdentityServer4.Stores; @@ -28,6 +29,7 @@ public class IdentityServerCacheItemInvalidator_Tests : AbpIdentityServerTestBas private readonly IDistributedCache _clientCache; private readonly IDistributedCache _identityResourceCache; + private readonly IDistributedCache> _apiResourcesCache; private readonly IDistributedCache _apiResourceCache; private readonly IDistributedCache _apiScopeCache; private readonly IDistributedCache _resourceCache; @@ -46,6 +48,7 @@ public class IdentityServerCacheItemInvalidator_Tests : AbpIdentityServerTestBas _clientCache = GetRequiredService>(); _identityResourceCache = GetRequiredService>(); + _apiResourcesCache = GetRequiredService>>(); _apiResourceCache = GetRequiredService>(); _apiScopeCache = GetRequiredService>(); _resourceCache = GetRequiredService>(); @@ -93,9 +96,9 @@ public class IdentityServerCacheItemInvalidator_Tests : AbpIdentityServerTestBas (await _apiResourceCache.GetAsync(newApiResource2)).ShouldBeNull(); //FindApiResourcesByScopeNameAsync - (await _apiResourceCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldBeNull(); + (await _apiResourcesCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldBeNull(); await _resourceStore.FindApiResourcesByScopeNameAsync(new[] { testApiResourceApiScopeName1 }); - (await _apiResourceCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldNotBeNull(); + (await _apiResourcesCache.GetAsync(ResourceStore.ApiResourceScopeNameCacheKeyPrefix + testApiResourceApiScopeName1)).ShouldNotBeNull(); var testApiResource1 = await _apiResourceRepository.FindByNameAsync(testApiResourceName1); await _apiResourceRepository.DeleteAsync(testApiResource1); diff --git a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs index c54c99e88d..27e3b04c5a 100644 --- a/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs +++ b/modules/identityserver/test/Volo.Abp.IdentityServer.Domain.Tests/Volo/Abp/IdentityServer/Clients/IdentityResourceStore_Tests.cs @@ -51,9 +51,9 @@ public class IdentityResourceStore_Tests : AbpIdentityServerTestBase })).ToList(); //Assert - apiResources.ShouldNotBe(null); + apiResources.ShouldNotBeNull(); - apiResources[0].Scopes.Count.ShouldBe(4); + apiResources.ShouldContain(x => x.Scopes.Contains("Test-ApiResource-ApiScope-Name-1")); } [Fact]