Skip to content

Commit

Permalink
Update login page to reflect dynamic versions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sfmskywalker committed Feb 12, 2024
1 parent d7615f6 commit 483eff5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/framework/Elsa.Studio.Core/Elsa.Studio.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Import Project="..\..\..\frameworks.props"/>

<PropertyGroup>
<Version>3.0.1</Version>
<Version>3.1.0</Version>
<Description>Core Elsa Studio services.</Description>
<PackageTags>elsa studio core</PackageTags>
<RootNamespace>Elsa.Studio</RootNamespace>
Expand Down
4 changes: 2 additions & 2 deletions src/modules/Elsa.Studio.Login/Pages/Login/Login.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<MudContainer MaxWidth="MaxWidth.Small">
<MudStack Spacing="10">
<h2 class="LoginTitle">Elsa 3.0</h2>
<h2 class="LoginTitle">Elsa @ServerVersion</h2>
<MudPaper Elevation="1">
<MudGrid Spacing="0" Justify="Justify.Center">
<MudItem md="9" xs="7" Class="pa-4 mx-auto my-4">
Expand All @@ -29,5 +29,5 @@
</MudGrid>
</MudPaper>
</MudStack>
<MudText Typo="Typo.subtitle2" Align="Align.Center" Class="mt-2">Elsa Studio v1.0.0</MudText>
<MudText Typo="Typo.subtitle2" Align="Align.Center" Class="mt-2">Elsa Studio @ClientVersion</MudText>
</MudContainer>
15 changes: 15 additions & 0 deletions src/modules/Elsa.Studio.Login/Pages/Login/Login.razor.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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";

/// <inheritdoc />
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()
{
Expand Down

0 comments on commit 483eff5

Please sign in to comment.