Skip to content

Commit c301902

Browse files
Merge pull request #1250 from TechnologyEnhancedLearning/Merge-RC-into-5490
Merge rc into 5490
2 parents 9bd5c68 + 0187263 commit c301902

File tree

53 files changed

+882
-826
lines changed

Some content is hidden

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

53 files changed

+882
-826
lines changed

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

Lines changed: 19 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -9,99 +9,38 @@ jobs:
99
runs-on: windows-latest
1010
steps:
1111
- uses: actions/checkout@v3
12-
13-
- name: Modify web.config files in all apps
14-
shell: pwsh
15-
run: |
16-
$webConfigPaths = @(
17-
"${{ github.workspace }}\AdminUI\LearningHub.Nhs.AdminUI\web.config",
18-
"${{ github.workspace }}\WebAPI\LearningHub.Nhs.Api\web.config",
19-
"${{ github.workspace }}\LearningHub.Nhs.WebUI\web.config"
20-
)
21-
22-
foreach ($path in $webConfigPaths) {
23-
if (Test-Path $path) {
24-
Write-Host "Modifying $path"
25-
[xml]$config = Get-Content $path
26-
27-
if (-not $config.configuration.'system.webServer') {
28-
$systemWebServer = $config.CreateElement("system.webServer")
29-
$config.configuration.AppendChild($systemWebServer) | Out-Null
30-
} else {
31-
$systemWebServer = $config.configuration.'system.webServer'
32-
}
33-
34-
if (-not $systemWebServer.httpProtocol) {
35-
$httpProtocol = $config.CreateElement("httpProtocol")
36-
$systemWebServer.AppendChild($httpProtocol) | Out-Null
37-
} else {
38-
$httpProtocol = $systemWebServer.httpProtocol
39-
}
40-
41-
if (-not $httpProtocol.customHeaders) {
42-
$customHeaders = $config.CreateElement("customHeaders")
43-
$httpProtocol.AppendChild($customHeaders) | Out-Null
44-
} else {
45-
$customHeaders = $httpProtocol.customHeaders
46-
}
47-
48-
foreach ($name in @("X-Powered-By", "Server")) {
49-
$removeNode = $config.CreateElement("remove")
50-
$removeNode.SetAttribute("name", $name)
51-
$customHeaders.AppendChild($removeNode) | Out-Null
52-
}
53-
54-
if (-not $systemWebServer.security) {
55-
$security = $config.CreateElement("security")
56-
$systemWebServer.AppendChild($security) | Out-Null
57-
} else {
58-
$security = $systemWebServer.security
59-
}
60-
61-
if (-not $security.requestFiltering) {
62-
$requestFiltering = $config.CreateElement("requestFiltering")
63-
$requestFiltering.SetAttribute("removeServerHeader", "true")
64-
$security.AppendChild($requestFiltering) | Out-Null
65-
}
66-
67-
$config.Save($path)
68-
} else {
69-
Write-Host "File not found: $path"
70-
}
71-
}
72-
12+
7313
- name: Setup .NET Core SDK 8.0
7414
uses: actions/setup-dotnet@v3
7515
with:
7616
dotnet-version: 8.0.x
7717

7818
- name: Add Azure artifact
79-
run: 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
19+
run: |
20+
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
8022
81-
- name: Use Node 20 with Yarn
23+
- name: Use Node 14
8224
uses: actions/setup-node@v4
8325
with:
84-
node-version: '20'
85-
cache: 'npm'
86-
87-
- name: Upgrade npm to the latest version
88-
run: npm install -g npm@6.14.8
26+
node-version: '14'
27+
cache: 'npm'
8928

90-
- name: Typescript install WebUI
91-
run: yarn install --network-timeout 600000 --frozen-lockfile
29+
- name: npm install WebUI
30+
run: npm install
9231
working-directory: ./LearningHub.Nhs.WebUI
93-
94-
- name: Typescript build WebUI
95-
run: yarn build:webpack
32+
33+
- name: npm build WebUI
34+
run: npm run build:webpack
9635
working-directory: ./LearningHub.Nhs.WebUI
9736

