From 483eff538f096d02533976a632b19e182a1951b0 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Mon, 12 Feb 2024 19:08:25 +0100 Subject: [PATCH] Update login page to reflect dynamic versions The static version display on the login page has been replaced with dynamic values. Now, the server and client version information is fetched from their respective information providers. The version defined in the Elsa.Studio.Core project has been updated as well. --- .../Elsa.Studio.Core/Elsa.Studio.Core.csproj | 2 +- .../Elsa.Studio.Login/Pages/Login/Login.razor | 4 ++-- .../Elsa.Studio.Login/Pages/Login/Login.razor.cs | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/framework/Elsa.Studio.Core/Elsa.Studio.Core.csproj b/src/framework/Elsa.Studio.Core/Elsa.Studio.Core.csproj index 9d4bf62f..f30342ae 100644 --- a/src/framework/Elsa.Studio.Core/Elsa.Studio.Core.csproj +++ b/src/framework/Elsa.Studio.Core/Elsa.Studio.Core.csproj @@ -5,7 +5,7 @@ - 3.0.1 + 3.1.0 Core Elsa Studio services. elsa studio core Elsa.Studio diff --git a/src/modules/Elsa.Studio.Login/Pages/Login/Login.razor b/src/modules/Elsa.Studio.Login/Pages/Login/Login.razor index bcac921a..f1fd6e66 100644 --- a/src/modules/Elsa.Studio.Login/Pages/Login/Login.razor +++ b/src/modules/Elsa.Studio.Login/Pages/Login/Login.razor @@ -9,7 +9,7 @@ -

Elsa 3.0

+

Elsa @ServerVersion

@@ -29,5 +29,5 @@
- Elsa Studio v1.0.0 + Elsa Studio @ClientVersion
\ No newline at end of file diff --git a/src/modules/Elsa.Studio.Login/Pages/Login/Login.razor.cs b/src/modules/Elsa.Studio.Login/Pages/Login/Login.razor.cs index 4c535a94..b6139b9f 100644 --- a/src/modules/Elsa.Studio.Login/Pages/Login/Login.razor.cs +++ b/src/modules/Elsa.Studio.Login/Pages/Login/Login.razor.cs @@ -1,3 +1,4 @@ +using Elsa.Studio.Contracts; using Elsa.Studio.Login.Contracts; using Elsa.Studio.Login.Pages.Login.Models; using Elsa.Studio.Login.Services; @@ -21,6 +22,20 @@ public partial class Login [Inject] private NavigationManager NavigationManager { get; set; } = default!; [Inject] private ISnackbar Snackbar { get; set; } = default!; [Inject] private AuthenticationStateProvider AuthenticationStateProvider { get; set; } = default!; + [Inject] private IClientInformationProvider ClientInformationProvider { get; set; } = default!; + [Inject] private IServerInformationProvider ServerInformationProvider { get; set; } = default!; + + private string ClientVersion { get; set; } = "3.0.0"; + private string ServerVersion { get; set; } = "3.0.0"; + + /// + protected override async Task OnInitializedAsync() + { + var clientInformation = await ClientInformationProvider.GetInfoAsync(); + var serverInformation = await ServerInformationProvider.GetInfoAsync(); + ClientVersion = clientInformation.PackageVersion; + ServerVersion = serverInformation.PackageVersion; + } private async Task TryLogin() {