Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c1050c6
TD-4212, TD-4231, TD-4257 - Error log issues
Swapnamol Jun 18, 2024
aab74c2
Merge branch 'Develop/Fixes/TD-4211_ProdLog_Error_fixes' into Develop…
OluwatobiAwe Jun 24, 2024
21f7f48
Merge pull request #427 from TechnologyEnhancedLearning/Develop/Fixes…
OluwatobiAwe Jun 24, 2024
ccfd1e8
TD-4271 dashboard service optimisation.
OluwatobiAwe Jun 25, 2024
2bb7a7b
removed manual Index for dashboard SP
OluwatobiAwe Jun 26, 2024
de6e357
Merge pull request #437 from TechnologyEnhancedLearning/Develop/Fixes…
OluwatobiAwe Jun 26, 2024
a18bdda
TD-4270 Archive Log Db
OluwatobiAwe Jun 27, 2024
1cbf095
Merge branch 'Develop/Fixes/TD-4211_ProdLog_Error_fixes' into Develop…
OluwatobiAwe Jun 27, 2024
4476483
Merge pull request #439 from TechnologyEnhancedLearning/Develop/Fixes…
OluwatobiAwe Jun 27, 2024
465f1f5
TD-4273 cache RoleUserGroupDetailForUser data
OluwatobiAwe Jun 27, 2024
f069fc2
LogDb script update
OluwatobiAwe Jun 27, 2024
f180ba7
Merge pull request #441 from TechnologyEnhancedLearning/Develop/Fixes…
OluwatobiAwe Jun 27, 2024
724ae3c
Merge remote-tracking branch 'origin/Develop/Fixes/TD-4211_ProdLog_Er…
OluwatobiAwe Jun 27, 2024
4a620e3
Merge pull request #443 from TechnologyEnhancedLearning/Develop/Fixes…
OluwatobiAwe Jun 27, 2024
164e4e2
TD-4285: My Learning Dashboard Tray showing Wrong Counts
Swapnamol Jun 27, 2024
6e62d21
Removed unused temp tables
Swapnamol Jun 27, 2024
8fc81c1
Merge pull request #444 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Jun 27, 2024
b29b087
merge TD-4211 into RC
OluwatobiAwe Jul 15, 2024
9565b57
LH Model update
OluwatobiAwe Jul 15, 2024
5705e2b
TD-4252: elearning resource is marked completed when the elearning re…
Swapnamol Jul 16, 2024
1b1e4fa
Merge pull request #467 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Jul 16, 2024
45708e1
TD-3308 : Fixed the issue with the javascript formatting.
Swapnamol Jul 16, 2024
70bfc90
Merge pull request #469 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Jul 16, 2024
7c75f61
Merge pull request #468 from TechnologyEnhancedLearning/RC_Local
OluwatobiAwe Jul 16, 2024
2572120
TD-3951: Corrected the error messages
Swapnamol Jul 17, 2024
ce350d1
Merge pull request #470 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Jul 17, 2024
54af04a
archive script update
OluwatobiAwe Jul 17, 2024
259a681
Merge pull request #472 from TechnologyEnhancedLearning/RC_Local
OluwatobiAwe Jul 17, 2024
b032442
disable script build for TD-4211
OluwatobiAwe Jul 17, 2024
b48b49e
Merge pull request #474 from TechnologyEnhancedLearning/RC_Local
OluwatobiAwe Jul 17, 2024
ba6c465
TD-3951: Bookmark screen error messages
Swapnamol Jul 18, 2024
76c8da3
Merge pull request #477 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Jul 18, 2024
5ff66dd
TD-3707: Fixed issue on first question expanding after all questions …
ArunimaGeorge Jul 23, 2024
30e5844
TD-3308 : Added additional error message on the contribute screen
Swapnamol Jul 23, 2024
e9d1cc4
Merge pull request #480 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Jul 23, 2024
34d90a3
TD-4421:Fixed issue on recording resource activity for Files when dow…
ArunimaGeorge Jul 23, 2024
36afb9a
Merge pull request #481 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge Jul 23, 2024
ae669c2
TD-4420: Issue viewing the resource when republished the HTML resourc…
Swapnamol Jul 24, 2024
54b21bf
Merge pull request #483 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Jul 24, 2024
837e77d
mobileview url fix
AnjuJose011 Jul 24, 2024
9149f32
Merge pull request #484 from TechnologyEnhancedLearning/Develop/Fixes…
AnjuJose011 Jul 24, 2024
a0702e3
Merge pull request #479 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge Jul 24, 2024
b480d2e
TD-3308: Added validation for case and assessment contribution page a…
Swapnamol Jul 24, 2024
01d3751
Removed the debugger
Swapnamol Jul 24, 2024
24132d6
Removed the commented lines
Swapnamol Jul 24, 2024
9275522
Merge pull request #485 from TechnologyEnhancedLearning/Develop/Fixes…
AnjuJose011 Jul 25, 2024
3e1dd09
lh model version update
OluwatobiAwe Jul 25, 2024
874879c
Merge pull request #488 from TechnologyEnhancedLearning/Develop/Fixes…
OluwatobiAwe Jul 25, 2024
d7ef467
Fixes
AnjuJose011 Jul 25, 2024
7512763
Merge pull request #494 from TechnologyEnhancedLearning/Develp/Fix/TD…
AnjuJose011 Jul 25, 2024
ca9c913
Fixes-For-LastOn
AnjuJose011 Jul 31, 2024
25e362d
Merge pull request #507 from TechnologyEnhancedLearning/develop-fixes
AnjuJose011 Jul 31, 2024
d5586e6
Merge Rc cahnges
AnjuJose011 Jul 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ public static string GetResourceTypeVerb(this MyLearningDetailedItemViewModel my
return "Played " + GetDurationText(myLearningDetailedItemViewModel.ActivityDurationSeconds * 1000);
case ResourceTypeEnum.WebLink:
return "Visited";
case ResourceTypeEnum.Html:
return "Viewed";
case ResourceTypeEnum.Case:
return "Accessed";
case ResourceTypeEnum.Assessment:
return "Accessed";
default:
return string.Empty;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<PackageReference Include="HtmlSanitizer" Version="6.0.453" />
<PackageReference Include="IdentityModel" Version="4.4.0" />
<PackageReference Include="LearningHub.Nhs.Caching" Version="2.0.2" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.31" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.33" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.19.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
Expand Down
749 changes: 383 additions & 366 deletions AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public async Task<IActionResult> DownloadResourceAndRecordActivity(int resourceV
ActivityStatus = ActivityStatusEnum.Completed,
};
await this.activityService.CreateResourceActivityAsync(activity);

return this.File(file.Content, file.ContentType, fileName);
}
else
Expand Down
10 changes: 10 additions & 0 deletions LearningHub.Nhs.WebUI/Controllers/BookmarkController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ public async Task<IActionResult> BookmarkToggle(EditBookmarkViewModel bookmark,
{
if (!this.ModelState.IsValid)
{
this.ModelState.Remove(nameof(bookmark.Title));
if (bookmark.BookmarkTypeId == 1)
{
this.ModelState.AddModelError(nameof(bookmark.Title), "You must enter a folder name");
}
else
{
this.ModelState.AddModelError(nameof(bookmark.Title), "You must enter a bookmark name");
}

this.ViewBag.ReturnUrl = returnUrl;
return this.View("Toggle", bookmark);
}
Expand Down
2 changes: 0 additions & 2 deletions LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ public async Task<IActionResult> IndexAsync(string reference, string tab, int? n
CatalogueAccessRequestViewModel catalogueAccessRequest = null;
if (this.ViewBag.UserAuthenticated)
{
var cacheKey = $"{this.CurrentUserId}:AllRolesWithPermissions";
await this.cacheService.RemoveAsync(cacheKey);
userGroups = await this.userGroupService.GetRoleUserGroupDetailAsync();
catalogueAccessRequest = await this.catalogueService.GetLatestCatalogueAccessRequestAsync(catalogue.NodeId);
}
Expand Down
22 changes: 16 additions & 6 deletions LearningHub.Nhs.WebUI/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,17 @@ public async Task<IActionResult> Index(string myLearningDashboard = "my-in-progr
this.Logger.LogInformation("User is authenticated: User is {fullname} and userId is: {lhuserid}", this.User.Identity.GetCurrentName(), this.User.Identity.GetCurrentUserId());
if (this.User.IsInRole("Administrator") || this.User.IsInRole("BlueUser") || this.User.IsInRole("ReadOnly") || this.User.IsInRole("BasicUser"))
{
var learningTask = this.dashboardService.GetMyAccessLearningsAsync(myLearningDashboard, 1);
var resourcesTask = this.dashboardService.GetResourcesAsync(resourceDashboard, 1);
var cataloguesTask = this.dashboardService.GetCataloguesAsync(catalogueDashboard, 1);

await Task.WhenAll(learningTask, resourcesTask, cataloguesTask);

var model = new DashboardViewModel()
{
MyLearnings = await this.dashboardService.GetMyAccessLearningsAsync(myLearningDashboard, 1),
Resources = await this.dashboardService.GetResourcesAsync(resourceDashboard, 1),
Catalogues = await this.dashboardService.GetCataloguesAsync(catalogueDashboard, 1),
MyLearnings = await learningTask,
Resources = await resourcesTask,
Catalogues = await cataloguesTask,
};

if (!string.IsNullOrEmpty(this.Request.Query["preview"]) && Convert.ToBoolean(this.Request.Query["preview"]))
Expand Down Expand Up @@ -271,9 +277,13 @@ public async Task<IActionResult> LoadPage(string dashBoardTray = "my-learning",
}
else
{
model.MyLearnings = await this.dashboardService.GetMyAccessLearningsAsync(myLearningDashBoard, dashBoardTray == "my-learning" ? pageNumber : 1);
model.Resources = await this.dashboardService.GetResourcesAsync(resourceDashBoard, dashBoardTray == "resources" ? pageNumber : 1);
model.Catalogues = await this.dashboardService.GetCataloguesAsync(catalogueDashBoard, dashBoardTray == "catalogues" ? pageNumber : 1);
var learningTask = this.dashboardService.GetMyAccessLearningsAsync(myLearningDashBoard, dashBoardTray == "my-learning" ? pageNumber : 1);
var resourcesTask = this.dashboardService.GetResourcesAsync(resourceDashBoard, dashBoardTray == "resources" ? pageNumber : 1);
var cataloguesTask = this.dashboardService.GetCataloguesAsync(catalogueDashBoard, dashBoardTray == "catalogues" ? pageNumber : 1);
await Task.WhenAll(learningTask, resourcesTask, cataloguesTask);
model.MyLearnings = await learningTask;
model.Resources = await resourcesTask;
model.Catalogues = await cataloguesTask;
return this.View("Dashboard", model);
}
}
Expand Down
17 changes: 12 additions & 5 deletions LearningHub.Nhs.WebUI/Controllers/ResourceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public async Task<IActionResult> Index(int resourceReferenceId, bool? acceptSens

var resource = await this.resourceService.GetItemByIdAsync(resourceReferenceId);

if (resource.Id == 0 || (resource.Catalogue != null && resource.Catalogue.Hidden))
if ((resource == null && resource.Id == 0) || (resource.Catalogue != null && resource.Catalogue.Hidden))
{
this.ViewBag.SupportFormUrl = this.Settings.SupportUrls.SupportForm;
return this.View("Unavailable");
Expand All @@ -147,7 +147,7 @@ public async Task<IActionResult> Index(int resourceReferenceId, bool? acceptSens
var hasCatalogueAccess = false;
if (resource.Catalogue.RestrictedAccess && this.User.Identity.IsAuthenticated)
{
var userGroups = await this.userGroupService.GetRoleUserGroupDetailForUserAsync(this.CurrentUserId);
var userGroups = await this.userGroupService.GetRoleUserGroupDetailAsync();

hasCatalogueAccess = userGroups.Any(x => x.CatalogueNodeId == resource.Catalogue.NodeId &&
(x.RoleEnum == RoleEnum.LocalAdmin || x.RoleEnum == RoleEnum.Editor || x.RoleEnum == RoleEnum.Reader)) || this.User.IsInRole("Administrator");
Expand Down Expand Up @@ -437,12 +437,13 @@ public async Task<IActionResult> UnpublishConfirm(ResourceUnpublishConfirmViewMo
/// View HTML resource content.
/// </summary>
/// <param name="resourceReferenceId">Resource reference id.</param>
/// <param name="currentResourceVersionId">Resource version id.</param>
/// <param name="path">Html resource content relative path.</param>
/// <returns>The file content.</returns>
[HttpGet]
[Authorize]
[Route("resource/html/{resourceReferenceId}/{*path}")]
public async Task<IActionResult> HtmlResourceContent(int resourceReferenceId, string path)
[Route("resource/html/{resourceReferenceId}/{CurrentResourceVersionId}/{*path}")]
public async Task<IActionResult> HtmlResourceContent(int resourceReferenceId, int currentResourceVersionId, string path)
{
if (resourceReferenceId == 0 || string.IsNullOrWhiteSpace(path))
{
Expand All @@ -452,8 +453,14 @@ public async Task<IActionResult> HtmlResourceContent(int resourceReferenceId, st
var userId = this.User.Identity.GetCurrentUserId();
var cacheKey = $"HtmlContent:{userId}:{resourceReferenceId}";
var (cacheExists, cacheValue) = await this.cacheService.TryGetAsync<string>(cacheKey);
var oldresourceVersionId = 0;
if (cacheExists)
{
var cachesplits = cacheValue.Split(":");
oldresourceVersionId = int.Parse(cachesplits[0]);
}

if (!cacheExists)
if (!cacheExists || (oldresourceVersionId != currentResourceVersionId))
{
var resource = await this.resourceService.GetItemByIdAsync(resourceReferenceId);

Expand Down
6 changes: 6 additions & 0 deletions LearningHub.Nhs.WebUI/Helpers/ViewActivityHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ public static string GetResourceTypeVerb(this ActivityDetailedItemViewModel acti
return "Played " + GetDurationText(activityDetailedItemViewModel.ActivityDurationSeconds * 1000);
case ResourceTypeEnum.WebLink:
return "Visited";
case ResourceTypeEnum.Html:
return "Viewed";
case ResourceTypeEnum.Case:
return "Accessed";
case ResourceTypeEnum.Assessment:
return "Accessed";
default:
return string.Empty;
}
Expand Down
2 changes: 1 addition & 1 deletion LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<PackageReference Include="HtmlAgilityPack" Version="1.11.38" />
<PackageReference Include="IdentityModel" Version="4.3.0" />
<PackageReference Include="LearningHub.Nhs.Caching" Version="2.0.0" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.31" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.33" />
<PackageReference Include="linqtotwitter" Version="6.9.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.19.0" />
<PackageReference Include="Microsoft.ApplicationInsights.EventCounterCollector" Version="2.21.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class EditBookmarkViewModel
/// <summary>
/// Gets or sets Title.
/// </summary>
[Required(AllowEmptyStrings = false, ErrorMessage = "You must edit bookmark name")]
[Required(AllowEmptyStrings = false, ErrorMessage = "You must enter a bookmark name")]
[MinLength(2, ErrorMessage = "The bookmark name must be at least 2 characters")]
[MaxLength(60, ErrorMessage = "The bookmark name must be no more than 60 characters")]
public string Title { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
<template>
<div class="key-words-editor-component">
<div class="common-content">

<div class="my-2 input-with-button">
<CharacterCount v-model="newKeyword"
inputId="newKeyword"
v-bind:characterLimit="50"
v-bind:hasOtherError="keywordError"
@input="keywordError=false">
<template v-slot:title>
Keywords
</template>
<template v-slot:otherErrorMessage>
<div class="row">
<div class="form-group" v-bind:class="{ 'input-validation-error': keywordError }">
<div class="col-12 mb-0 error-text" v-if="keywordError">
<span class="text-danger">This keyword has already been added.</span>
</template>
<template v-slot:description>
To help learners find this resource, type one or more relevant keywords separated by commas and click 'Add'.
</template>
<template v-slot:afterInput>
<Button class="ml-3" v-on:click="addKeyword">Add</Button>
</template>
</CharacterCount>
</div>
</div>
<div class="col-12 mb-0 error-text" v-if="keywordLengthExceeded">
<span class="text-danger">
Each keyword must be no longer than 50 characters.
</span>
</div>

<div class="col-12">
To help learners find this resource, type one or more relevant keywords separated by commas and click 'Add'.
</div>
<div class="col-12 input-with-button">
<input id="newKeyword" aria-labelledby="keyword-label" type="text" class="form-control" maxlength="260" v-model="newKeyword" v-bind:class="{ 'input-validation-error': keywordError }" @input="keywordError=false" @change="keywordChange" />
<button type="button" class="nhsuk-button nhsuk-button--secondary ml-3 button_width nhsuk-u-margin-bottom-0" @click="addKeyword">&nbsp;Add</button>
</div>
<div class="col-12 footer-text">
You can enter a maximum of 50 characters per keyword
</div>
</div>
</div>
<div class="keyword-container my-4 d-flex">
<div class="keyword-tag" v-for="keyword in resourceDetails.resourceKeywords" :key="keyword.id">
<button class="btn btn-link" aria-label="Delete keyword" @click="deleteKeyword(keyword.id)">
Expand Down Expand Up @@ -57,6 +59,7 @@
return {
newKeyword: '',
keywordError: false,
keywordLengthExceeded: false,
}
},
computed: {
Expand All @@ -68,14 +71,18 @@
},
},
methods: {
keywordChange() {
this.keywordError = false;
this.keywordLengthExceeded = false;
},
async addKeyword() {
if (this.newKeyword && this.newKeywordTrimmed.length > 0) {
let allTrimmedKeyword = this.newKeywordTrimmed.toLowerCase().split(',');
allTrimmedKeyword = allTrimmedKeyword.filter(e => String(e).trim());
if (!this.resourceDetails.resourceKeywords.find(_keyword => allTrimmedKeyword.includes(_keyword.keyword.toLowerCase()))) {
for (var i = 0; i < allTrimmedKeyword.length; i++) {
let item = allTrimmedKeyword[i];
if (item.length > 0) {
if (item.length > 0 && item.length <= 50) {
let newKeywordObj = new KeywordModel({
keyword: item,
resourceVersionId: this.resourceVersionId,
Expand All @@ -93,13 +100,10 @@

}
else {
this.keywordError = true;
this.keywordLengthExceeded = true;
}
}

}


}
else {
this.keywordError = true;
}
Expand All @@ -122,6 +126,10 @@
display: flex;
align-items: center;
}
.button_width
{
width:15%;
}

.input-with-button::v-deep #newKeyword {
text-transform: lowercase;
Expand Down
12 changes: 12 additions & 0 deletions LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@
<div class="col-12 mb-0 error-text" v-if="keywordError">
<span class="text-danger">This keyword has already been added.</span>
</div>
<div class="col-12 mb-0 error-text" v-if="keywordLengthExceeded">
<span class="text-danger">
Each keyword must be no longer than 50 characters.
</span>
</div>

<div class="col-12">
To help learners find this resource, type one or more relevant keywords separated by commas and click 'Add'.
</div>
Expand Down Expand Up @@ -285,6 +291,7 @@
editorConfig: { toolbar: CKEditorToolbar.default, versionCheck: false },
ResourceType,
resourceProviderId: null,
keywordLengthExceeded: false,
};
},
computed: {
Expand Down Expand Up @@ -477,6 +484,7 @@
},
keywordChange() {
this.keywordError = false;
this.keywordLengthExceeded = false;
},
resetSelectedLicence() {
this.resourceLicenceId = 0;
Expand Down Expand Up @@ -547,6 +555,10 @@
break;
}
}
else {
this.keywordLengthExceeded = true;
break;
}
}
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
:firstUnansweredQuestion="pagesProgress.map((e, i) => i < questionInFocus || e).findIndex(p => !p) === index"
:isQuestionInFocus="questionInFocus === index"
:answerInOrder="answerInOrder"
:allQuestAnswered="allQuestionsAnswered"
@updateQuestionProgress="isComplete => pushUpdate(index, isComplete)"
@nextPage="$emit('nextPage')"
@submitAssessmentAnswers="answers => $emit(`submitAssessmentAnswers`, answers, block.blockRef)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@
isQuestionInFocus: { type: Boolean, default: false },
firstUnansweredQuestion: Boolean,
matchQuestionsState: { type: Array } as PropOptions<MatchQuestionState[]>,
answerInOrder: Boolean
answerInOrder: Boolean,
allQuestAnswered: { type: Boolean, default: false }
},
components: {
MatchGameSubmissionView,
Expand Down Expand Up @@ -268,6 +269,9 @@
},
isQuestionInFocus(value) {
this.isOpen = value;
if (this.allQuestAnswered) {
this.isOpen = false;
}
}
},
methods: {
Expand Down
Loading