Skip to content

Commit 82d6823

Browse files
committed
merge RC into branch
2 parents 7a482a3 + e662e23 commit 82d6823

File tree

81 files changed

+1893
-1735
lines changed

Some content is hidden

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

81 files changed

+1893
-1735
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:

AdminUI/LearningHub.Nhs.AdminUI/Controllers/UserGroupController.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,15 @@ public async Task<IActionResult> Details(UserGroupAdminDetailViewModel userGroup
197197
if (userGroup.IsNew())
198198
{
199199
validationResult = await this.userGroupService.CreateUserGroup(userGroup);
200-
userGroup = await this.userGroupService.GetUserGroupAdminDetailbyIdAsync(validationResult.CreatedId.Value);
200+
if (validationResult.IsValid)
201+
{
202+
userGroup = await this.userGroupService.GetUserGroupAdminDetailbyIdAsync(validationResult.CreatedId.Value);
203+
}
204+
else
205+
{
206+
this.ViewBag.ErrorMessage = $"Update failed: {string.Join(Environment.NewLine, validationResult.Details)}";
207+
return this.View("Details", userGroup);
208+
}
201209
}
202210
else
203211
{

AdminUI/LearningHub.Nhs.AdminUI/Controllers/api/UserController.cs

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

AdminUI/LearningHub.Nhs.AdminUI/Helpers/LearningActivityHelper.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,15 @@ public static string GetResourceTypeVerb(this MyLearningDetailedItemViewModel my
8585
case ResourceTypeEnum.Article:
8686
return "Read";
8787
case ResourceTypeEnum.Audio:
88-
return "Played " + GetDurationText(myLearningDetailedItemViewModel.ActivityDurationSeconds * 1000);
88+
if ((myLearningDetailedItemViewModel.ActivityDurationSeconds * 1000) > myLearningDetailedItemViewModel.ResourceDurationMilliseconds)
89+
{
90+
return "Played " + GetDurationText(myLearningDetailedItemViewModel.ResourceDurationMilliseconds);
91+
}
92+
else
93+
{
94+
return "Played " + GetDurationText(myLearningDetailedItemViewModel.ActivityDurationSeconds * 1000);
95+
}
96+
8997
case ResourceTypeEnum.Embedded:
9098
return string.Empty;
9199
case ResourceTypeEnum.Equipment:
@@ -113,7 +121,15 @@ public static string GetResourceTypeVerb(this MyLearningDetailedItemViewModel my
113121
}
114122

115123
case ResourceTypeEnum.Video:
116-
return "Played " + GetDurationText(myLearningDetailedItemViewModel.ActivityDurationSeconds * 1000);
124+
if ((myLearningDetailedItemViewModel.ActivityDurationSeconds * 1000) > myLearningDetailedItemViewModel.ResourceDurationMilliseconds)
125+
{
126+
return "Played " + GetDurationText(myLearningDetailedItemViewModel.ResourceDurationMilliseconds);
127+
}
128+
else
129+
{
130+
return "Played " + GetDurationText(myLearningDetailedItemViewModel.ActivityDurationSeconds * 1000);
131+
}
132+
117133
case ResourceTypeEnum.WebLink:
118134
return "Visited";
119135
case ResourceTypeEnum.Html:

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">

AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/Details.cshtml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,32 @@
571571
</dl>
572572
</div>
573573
}
574+
@if (Model.ResourceTypeEnum == ResourceTypeEnum.Html)
575+
{
576+
<div class="col-12">
577+
<div class="id-container">Resource Reference ID: @Model.DefaultResourceReferenceId</div>
578+
<dl>
579+
<dt>Resource Version Id</dt>
580+
<dd>@Html.DisplayFor(model => model.ResourceVersionId)</dd>
581+
<dt>Resource Type</dt>
582+
<dd>
583+
@Html.DisplayFor(model => model.ResourceTypeDescription)
584+
</dd>
585+
<dt>ESR Link</dt>
586+
<dd><a href="@Model.HtmlDetails.HostedContentUrl" target="_blank">@Model.HtmlDetails.HostedContentUrl</a></dd>
587+
@if (Model.HtmlDetails.File != null)
588+
{
589+
<dt>Zip File</dt>
590+
<dd>
591+
<a href="@String.Format("{0}file/download/{1}/{2}", webSettings.Value.LearningHubAdminUrl, Model.HtmlDetails.File.FilePath, Model.HtmlDetails.File.FileName)" target="_blank" download>@Model.HtmlDetails.File.FileName</a>
592+
</dd>
593+
}
594+
595+
<dt>Content Folder</dt>
596+
<dd>@Model.HtmlDetails.ContentFilePath</dd>
597+
</dl>
598+
</div>
599+
}
574600

575601
@if (Model.ResourceTypeEnum == ResourceTypeEnum.Assessment)
576602
{

AdminUI/LearningHub.Nhs.AdminUI/Views/Shared/_Layout.cshtml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,7 @@
7878
</environment>
7979
@*<script type="text/javascript" src="~/js/bundle/header.js"></script>*@
8080
<partial name="~/Views/Shared/_ValidationScriptsPartial.cshtml" />
81-
8281
@RenderSection("Scripts", required: false)
83-
<script type="text/javascript" src="~/js/pageunload.js" asp-append-version="true"></script>
84-
<script type="text/javascript">
85-
// Bind the function to the unload event
86-
window.onunload = tellServerBrowserClosed;
87-
88-
</script>
8982
</body>
9083
</html>
9184
<!-- Build number: @settings.Value.BuildNumber -->

0 commit comments

Comments
 (0)