98-
- name: Typescript install AdminUI
99-
run: yarn install
37+
- name: npm install AdminUI
38+
run: npm install
10039
working-directory: ./AdminUI/LearningHub.Nhs.AdminUI
101-
102-
- name: Typescript build AdminUI
103-
run: yarn build:webpack
104-
working-directory: ./AdminUI/LearningHub.Nhs.AdminUI
40+
41+
- name: npm build AdminUI
42+
run: npm run build:webpack
43+
working-directory: ./AdminUI/LearningHub.Nhs.AdminUI
10544

10645
- name: Setup MSBuild
10746
uses: microsoft/setup-msbuild@v1.0.3
@@ -181,5 +120,4 @@ jobs:
181120
}
182121

183122
# - name: Test
184-
# run: dotnet test ${{ env.BuildParameters.TestProjects }}
185-
123+
# run: dotnet test ${{ env.BuildParameters.TestProjects }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ obj
5353
/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj.user
5454
/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj.user
5555
/ReportAPI/LearningHub.Nhs.ReportApi/web.config
56+
/AdminUI/LearningHub.Nhs.AdminUI/web.config
57+
/LearningHub.Nhs.WebUI/web.config
58+
/WebAPI/LearningHub.Nhs.API/web.config

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<AssemblyVersion>1.0.0.0</AssemblyVersion>
6-
<FileVersion>1.0.0.0</FileVersion>
7-
<Version>1.0.0</Version>
8-
<UserSecretsId>31abd8b9-4223-4ff3-896b-a46530c9e15c</UserSecretsId>
9-
<ApplicationInsightsResourceId>/subscriptions/57c55d5f-78c1-4373-a021-ff8357548f51/resourceGroups/LearningHubNhsUk-AdminUI-Prod-RG/providers/microsoft.insights/components/LearningHubNhsUk-AdminUI-Prod</ApplicationInsightsResourceId>
10-
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
11-
<GenerateDocumentationFile>true</GenerateDocumentationFile>
12-
<Platforms>x64</Platforms>
13-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<AssemblyVersion>1.0.0.0</AssemblyVersion>
6+
<FileVersion>1.0.0.0</FileVersion>
7+
<Version>1.0.0</Version>
8+
<UserSecretsId>31abd8b9-4223-4ff3-896b-a46530c9e15c</UserSecretsId>
9+
<ApplicationInsightsResourceId>/subscriptions/57c55d5f-78c1-4373-a021-ff8357548f51/resourceGroups/LearningHubNhsUk-AdminUI-Prod-RG/providers/microsoft.insights/components/LearningHubNhsUk-AdminUI-Prod</ApplicationInsightsResourceId>
10+
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
11+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
12+
<Platforms>x64</Platforms>
13+
</PropertyGroup>
1414
<ItemGroup>
1515
<Compile Remove="Views\Notification\**" />
1616
<Content Remove="Views\Notification\**" />

AdminUI/LearningHub.Nhs.AdminUI/web.config

Lines changed: 0 additions & 21 deletions
This file was deleted.

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<CodeAnalysisRuleSet>$(SolutionDir)StyleCop.ruleset</CodeAnalysisRuleSet>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
7+
<!--<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />-->
88
<AdditionalFiles Include="$(SolutionDir)StyleCop.json" Link="StyleCop.json" />
99
</ItemGroup>
1010
</Project>

