Skip to content

Commit b2a4b28

Browse files
committed
TD-5925 Bring in current blazor change
2 parents 2f5bfe6 + 9822314 commit b2a4b28

File tree

83 files changed

+1417
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1417
-154
lines changed

.github/workflows/continuous-integration-workflow.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ on: [push]
33
env:
44
BuildParameters.RestoreBuildProjects: '**/*.csproj'
55
BuildParameters.TestProjects: '**/*[Tt]ests/*.csproj'
6+
7+
# Nuget Feed Credentials
8+
TEL_GITHUB_DEVOPS_USERNAME: ${{ secrets.TEL_GITHUB_DEVOPS_USERNAME }}
9+
TEL_GITHUB_PACKAGE_READ_PAT: ${{ secrets.TEL_GITHUB_PACKAGE_READ_PAT }}
10+
TEL_AZURE_DEVOPS_USERNAME: ${{ secrets.TEL_AZURE_DEVOPS_USERNAME }}
11+
TEL_AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }}
612
jobs:
713
build:
814
name: Build and test
@@ -15,10 +21,45 @@ jobs:
1521
with:
1622
dotnet-version: 8.0.x
1723

18-
- name: Add Azure artifact
24+
# Todo: remove check once all pipeline work and have the file
25+
- name: Check if nuget.config.cicd exists
26+
id: check_nuget_cicd
27+
run: |
28+
if (Test-Path "nuget.config.cicd") {
29+
echo "exists=true" >> $env:GITHUB_OUTPUT
30+
echo "nuget.config.cicd exists"
31+
} else {
32+
echo "exists=false" >> $env:GITHUB_OUTPUT
33+
echo "nuget.config.cicd doesnt exist"
34+
}
35+
shell: pwsh
36+
37+
# Remove local nuget.config (Should be gitignored) and create nuget.config from nuget.config.cicd
38+
# Todo: remove if once all pipeline work and have the file
39+
- name: Setup NuGet with CICD config
40+
if: steps.check_nuget_cicd.outputs.exists == 'true'
41+
run: |
42+
if (Test-Path "nuget.config") { Remove-Item "nuget.config" }
43+
Copy-Item "nuget.config.cicd" "nuget.config"
44+
shell: pwsh
45+
46+
# Replace env values with github secrets
47+
- name: Replace environment variables in nuget config
48+
if: steps.check_nuget_cicd.outputs.exists == 'true'
49+
run: |
50+
(Get-Content nuget.config) -replace '%TEL_GITHUB_DEVOPS_USERNAME%', $env:TEL_GITHUB_DEVOPS_USERNAME | Set-Content nuget.config
51+
(Get-Content nuget.config) -replace '%TEL_GITHUB_PACKAGE_READ_PAT%', $env:TEL_GITHUB_PACKAGE_READ_PAT | Set-Content nuget.config
52+
(Get-Content nuget.config) -replace '%TEL_AZURE_DEVOPS_USERNAME%', $env:TEL_AZURE_DEVOPS_USERNAME | Set-Content nuget.config
53+
(Get-Content nuget.config) -replace '%TEL_AZURE_DEVOPS_PAT%', $env:TEL_AZURE_DEVOPS_PAT | Set-Content nuget.config
54+
shell: pwsh
55+
56+
# Todo: remove fallback once all pipeline work and have the file
57+
- name: Setup NuGet with Azure DevOps (fallback)
58+
if: steps.check_nuget_cicd.outputs.exists == 'false'
1959
run: |
2060
dotnet nuget remove source LearningHubFeed || true
21-
dotnet nuget add source 'https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json' --name 'LearningHubFeed' --username 'kevin.whittaker' --password ${{ secrets.AZURE_DEVOPS_PAT }} --store-password-in-clear-text
61+
dotnet nuget add source 'https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json' --name 'LearningHubFeed' --username 'kevin.whittaker' --password ${{ secrets.AZURE_DEVOPS_PAT }} --store-password-in-clear-text
62+
2263
2364
- name: Use Node 14
2465
uses: actions/setup-node@v4

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ obj
5656
/AdminUI/LearningHub.Nhs.AdminUI/web.config
5757
/LearningHub.Nhs.WebUI/web.config
5858
/WebAPI/LearningHub.Nhs.API/web.config
59-
/.github/workflows/test.yml
60-
/LearningHub.Nhs.WebUI.BlazorClient/LearningHub.Nhs.WebUI.BlazorClient.csproj.user
59+
/LearningHub.Nhs.WebUI/nuget.config
6160
/LearningHub.Nhs.WebUI.BlazorClient/Properties/launchSettings.json
62-
/LearningHub.Nhs.WebUI.slnLaunch.user
61+
/LearningHub.Nhs.WebUI.BlazorClient/wwwroot/appsettings.json
62+
/LearningHub.Nhs.WebUI.BlazorClient/wwwroot/appsettings.Development.json
63+
/LearningHub.Nhs.WebUI.BlazorClient/nuget.config
64+
/LearningHub.Nhs.WebUI.BlazorClient/LearningHub.Nhs.WebUI.BlazorClient.csproj.user
6365
/nuget.config
66+
/LearningHub.Nhs.WebUI.slnLaunch.user
67+
/.github/workflows/test.yml

AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
8484
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.8.0" />
8585
<PackageReference Include="BuildWebCompiler" Version="1.12.405" />
86-
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.9" />
86+
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.8" />
8787
<PackageReference Include="FluentValidation" Version="11.11.0" />
8888
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
8989
<PackageReference Include="HtmlSanitizer" Version="6.0.453" />
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace LearningHub.Nhs.Shared.Configuration
2+
{
3+
using LearningHub.Nhs.Shared.Interfaces.Configuration;
4+
/// <summary>
5+
/// Represents a public-facing set of configuration values for Findwise search,
6+
/// intended to be safely exposed to client-side applications or public APIs.
7+
///
8+
/// <para>
9+
/// Contains only non-sensitive data such as page sizes for various search types.
10+
/// </para>
11+
/// </summary>
12+
public class ExposableFindwiseSettings : IExposableFindwiseSettings
13+
{
14+
/// <summary>
15+
/// Gets or sets the ResourceSearchPageSize.
16+
/// </summary>
17+
public int ResourceSearchPageSize { get; set; }
18+
19+
/// <summary>
20+
/// Gets or sets the CatalogueSearchPageSize.
21+
/// </summary>
22+
public int CatalogueSearchPageSize { get; set; }
23+
24+
/// <summary>
25+
/// Gets or sets the AllCatalogueSearchPageSize.
26+
/// </summary>
27+
public int AllCatalogueSearchPageSize { get; set; }
28+
}
29+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
namespace LearningHub.Nhs.Shared.Configuration
2+
{
3+
using LearningHub.Nhs.Shared.Interfaces.Configuration;
4+
/// <summary>
5+
/// Represents configuration values that are safe to expose to clientside frontend applications
6+
/// (such as Blazor WebAssembly) or public-facing APIs.
7+
///
8+
/// <para>
9+
/// Implements <see cref="IExposableSettings"/> and contains only non-sensitive, non-secret
10+
/// values such as public API endpoints and pagination settings. This separation ensures
11+
/// that secure or private configuration data is not inadvertently exposed to clients.
12+
/// </para>
13+
/// </summary>
14+
public class ExposableSettings : IExposableSettings
15+
{
16+
/// <inheritdoc/>
17+
public string LearningHubApiUrl { get; set; }
18+
19+
/// <summary>
20+
/// Gets or sets the UserApiUrl.
21+
/// </summary>
22+
public string UserApiUrl { get; set; }
23+
24+
/// <summary>
25+
/// Gets or sets the OpenApiUrl.
26+
/// </summary>
27+
public string OpenApiUrl { get; set; }
28+
/// <summary>
29+
/// Backend for Frontend (BFF) URL for the Learning Hub API accessed by samesite cookie and uses httpclients with bearers to access external apis.
30+
/// </summary>
31+
public string LearningHubApiBFFUrl { get; set; }
32+
/// <inheritdoc/>
33+
public IExposableFindwiseSettings FindwiseSettings { get; set; }
34+
35+
}
36+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace LearningHub.Nhs.Shared.Interfaces.Configuration
2+
{
3+
/// <summary>
4+
/// Represents configuration values related to Findwise search that are safe to expose
5+
/// to client-side applications or public-facing APIs.
6+
///
7+
/// <para>
8+
/// This includes non-sensitive values such as page sizes for different types of search results.
9+
/// It does not contain any secure credentials or internal service configuration.
10+
/// </para>
11+
/// </summary>
12+
public interface IExposableFindwiseSettings
13+
{
14+
/// <summary>
15+
/// Gets or sets the page size for resource search results.
16+
/// </summary>
17+
public int ResourceSearchPageSize { get; set; }
18+
19+
/// <summary>
20+
/// Gets or sets the CatalogueSearchPageSize.
21+
/// </summary>
22+
public int CatalogueSearchPageSize { get; set; }
23+
24+
/// <summary>
25+
/// Gets or sets the AllCatalogueSearchPageSize.
26+
/// </summary>
27+
public int AllCatalogueSearchPageSize { get; set; }
28+
}
29+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
namespace LearningHub.Nhs.Shared.Interfaces.Configuration
2+
{
3+
/// <summary>
4+
/// Defines a contract for configuration data that is non-sensitive and safe to expose publicly
5+
///
6+
/// <para>
7+
/// This interface exposes only data that is safe to be publicly consumed or shared,
8+
/// such as API endpoint URLs or non-sensitive configuration values.
9+
/// It explicitly excludes any private or sensitive information (e.g., authentication tokens,
10+
/// credentials, or secret keys), which should be handled via separate interfaces or services.
11+
/// </para>
12+
///
13+
/// <para>
14+
/// The data provided by this interface can be safely used in frontend technologies,
15+
/// such as Blazor WebAssembly, JavaScript frameworks, or other client-side applications,
16+
/// without risking exposure of sensitive information.
17+
/// </para>
18+
/// </summary>
19+
public interface IExposableSettings
20+
{
21+
/// <summary>
22+
/// Gets or sets the LearningHubApiUrl.
23+
/// </summary>
24+
public string LearningHubApiUrl { get; set; }
25+
26+
/// <summary>
27+
/// Gets or sets the UserApiUrl.
28+
/// </summary>
29+
public string UserApiUrl { get; set; }
30+
31+
/// <summary>
32+
/// Gets or sets the OpenApiUrl.
33+
/// </summary>
34+
public string OpenApiUrl { get; set; }
35+
/// <summary>
36+
/// Gets or sets the LearningHubApiBFFUrl used to proxy via same domain cookie to the BFF LearningHubAPI calls.
37+
/// </summary>
38+
public string LearningHubApiBFFUrl { get; set; }
39+
40+
public IExposableFindwiseSettings FindwiseSettings { get; set; }
41+
}
42+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace LearningHub.Nhs.Shared.Interfaces.Http
2+
{
3+
/// <summary>
4+
/// Represents an HTTP client for a specific API.
5+
/// </summary>
6+
public interface IAPIHttpClient
7+
{
8+
/// <summary>
9+
/// Gets the configured <see cref="HttpClient"/> for the API.
10+
/// </summary>
11+
Task<HttpClient> GetClientAsync();
12+
13+
/// <summary>
14+
/// Gets the base URL of the API.
15+
/// </summary>
16+
string ApiUrl { get; }
17+
}
18+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
namespace LearningHub.Nhs.Shared.Interfaces.Http
2+
{
3+
/// <summary>
4+
/// Marker interface for the LearningHub API HttpClient.
5+
///
6+
/// <para>
7+
/// Inherits from <see cref="IAPIHttpClient"/> to enable
8+
/// dependency injection of a specific implementation configured with
9+
/// different API endpoints or settings specific to LH API.
10+
/// </para>
11+
///
12+
/// <para>
13+
/// Currently, this interface is empty and used solely to differentiate implementations
14+
/// that connect to different endpoints via configuration, but it may be extended in the future
15+
/// with LearningHub-specific functionality or properties.
16+
/// </para>
17+
/// </summary>
18+
public interface ILearningHubHttpClient : IAPIHttpClient
19+
{
20+
21+
}
22+
}

0 commit comments

Comments
 (0)