Skip to content

Commit

Permalink
FDC3 IIFE Bundle Resource Name is a Static Constant
Browse files Browse the repository at this point in the history
  • Loading branch information
kruplm committed Jul 4, 2023
1 parent 96df7c8 commit 594bf75
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/shell/dotnet/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
Preload
6 changes: 3 additions & 3 deletions src/shell/dotnet/Shell/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using MorganStanley.ComposeUI.Fdc3.DesktopAgent;
using MorganStanley.ComposeUI.Messaging.Server.WebSocket;
using Shell.Utilities;
using Shell.Preload;

namespace Shell;

Expand Down Expand Up @@ -176,11 +177,10 @@ private void InjectMessageRouterConfig()
""");
}

private void InjectFdc3()
{
string bundle = @"Shell.fdc3-iife-bundle.js";
string iife = ResourceReader.ReadResource(bundle);
string iife = ResourceReader.ReadResource(PreloadFdc3.Fdc3BundleResourceName);

WebWindow.AddPreloadScript(iife);
}
Expand Down
13 changes: 13 additions & 0 deletions src/shell/dotnet/Shell/Preload/PreloadFdc3.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shell.Preload
{
public static class PreloadFdc3
{
public static readonly string Fdc3BundleResourceName = @"Shell.fdc3-iife-bundle.js";
}
}
2 changes: 1 addition & 1 deletion src/shell/dotnet/Shell/Shell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="$(Fdc3BundleOutput)" >
<EmbeddedResource Include="$(Fdc3BundleOutput)">
</EmbeddedResource>
</ItemGroup>

Expand Down
3 changes: 2 additions & 1 deletion src/shell/dotnet/tests/Shell.Tests/ResourceReaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Shell.Preload;

namespace ShellTests
{
Expand All @@ -28,7 +29,7 @@ public class ReadResourceTests
[Fact]
public void ResourceCanBeRead()
{
var resource = ResourceReader.ReadResource(@"Shell.fdc3-iife-bundle.js");
var resource = ResourceReader.ReadResource(PreloadFdc3.Fdc3BundleResourceName);

Assert.NotNull(resource);
}
Expand Down

0 comments on commit 594bf75

Please sign in to comment.