@if (provider != null)
diff --git a/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj b/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj
index 67c025df9..82b88c37a 100644
--- a/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj
+++ b/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj
@@ -27,7 +27,7 @@
-
+
diff --git a/WebAPI/LearningHub.Nhs.Api.Shared/LearningHub.Nhs.Api.Shared.csproj b/WebAPI/LearningHub.Nhs.Api.Shared/LearningHub.Nhs.Api.Shared.csproj
index 4be0eeb12..f38e0260e 100644
--- a/WebAPI/LearningHub.Nhs.Api.Shared/LearningHub.Nhs.Api.Shared.csproj
+++ b/WebAPI/LearningHub.Nhs.Api.Shared/LearningHub.Nhs.Api.Shared.csproj
@@ -9,7 +9,7 @@
-
+ allruntime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/WebAPI/LearningHub.Nhs.Api.UnitTests/LearningHub.Nhs.Api.UnitTests.csproj b/WebAPI/LearningHub.Nhs.Api.UnitTests/LearningHub.Nhs.Api.UnitTests.csproj
index 063b86205..f61e84c2f 100644
--- a/WebAPI/LearningHub.Nhs.Api.UnitTests/LearningHub.Nhs.Api.UnitTests.csproj
+++ b/WebAPI/LearningHub.Nhs.Api.UnitTests/LearningHub.Nhs.Api.UnitTests.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/WebAPI/LearningHub.Nhs.Repository.Interface/LearningHub.Nhs.Repository.Interface.csproj b/WebAPI/LearningHub.Nhs.Repository.Interface/LearningHub.Nhs.Repository.Interface.csproj
index 22ee37034..a2ac5f308 100644
--- a/WebAPI/LearningHub.Nhs.Repository.Interface/LearningHub.Nhs.Repository.Interface.csproj
+++ b/WebAPI/LearningHub.Nhs.Repository.Interface/LearningHub.Nhs.Repository.Interface.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/WebAPI/LearningHub.Nhs.Repository/LearningHub.Nhs.Repository.csproj b/WebAPI/LearningHub.Nhs.Repository/LearningHub.Nhs.Repository.csproj
index 0c1aed810..0f94d7953 100644
--- a/WebAPI/LearningHub.Nhs.Repository/LearningHub.Nhs.Repository.csproj
+++ b/WebAPI/LearningHub.Nhs.Repository/LearningHub.Nhs.Repository.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/WebAPI/LearningHub.Nhs.Services.Interface/LearningHub.Nhs.Services.Interface.csproj b/WebAPI/LearningHub.Nhs.Services.Interface/LearningHub.Nhs.Services.Interface.csproj
index 41178c7f4..59748eeb8 100644
--- a/WebAPI/LearningHub.Nhs.Services.Interface/LearningHub.Nhs.Services.Interface.csproj
+++ b/WebAPI/LearningHub.Nhs.Services.Interface/LearningHub.Nhs.Services.Interface.csproj
@@ -16,7 +16,7 @@
-
+ all
diff --git a/WebAPI/LearningHub.Nhs.Services.UnitTests/LearningHub.Nhs.Services.UnitTests.csproj b/WebAPI/LearningHub.Nhs.Services.UnitTests/LearningHub.Nhs.Services.UnitTests.csproj
index 65fe0dcc3..7f312c998 100644
--- a/WebAPI/LearningHub.Nhs.Services.UnitTests/LearningHub.Nhs.Services.UnitTests.csproj
+++ b/WebAPI/LearningHub.Nhs.Services.UnitTests/LearningHub.Nhs.Services.UnitTests.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/WebAPI/LearningHub.Nhs.Services/LearningHub.Nhs.Services.csproj b/WebAPI/LearningHub.Nhs.Services/LearningHub.Nhs.Services.csproj
index ae225e64c..e9fa30eef 100644
--- a/WebAPI/LearningHub.Nhs.Services/LearningHub.Nhs.Services.csproj
+++ b/WebAPI/LearningHub.Nhs.Services/LearningHub.Nhs.Services.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/WebAPI/LearningHub.Nhs.Services/SearchService.cs b/WebAPI/LearningHub.Nhs.Services/SearchService.cs
index a247d9aa1..99ea20895 100644
--- a/WebAPI/LearningHub.Nhs.Services/SearchService.cs
+++ b/WebAPI/LearningHub.Nhs.Services/SearchService.cs
@@ -11,7 +11,7 @@ namespace LearningHub.Nhs.Services
using LearningHub.Nhs.Models.Entities.Analytics;
using LearningHub.Nhs.Models.Enums;
using LearningHub.Nhs.Models.Search;
- using LearningHub.Nhs.Models.Search.SearchFeedback;
+ using LearningHub.Nhs.Models.Search.SearchClick;
using LearningHub.Nhs.Models.Validation;
using LearningHub.Nhs.Services.Helpers;
using LearningHub.Nhs.Services.Interface;
@@ -512,7 +512,7 @@ public async Task CreateCatalogueSearchTermEvent(Ca
///
public async Task SendResourceSearchEventClickAsync(SearchActionResourceModel searchActionResourceModel)
{
- var searchClickPayloadModel = this.mapper.Map(searchActionResourceModel);
+ var searchClickPayloadModel = this.mapper.Map(searchActionResourceModel);
searchClickPayloadModel.TimeOfClick = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
searchClickPayloadModel.SearchSignal.ProfileSignature.ApplicationId = ApplicationId;
searchClickPayloadModel.SearchSignal.ProfileSignature.ProfileType = ProfileType;
@@ -532,7 +532,7 @@ public async Task SendResourceSearchEventClickAsync(SearchActionResourceMo
///
public async Task SendCatalogueSearchEventAsync(SearchActionCatalogueModel searchActionCatalogueModel)
{
- var searchClickPayloadModel = this.mapper.Map(searchActionCatalogueModel);
+ var searchClickPayloadModel = this.mapper.Map(searchActionCatalogueModel);
searchClickPayloadModel.TimeOfClick = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
searchClickPayloadModel.SearchSignal.ProfileSignature.ApplicationId = ApplicationId;
searchClickPayloadModel.SearchSignal.ProfileSignature.ProfileType = ProfileType;
@@ -596,7 +596,7 @@ public async Task GetAllCatalogueSearchResultsAsy
///
/// The .
///
- private async Task SendSearchEventClickAsync(SearchFeedbackPayloadModel searchClickPayloadModel, bool isResource)
+ private async Task SendSearchEventClickAsync(SearchClickPayloadModel searchClickPayloadModel, bool isResource)
{
var eventType = isResource ? "resource" : "catalog";
diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.ConsoleApp/LearningHub.Nhs.Migration.ConsoleApp.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.ConsoleApp/LearningHub.Nhs.Migration.ConsoleApp.csproj
index fdfb3d5d8..539697d49 100644
--- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.ConsoleApp/LearningHub.Nhs.Migration.ConsoleApp.csproj
+++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.ConsoleApp/LearningHub.Nhs.Migration.ConsoleApp.csproj
@@ -24,7 +24,7 @@
-
+ all
diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Interface/LearningHub.Nhs.Migration.Interface.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Interface/LearningHub.Nhs.Migration.Interface.csproj
index 279defe85..eb924766b 100644
--- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Interface/LearningHub.Nhs.Migration.Interface.csproj
+++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Interface/LearningHub.Nhs.Migration.Interface.csproj
@@ -9,7 +9,7 @@
-
+ allruntime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Models/LearningHub.Nhs.Migration.Models.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Models/LearningHub.Nhs.Migration.Models.csproj
index 1aae28941..6f4c807b7 100644
--- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Models/LearningHub.Nhs.Migration.Models.csproj
+++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Models/LearningHub.Nhs.Migration.Models.csproj
@@ -10,7 +10,7 @@
-
+ all
diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Repository/LearningHub.Nhs.Migration.Staging.Repository.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Repository/LearningHub.Nhs.Migration.Staging.Repository.csproj
index 217743117..df5c3c6c3 100644
--- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Repository/LearningHub.Nhs.Migration.Staging.Repository.csproj
+++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Repository/LearningHub.Nhs.Migration.Staging.Repository.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.UnitTests/LearningHub.Nhs.Migration.UnitTests.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.UnitTests/LearningHub.Nhs.Migration.UnitTests.csproj
index 14710ab84..16a31717c 100644
--- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.UnitTests/LearningHub.Nhs.Migration.UnitTests.csproj
+++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.UnitTests/LearningHub.Nhs.Migration.UnitTests.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration/LearningHub.Nhs.Migration.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration/LearningHub.Nhs.Migration.csproj
index 58db5c448..440ec325e 100644
--- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration/LearningHub.Nhs.Migration.csproj
+++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration/LearningHub.Nhs.Migration.csproj
@@ -12,7 +12,7 @@
-
+ allruntime; build; native; contentfiles; analyzers; buildtransitive
From 68f66fd42adc88e261234908b55af18261ac0890 Mon Sep 17 00:00:00 2001
From: Swapnamol Abraham
Date: Fri, 27 Sep 2024 16:02:33 +0100
Subject: [PATCH 16/29] TD-4373-Allow ppsx file type
---
.../LearningHub.Nhs.Database.sqlproj | 3 +-
.../Post-Deploy/Script.PostDeployment.sql | 3 +-
.../Post-Deploy/Scripts/PPSXFileType.sql | 30 +++++++++++++++++++
3 files changed, 34 insertions(+), 2 deletions(-)
create mode 100644 WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/PPSXFileType.sql
diff --git a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj
index 6f39be1b9..48f35761f 100644
--- a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj
+++ b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj
@@ -524,6 +524,7 @@
+
@@ -594,4 +595,4 @@
-
+
\ No newline at end of file
diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql
index 151c7c2c5..5d99e1884 100644
--- a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql
+++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql
@@ -81,4 +81,5 @@ UPDATE [resources].[ResourceVersion] SET CertificateEnabled = 0 WHERE VersionSta
:r .\Scripts\InitialiseDataForEmailTemplates.sql
:r .\Scripts\TD-2929_ActivityStatusUpdates.sql
:r .\Scripts\InitialiseDataForEmailTemplates.sql
-:r .\Scripts\AttributeData.sql
\ No newline at end of file
+:r .\Scripts\AttributeData.sql
+:r .\Scripts\PPSXFileType.sql
\ No newline at end of file
diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/PPSXFileType.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/PPSXFileType.sql
new file mode 100644
index 000000000..d948664ad
--- /dev/null
+++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/PPSXFileType.sql
@@ -0,0 +1,30 @@
+IF NOT EXISTS(SELECT Id FROM [resources].[FileType] where Extension ='ppsx')
+BEGIN
+INSERT INTO [resources].[FileType]
+ (Id,
+ [DefaultResourceTypeId]
+ ,[Name]
+ ,[Description]
+ ,[Extension]
+ ,[Icon]
+ ,[NotAllowed]
+ ,[Deleted]
+ ,[CreateUserId]
+ ,[CreateDate]
+ ,[AmendUserId]
+ ,[AmendDate])
+ VALUES
+ (70,
+ 9
+ ,'PowerPoint Open XML Slide Show'
+ ,'PowerPoint Open XML Slide Show'
+ ,'ppsx'
+ ,'a-mppoint-icon.svg'
+ ,0
+ ,0
+ ,57541
+ ,SYSDATETIMEOFFSET()
+ ,57541
+ ,SYSDATETIMEOFFSET())
+END
+GO
\ No newline at end of file
From 315b4e9aa7ba5d54cb5401b783bbbd0c89aa0a79 Mon Sep 17 00:00:00 2001
From: Arunima George
Date: Tue, 1 Oct 2024 10:52:12 +0100
Subject: [PATCH 17/29] TD-4430: Duplicate keywords issue
---
AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml | 6 +++---
.../contribute-resource/components/KeyWordsEditor.vue | 4 +++-
.../Scripts/vuesrc/contribute/ContentCommon.vue | 4 +++-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml
index 629e03c7c..5d69e9ee3 100644
--- a/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml
+++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml
@@ -360,14 +360,14 @@
// Split the input value by commas and trim each keyword
var values = value.split(',').map(function (item) {
- return item.trim();
+ return item.trim().toLowerCase();
});
var duplicateKeywords = [];
$('#keyword-error-span').hide();
values.forEach(function (value) {
if (value && keywords.indexOf(value) === -1) {
- keywords.push(value);
+ keywords.push(value);
$('#Keywords').val(keywords);
var tag = $('
' + value + '
');
tag.find('.fa-times').on('click', removeKeyword);
@@ -386,7 +386,7 @@
}
});
- $keywordInput.val("");
+ $keywordInput.val("");
if (keywords.length > 4) {
$('#add-keyword').attr('disabled', 'disabled');
$('#add-keyword-input').attr('disabled', 'disabled');
diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/KeyWordsEditor.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/KeyWordsEditor.vue
index 38c9c50c7..97e4ed42f 100644
--- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/KeyWordsEditor.vue
+++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/KeyWordsEditor.vue
@@ -82,10 +82,11 @@
},
async addKeyword() {
if (this.newKeyword && this.newKeywordTrimmed.length > 0) {
+ this.keywordChange();
let allTrimmedKeyword = this.newKeywordTrimmed.toLowerCase().split(',');
allTrimmedKeyword = allTrimmedKeyword.filter(e => String(e).trim());
for (var i = 0; i < allTrimmedKeyword.length; i++) {
- let item = allTrimmedKeyword[i];
+ let item = allTrimmedKeyword[i].trim();
if (item.length > 0 && item.length <= 50) {
let newKeywordObj = new KeywordModel({
keyword: item,
@@ -96,6 +97,7 @@
this.resourceDetails.resourceKeywords.push(newKeywordObj);
this.newKeyword = '';
} else if (newKeywordObj.id == 0) {
+ this.newKeyword = '';
this.keywordError = true;
this.keywordErrorMessage.push(item);
}
diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue
index 2f1f07809..8304843e1 100644
--- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue
+++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue
@@ -537,10 +537,11 @@
},
async addKeyword() {
if (this.newKeyword && this.newKeywordTrimmed.length > 0) {
+ this.keywordChange();
let allTrimmedKeyword = this.newKeywordTrimmed.toLowerCase().split(',');
allTrimmedKeyword = allTrimmedKeyword.filter(e => String(e).trim());
for (var i = 0; i < allTrimmedKeyword.length; i++) {
- let item = allTrimmedKeyword[i];
+ let item = allTrimmedKeyword[i].trim();
if (item.length > 0 && item.length <= 50) {
let newkeywordObj = new KeywordModel();
newkeywordObj.keyword = item;
@@ -554,6 +555,7 @@
}
this.newKeyword = '';
} else if (newkeywordObj.id == 0) {
+ this.newKeyword = '';
this.keywordError = true;
this.keywordErrorMessage.push(item);
}
From 8888bc500d8d97379e2258513d49adc04a97d3db Mon Sep 17 00:00:00 2001
From: ArunimaGeorge <163844873+ArunimaGeorge@users.noreply.github.com>
Date: Tue, 1 Oct 2024 11:01:30 +0100
Subject: [PATCH 18/29] Update Edit.cshtml
---
AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml
index 5d69e9ee3..19ed8d399 100644
--- a/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml
+++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml
@@ -367,7 +367,7 @@
$('#keyword-error-span').hide();
values.forEach(function (value) {
if (value && keywords.indexOf(value) === -1) {
- keywords.push(value);
+ keywords.push(value);
$('#Keywords').val(keywords);
var tag = $('
' + value + '
');
tag.find('.fa-times').on('click', removeKeyword);
@@ -457,4 +457,4 @@
-}
\ No newline at end of file
+}
From 0437380f1c113a8adf0bd3ab786487b707d6de8c Mon Sep 17 00:00:00 2001
From: Swapnamol Abraham
Date: Wed, 2 Oct 2024 15:15:43 +0100
Subject: [PATCH 19/29] TD-4388: Assessment resource settings need a required
field marker
---
.../ContributeAssessmentSettings.vue | 31 ++++++++++++++++---
1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeAssessmentSettings.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeAssessmentSettings.vue
index ab3a50bd0..b828110a1 100644
--- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeAssessmentSettings.vue
+++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeAssessmentSettings.vue
@@ -65,7 +65,7 @@
-
Provide guidance for the learner at the end of this assessment.
+
Provide guidance for the learner at the end of this assessment.
Tip
You can offer guidance to the learner at the end of the assessment such as next steps or recommendations on other learning resources to try.
-
+
@@ -131,6 +131,7 @@
endGuidance: "",
initialGuidance: "",
guidanceValid: true,
+ IsVisible: false,
}
},
watch: {
@@ -139,7 +140,7 @@
{
this.assessmentDetails.endGuidance.addBlock(BlockTypeEnum.Text);
}
- this.assessmentDetails.endGuidance.blocks[0].textBlock.content = this.endGuidance;
+ this.assessmentDetails.endGuidance.blocks[0].textBlock.content = this.endGuidance;
},
["assessmentDetails.passMark"](value){ this.assessmentDetails.passMark = this.capNumberFieldBy(value, 100)},
["assessmentDetails.maximumAttempts"](value){ this.assessmentDetails.maximumAttempts = this.capNumberFieldBy(value, 10)},
@@ -156,6 +157,14 @@
}
this.assessmentDetails.assessmentSettingsAreValid = settingsAreValid;
+
+ if (this.endGuidance != "") {
+ this.IsVisible = true;
+ }
+ else {
+ this.IsVisible = false;
+ }
+
return settingsAreValid;
},
},
@@ -169,9 +178,23 @@
{
this.endGuidance = description;
}
+
+ if (this.endGuidance != "") {
+ this.IsVisible = true;
+ }
+ else {
+ this.IsVisible = false;
+ }
},
setGuidanceValidity(valid: boolean) {
- this.guidanceValid = valid;
+ if (this.endGuidance == "") {
+ this.guidanceValid = false;
+ this.IsVisible = false;
+ }
+ else {
+ this.guidanceValid = valid;
+ this.IsVisible = true;
+ }
}
}
});
From 9d4bc518cf5b3ef44854c839d8d2f5384e9a244b Mon Sep 17 00:00:00 2001
From: Swapnamol Abraham
Date: Thu, 3 Oct 2024 11:41:13 +0100
Subject: [PATCH 20/29] TD-4819: LH-Issue showing 'Certificates' section blank
on 'My accessed learning' tray
---
.../LearningHub.Nhs.Database.sqlproj | 1 +
...LearningCertificatesDashboardResources.sql | 101 ++++++++++++++++++
.../Resources/ResourceVersionRepository.cs | 2 +-
3 files changed, 103 insertions(+), 1 deletion(-)
create mode 100644 WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetMyLearningCertificatesDashboardResources.sql
diff --git a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj
index 48f35761f..477a48869 100644
--- a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj
+++ b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj
@@ -525,6 +525,7 @@
+
diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetMyLearningCertificatesDashboardResources.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetMyLearningCertificatesDashboardResources.sql
new file mode 100644
index 000000000..986e25423
--- /dev/null
+++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetMyLearningCertificatesDashboardResources.sql
@@ -0,0 +1,101 @@
+-------------------------------------------------------------------------------
+-- Author OA
+-- Created 24 JUN 2024 Nov 2020
+-- Purpose Break down the GetDashboardResources SP to smaller SP for a specific data type
+--
+-- Modification History
+--
+-- 24 Jun 2024 OA Initial Revision
+-------------------------------------------------------------------------------
+
+CREATE PROCEDURE [resources].[GetMyLearningCertificatesDashboardResources]
+ @UserId INT,
+ @PageNumber INT = 1,
+ @TotalRecords INT OUTPUT
+AS
+BEGIN
+ DECLARE @MaxPageNumber INT = 4
+
+ IF @PageNumber > 4
+ BEGIN
+ SET @PageNumber = @MaxPageNumber
+ END
+
+ DECLARE @FetchRows INT = 3
+ DECLARE @MaxRows INT = @MaxPageNUmber * @FetchRows
+ DECLARE @OffsetRows INT = (@PageNumber - 1) * @FetchRows
+
+ DECLARE @MyActivity TABLE (ResourceId [int] NOT NULL PRIMARY KEY, ResourceActivityId [int] NOT NULL);
+ DECLARE @Resources TABLE (ResourceId [int] NOT NULL PRIMARY KEY, ResourceActivityCount [int] NOT NULL);
+
+ INSERT INTO @MyActivity
+ SELECT TOP (@MaxRows) ra.ResourceId, MAX(ra.Id) ResourceActivityId
+ FROM
+ activity.ResourceActivity ra
+ JOIN [resources].[Resource] r ON ra.ResourceId = r.Id
+ JOIN [resources].[ResourceVersion] rv ON rv.Id = ra.ResourceVersionId
+ LEFT JOIN [resources].[AssessmentResourceVersion] arv ON arv.ResourceVersionId = ra.ResourceVersionId
+ LEFT JOIN [activity].[AssessmentResourceActivity] ara ON ara.ResourceActivityId = ra.Id
+ LEFT JOIN [activity].[MediaResourceActivity] mar ON mar.ResourceActivityId = ra.Id
+ LEFT JOIN [activity].[ScormActivity] sa ON sa.ResourceActivityId = ra.Id
+ WHERE ra.UserId = @UserId AND rv.CertificateEnabled = 1
+ AND (
+ (r.ResourceTypeId IN (2, 7) AND ra.ActivityStatusId = 3 OR ra.ActivityStart < '2020-09-07 00:00:00 +00:00' OR mar.Id IS NOT NULL AND mar.PercentComplete = 100)
+ OR (r.ResourceTypeId = 6 AND (sa.CmiCoreLesson_status IN(3,5) OR (ra.ActivityStatusId IN(3, 5))))
+ OR ((r.ResourceTypeId = 11 AND arv.AssessmentType = 2) AND (ara.Score >= arv.PassMark OR ra.ActivityStatusId IN(3, 5)))
+ OR ((r.ResourceTypeId = 11 AND arv.AssessmentType =1) AND (ara.Score >= arv.PassMark AND ra.ActivityStatusId IN(3, 5,7)))
+ OR (r.ResourceTypeId IN (1, 5, 8, 9, 10, 12) AND ra.ActivityStatusId = 3))
+ GROUP BY ra.ResourceId
+ ORDER BY ResourceActivityId DESC
+
+ SELECT r.Id AS ResourceId
+ ,( SELECT TOP 1 rr.OriginalResourceReferenceId
+ FROM [resources].[ResourceReference] rr
+ JOIN hierarchy.NodePath np on np.id = rr.NodePathId and np.NodeId = n.Id and np.Deleted = 0
+ WHERE rr.ResourceId = rv.ResourceId AND rr.Deleted = 0
+ ) AS ResourceReferenceID
+ ,r.CurrentResourceVersionId AS ResourceVersionId
+ ,r.ResourceTypeId AS ResourceTypeId
+ ,rv.Title
+ ,rv.Description
+ ,CASE
+ WHEN r.ResourceTypeId = 7 THEN
+ (SELECT vrv.DurationInMilliseconds from [resources].[VideoResourceVersion] vrv WHERE vrv.[ResourceVersionId] = r.CurrentResourceVersionId)
+ WHEN r.ResourceTypeId = 2 THEN
+ (SELECT vrv.DurationInMilliseconds from [resources].[AudioResourceVersion] vrv WHERE vrv.[ResourceVersionId] = r.CurrentResourceVersionId)
+ ELSE
+ NULL
+ END AS DurationInMilliseconds
+ ,CASE WHEN n.id = 1 THEN NULL ELSE cnv.Name END AS CatalogueName
+ ,cnv.Url AS Url
+ ,CASE WHEN n.id = 1 THEN NULL ELSE cnv.BadgeUrl END AS BadgeUrl
+ ,cnv.RestrictedAccess
+ ,CAST(CASE WHEN cnv.RestrictedAccess = 1 AND auth.CatalogueNodeId IS NULL THEN 0 ELSE 1 END AS bit) AS HasAccess
+ ,ub.Id AS BookMarkId
+ ,CAST(ISNULL(ub.[Deleted], 1) ^ 1 AS BIT) AS IsBookmarked
+ ,rvrs.AverageRating
+ ,rvrs.RatingCount
+FROM @MyActivity ma
+JOIN activity.ResourceActivity ra ON ra.id = ma.ResourceActivityId
+JOIN resources.resourceversion rv ON rv.id = ra.ResourceVersionId AND rv.Deleted = 0
+JOIN Resources.Resource r ON r.Id = rv.ResourceId
+JOIN hierarchy.Publication p ON rv.PublicationId = p.Id AND p.Deleted = 0
+JOIN resources.ResourceVersionRatingSummary rvrs ON rv.Id = rvrs.ResourceVersionId AND rvrs.Deleted = 0
+JOIN hierarchy.NodeResource nr ON r.Id = nr.ResourceId AND nr.Deleted = 0
+JOIN hierarchy.Node n ON n.Id = nr.NodeId AND n.Hidden = 0 AND n.Deleted = 0
+JOIN hierarchy.NodePath np ON np.NodeId = n.Id AND np.Deleted = 0 AND np.IsActive = 1
+JOIN hierarchy.NodeVersion nv ON nv.NodeId = np.CatalogueNodeId AND nv.VersionStatusId = 2 AND nv.Deleted = 0
+JOIN hierarchy.CatalogueNodeVersion cnv ON cnv.NodeVersionId = nv.Id AND cnv.Deleted = 0
+LEFT JOIN hub.UserBookmark ub ON ub.UserId = @UserId AND ub.ResourceReferenceId = (SELECT TOP 1 rr.OriginalResourceReferenceId
+ FROM [resources].[ResourceReference] rr
+ JOIN hierarchy.NodePath np on np.id = rr.NodePathId and np.NodeId = n.Id and np.Deleted = 0
+ WHERE rr.ResourceId = rv.ResourceId AND rr.Deleted = 0)
+LEFT JOIN ( SELECT DISTINCT CatalogueNodeId
+ FROM [hub].[RoleUserGroupView] rug JOIN hub.UserUserGroup uug ON rug.UserGroupId = uug.UserGroupId
+ WHERE rug.ScopeTypeId = 1 and rug.RoleId in (1,2,3) and uug.Deleted = 0 and uug.UserId = @userId) auth ON n.Id = auth.CatalogueNodeId
+ORDER BY ma.ResourceActivityId DESC, rv.Title
+OFFSET @OffsetRows ROWS
+FETCH NEXT @FetchRows ROWS ONLY
+
+ SELECT @TotalRecords = CASE WHEN COUNT(*) > 12 THEN @MaxRows ELSE COUNT(*) END FROM @MyActivity
+END
\ No newline at end of file
diff --git a/WebAPI/LearningHub.Nhs.Repository/Resources/ResourceVersionRepository.cs b/WebAPI/LearningHub.Nhs.Repository/Resources/ResourceVersionRepository.cs
index 584da6344..cee3e6a07 100644
--- a/WebAPI/LearningHub.Nhs.Repository/Resources/ResourceVersionRepository.cs
+++ b/WebAPI/LearningHub.Nhs.Repository/Resources/ResourceVersionRepository.cs
@@ -690,7 +690,7 @@ public List GetContributions(int userId, ResourceContri
switch (dashboardType)
{
case "my-certificates":
- dashboardResources = this.DbContext.DashboardResourceDto.FromSqlRaw("resources.GetMyCertificatesDashboardResources @userId, @pageNumber, @totalRows output", param0, param1, param2).ToList();
+ dashboardResources = this.DbContext.DashboardResourceDto.FromSqlRaw("resources.GetMyLearningCertificatesDashboardResources @userId, @pageNumber, @totalRows output", param0, param1, param2).ToList();
break;
case "my-recent-completed":
dashboardResources = this.DbContext.DashboardResourceDto.FromSqlRaw("resources.GetMyRecentCompletedDashboardResources @userId, @pageNumber, @totalRows output", param0, param1, param2).ToList();
From ff2d0e2043a75da14a5095efd8913daa90993738 Mon Sep 17 00:00:00 2001
From: AnjuJose011 <154979799+AnjuJose011@users.noreply.github.com>
Date: Mon, 7 Oct 2024 12:07:11 +0100
Subject: [PATCH 21/29] removed -hyperlink
---
OpenAPI/LearningHub.Nhs.OpenApi/SwaggerDefinitions/v1.3.0.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/SwaggerDefinitions/v1.3.0.json b/OpenAPI/LearningHub.Nhs.OpenApi/SwaggerDefinitions/v1.3.0.json
index 4fdbbba8b..dcfd80c44 100644
--- a/OpenAPI/LearningHub.Nhs.OpenApi/SwaggerDefinitions/v1.3.0.json
+++ b/OpenAPI/LearningHub.Nhs.OpenApi/SwaggerDefinitions/v1.3.0.json
@@ -3,7 +3,7 @@
"info": {
"title": "LearningHub.NHS.OpenAPI",
"version": "1.3.0",
- "description": "A set of API endpoints for retrieving learning resource information from the Learning Hub learning platform. The [Learning Hub](https://learninghub.nhs.uk/) is a platform for hosting and sharing learning resources for health and social care provided by Technology Enhanced Learning (TEL) at NHS England. An application API key must be used to authorise calls to the API from external applications. To contact TEL to discuss connecting your external system to the Learning Hub, email [england.tel@nhs.net](england.tel@nhs.net)"
+ "description": "A set of API endpoints for retrieving learning resource information from the Learning Hub learning platform. The [Learning Hub](https://learninghub.nhs.uk/) is a platform for hosting and sharing learning resources for health and social care provided by Technology Enhanced Learning (TEL) at NHS England. An application API key must be used to authorise calls to the API from external applications. To contact TEL to discuss connecting your external system to the Learning Hub, email england.tel@nhs.net."
},
"paths": {
"/Bookmark/GetAllByParent": {
From 702fc223fee3a6f36ae007ede2f9cca65af123f9 Mon Sep 17 00:00:00 2001
From: AnjuJose011 <154979799+AnjuJose011@users.noreply.github.com>
Date: Tue, 15 Oct 2024 09:56:56 +0100
Subject: [PATCH 22/29] defectfix
---
.../Views/Shared/_FooterPartial.cshtml | 31 +++++++++----------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/LearningHub.Nhs.WebUI/Views/Shared/_FooterPartial.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/_FooterPartial.cshtml
index 29446946a..2c6e87651 100644
--- a/LearningHub.Nhs.WebUI/Views/Shared/_FooterPartial.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Shared/_FooterPartial.cshtml
@@ -3,28 +3,27 @@
@using LearningHub.Nhs.WebUI.Configuration;
@inject IOptions settings;
-