diff --git a/.github/workflows/bit.full.ci.yml b/.github/workflows/bit.full.ci.yml index c08e74098e..7a280315f2 100644 --- a/.github/workflows/bit.full.ci.yml +++ b/.github/workflows/bit.full.ci.yml @@ -58,6 +58,7 @@ jobs: - name: Simple tests (no --advancedTests) id: simple-test + continue-on-error: true run: | dotnet new bit-bp --name SimpleTest --database Sqlite --framework net8.0 cd SimpleTest/src/Server/SimpleTest.Server.Api/ @@ -79,6 +80,7 @@ jobs: - name: Test Sqlite database option id: sqlite-test + continue-on-error: true run: | dotnet new bit-bp --name TestSqlite --database Sqlite --advancedTests --framework net9.0 cd TestSqlite/src/Server/TestSqlite.Server.Api/ @@ -101,6 +103,7 @@ jobs: - name: Test SqlServer database option id: sqlserver-test + continue-on-error: true run: | dotnet new bit-bp --name TestSqlServer --database SqlServer --advancedTests --framework net8.0 cd TestSqlServer/src/Server/TestSqlServer.Server.Api/ @@ -121,6 +124,7 @@ jobs: - name: Test Multilingual disabled option id: multilingual-disabled-test + continue-on-error: true run: | dotnet new bit-bp --name MultilingualDisabled --database Sqlite --advancedTests --framework net8.0 cd MultilingualDisabled/src/Server/MultilingualDisabled.Server.Api/ diff --git a/README.md b/README.md index d0ffb560b2..e6111238e8 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![License](https://img.shields.io/github/license/bitfoundation/bitplatform.svg) ![CI Status](https://github.com/bitfoundation/bitplatform/actions/workflows/bit.ci.yml/badge.svg) ![NuGet version](https://img.shields.io/nuget/v/bit.blazorui.svg?logo=nuget) -[![Nuget downloads](https://img.shields.io/badge/packages_download-5.5M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation) +[![Nuget downloads](https://img.shields.io/badge/packages_download-5.6M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/bitfoundation/bitplatform.svg)](http://isitmaintained.com/project/bitfoundation/bitplatform "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/bitfoundation/bitplatform.svg)](http://isitmaintained.com/project/bitfoundation/bitplatform "Percentage of issues still open") diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitActionButton/BitActionButton.razor b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitActionButton/BitActionButton.razor index ff0059f783..30002ad6bf 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitActionButton/BitActionButton.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Buttons/BitActionButton/BitActionButton.razor @@ -31,6 +31,7 @@ else { - [Parameter] public string? Href { get; set; } + [Parameter] + [CallOnSet(nameof(OnSetHrefAndRel))] + public string? Href { get; set; } /// /// The icon name of the icon to render inside the button. @@ -90,6 +93,13 @@ public partial class BitActionButton : BitComponentBase [Parameter, ResetClassBuilder] public bool ReversedIcon { get; set; } + /// + /// If Href provided, specifies the relationship between the current document and the linked document. + /// + [Parameter] + [CallOnSet(nameof(OnSetHrefAndRel))] + public BitLinkRel? Rel { get; set; } + /// /// The size of the button. /// @@ -172,4 +182,15 @@ protected virtual async Task HandleOnClick(MouseEventArgs e) await OnClick.InvokeAsync(e); } } + + private void OnSetHrefAndRel() + { + if (Rel.HasValue is false || Href.HasNoValue() || Href!.StartsWith('#')) + { + _rel = null; + return; + } + + _rel = BitLinkRelUtils.GetRels(Rel.Value); + } } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor index 74944fa146..8f134e5109 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor @@ -38,7 +38,23 @@ - + + +
Use BitActionButton as a hyperlink to external URLs, with a rel attribute.
+
+
+ + Open bitplatform.dev with a rel attribute (nofollow) + + + + Open bitplatform.dev with a rel attribute (nofollow & noreferrer) + +
+
+
+ +
Demonstrates BitActionButton with various predefined colors: Primary, Secondary, Tertiary, Info, Success, Warning, SevereWarning, and Error.

@@ -133,7 +149,7 @@
- +
Show BitActionButton in different sizes: Small, Medium, and Large.

@@ -145,7 +161,7 @@
- +
Customize the appearance of BitActionButton using styles and CSS classes.

@@ -167,7 +183,7 @@
- +
Add custom template within BitActionButton.

@@ -182,7 +198,7 @@
- +
Use BitActionButton within a form and validate its state.

@@ -214,7 +230,7 @@
- +
Use BitActionButton in right-to-left (RTL).

diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor.cs index 21ac7dcb05..9c4b43558f 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor.cs @@ -110,6 +110,15 @@ public partial class BitActionButtonDemo Description = "Reverses the positions of the icon and the content of the button.", }, new() + { + Name = "Rel", + Type = "BitLinkRel?", + DefaultValue = "null", + Description = "If Href provided, specifies the relationship between the current document and the linked document.", + LinkType = LinkType.Link, + Href = "#button-rel", + }, + new() { Name = "Size", Type = "BitSize?", @@ -334,5 +343,92 @@ public partial class BitActionButtonDemo } ] }, + new() + { + Id = "button-rel", + Name = "BitLinkRel", + Description = "", + Items = + [ + new() + { + Name = "Alternate", + Value = "1", + Description = "Provides a link to an alternate representation of the document. (i.e. print page, translated or mirror)" + }, + new() + { + Name = "Author", + Value = "2", + Description = "Provides a link to the author of the document." + }, + new() + { + Name = "Bookmark", + Value = "4", + Description = "Permanent URL used for bookmarking." + }, + new() + { + Name = "External", + Value = "8", + Description = "Indicates that the referenced document is not part of the same site as the current document." + }, + new() + { + Name = "Help", + Value = "16", + Description = "Provides a link to a help document." + }, + new() + { + Name = "License", + Value = "32", + Description = "Provides a link to licensing information for the document." + }, + new() + { + Name = "Next", + Value = "64", + Description = "Provides a link to the next document in the series." + }, + new() + { + Name = "NoFollow", + Value = "128", + Description = @"Links to an unendorsed document, like a paid link. (""NoFollow"" is used by Google, to specify that the Google search spider should not follow that link)" + }, + new() + { + Name = "NoOpener", + Value = "256", + Description = "Requires that any browsing context created by following the hyperlink must not have an opener browsing context." + }, + new() + { + Name = "NoReferrer", + Value = "512", + Description = "Makes the referrer unknown. No referrer header will be included when the user clicks the hyperlink." + }, + new() + { + Name = "Prev", + Value = "1024", + Description = "The previous document in a selection." + }, + new() + { + Name = "Search", + Value = "2048", + Description = "Links to a search tool for the document." + }, + new() + { + Name = "Tag", + Value = "4096", + Description = "A tag (keyword) for the current document." + } + ] + }, ]; } diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor.samples.cs b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor.samples.cs index 719f683bd4..6de91030ef 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor.samples.cs +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/BitActionButtonDemo.razor.samples.cs @@ -18,6 +18,15 @@ Go to bitplatform GitHub "; private readonly string example3RazorCode = @" + + Open bitplatform.dev with a rel attribute (nofollow) + + + + Open bitplatform.dev with a rel attribute (nofollow & noreferrer) +"; + + private readonly string example4RazorCode = @" Primary Primary @@ -69,12 +78,12 @@ Go to bitplatform GitHub TertiaryBorder TertiaryBorder"; - private readonly string example4RazorCode = @" + private readonly string example5RazorCode = @" Small Medium Large"; - private readonly string example5RazorCode = @" + private readonly string example6RazorCode = @"