From dc60cfd8fcba61430489e8345ec4b2612a2e6e89 Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Thu, 7 Aug 2025 12:45:46 +0100 Subject: [PATCH 1/7] TD-5892: bug fix for the new resource creation --- .../vuesrc/contribute-resource/ContributeLocationTab.vue | 7 ++++--- .../Scripts/vuesrc/contribute/ContentCommon.vue | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeLocationTab.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeLocationTab.vue index 8af5f25c..5cb06877 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeLocationTab.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/ContributeLocationTab.vue @@ -85,14 +85,15 @@ return new CatalogueModel({ nodeId: 0 }); }, resourceDescription(): string { - return this.resourceDetails.description; + return this.resourceDetails.description; }, isDividerVisible(): boolean { return this.resourceDetails.resourceCatalogueId >= 0 && this.selectionInProgress; }, allowCatalogueChange(): boolean { - return (!Boolean(this.$route.query.initialCreate)); // allow if user is contributing into the catalogue root // or if the user is editing an existing draft (initialCreate=false) - //this.resourceDetails.resourceCatalogueId === this.resourceDetails.nodeId) || + return (this.resourceDetails.resourceCatalogueId === this.resourceDetails.nodeId) || // allow if user is contributing into the catalogue root + !Boolean(this.$route.query.initialCreate); + // allow if user is contributing into the catalogue root // or if the user is editing an existing draft (initialCreate=false) }, onChangeClick() { this.$emit('change-click'); diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue index f62b7d78..1d4cf7f6 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue @@ -314,11 +314,11 @@ return this.$store.state.userProviders; }, resourceCatalogueCount(): number { - if (!this.$store.state.userCatalogues) { + if (!this.$store.state.userCatalogues) { return 0; } else { return this.$store.state.userCatalogues.length; - } + } }, userIsAuthor(): boolean { return this.authors.filter(a => a.isContributor).length > 0; @@ -333,9 +333,8 @@ return this.$store.state.resourceDetail.resourceType; }, showCatalogueSelect(): boolean { - //return (this.resourceDetail.resourceCatalogueId === this.resourceDetail.nodeId) || // show if user is contributing into the catalogue root - // !Boolean(this.$route.query.initialCreate); // or if the user is editing an existing draft (initialCreate=false) - return (!Boolean(this.$route.query.initialCreate)); + return (this.resourceDetail.resourceCatalogueId === this.resourceDetail.nodeId) || // show if user is contributing into the catalogue root + !Boolean(this.$route.query.initialCreate); // or if the user is editing an existing draft (initialCreate=false) }, newKeywordTrimmed(): string { return this.newKeyword?.trim().replace(/ +(?= )/g, ''); From e403b98199246fe9ad0de26f873f5eb8a17dca96 Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Fri, 8 Aug 2025 14:13:43 +0100 Subject: [PATCH 2/7] TD-5892: bug fix --- .../Scripts/vuesrc/contribute/ContentCommon.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue index 1d4cf7f6..1d153452 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue @@ -243,7 +243,7 @@ - + From b1b2ac51e9c02c0e760b83e9892dfb90ac699995 Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Mon, 11 Aug 2025 17:11:43 +0100 Subject: [PATCH 3/7] TD-5916: Catalogue access not working --- .../Views/Catalogue/Index.cshtml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Catalogue/Index.cshtml b/LearningHub.Nhs.WebUI/Views/Catalogue/Index.cshtml index c3dbb7e4..03ef6c17 100644 --- a/LearningHub.Nhs.WebUI/Views/Catalogue/Index.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Catalogue/Index.cshtml @@ -9,16 +9,15 @@ ViewData["Title"] = "Catalogue"; - bool CanManage() - { - return IsInRole(RoleEnum.LocalAdmin); - } + bool CanManage() + { + return IsInRole(RoleEnum.LocalAdmin); + } - bool Unlocked() - { - return IsInRole(RoleEnum.LocalAdmin) || IsInRole(RoleEnum.Editor) || IsInRole(RoleEnum.Reader) ; - //// || this.User.IsInRole("Administrator") - } + bool Unlocked() + { + return IsInRole(RoleEnum.LocalAdmin) || IsInRole(RoleEnum.Editor) || IsInRole(RoleEnum.Reader) || this.User.IsInRole("Administrator"); + } bool IsInRole(RoleEnum role) { From fe9a09365467e9fcaed42c0c98ed5ff6b3b14c9d Mon Sep 17 00:00:00 2001 From: Arunima George Date: Mon, 11 Aug 2025 17:29:24 +0100 Subject: [PATCH 4/7] TD-5917: Fixed padding issue. --- LearningHub.Nhs.WebUI/Styles/nhsuk/layout.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LearningHub.Nhs.WebUI/Styles/nhsuk/layout.scss b/LearningHub.Nhs.WebUI/Styles/nhsuk/layout.scss index 25b84b7d..0e2ac3ad 100644 --- a/LearningHub.Nhs.WebUI/Styles/nhsuk/layout.scss +++ b/LearningHub.Nhs.WebUI/Styles/nhsuk/layout.scss @@ -53,7 +53,7 @@ button[data-toggle="modal"] { } .autosuggestion-menu { - padding: 16px 16px 0px 16px; + padding: 16px 16px 0px 16px !important; background-color: $color_nhsuk-white; border-bottom: 1px solid $color_nhsuk-grey-4; border-radius: 0px 0px 4px 4px; From 4905788549f49d1ce64d0ec97df9737c1e6a23a3 Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Tue, 12 Aug 2025 11:28:54 +0100 Subject: [PATCH 5/7] TD-5920: Issue showing catalogue as 'Access restricted' on Catalogues tray for which admin accepted the catalogue request --- .../Stored Procedures/Hierarchy/GetDashboardCatalogues.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetDashboardCatalogues.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetDashboardCatalogues.sql index 625a1680..6210d784 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetDashboardCatalogues.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetDashboardCatalogues.sql @@ -219,7 +219,7 @@ BEGIN ,cnv.CardImageUrl ,cnv.Url ,cnv.RestrictedAccess - ,CAST(CASE WHEN cnv.RestrictedAccess = 1 THEN 0 ELSE 1 END AS bit) AS HasAccess + ,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 FROM @MyActivity ma From a1e305872a0c23ec208ff297fb0bdbd4803e964b Mon Sep 17 00:00:00 2001 From: OluwatobiAwe Date: Wed, 13 Aug 2025 12:47:52 +0100 Subject: [PATCH 6/7] TD-5490 auth issues for LH api request when user is yet to login --- .../Controllers/BookmarkController.cs | 2 ++ .../Controllers/CatalogueController.cs | 1 + .../Controllers/ResourceController.cs | 1 + .../Controllers/SearchController.cs | 2 ++ OpenAPI/LearningHub.Nhs.OpenApi/Startup.cs | 18 ++++++++++-------- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/BookmarkController.cs b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/BookmarkController.cs index 867f295f..4adaebe2 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/BookmarkController.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/BookmarkController.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using LearningHub.Nhs.Models.Bookmark; using LearningHub.Nhs.OpenApi.Services.Interface.Services; + using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; /// @@ -11,6 +12,7 @@ /// [Route("Bookmark")] [ApiController] + [Authorize] public class BookmarkController : OpenApiControllerBase { private readonly IBookmarkService bookmarkService; diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/CatalogueController.cs b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/CatalogueController.cs index 35686597..15926b75 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/CatalogueController.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/CatalogueController.cs @@ -14,6 +14,7 @@ /// [Route("Catalogue")] [Authorize] + [ApiController] public class CatalogueController : OpenApiControllerBase { private readonly ICatalogueService catalogueService; diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/ResourceController.cs b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/ResourceController.cs index 98ae2417..343906d9 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/ResourceController.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/ResourceController.cs @@ -29,6 +29,7 @@ namespace LearningHub.NHS.OpenAPI.Controllers /// [Route("Resource")] [Authorize] + [ApiController] public class ResourceController : OpenApiControllerBase { private const int MaxNumberOfReferenceIds = 1000; diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/SearchController.cs b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/SearchController.cs index b8a0b5aa..2b463125 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/SearchController.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi/Controllers/SearchController.cs @@ -11,6 +11,7 @@ using LearningHub.Nhs.OpenApi.Models.Configuration; using LearningHub.Nhs.OpenApi.Repositories.Interface.Repositories; using LearningHub.Nhs.OpenApi.Services.Interface.Services; + using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -18,6 +19,7 @@ /// /// Search operations. /// + [Authorize] [Route("Search")] [ApiController] public class SearchController : OpenApiControllerBase diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/Startup.cs b/OpenAPI/LearningHub.Nhs.OpenApi/Startup.cs index e5f9c180..dfe34b2b 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi/Startup.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi/Startup.cs @@ -8,10 +8,12 @@ namespace LearningHub.NHS.OpenAPI using System.Collections.Generic; using System.IO; using AspNetCore.Authentication.ApiKey; + using LearningHub.Nhs.Api.Authentication; using LearningHub.Nhs.Caching; using LearningHub.Nhs.Models.Enums; using LearningHub.Nhs.Models.Extensions; using LearningHub.NHS.OpenAPI.Auth; + using LearningHub.NHS.OpenAPI.Authentication; using LearningHub.NHS.OpenAPI.Configuration; using LearningHub.NHS.OpenAPI.Middleware; using LearningHub.Nhs.OpenApi.Repositories; @@ -19,9 +21,9 @@ namespace LearningHub.NHS.OpenAPI using LearningHub.Nhs.OpenApi.Services; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.JwtBearer; + using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; - using Microsoft.AspNetCore.Mvc.Authorization; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -29,9 +31,6 @@ namespace LearningHub.NHS.OpenAPI using Microsoft.Extensions.Hosting; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; - using Microsoft.AspNetCore.Authorization; - using LearningHub.NHS.OpenAPI.Authentication; - using LearningHub.Nhs.Api.Authentication; /// /// The Startup class. @@ -62,8 +61,12 @@ public void ConfigureServices(IServiceCollection services) services.AddApiKeyAuth(); - services.AddAuthentication() - .AddJwtBearer(options => + services.AddAuthentication(options => + { + options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; + }) + .AddJwtBearer(options => { options.Authority = this.Configuration.GetValue("LearningHUbAuthServiceConfig:Authority"); options.TokenValidationParameters = new TokenValidationParameters() @@ -76,7 +79,7 @@ public void ConfigureServices(IServiceCollection services) }); services.AddCustomMiddleware(); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddRepositories(this.Configuration); @@ -89,7 +92,6 @@ public void ConfigureServices(IServiceCollection services) services.AddControllers(options => { options.Filters.Add(new HttpResponseExceptionFilter()); - options.Filters.Add(new AuthorizeFilter()); }); services.AddMvc() From ab438ca7fa9f0fffde80eeb5c0a082daa86945d8 Mon Sep 17 00:00:00 2001 From: OluwatobiAwe Date: Wed, 13 Aug 2025 16:28:48 +0100 Subject: [PATCH 7/7] TD-5929 Added missing appsettings variable --- OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json b/OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json index 401183bf..7142f4b3 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json +++ b/OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json @@ -78,6 +78,7 @@ "UseRedisCache": true, "ResourcePublishQueueRouteName": "", "HierarchyEditPublishQueueName": "", + "ContentManagementQueueName": "", "AuthClientIdentityKey": "", "LHClientIdentityKey": "", "ReportApiClientIdentityKey": "",