Skip to content

Commit 8043fa2

Browse files
authored
Merge pull request TechnologyEnhancedLearning#1137 from TechnologyEnhancedLearning/RC
Merge RC Changes to master
2 parents 45cefe2 + 4d35089 commit 8043fa2

File tree

91 files changed

+3428
-1745
lines changed

Some content is hidden

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

91 files changed

+3428
-1745
lines changed

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,66 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v3
1212

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+
1373
- name: Setup .NET Core SDK 8.0
1474
uses: actions/setup-dotnet@v3
1575
with:
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
namespace LearningHub.Nhs.AdminUI.Controllers.Api
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Threading.Tasks;
6+
using elfhHub.Nhs.Models.Common;
7+
using elfhHub.Nhs.Models.Enums;
8+
using LearningHub.Nhs.AdminUI.Interfaces;
9+
using Microsoft.AspNetCore.Authorization;
10+
using Microsoft.AspNetCore.Mvc;
11+
using Microsoft.Extensions.Logging;
12+
using Microsoft.Extensions.Options;
13+
14+
/// <summary>
15+
/// The UserController class.
16+
/// </summary>
17+
[Authorize]
18+
[Route("api/[controller]")]
19+
[ApiController]
20+
public class UserController : BaseApiController
21+
{
22+
/// <summary>
23+
/// The elfh user service..
24+
/// </summary>
25+
private IUserService userService;
26+
27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="UserController"/> class.
29+
/// </summary>
30+
/// <param name="userService">The userService<see cref="IUserService"/>.</param>
31+
/// <param name="loginWizardService">loginWizardService.</param>
32+
/// <param name="logger">logger.</param>
33+
/// <param name="settings">Settings.</param>
34+
public UserController(IUserService userService, ILogger<UserController> logger)
35+
: base(logger)
36+
{
37+
this.userService = userService;
38+
}
39+
40+
/// <summary>
41+
/// The SessionTimeout.
42+
/// </summary>
43+
/// <returns>The <see cref="IActionResult"/>.</returns>
44+
[HttpPost("browser-close")]
45+
public IActionResult BrowserClose()
46+
{
47+
// Add browser close to the UserHistory
48+
UserHistoryViewModel userHistory = new UserHistoryViewModel()
49+
{
50+
UserId = this.CurrentUserId,
51+
UserHistoryTypeId = (int)UserHistoryType.Logout,
52+
Detail = @"User browser closed",
53+
};
54+
55+
this.userService.StoreUserHistory(userHistory);
56+
57+
return this.Ok(true);
58+
}
59+
}
60+
}

AdminUI/LearningHub.Nhs.AdminUI/Scripts/vuesrc/ckeditorwithhint.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<ckeditor v-model="description" :config="editorConfig" @ready="onEditorReady" @blur="onBlur"></ckeditor>
3+
<ckeditor class="nhsuk-textarea" v-model="description" :config="editorConfig" @ready="onEditorReady" @blur="onBlur"></ckeditor>
44
<div :class="[`pt-2 footer-text${this.valid ? '' : ' text-danger'}`]">{{ hint }}</div>
55
</div>
66
</template>

AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/CatalogueOwner.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747
<div class="row mt-5">
4848
<div class="col-12">
4949
<label>Catalogue owner email address</label>
50-
<input asp-for="OwnerEmailAddress" class="form-control" maxlength="250" />
50+
<input asp-for="OwnerEmailAddress" class="form-control nhsuk-input" maxlength="250" />
5151
<span asp-validation-for="OwnerEmailAddress"></span>
5252
</div>
5353
</div>
5454
<div class="row mt-5">
5555
<div class="col-12">
5656
<label>Notes</label>
57-
<textarea asp-for="Notes" class="form-control"></textarea>
57+
<textarea asp-for="Notes" class="form-control nhsuk-input"></textarea>
5858
<span asp-validation-for="Notes"></span>
5959
</div>
6060
</div>

AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
<div class="row mt-5">
138138
<div class="col-12">
139139
<label for="Description">Description</label>
140-
<textarea asp-for="Description" class="form-control"></textarea>
140+
<textarea asp-for="Description" class="form-control nhsuk-input"></textarea>
141141
<small id="with-hint-info" class="pt-2">Only the first 3,000 characters of the description will be used by search</small>
142142
<span asp-validation-for="Description"></span>
143143
</div>

AdminUI/LearningHub.Nhs.AdminUI/Views/Notifications/CreateEdit.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</div>
7474
<div class="form-group col-12">
7575
<label asp-for="Message" class="control-label"></label>
76-
<textarea asp-for="Message" class="form-control" rows="10" required></textarea>
76+
<textarea asp-for="Message" class="form-control nhsuk-input" rows="10" required></textarea>
7777
<span asp-validation-for="Message" class="text-danger"></span>
7878
</div>
7979
<div class="form-group col-lg-3 col-md-6">

0 commit comments

Comments
 (0)