Skip to content

Commit

Permalink
Package updates
Browse files Browse the repository at this point in the history
This included dropping BGQuery and writing the JavaScript even handlers by hand.
  • Loading branch information
JosephEShook committed Dec 17, 2024
1 parent e5bf462 commit 90726bc
Show file tree
Hide file tree
Showing 14 changed files with 101 additions and 82 deletions.
3 changes: 1 addition & 2 deletions Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#endregion

using Blazored.LocalStorage;
using BQuery;
using Hl7.Fhir.FhirPath;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
Expand Down Expand Up @@ -51,4 +50,4 @@
// Add this so that the resolve() extension will be available when including in FhirPath
Hl7.FhirPath.FhirPathCompiler.DefaultSymbolTable.AddFhirExtensions();

await builder.Build().UseBQuery().RunAsync();
await builder.Build().RunAsync();
9 changes: 4 additions & 5 deletions Client/UdapEd.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@

<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="BQuery" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.10" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageReference Include="MudBlazor" Version="7.8.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0" />
<PackageReference Include="MudBlazor" Version="7.15.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\UdapEd.Shared.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Udap.CdsHooks.Model" Version="0.3.92" />
<PackageReference Include="Udap.Common" Version="0.3.93" />
<PackageReference Include="Udap.CdsHooks.Model" Version="0.4.0" />
<PackageReference Include="Udap.Common" Version="0.4.0" />
</ItemGroup>

<!-- From:: https://jonhilton.net/visual-studio-2022-blazor-css-intellisense/ -->
Expand Down
1 change: 1 addition & 0 deletions Client/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<script src="_content/BQuery/bQuery.min.js"></script>
<script src="_content/UdapEd.Shared/scripts/AutoFocus.js"></script>
<script src="_content/UdapEd.Shared/scripts/UdapEdUtility.js"></script>
<script src="_content/UdapEd.Shared/scripts/EventHandlers.js"></script>

<script src="_content/BlazorMonaco/jsInterop.js"></script>
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
Expand Down
26 changes: 13 additions & 13 deletions Server/UdapEd.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Firely.Fhir.Packages" Version="4.8.0" />
<PackageReference Include="Firely.Fhir.Packages" Version="4.9.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.10" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.10.0" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="System.IO" Version="4.3.0" />


<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.10.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.10.0" />

<PackageReference Include="Udap.CdsHooks.Model" Version="0.3.92" />
<PackageReference Include="Udap.Smart.Model" Version="0.3.93" />
<PackageReference Include="Udap.CdsHooks.Model" Version="0.4.0" />
<PackageReference Include="Udap.Smart.Model" Version="0.4.0" />

</ItemGroup>

Expand All @@ -37,9 +37,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Udap.Client" Version="0.3.93" />
<PackageReference Include="Udap.Model" Version="0.3.93" />
<PackageReference Include="Udap.Common" Version="0.3.93" />
<PackageReference Include="Udap.Client" Version="0.4.0" />
<PackageReference Include="Udap.Model" Version="0.4.0" />
<PackageReference Include="Udap.Common" Version="0.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
36 changes: 22 additions & 14 deletions Shared/Components/CertificationAndEndorsementLoader.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
// */
#endregion

using BQuery;
// using BQuery;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.JSInterop;
using MudBlazor;
using UdapEd.Shared.Model;
using UdapEd.Shared.Services;
Expand All @@ -20,14 +21,18 @@ namespace UdapEd.Shared.Components;

