From 0bd9e91b7a1562101830f238bff12b6e35bfbbd4 Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Mon, 16 Jun 2025 16:59:56 +0100 Subject: [PATCH 1/3] Td-5664: Implement a business rule tieing 'Contribute a resource' and a Catalogue permission/group --- .gitignore | 3 +++ AdminUI/LearningHub.Nhs.AdminUI/web.config | 21 --------------------- LearningHub.Nhs.WebUI/web.config | 21 --------------------- WebAPI/LearningHub.Nhs.API/web.config | 21 --------------------- 4 files changed, 3 insertions(+), 63 deletions(-) delete mode 100644 AdminUI/LearningHub.Nhs.AdminUI/web.config delete mode 100644 LearningHub.Nhs.WebUI/web.config delete mode 100644 WebAPI/LearningHub.Nhs.API/web.config diff --git a/.gitignore b/.gitignore index fcd06e014..8cc7d8bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,6 @@ obj /AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj.user /WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj.user /ReportAPI/LearningHub.Nhs.ReportApi/web.config +/AdminUI/LearningHub.Nhs.AdminUI/web.config +/LearningHub.Nhs.WebUI/web.config +/WebAPI/LearningHub.Nhs.API/web.config diff --git a/AdminUI/LearningHub.Nhs.AdminUI/web.config b/AdminUI/LearningHub.Nhs.AdminUI/web.config deleted file mode 100644 index 6bcb74972..000000000 --- a/AdminUI/LearningHub.Nhs.AdminUI/web.config +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/LearningHub.Nhs.WebUI/web.config b/LearningHub.Nhs.WebUI/web.config deleted file mode 100644 index 837247997..000000000 --- a/LearningHub.Nhs.WebUI/web.config +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/WebAPI/LearningHub.Nhs.API/web.config b/WebAPI/LearningHub.Nhs.API/web.config deleted file mode 100644 index 62efcf17d..000000000 --- a/WebAPI/LearningHub.Nhs.API/web.config +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 4ec4010ce9ad18ef671129196990299e7ab24ff3 Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Mon, 16 Jun 2025 17:00:18 +0100 Subject: [PATCH 2/3] TD-5664: Implement a business rule tieing 'Contribute a resource' and a Catalogue permission/group --- .../Hierarchy/CatalogueNodeVersionRepository.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs b/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs index 38f77a37f..d12f1b730 100644 --- a/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs +++ b/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs @@ -81,10 +81,10 @@ public async Task> GetPublishedCatalogues() /// The . public IQueryable GetPublishedCataloguesForUserAsync(int userId) { - var communityCatalogue = this.DbContext.CatalogueNodeVersion.AsNoTracking() - .Include(cnv => cnv.NodeVersion.Node) - .Where(cnv => cnv.NodeVersion.VersionStatusEnum == VersionStatusEnum.Published - && cnv.NodeVersion.NodeId == 1 /* Community Catalogue */); + ////var communityCatalogue = this.DbContext.CatalogueNodeVersion.AsNoTracking() + //// .Include(cnv => cnv.NodeVersion.Node) + //// .Where(cnv => cnv.NodeVersion.VersionStatusEnum == VersionStatusEnum.Published + //// && cnv.NodeVersion.NodeId == 1 /* Community Catalogue */); var cataloguesForUser = from cnv in this.DbContext.CatalogueNodeVersion.Include(cnv => cnv.NodeVersion.Node).AsNoTracking() join nv in this.DbContext.NodeVersion.Where(cnv => cnv.VersionStatusEnum == VersionStatusEnum.Published && !cnv.Deleted) // .Include(nv => nv.Node) @@ -99,7 +99,7 @@ join n in this.DbContext.Node.Where(x => !x.Deleted) on nv.Id equals n.CurrentNodeVersionId select cnv; - var returnedCatalogues = communityCatalogue.Union(cataloguesForUser).Distinct() + var returnedCatalogues = cataloguesForUser.Distinct() .OrderBy(cnv => cnv.NodeVersion.NodeId != 1) .ThenBy(cnv => cnv.Name); From 4e100304432fa253bfcb6a96c44fa30da5d56667 Mon Sep 17 00:00:00 2001 From: swapnamol-abraham Date: Mon, 16 Jun 2025 17:07:20 +0100 Subject: [PATCH 3/3] Removed commented lines --- .../Hierarchy/CatalogueNodeVersionRepository.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs b/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs index d12f1b730..5ae373e42 100644 --- a/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs +++ b/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs @@ -81,11 +81,6 @@ public async Task> GetPublishedCatalogues() /// The . public IQueryable GetPublishedCataloguesForUserAsync(int userId) { - ////var communityCatalogue = this.DbContext.CatalogueNodeVersion.AsNoTracking() - //// .Include(cnv => cnv.NodeVersion.Node) - //// .Where(cnv => cnv.NodeVersion.VersionStatusEnum == VersionStatusEnum.Published - //// && cnv.NodeVersion.NodeId == 1 /* Community Catalogue */); - var cataloguesForUser = from cnv in this.DbContext.CatalogueNodeVersion.Include(cnv => cnv.NodeVersion.Node).AsNoTracking() join nv in this.DbContext.NodeVersion.Where(cnv => cnv.VersionStatusEnum == VersionStatusEnum.Published && !cnv.Deleted) // .Include(nv => nv.Node) on cnv.NodeVersionId equals nv.Id