Skip to content

Commit

Permalink
Merge pull request #337 from NeoCoderMatrix86/305-error-boundary-relo…
Browse files Browse the repository at this point in the history
…ad-link-doesnt-work

Error boundary reload link doesnt work
  • Loading branch information
NeoCoderMatrix86 authored Apr 8, 2024
2 parents e74a2d6 + ffbf649 commit 773f6b1
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
- uses: actions/[email protected]

# sets up .NET
# version can be found here https://dotnet.microsoft.com/en-us/download/dotnet/7.0
# version can be found here https://dotnet.microsoft.com/en-us/download/dotnet/8.0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.101'
dotnet-version: '8.0.203'

- name: Install wasm-tools
run: dotnet workload install wasm-tools-net7
run: dotnet workload install wasm-tools

# Only publish when unit tests are ok
- name: Run Unit Tests
Expand Down
24 changes: 12 additions & 12 deletions AudioCuesheetEditor/AudioCuesheetEditor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -96,19 +96,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap5" Version="1.1.5" />
<PackageReference Include="MetaBrainz.MusicBrainz" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.1" PrivateAssets="all" />
<PackageReference Include="Blazorise.Bootstrap5" Version="1.5.1" />
<PackageReference Include="MetaBrainz.MusicBrainz" Version="6.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.3" PrivateAssets="all" />
<PackageReference Include="BlazorDownloadFile" Version="2.4.0.2" />
<PackageReference Include="Blazorise.Components" Version="1.1.5" />
<PackageReference Include="Blazorise.Components" Version="1.5.1" />
<PackageReference Include="Howler.Blazor" Version="0.9.8" />
<PackageReference Include="Markdig" Version="0.30.4" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="7.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />
<PackageReference Include="Toolbelt.Blazor.HotKeys2" Version="1.0.0" />
<PackageReference Include="z440.atl.core" Version="4.17.0" />
<PackageReference Include="Markdig" Version="0.36.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
<PackageReference Include="Toolbelt.Blazor.HotKeys2" Version="4.0.0" />
<PackageReference Include="z440.atl.core" Version="5.21.0" />
</ItemGroup>

</Project>
6 changes: 4 additions & 2 deletions AudioCuesheetEditor/Resources/Localization/MainLayout/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"translations": {
"About": "Über",
"An error occured": "Ein Fehler ist aufgetreten!",
"An error has occured in this applciation. Please report this error with as much details as possible here. Afterwards you can reload the application.": "Es ist ein Fehler in der Anwendung aufgetreten. Bitte melden Sie diesen Fehler unter Angabe von möglichst vielen Details hier: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>. Anschließend können Sie die Anwendung <a href=\"\" class=\"reload\">neu laden</a>.",
"An error has occured in this application. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>.": "Es ist ein Fehler in der Anwendung aufgetreten. Bitte melden Sie diesen Fehler unter Angabe von möglichst vielen Details hier: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>.",
"Help": "Hilfe",
"Undo last change": "Letzte Änderung Rückgängig machen",
"Redo last change": "Letzte Änderung wiederherstellen",
Expand Down Expand Up @@ -69,6 +69,8 @@
"Length": "Länge",
"Flags": "Markierungen",
"PreGap": "Vorlücke",
"PostGap": "Nachlücke"
"PostGap": "Nachlücke",
"Error details": "Fehlerdetails",
"Reload application": "Applikation neu laden"
}
}
6 changes: 4 additions & 2 deletions AudioCuesheetEditor/Resources/Localization/MainLayout/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"translations": {
"About": "About",
"An error occured": "An error has occured!",
"An error has occured in this applciation. Please report this error with as much details as possible here. Afterwards you can reload the application.": "An error has occured in this applciation. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>. Afterwards you can <a href=\"\" class=\"reload\">reload</a> the application.",
"An error has occured in this application. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>.": "An error has occured in this application. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>.",
"Help": "Help",
"Undo last change": "Undo last change",
"Redo last change": "Redo last change",
Expand Down Expand Up @@ -69,6 +69,8 @@
"Length": "Length",
"Flags": "Flags",
"PreGap": "Pregap",
"PostGap": "Postgap"
"PostGap": "Postgap",
"Error details": "Error details",
"Reload application": "Reload application"
}
}
16 changes: 12 additions & 4 deletions AudioCuesheetEditor/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,11 @@ along with Foobar. If not, see
</CascadingValue>
</ChildContent>
<ErrorContent>
<Heading Size="HeadingSize.Is3" TextColor="TextColor.Danger">@_localizer["An error occured"]</Heading>
<Paragraph>@((MarkupString)_localizer["An error has occured in this applciation. Please report this error with as much details as possible here. Afterwards you can reload the application."])</Paragraph>
<Heading Size="HeadingSize.Is2" TextColor="TextColor.Danger">@_localizer["An error occured"]</Heading>
<Paragraph>@((MarkupString)_localizer["An error has occured in this application. Please report this error with as much details as possible here: <a href=\"https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=bug&template=bug_report.md&title=\" target=\"_blank\">https://github.com/NeoCoderMatrix86/AudioCuesheetEditor/issues/new?assignees=&labels=unreviewed+bug&template=bug_report.md&title=</a>."])</Paragraph>
<Heading Size="HeadingSize.Is4">@_localizer["Error details"]</Heading>
<Paragraph>@context</Paragraph>
<Button Color="Color.Primary" Clicked="ReloadApplication">@_localizer["Reload application"]</Button>
</ErrorContent>
</ErrorBoundary>

Expand Down Expand Up @@ -560,8 +563,7 @@ along with Foobar. If not, see
{
_logger.LogInformation("restartApplicationDelegate");
modalDialog.Confirmed -= restartApplicationDelegate;
await _jsRuntime.InvokeVoidAsync("removeBeforeunload");
_navigationManager.NavigateTo(_navigationManager.Uri, true);
await ReloadApplication();
};
modalDialog.Confirmed += restartApplicationDelegate;
await modalDialog.ShowModal();
Expand Down Expand Up @@ -844,4 +846,10 @@ along with Foobar. If not, see
}
return Task.CompletedTask;
}

async Task ReloadApplication()
{
await _jsRuntime.InvokeVoidAsync("removeBeforeunload");
_navigationManager.NavigateTo(_navigationManager.Uri, true);
}
}
10 changes: 5 additions & 5 deletions AudioCuesheetEditorTests/AudioCuesheetEditorTests.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.2.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.2.2" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions netlify/build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env bash
set -e

## install latest .NET 7.0 release
## install latest .NET 8.0 release
pushd /tmp
wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
chmod u+x /tmp/dotnet-install.sh
/tmp/dotnet-install.sh --channel 7.0
/tmp/dotnet-install.sh --channel 8.0
popd

## Install wasm-tools
Expand Down

0 comments on commit 773f6b1

Please sign in to comment.