public partial class CertificationAndEndorsementLoader
{
private static CertificationAndEndorsementLoader? _instance;
[Inject] private ICertificationService CertificationService { get; set; } = null!;
[CascadingParameter] private CascadingAppState AppState { get; set; } = null!;
[Inject] private IDialogService DialogService { get; set; } = null!;
[Inject] private IJSRuntime JSRuntime { get; set; } = null!;
private readonly PeriodicTimer _periodicTimer = new PeriodicTimer(TimeSpan.FromMinutes(5));
private bool _checkServerSession;

protected override async Task OnInitializedAsync()
{
_instance = this;

var userSuppliedCertificate = AppState.CertificationAndEndorsementInfo?.UserSuppliedCertificate;
var clientCertificateLoadStatus = await CertificationService.ClientCertificateLoadStatus();

Expand All @@ -48,26 +53,28 @@ await AppState.SetPropertyAsync(this, nameof(AppState.CertificationAndEndorsemen
await SetCertLoadedColorFoExample(clientCertificateLoadStatus.CertLoaded);
}


if (Bq.Events != null)
{
//No background tasks in Maui. FYI IOS doesn't allow it.
RunTimer();
}
await JSRuntime.InvokeVoidAsync("pageEventHandlers.registerHandlers");
RunTimer();
}

protected override async Task OnAfterRenderAsync(bool firstRender)

[JSInvokable("OnPageFocus")]
public static async Task OnPageFocus()
{
if (Bq.Events != null && firstRender)
if (_instance != null)
{
Bq.Events.OnBlur += Events_OnBlur;
Bq.Events.OnFocusAsync += Events_OnFocus;
await _instance.OnPageFocusInstance();
}
}

await base.OnAfterRenderAsync(firstRender);
[JSInvokable("OnPageBlur")]
public static void OnPageBlur()
{
_instance?.OnPageBlurInstance();
}

private async Task Events_OnFocus(FocusEventArgs obj)

public async Task OnPageFocusInstance()
{
var userSuppliedCertificate = AppState.CertificationAndEndorsementInfo?.UserSuppliedCertificate;
var clientCertificateLoadStatus = await CertificationService.ClientCertificateLoadStatus();
Expand All @@ -92,7 +99,7 @@ await AppState.SetPropertyAsync(this, nameof(AppState.CertificationAndEndorsemen
_checkServerSession = true;
}

private void Events_OnBlur(FocusEventArgs obj)
public void OnPageBlurInstance()
{
_checkServerSession = false;
}
Expand Down Expand Up @@ -219,6 +226,7 @@ await AppState.SetPropertyAsync(this, nameof(AppState.CertificationAndEndorsemen
public void Dispose()
{
_periodicTimer.Dispose();
JSRuntime.InvokeVoidAsync("pageEventHandlers.unregisterHandlers");
}

private async Task ClearCertificationAndEndorsementInfo()
Expand Down
15 changes: 3 additions & 12 deletions Shared/Components/ClientCertLoader.razor
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,16 @@
}


if (Bq.Events != null)
{
//No background tasks in Maui. FYI IOS doesn't allow it.
RunTimer();
}
//No background tasks in Maui. FYI IOS doesn't allow it.
RunTimer();
}

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (Bq.Events != null && firstRender)
{
Bq.Events.OnBlur += Events_OnBlur;
Bq.Events.OnFocusAsync += Events_OnFocus;
}

await base.OnAfterRenderAsync(firstRender);
}

private async Task Events_OnFocus(FocusEventArgs obj)
private async Task OnFocus(FocusEventArgs obj)
{
var userSuppliedCertificate = AppState.UdapClientCertificateInfo?.UserSuppliedCertificate;
var clientCertificateLoadStatus = await RegisterService.ClientCertificateLoadStatus();
Expand Down
33 changes: 19 additions & 14 deletions Shared/Components/UdapAnchorCertificate.razor
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,20 @@
</MudCard>

@code {
private static UdapAnchorCertificate? _instance;
[CascadingParameter] CascadingAppState AppState { get; set; } = null!;
readonly PeriodicTimer _periodicTimer = new PeriodicTimer(TimeSpan.FromMinutes(5));
[Inject] private IJSRuntime JSRuntime { get; set; } = null!;

private bool _checkServerSession;


public Color AnchorLoadedColor;
public Color EmrDirectAnchorLoadedColor;
public Color FhirLabsAnchorLoadedColor;


protected override async Task OnInitializedAsync()
{
_instance = this;
var userSuppliedCertificate = AppState.UdapAnchorCertificateInfo?.UserSuppliedCertificate;

var anchorCertificateLoadStatus = await DiscoveryService.AnchorCertificateLoadStatus();
Expand All @@ -95,24 +96,28 @@
}


if (Bq.Events != null)
{
//No background tasks in Maui. FYI IOS doesn't allow it.
RunTimer();
}
await JSRuntime.InvokeVoidAsync("pageEventHandlers.registerHandlers");
RunTimer();
}


protected override async Task OnAfterRenderAsync(bool firstRender)
[JSInvokable("OnPageFocus")]
public static async Task OnPageFocus()
{
if (Bq.Events != null && firstRender)
if (_instance != null)
{
Bq.Events.OnBlur += Events_OnBlur;
Bq.Events.OnFocusAsync += Events_OnFocus;
await _instance.OnPageFocusInstance();
}
await base.OnAfterRenderAsync(firstRender);
}

private async Task Events_OnFocus(FocusEventArgs obj)
[JSInvokable("OnPageBlur")]
public static void OnPageBlur()
{
_instance?.OnPageBlurInstance();
}


private async Task OnPageFocusInstance()
{
var anchorCertificateLoadStatus = await DiscoveryService.AnchorCertificateLoadStatus();
await AppState.SetPropertyAsync(this, nameof(AppState.UdapAnchorCertificateInfo), anchorCertificateLoadStatus);
Expand All @@ -134,7 +139,7 @@
_checkServerSession = true;
}

private void Events_OnBlur(FocusEventArgs obj)
private void OnPageBlurInstance()
{
_checkServerSession = false;
}
Expand Down
17 changes: 8 additions & 9 deletions Shared/UdapEd.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@
<PackageReference Include="BlazorMonaco" Version="3.2.0" IncludeAssets="all" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="BQuery" Version="3.1.0" />
<PackageReference Include="Google.Cloud.Storage.V1" Version="4.10.0" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageReference Include="MudBlazor" Version="7.8.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0" />
<PackageReference Include="MudBlazor" Version="7.15.0" />


<PackageReference Include="Udap.Smart.Model" Version="0.3.93" />
<PackageReference Include="Udap.CdsHooks.Model" Version="0.3.92" />
<PackageReference Include="Udap.Model" Version="0.3.93" />
<PackageReference Include="Udap.Common" Version="0.3.93" />
<PackageReference Include="Udap.Smart.Model" Version="0.4.0" />
<PackageReference Include="Udap.CdsHooks.Model" Version="0.4.0" />
<PackageReference Include="Udap.Model" Version="0.4.0" />
<PackageReference Include="Udap.Common" Version="0.4.0" />

<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Fast.Components.FluentUI" Version="3.7.8" />
<PackageReference Include="Microsoft.Fast.Components.FluentUI" Version="3.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.10" />

Expand All @@ -54,7 +53,7 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworks)' != 'net8.0'">
<PackageReference Include="CommunityToolkit.Maui" Version="9.1.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="9.1.1" />
</ItemGroup>


Expand Down
1 change: 0 additions & 1 deletion Shared/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
@using Udap.Model
@using UdapEd.Shared.Model
@using System.Reflection
@using BQuery
@using UdapEd.Shared
@using UdapEd.Shared.Components
@using BlazorMonaco
Expand Down
1 change: 1 addition & 0 deletions Shared/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<script src="_content/BQuery/bQuery.min.js"></script>
<script src="_content/UdapEd.Shared/scripts/AutoFocus.js"></script>
<script src="_content/UdapEd.Shared/scripts/UdapEdUtility.js"></script>
<script src="_content/UdapEd.Shared/scripts/EventHandlers.js"></script>
</body>

</html>
16 changes: 16 additions & 0 deletions Shared/wwwroot/scripts/EventHandlers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
window.pageEventHandlers = {
onFocus: function () {
window.DotNet.invokeMethodAsync('UdapEd.Shared', 'OnPageFocus');
},
onBlur: function () {
window.DotNet.invokeMethodAsync('UdapEd.Shared', 'OnPageBlur');
},
registerHandlers: function () {
window.addEventListener('focus', this.onFocus);
window.addEventListener('blur', this.onBlur);
},
unregisterHandlers: function () {
window.removeEventListener('focus', this.onFocus);
window.removeEventListener('blur', this.onBlur);
}
};
12 changes: 6 additions & 6 deletions UdapEdAppMaui/UdapEdAppMaui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@


<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="9.1.0" />
<PackageReference Include="CommunityToolkit.Maui" Version="9.1.1" />
<PackageReference Include="Google.Cloud.Storage.V1" Version="4.10.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.91" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.91" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.91" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
<PackageReference Include="Serilog" Version="4.0.2" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Udap.Client" Version="0.3.93" />
<PackageReference Include="Udap.Client" Version="0.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions UdapEdAppMaui/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<script src="_content/BQuery/bQuery.min.js"></script>
<script src="_content/UdapEd.Shared/scripts/AutoFocus.js"></script>
<script src="_content/UdapEd.Shared/scripts/UdapEdUtility.js"></script>
<script src="_content/UdapEd.Shared/scripts/EventHandlers.js"></script>

<script src="_content/BlazorMonaco/jsInterop.js"></script>
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
Expand Down
Loading

0 comments on commit 90726bc

Please sign in to comment.