Directory.Packages.props

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<!-- Enable centralised version control for packages -->
5+
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
6+
</PropertyGroup>
7+
8+
9+
<ItemGroup>
10+
11+
<PackageVersion Include="elfhHub.Nhs.Models" Version="3.0.9" />
12+
<PackageVersion Include="GDS.MultiPageFormData" Version="1.0.6" />
13+
<PackageVersion Include="LearningHub.Nhs.Caching" Version="2.0.2" />
14+
<PackageVersion Include="LearningHub.Nhs.Models" Version="3.0.48" />
15+
<PackageVersion Include="UK.NHS.CookieBanner" Version="2.0.7" />
16+
17+
<PackageVersion Include="AngleSharp" Version="0.16.1" />
18+
<PackageVersion Include="AspNetCore.Authentication.ApiKey" Version="9.0.0" />
19+
<PackageVersion Include="AspNetCoreRateLimit" Version="5.0.0" />
20+
<PackageVersion Include="AutoFixture" Version="4.18.1" />
21+
<PackageVersion Include="AutoMapper" Version="10.1.1" />
22+
<PackageVersion Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
23+
<PackageVersion Include="Azure.Messaging.ServiceBus" Version="7.20.1" />
24+
<PackageVersion Include="Azure.Storage.Blobs" Version="12.24.1" />
25+
<PackageVersion Include="Azure.Storage.Files.Shares" Version="12.11.0" />
26+
<PackageVersion Include="Azure.Storage.Queues" Version="12.22.0" />
27+
<PackageVersion Include="BuildWebCompiler" Version="1.12.405" />
28+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
29+
<PackageVersion Include="EntityFrameworkCore.Testing.Moq" Version="9.0.1" />
30+
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
31+
<PackageVersion Include="FluentValidation" Version="12.0.0" />
32+
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.1" />
33+
<PackageVersion Include="HtmlAgilityPack" Version="1.12.1" />
34+
<PackageVersion Include="HtmlSanitizer" Version="6.0.453" />
35+
<PackageVersion Include="IdentityModel" Version="4.6.0" />
36+
<PackageVersion Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
37+
<PackageVersion Include="linqtotwitter" Version="6.9.0" />
38+
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.23.0" />
39+
<PackageVersion Include="Microsoft.ApplicationInsights.EventCounterCollector" Version="2.23.0" />
40+
<PackageVersion Include="Microsoft.ApplicationInsights.NLogTarget" Version="2.23.0" />
41+
<PackageVersion Include="Microsoft.AspNetCore" Version="2.3.0" />
42+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.17" />
43+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.17" />
44+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Core" Version="2.3.0" />
45+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.17" />
46+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.17" />
47+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.17" />
48+
<PackageVersion Include="Microsoft.Azure.Management.DataFactory" Version="9.3.0" />
49+
<PackageVersion Include="Microsoft.Azure.Management.Media" Version="6.0.0" />
50+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.6" />
51+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.6" />
52+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.6" />
53+
<PackageVersion Include="Microsoft.Extensions.Caching.Redis" Version="2.3.0" />
54+
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.6" />
55+
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.6" />
56+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.6" />
57+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.6" />
58+
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.6" />
59+
<PackageVersion Include="Microsoft.FeatureManagement" Version="4.1.0" />
60+
<PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="3.2.0" />
61+
<PackageVersion Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.3.0" />
62+
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.12.0" />
63+
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="8.12.0" />
64+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
65+
<PackageVersion Include="Microsoft.Rest.ClientRuntime.Azure.Authentication" Version="2.4.1" />
66+
<PackageVersion Include="Microsoft.TypeScript.MSBuild" Version="5.8.3" />
67+
<PackageVersion Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
68+
<PackageVersion Include="MK.IO" Version="2.1.3" />
69+
<PackageVersion Include="Moq" Version="4.20.72" />
70+
<PackageVersion Include="NBuilder" Version="6.1.0" />
71+
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
72+
<PackageVersion Include="NHSUKViewComponents.Web" Version="1.0.29" />
73+
<PackageVersion Include="NLog.Schema" Version="5.5.0" />
74+
<PackageVersion Include="NLog.Web.AspNetCore" Version="5.5.0" />
75+
<PackageVersion Include="Selenium.Axe" Version="4.0.21" />
76+
<PackageVersion Include="Selenium.Support" Version="4.33.0" />
77+
<PackageVersion Include="Selenium.WebDriver" Version="4.33.0" />
78+
<PackageVersion Include="Selenium.WebDriver.ChromeDriver" Version="133.0.6943.5300" />
79+
<PackageVersion Include="Serilog.AspNetCore" Version="9.0.0" />
80+
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118" />
81+
<PackageVersion Include="Swashbuckle.AspNetCore" Version="9.0.1" />
82+
<PackageVersion Include="System.Collections" Version="4.3.0" />
83+
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.6" />
84+
<PackageVersion Include="System.Data.SqlClient" Version="4.9.0" />
85+
<PackageVersion Include="System.Drawing.Common" Version="9.0.6" />
86+
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.12.0" />
87+
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="9.0.6" />
88+
<PackageVersion Include="tusdotnet" Version="2.10.0" />
89+
<PackageVersion Include="UAParser" Version="3.1.47" />
90+
<PackageVersion Include="xunit" Version="2.4.1" />
91+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.3" />
92+
</ItemGroup>
93+
</Project>
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>enable</Nullable>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
77

