Skip to content

Commit 2fa10e4

Browse files
authored
Merge pull request #1037 from TechnologyEnhancedLearning/MergeRc-EnglishIvy
Merge English Ivy changes to RC
2 parents a5696ab + bd801af commit 2fa10e4

File tree

212 files changed

+23187
-121
lines changed

Some content is hidden

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

212 files changed

+23187
-121
lines changed

AdminUI/LearningHub.Nhs.AdminUI/Services/MKIOMediaService.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,21 @@ public async Task<string> CreateMediaInputAsset(IFormFile file)
9191
/// <returns>.</returns>
9292
public async Task<BlobDownloadResult> DownloadMediaInputAsset(string inputAssetName, string fileName)
9393
{
94-
IAzureMediaServicesClient client = await this.CreateMediaServicesClientAsync();
94+
var client = this.GetMKIOServicesClientAsync();
95+
var assets = client.Assets.Get(inputAssetName);
96+
97+
BlobServiceClient blobServiceClient = new BlobServiceClient(this.settings.MediaKindSettings.MediaKindStorageConnectionString);
9598

96-
AssetContainerSas assetContainerSas = await client.Assets.ListContainerSasAsync(
97-
this.settings.AzureMediaResourceGroup,
98-
this.settings.AzureMediaAccountName,
99-
inputAssetName,
100-
permissions: AssetContainerPermission.Read,
101-
expiryTime: DateTime.UtcNow.AddHours(1).ToUniversalTime());
99+
BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(assets.Properties.Container);
100+
if (!await containerClient.ExistsAsync().ConfigureAwait(false))
101+
{
102+
await containerClient.CreateIfNotExistsAsync().ConfigureAwait(false);
103+
}
102104

103-
string sasUri = assetContainerSas.AssetContainerSasUrls.First();
105+
var filename1 = Regex.Replace(fileName, "[^a-zA-Z0-9.]", string.Empty);
106+
filename1 = string.IsNullOrEmpty(filename1) ? "file.txt" : filename1;
104107

105-
var blobServiceClient = new BlobContainerClient(new Uri(sasUri));
106-
var blobClient = blobServiceClient.GetBlockBlobClient(fileName);
108+
BlobClient blobClient = containerClient.GetBlobClient(filename1);
107109
var fileContent = await blobClient.DownloadContentAsync();
108110

109111
return fileContent;

LearningHub.Nhs.WebUI/Controllers/AccountController.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,18 @@ public async Task<IActionResult> CreateAccountSearchRole(AccountCreationViewMode
581581
{
582582
var accountCreation = await this.multiPageFormService.GetMultiPageFormData<AccountCreationViewModel>(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
583583

584-
return this.View("CreateAccountSearchRole", new AccountCreationViewModel { CountryId = accountCreationViewModel.CountryId });
584+
var currentJobRole = int.TryParse(accountCreation.CurrentRole, out int currentRole);
585+
if (currentJobRole && currentRole > 0)
586+
{
587+
var filterText = await this.jobRoleService.GetByIdAsync(currentRole);
588+
accountCreationViewModel.FilterText = filterText.Name;
589+
var jobrole = await this.jobRoleService.GetByIdAsync(currentRole);
590+
return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { RoleList = new List<JobRoleBasicViewModel> { jobrole }, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = 1, PageSize = UserRegistrationContentPageSize, HasItems = jobrole != null, CurrentPage = 1 }, CurrentRole = accountCreation.CurrentRole, CountryId = accountCreation.CountryId, RegionId = accountCreation.RegionId, FilterText = accountCreationViewModel.FilterText, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
591+
}
592+
else
593+
{
594+
return this.View("CreateAccountSearchRole", new AccountCreationViewModel { CountryId = accountCreationViewModel.CountryId });
595+
}
585596
}
586597

587598
/// <summary>

LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<a href="#" @click="showNotification(notification)">{{ notification.title }}</a>
3131
</td>
3232
<td class="px-sm-3 py-sm-3">
33-
<div class="d-flex justify-content-between"
33+
<div class="d-flex justify-content-between"
3434
v-for="item in notificationTypeContent(notification.notificationType)">
3535
{{ item.text }}&nbsp;
3636
<i :class="item.className"></i>
@@ -45,7 +45,7 @@
4545
</td>
4646
<td class="px-sm-3 py-sm-3">
4747
<div class="d-flex justify-content-between" v-if="notification.userDismissable">
48-
<button data-target="#deleteModal" class="nhsuk-button" data-toggle="modal" @click="selectNotification(notification)">Delete</button>
48+
<button data-target="#deleteModal" class="nhsuk-button nhsuk-u-margin-bottom-0" data-toggle="modal" @click="selectNotification(notification)">Delete</button>
4949
</div>
5050
</td>
5151
</tr>
@@ -74,7 +74,10 @@
7474
<i :class="['fal fa-envelope' + (notification.readOnDate != null ? '-open text-success' : '')]">&nbsp;</i>
7575
<a href="#" @click="showNotification(notification)">{{ notification.title }}</a>
7676
</div>
77-
<button data-target="#deleteModalButton" class="nhsuk-button" data-toggle="modal" @click="deleteNotification()" aria-label="Delete" v-if="notification.userDismissable">Delete</button>
77+
78+
<a href="#deleteModalButton" data-toggle="modal" @click="selectNotification(notification)" aria-label="Delete" v-if="notification.userDismissable">
79+
<i class="fas fa-ellipsis-h fa-lg" style="color: #435563;"></i>
80+
</a>
7881
</div>
7982

8083
<paging v-bind="this.pagingModel" @loadPage="loadPage"></paging>
@@ -170,7 +173,7 @@
170173
.catch(e => console.log(e));
171174
}
172175
},
173-
async deleteNotification() {
176+
async deleteNotification() {
174177
await axios.delete(
175178
'/api/notification/' + this.selectedNotification.notificationId + '?userNotificationId=' + this.selectedNotification.id)
176179
.catch(e => console.log(e));

LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notifications.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
<div class="modal-dialog modal-dialog-centered" role="document">
8787
<div class="modal-content">
8888
<div class="modal-header pr-0 pt-0">
89-
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
89+
<button type="button" class="close" @click="closeConfirmation" aria-label="Close">
9090
<i class="fa-solid fa-xmark"></i>
9191
</button>
9292
</div>
@@ -97,7 +97,7 @@
9797
</p>
9898
</div>
9999
<div class="modal-footer justify-content-center">
100-
<button type="button" class="nhsuk-button nhsuk-button--secondary mr-4" data-dismiss="modal">Cancel</button>
100+
<button type="button" class="nhsuk-button nhsuk-button--secondary mr-4" @click="closeConfirmation">Cancel</button>
101101
<button type="button" class="nhsuk-button" @click="deleteNotification">Delete</button>
102102
</div>
103103
</div>
@@ -142,6 +142,13 @@
142142
$('#deleteModalButton').modal('hide');
143143
$('#deleteModal').modal();
144144
},
145+
closeConfirmation() {
146+
if (document.activeElement instanceof HTMLElement) {
147+
document.activeElement.blur();
148+
}
149+
document.body.focus();
150+
setTimeout(() => { $('#deleteModal').modal('hide'); }, 10);
151+
},
145152
showNotification(notification: NotificationModel) {
146153
this.selectedNotification = notification;
147154
this.showMessage = true;
@@ -154,7 +161,7 @@
154161
},
155162
async deleteNotification() {
156163
await this.getSelectedComponent().deleteNotification();
157-
$('#deleteModal').modal('hide');
164+
this.closeConfirmation();
158165
this.showMessage = false;
159166
},
160167
notificationTypeContent() {

LearningHub.Nhs.WebUI/Styles/nhsuk/pages/bookmark.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,23 @@ td.col-type {
112112
tr.bookmark-item:hover td {
113113
background-color: $nhsuk-white;
114114
}
115+
.my-bookmark-btn:focus {
116+
outline: none;
117+
text-decoration: none !important;
118+
color: $nhsuk-black !important;
119+
background-color: $nhsuk-yellow !important;
120+
box-shadow: 0 -2px $govuk-focus-highlight-yellow, 0 4px $nhsuk-black;
121+
}
122+
123+
.my-bookmark-btn:hover {
124+
outline: none;
125+
text-decoration: none !important;
126+
}
127+
128+
.my-bookmark-btn {
129+
transition: none !important;
130+
border-radius: 0 !important;
131+
}
115132

116133
@media (min-width: 768px) {
117134

LearningHub.Nhs.WebUI/Views/Bookmark/_BookmarkAction.cshtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<span class="action-link-chevron @(Model.IsFirst? "empty" : "")">
77
@if (Model.IsFirst == false)
88
{
9-
<button name="action" value="moveup" class="btn btn-link action-link" title="Move up" aria-label="Move up">
9+
<button name="action" value="moveup" class="btn btn-link action-link my-bookmark-btn" title="Move up" aria-label="Move up">
1010
<i class="fa-solid fa-chevron-up fa-sm"></i>
1111
</button>
1212
}
@@ -15,25 +15,25 @@
1515
<span class="action-link-chevron @(Model.IsLast? "empty" : "")">
1616
@if (Model.IsLast == false)
1717
{
18-
<button name="action" value="movedown" class="btn btn-link action-link" title="Move down" aria-label="Move down">
18+
<button name="action" value="movedown" class="btn btn-link action-link my-bookmark-btn" title="Move down" aria-label="Move down">
1919
<i class="fa-solid fa-chevron-down fa-sm"></i>
2020
</button>
2121
}
2222
</span>
2323

2424
<span class="action-link-rename">
25-
<button name="action" value="rename" class="btn btn-link action-link" title="Rename">Rename</button>
25+
<button name="action" value="rename" class="btn btn-link action-link my-bookmark-btn" title="Rename">Rename</button>
2626
</span>
2727

2828
<span class="action-link-move">
2929
@if (Model.IsFolder == false)
3030
{
31-
<button name="action" value="move" class="btn btn-link action-link" title="Move">Move</button>
31+
<button name="action" value="move" class="btn btn-link action-link my-bookmark-btn" title="Move">Move</button>
3232
}
3333
</span>
3434

3535
<span class="action-link-delete">
36-
<button name="action" value="delete" class="btn btn-link action-link" title="Delete">Delete</button>
36+
<button name="action" value="delete" class="btn btn-link action-link my-bookmark-btn" title="Delete">Delete</button>
3737
</span>
3838
</form>
3939
</div>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace LearningHub.Nhs.OpenApi.Models.Configuration
2+
{
3+
/// <summary>
4+
/// The AzureBlobSettings.
5+
/// </summary>
6+
public class AzureBlobSettings
7+
{
8+
/// <summary>
9+
/// Gets or sets the connectionString.
10+
/// </summary>
11+
public string ConnectionString { get; set; } = null!;
12+
13+
/// <summary>
14+
/// Gets or sets the catalogue collection id.
15+
/// </summary>
16+
public string UploadContainer { get; set; } = null!;
17+
}
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace LearningHub.Nhs.OpenApi.Models.Configuration
2+
{
3+
/// <summary>
4+
/// The AzureConfig.
5+
/// </summary>
6+
public class AzureConfig
7+
{
8+
/// <summary>
9+
/// Gets or sets the azure blob settings.
10+
/// </summary>
11+
public AzureBlobSettings AzureBlobSettings { get; set; } = null!;
12+
/// <summary>
13+
/// Gets or sets the azure storage queue.
14+
/// </summary>
15+
public string AzureStorageQueueConnectionString { get; set; } = null!;
16+
}
17+
}

OpenAPI/LearningHub.Nhs.OpenApi.Models/Configuration/FindwiseCollectionIdSettings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@ public class FindwiseCollectionIdSettings
1414
/// Gets or sets the catalogue collection id.
1515
/// </summary>
1616
public string Catalogue { get; set; } = null!;
17+
18+
/// <summary>
19+
/// Gets or sets the AutoSuggestion collection id.
20+
/// </summary>
21+
public string AutoSuggestion { get; set; } = null!;
1722
}
1823
}

OpenAPI/LearningHub.Nhs.OpenApi.Models/Configuration/FindwiseConfig.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ namespace LearningHub.Nhs.OpenApi.Models.Configuration
55
/// </summary>
66
public class FindwiseConfig
77
{
8+
/// <summary>
9+
/// Gets or sets the base url for the Findwise Index endpoint.
10+
/// </summary>
11+
public string IndexUrl { get; set; } = null!;
12+
813
/// <summary>
914
/// Gets or sets the base url for the Findwise search service.
1015
/// </summary>
@@ -25,6 +30,16 @@ public class FindwiseConfig
2530
/// </summary>
2631
public int DefaultItemLimitForSearch { get; set; }
2732

33+
/// <summary>
34+
/// Gets or sets the description limit.
35+
/// </summary>
36+
public int DescriptionLengthLimit { get; set; }
37+
38+
/// <summary>
39+
/// Gets or sets the description length.
40+
/// </summary>
41+
public int MaximumDescriptionLength { get; set; }
42+
2843
/// <summary>
2944
/// Gets or sets the collection ids.
3045
/// </summary>
@@ -34,5 +49,10 @@ public class FindwiseConfig
3449
/// Gets or sets the special search characters.
3550
/// </summary>
3651
public string SpecialSearchCharacters { get; set; } = null!;
52+
53+
/// <summary>
54+
/// Gets or sets the index method.
55+
/// </summary>
56+
public string IndexMethod { get; set; } = null!;
3757
}
3858
}

0 commit comments

Comments
 (0)