diff --git a/src/Money.Blazor.Host/Components/PwaUpdate.razor b/src/Money.Blazor.Host/Components/PwaUpdate.razor index d0513e8c..96e7802f 100644 --- a/src/Money.Blazor.Host/Components/PwaUpdate.razor +++ b/src/Money.Blazor.Host/Components/PwaUpdate.razor @@ -3,7 +3,7 @@ - <div class="mt-4"> + <div class="my-4"> <button class="btn btn-primary" @onclick="(async () => Commands.HandleAsync(new UpdatePwa()))"> Activate the update </button> @@ -11,6 +11,8 @@ Leave it for the next time </button> </div> + + @ReleaseNotes </LayoutView> } else diff --git a/src/Money.Blazor.Host/Components/PwaUpdate.razor.cs b/src/Money.Blazor.Host/Components/PwaUpdate.razor.cs index ef50a0ee..83e72c11 100644 --- a/src/Money.Blazor.Host/Components/PwaUpdate.razor.cs +++ b/src/Money.Blazor.Host/Components/PwaUpdate.razor.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components; using Money.Events; +using Money.Services; using Neptuo.Commands; using Neptuo.Events; using Neptuo.Events.Handlers; @@ -7,6 +8,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Net.Http; using System.Text; using System.Threading.Tasks; @@ -15,22 +17,29 @@ namespace Money.Components public partial class PwaUpdate : IDisposable, IEventHandler<PwaUpdateable> { + private readonly HttpClient http = new HttpClient(); + [Inject] protected IEventHandlerCollection EventHandlers { get; set; } [Inject] protected ICommandDispatcher Commands { get; set; } + [Inject] + protected Navigator Navigator { get; set; } + [Parameter] public RenderFragment ChildContent { get; set; } protected bool IsUpdateable { get; set; } + protected MarkupString ReleaseNotes { get; set; } protected override void OnInitialized() { base.OnInitialized(); EventHandlers.Add<PwaUpdateable>(this); + http.BaseAddress = new Uri(Navigator.UrlOrigin()); } public void Dispose() @@ -38,11 +47,13 @@ public void Dispose() EventHandlers.Remove<PwaUpdateable>(this); } - Task IEventHandler<PwaUpdateable>.HandleAsync(PwaUpdateable payload) + async Task IEventHandler<PwaUpdateable>.HandleAsync(PwaUpdateable payload) { IsUpdateable = true; + + ReleaseNotes = new MarkupString(await http.GetStringAsync("/release-notes.html")); + StateHasChanged(); - return Task.CompletedTask; } } } diff --git a/src/Money.Blazor.Host/Services/Navigator.cs b/src/Money.Blazor.Host/Services/Navigator.cs index a31832c1..d074eb72 100644 --- a/src/Money.Blazor.Host/Services/Navigator.cs +++ b/src/Money.Blazor.Host/Services/Navigator.cs @@ -48,6 +48,9 @@ public void Dispose() public string UrlCurrent() => manager.Uri; + public string UrlOrigin() + => manager.BaseUri; + private void OnLocationChanged(object sender, LocationChangedEventArgs e) { queryString = null; diff --git a/src/Money.Blazor.Host/wwwroot/release-notes.html b/src/Money.Blazor.Host/wwwroot/release-notes.html new file mode 100644 index 00000000..4653f886 --- /dev/null +++ b/src/Money.Blazor.Host/wwwroot/release-notes.html @@ -0,0 +1,22 @@ +<h3>New features</h3> +<ul> + <li>Expense edit actions in search results.</li> + <li>Small redesign of user info in main navigation bar.</li> + <li>Button for deleting incomes.</li> + <li>Ability to disable mobile bottom navigation.</li> + <li>Use darker blue in theme colors.</li> + <li>Show release notes of available update.</li> +</ul> + +<h3>Fixed bugs</h3> +<ul> + <li>Auto select value in amount box</li> + <li>Date for the expense created on the first day of a month.</li> + <li>Currency formatting in income overview for larger amounts.</li> + <li>Horizontal scrolling for trends on small screens.</li> +</ul> + +<a target="_blank" href="https://github.com/maraf/Money/releases/blazor-v1.16.0" class="btn btn-light"> + <span class="fab fa-github"></span> + See details on GitHub +</a> \ No newline at end of file