8-
<IsPackable>false</IsPackable>
8+
<IsPackable>false</IsPackable>
99

10-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
11-
</PropertyGroup>
10+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
11+
</PropertyGroup>
1212

13-
<ItemGroup>
14-
<PackageReference Include="FluentAssertions" Version="6.12.0" />
15-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.13" />
16-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
17-
<PackageReference Include="Selenium.Axe" Version="4.0.19" />
18-
<PackageReference Include="Selenium.Support" Version="4.19.0" />
19-
<PackageReference Include="Selenium.WebDriver" Version="4.19.0" />
20-
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="133.0.6943.5300" />
21-
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
22-
<PackageReference Include="xunit" Version="2.4.1" />
23-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
24-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25-
<PrivateAssets>all</PrivateAssets>
26-
</PackageReference>
27-
<PackageReference Include="coverlet.collector" Version="1.3.0">
28-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
29-
<PrivateAssets>all</PrivateAssets>
30-
</PackageReference>
31-
</ItemGroup>
13+
<ItemGroup>
14+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
15+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.13" />
16+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
17+
<PackageReference Include="Selenium.Axe" Version="4.0.19" />
18+
<PackageReference Include="Selenium.Support" Version="4.19.0" />
19+
<PackageReference Include="Selenium.WebDriver" Version="4.19.0" />
20+
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="133.0.6943.5300" />
21+
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
22+
<PackageReference Include="xunit" Version="2.4.1" />
23+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
24+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25+
<PrivateAssets>all</PrivateAssets>
26+
</PackageReference>
27+
<PackageReference Include="coverlet.collector" Version="1.3.0">
28+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
29+
<PrivateAssets>all</PrivateAssets>
30+
</PackageReference>
31+
</ItemGroup>
3232

33-
<ItemGroup>
34-
<ProjectReference Include="..\LearningHub.Nhs.WebUI\LearningHub.Nhs.WebUI.csproj" />
35-
</ItemGroup>
33+
<ItemGroup>
34+
<ProjectReference Include="..\LearningHub.Nhs.WebUI\LearningHub.Nhs.WebUI.csproj" />
35+
</ItemGroup>
3636

3737
</Project>

LearningHub.Nhs.WebUI.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B5D48B6A-D4A7-494E-89C0-64428232D242}"
99
ProjectSection(SolutionItems) = preProject
1010
Directory.Build.props = Directory.Build.props
11+
Directory.Packages.props = Directory.Packages.props
1112
StyleCop.ruleset = StyleCop.ruleset
1213
EndProjectSection
1314
EndProject

LearningHub.Nhs.WebUI/Controllers/Api/UserController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ public async Task<ActionResult> CheckUserRole()
102102
/// <summary>
103103
/// to check user password is correct.
104104
/// </summary>
105-
/// <param name="currentPassword">The currentPassword.</param>
105+
/// <param name="password">The currentPassword.</param>
106106
/// <returns>The <see cref="Task{ActionResult}"/>.</returns>
107-
[HttpGet]
108-
[Route("ConfirmPassword/{currentPassword}")]
109-
public async Task<ActionResult> ConfirmPassword(string currentPassword)
107+
[HttpPost]
108+
[Route("ConfirmPassword")]
109+
public async Task<ActionResult> ConfirmPassword([FromBody] PasswordUpdateModel password)
110110
{
111-
string passwordHash = this.userService.Base64MD5HashDigest(currentPassword);
111+
string passwordHash = this.userService.Base64MD5HashDigest(password.PasswordHash);
112112
var userPersonalDetails = await this.userService.GetCurrentUserPersonalDetailsAsync();
113113
if (userPersonalDetails != null && userPersonalDetails.PasswordHash == passwordHash)
114114
{

0 commit comments

Comments
 (0)