Skip to content

Commit

Permalink
Merge pull request #9541 from bitfoundation/develop
Browse files Browse the repository at this point in the history
Version 9.1.2 (#9539)
  • Loading branch information
msynk authored Dec 24, 2024
2 parents 6c529e1 + 634f534 commit 521f7c5
Show file tree
Hide file tree
Showing 135 changed files with 3,789 additions and 1,659 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/admin-sample.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,56 @@ jobs:
path: ${{env.DOTNET_ROOT}}/server
include-hidden-files: true # Required for wwwroot/.well-known folder

deploy_blazor_wasm_standalone:
name: build blazor wasm standalone
runs-on: ubuntu-24.04

steps:

- name: Checkout source code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json

- name: Create project from Boilerplate
run: |
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'AdminPanel/src/Shared/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Core/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.Production.json'
env:
ServerAddress: ${{ env.SERVER_ADDRESS }}
Logging.Sentry.Dsn: ${{ secrets.ADMINPANEL_SENTRY_DSN }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
AdsPushVapid.PublicKey: ${{ secrets.ADMINPANEL_PUBLIC_VAPIDKEY }}
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Install wasm
run: cd src && dotnet workload install wasm-tools

- name: Generate CSS/JS files
run: dotnet build AdminPanel/src/Client/AdminPanel.Client.Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" --no-restore -c Release

- name: Publish
run: dotnet publish AdminPanel/src/Client/AdminPanel.Client.Web/AdminPanel.Client.Web.csproj -c Release -p:PwaEnabled=true -o ${{env.DOTNET_ROOT}}/client -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}"

- name: Upload to asw
run: |
npm install -g @azure/static-web-apps-cli
swa deploy --deployment-token ${{ secrets.ADMINPANEL_ASW_TOKEN }} --env production --app-location ${{env.DOTNET_ROOT}}/client/wwwroot
deploy_api_blazor:
name: deploy api + blazor
needs: build_api_blazor
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/bit.full.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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/
Expand All @@ -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/
Expand All @@ -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/
Expand All @@ -139,6 +143,7 @@ jobs:
retention-days: 14

- name: Test PostgreSQL, MySql, Other database options
continue-on-error: true
run: |
dotnet new bit-bp --name TestPostgreSQL --database PostgreSQL --framework net8.0 --signalR
cd TestPostgreSQL/src/Server/TestPostgreSQL.Server.Api/
Expand All @@ -153,6 +158,7 @@ jobs:
dotnet build
- name: Test file storage options
continue-on-error: true
run: |
dotnet new bit-bp --name TestLocal --filesStorage Local --framework net8.0 --appInsights
cd TestLocal/src/Server/TestLocal.Server.Api/
Expand All @@ -163,6 +169,7 @@ jobs:
dotnet build
- name: Test backend setup options
continue-on-error: true
run: |
dotnet new bit-bp --name TestStandalone --api Standalone --framework net8.0
cd TestStandalone/src/Server/TestStandalone.Server.Api/
Expand All @@ -176,11 +183,13 @@ jobs:
dotnet build
- name: Test sample configuration 1
continue-on-error: true
run: |
dotnet new bit-bp --name TestProject --database SqlServer --filesStorage AzureBlobStorage --api Integrated --captcha reCaptcha --pipeline Azure --sample Admin --offlineDb --windows --appInsights --sentry --signalR --notification --framework net9.0
dotnet build TestProject/TestProject.sln -p:MultilingualEnabled=true -p:PwaEnabled=true -p:Environment=Staging
- name: Test sample configuration 2
continue-on-error: true
run: |
dotnet new bit-bp --name TestProject2 --database Other --filesStorage Other --api Standalone --captcha None --pipeline None --sample None --offlineDb false --windows false --appInsights false --sentry false --signalR false --notification false --framework net8.0
dotnet build TestProject2/TestProject2.sln -p:MultilingualEnabled=false -p:PwaEnabled=false -p:Environment=Development
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/todo-sample.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,53 @@ jobs:
CLOUDFLARE_ZONE: ${{ secrets.BITPLATFORM_DEV_CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}

deploy_blazor_wasm_standalone:
name: build blazor wasm standalone
runs-on: ubuntu-24.04

steps:

- name: Checkout source code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json

- name: Create project from Boilerplate
run: |
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'TodoSample/src/Shared/appsettings.json, TodoSample/src/Client/TodoSample.Client.Core/appsettings.json, TodoSample/src/Client/TodoSample.Client.Web/appsettings.json, TodoSample/src/Client/TodoSample.Client.Web/appsettings.Production.json'
env:
ServerAddress: ${{ env.SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Install wasm
run: cd src && dotnet workload install wasm-tools

- name: Generate CSS/JS files
run: dotnet build TodoSample/src/Client/TodoSample.Client.Core/TodoSample.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" --no-restore -c Release

- name: Publish
run: dotnet publish TodoSample/src/Client/TodoSample.Client.Web/TodoSample.Client.Web.csproj -c Release -p:PwaEnabled=true -o ${{env.DOTNET_ROOT}}/client -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" -p:RunAOTCompilation=true -p:MultilingualEnabled=false

- name: Upload to asw
run: |
npm install -g @azure/static-web-apps-cli
swa deploy --deployment-token ${{ secrets.TODO_ASW_TOKEN }} --env production --app-location ${{env.DOTNET_ROOT}}/client/wwwroot
build_blazor_hybrid_windows:
name: build blazor hybrid (windows)
runs-on: windows-2022
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -47,7 +47,9 @@ The following apps are our open-source projects powered by the bit platform show
1. [bitplatform.dev](https://bitplatform.dev): .NET 9 Pre-rendered SPA with Blazor WebAssembly
2. [blazorui.bitplatform.dev](https://blazorui.bitplatform.dev): .NET 9 Pre-rendered PWA with Blazor WebAssembly
3. [todo.bitplatform.dev](https://todo.bitplatform.dev): .NET 8 Pre-rendered PWA with Blazor WebAssembly
5. [adminpanel.bitplatform.dev](https://adminpanel.bitplatform.dev): .NET 9 PWA with Blazor WebAssembly Standalone (Hosted on Cloudflare Pages)
5. [adminpanel.bitplatform.dev](https://adminpanel.bitplatform.dev): .NET 9 PWA with Blazor WebAssembly
6. [adminpanel.bitplatform.cc](https://adminpanel.bitplatform.cc): .NET 9 PWA with Blazor WebAssembly Standalone (Free Azure static web app)
7. [todo.bitplatform.cc](https://todo.bitplatform.cc): AOT Compiled .NET 9 PWA with Blazor WebAssembly Standalone (Free Azure static web app)

[Todo](https://todo.bitplatform.dev) & [Adminpanel](https://adminpanel.bitplatform.dev) web apps will launch their respective Android and iOS applications if you have already installed them, mirroring the behavior of apps like YouTube and Instagram.

Expand Down
2 changes: 1 addition & 1 deletion src/Besql/Bit.Besql/wwwroot/bit-besql.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var BitBesql = window.BitBesql || {};
BitBesql.version = window['bit-besql version'] = '9.1.1';
BitBesql.version = window['bit-besql version'] = '9.1.2';

BitBesql.init = async function init(fileName) {
const sqliteFilePath = `/${fileName}`;
Expand Down
2 changes: 1 addition & 1 deletion src/Bit.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<PackageProjectUrl>https://github.com/bitfoundation/bitplatform</PackageProjectUrl>

<!-- Version -->
<ReleaseVersion>9.1.1</ReleaseVersion>
<ReleaseVersion>9.1.2</ReleaseVersion>
<PackageVersion>$(ReleaseVersion)</PackageVersion>
<PackageReleaseNotes>https://github.com/bitfoundation/bitplatform/releases/tag/v-$(ReleaseVersion)</PackageReleaseNotes>
<Version Condition=" '$(Configuration)' == 'Release' ">$([System.String]::Copy($(ReleaseVersion)).Replace('-pre-', '.'))</Version>
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorUI/Bit.BlazorUI.Tests/Bit.BlazorUI.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="bunit.web" Version="1.36.0" />
<PackageReference Include="bunit.web" Version="1.37.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ else
{
<a @ref="RootElement" @attributes="HtmlAttributes" @onclick="HandleOnClick"
id="@_Id"
rel="@_rel"
style="@StyleBuilder.Value"
class="@ClassBuilder.Value"
dir="@Dir?.ToString().ToLower()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace Bit.BlazorUI;

public partial class BitActionButton : BitComponentBase
{
private string? _rel;
private int? _tabIndex;
private BitButtonType _buttonType;

Expand Down Expand Up @@ -62,7 +63,9 @@ public partial class BitActionButton : BitComponentBase
/// The value of the href attribute of the link rendered by the button.
/// If provided, the component will be rendered as an anchor tag instead of button.
/// </summary>
[Parameter] public string? Href { get; set; }
[Parameter]
[CallOnSet(nameof(OnSetHrefAndRel))]
public string? Href { get; set; }

/// <summary>
/// The icon name of the icon to render inside the button.
Expand Down Expand Up @@ -90,6 +93,13 @@ public partial class BitActionButton : BitComponentBase
[Parameter, ResetClassBuilder]
public bool ReversedIcon { get; set; }

/// <summary>
/// If Href provided, specifies the relationship between the current document and the linked document.
/// </summary>
[Parameter]
[CallOnSet(nameof(OnSetHrefAndRel))]
public BitLinkRel? Rel { get; set; }

/// <summary>
/// The size of the button.
/// </summary>
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
tabindex="@(isEnabled ? 0 : -1)"
disabled="@(isEnabled is false)"
aria-disabled="@(isEnabled is false)"
title="@GetItemTitle(item)"
style="@GetStyle(item)"
class="bit-btg-itm @GetClass(item)">
class="@GetItemClass(item)">
@if (template is not null)
{
@template(item)
Expand All @@ -33,12 +34,17 @@
}
else
{
var iconName = GetIconName(item);
var iconName = GetItemIconName(item);
@if (iconName.HasValue())
{
<i class="bit-icon bit-icon--@iconName" />
}
<span class="bit-btg-btx">@GetText(item)</span>

var text = GetItemText(item);
if (text.HasValue())
{
<span class="bit-btg-btx">@text</span>
}
}
</button>
}
Expand Down
Loading

0 comments on commit 521f7c5

Please sign in to comment.