diff --git a/LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs b/LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs index 2fca0012e..12d9973ac 100644 --- a/LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs @@ -587,8 +587,7 @@ public async Task RequestPreviewAccess(CatalogueRequestAccessView [Route("/allcatalogue/{filterChar}")] public async Task GetAllCatalogue(string filterChar = "a") { - var pageSize = this.settings.AllCataloguePageSize; - var catalogues = await this.catalogueService.GetAllCatalogueAsync(filterChar, pageSize); + var catalogues = await this.catalogueService.GetAllCatalogueAsync(filterChar); return this.View("allcatalogue", catalogues); } diff --git a/LearningHub.Nhs.WebUI/Interfaces/ICatalogueService.cs b/LearningHub.Nhs.WebUI/Interfaces/ICatalogueService.cs index 635eee151..e7770fd86 100644 --- a/LearningHub.Nhs.WebUI/Interfaces/ICatalogueService.cs +++ b/LearningHub.Nhs.WebUI/Interfaces/ICatalogueService.cs @@ -143,8 +143,7 @@ public interface ICatalogueService /// The GetAllCatalogueAsync. /// /// The letter. - /// The pageSize. /// The allcatalogue result based on letters. - Task GetAllCatalogueAsync(string filterChar, int pageSize); + Task GetAllCatalogueAsync(string filterChar); } } diff --git a/LearningHub.Nhs.WebUI/Services/CatalogueService.cs b/LearningHub.Nhs.WebUI/Services/CatalogueService.cs index 615363cfd..a8a6d3055 100644 --- a/LearningHub.Nhs.WebUI/Services/CatalogueService.cs +++ b/LearningHub.Nhs.WebUI/Services/CatalogueService.cs @@ -607,14 +607,13 @@ public async Task RemoveUserFromRestrictedAccessUse /// GetAllCatalogueAsync. /// /// The filterChar. - /// the pageSize. - /// A representing the result of the asynchronous operation. - public async Task GetAllCatalogueAsync(string filterChar, int pageSize) + /// /// A representing the result of the asynchronous operation. + public async Task GetAllCatalogueAsync(string filterChar) { AllCatalogueResponseViewModel viewmodel = new AllCatalogueResponseViewModel { }; var client = await this.LearningHubHttpClient.GetClientAsync(); - var request = $"catalogue/allcatalogues/{pageSize}/{filterChar}"; + var request = $"catalogue/allcatalogues/{filterChar}"; var response = await client.GetAsync(request).ConfigureAwait(false); if (response.IsSuccessStatusCode) diff --git a/LearningHub.Nhs.WebUI/appsettings.json b/LearningHub.Nhs.WebUI/appsettings.json index af3d9e063..b459b9b6b 100644 --- a/LearningHub.Nhs.WebUI/appsettings.json +++ b/LearningHub.Nhs.WebUI/appsettings.json @@ -112,8 +112,8 @@ "MediaKindStorageConnectionString": "" }, "EnableTempDebugging": "false", - "LimitScormToAdmin": "false", - "AllCataloguePageSize": 10 + "LimitScormToAdmin": "false" + }, "LearningHubAuthServiceConfig": { "Authority": "", diff --git a/WebAPI/LearningHub.Nhs.API/Controllers/CatalogueController.cs b/WebAPI/LearningHub.Nhs.API/Controllers/CatalogueController.cs index 814d16dd4..beb33ad24 100644 --- a/WebAPI/LearningHub.Nhs.API/Controllers/CatalogueController.cs +++ b/WebAPI/LearningHub.Nhs.API/Controllers/CatalogueController.cs @@ -375,14 +375,13 @@ public async Task AccessRequest(int accessRequestId) /// /// Gets AllCatalogues. /// - /// The pageSize. /// The filterChar. /// IActionResult. [HttpGet] - [Route("allcatalogues/{pageSize}/{filterChar}")] - public async Task GetAllCataloguesAsync(int pageSize, string filterChar = null) + [Route("allcatalogues/{filterChar}")] + public async Task GetAllCataloguesAsync(string filterChar = null) { - var response = await this.catalogueService.GetAllCataloguesAsync(pageSize, filterChar, this.CurrentUserId); + var response = await this.catalogueService.GetAllCataloguesAsync(filterChar, this.CurrentUserId); return this.Ok(response); } } diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetCatalogues.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetCatalogues.sql index 64eb0d38c..2f58d9a75 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetCatalogues.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetCatalogues.sql @@ -1,9 +1,16 @@ -CREATE PROCEDURE [hierarchy].[GetCatalogues] ( +------------------------------------------------------------------------------- +-- Author Arunima George +-- Created 15-08-2024 +-- Purpose Get Cataloges for View all cataoge page +-- +-- Modification History + +-- Anju 03-02-2025 TD-4794: Removed page size to disaplay all records +------------------------------------------------------------------------------- + +CREATE PROCEDURE [hierarchy].[GetCatalogues] ( @userId INT - ,@filterChar nvarchar(10) - ,@OffsetRows int - ,@fetchRows int - ) + ,@filterChar nvarchar(10)) AS BEGIN @@ -30,10 +37,7 @@ BEGIN WHERE n.Id <> 1 AND n.Hidden = 0 AND n.Deleted = 0 AND cnv.Deleted = 0 AND nv.VersionStatusId = 2 and cnv.Name like @filterChar+'%' ORDER BY cnv.Name - OFFSET @OffsetRows ROWS - FETCH NEXT @FetchRows ROWS ONLY - - + END diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetCataloguesCount.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetCataloguesCount.sql index eb22506d0..b321946ae 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetCataloguesCount.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Hierarchy/GetCataloguesCount.sql @@ -1,4 +1,9 @@ -CREATE PROCEDURE [hierarchy].[GetCataloguesCount] ( +------------------------------------------------------------------------------- +-- Author Arunima George +-- Created 15-08-2024 +-- Purpose Get Cataloges for View all cataoge page + +CREATE PROCEDURE [hierarchy].[GetCataloguesCount] ( @userId INT ) AS diff --git a/WebAPI/LearningHub.Nhs.Repository.Interface/Hierarchy/ICatalogueNodeVersionRepository.cs b/WebAPI/LearningHub.Nhs.Repository.Interface/Hierarchy/ICatalogueNodeVersionRepository.cs index 1b68a3aef..53c84a657 100644 --- a/WebAPI/LearningHub.Nhs.Repository.Interface/Hierarchy/ICatalogueNodeVersionRepository.cs +++ b/WebAPI/LearningHub.Nhs.Repository.Interface/Hierarchy/ICatalogueNodeVersionRepository.cs @@ -132,10 +132,9 @@ public interface ICatalogueNodeVersionRepository : IGenericRepository /// Gets catalogues based on filter character. /// - /// The pageSize. /// The filterChar. /// The userId. /// The catalogues. - Task> GetAllCataloguesAsync(int pageSize, string filterChar, int userId); + Task> GetAllCataloguesAsync(string filterChar, int userId); } } diff --git a/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs b/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs index e65bd58ef..38f77a37f 100644 --- a/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs +++ b/WebAPI/LearningHub.Nhs.Repository/Hierarchy/CatalogueNodeVersionRepository.cs @@ -373,18 +373,15 @@ public List GetAllCataloguesAlphaCount(int userId) /// /// Gets catalogues based on filter character. /// - /// The pageSize. /// The filterChar. /// The userId. /// resources. - public async Task> GetAllCataloguesAsync(int pageSize, string filterChar, int userId) + public async Task> GetAllCataloguesAsync(string filterChar, int userId) { var param0 = new SqlParameter("@userId", SqlDbType.Int) { Value = userId }; var param1 = new SqlParameter("@filterChar", SqlDbType.NVarChar, 10) { Value = filterChar.Trim() }; - var param2 = new SqlParameter("@OffsetRows", SqlDbType.Int) { Value = 0 }; - var param3 = new SqlParameter("@fetchRows", SqlDbType.Int) { Value = pageSize }; - var result = await this.DbContext.AllCatalogueViewModel.FromSqlRaw("[hierarchy].[GetCatalogues] @userId, @filterChar, @OffsetRows, @fetchRows", param0, param1, param2, param3) + var result = await this.DbContext.AllCatalogueViewModel.FromSqlRaw("[hierarchy].[GetCatalogues] @userId, @filterChar", param0, param1) .AsNoTracking().ToListAsync(); return result; } diff --git a/WebAPI/LearningHub.Nhs.Services.Interface/ICatalogueService.cs b/WebAPI/LearningHub.Nhs.Services.Interface/ICatalogueService.cs index 69dc89908..0d8212f5d 100644 --- a/WebAPI/LearningHub.Nhs.Services.Interface/ICatalogueService.cs +++ b/WebAPI/LearningHub.Nhs.Services.Interface/ICatalogueService.cs @@ -250,10 +250,9 @@ public interface ICatalogueService /// /// GetAllCataloguesAsync. /// - /// The pageSize. /// filterChar. /// userId. /// The allcatalogue result based on letters. - Task GetAllCataloguesAsync(int pageSize, string filterChar, int userId); + Task GetAllCataloguesAsync(string filterChar, int userId); } } diff --git a/WebAPI/LearningHub.Nhs.Services/CatalogueService.cs b/WebAPI/LearningHub.Nhs.Services/CatalogueService.cs index eb354317e..c9906b62f 100644 --- a/WebAPI/LearningHub.Nhs.Services/CatalogueService.cs +++ b/WebAPI/LearningHub.Nhs.Services/CatalogueService.cs @@ -968,11 +968,10 @@ public async Task AccessRequestAsync(int userId /// /// GetAllCataloguesAsync. /// - /// The pageSize. /// The filterChar. /// The userId. /// A representing the result of the asynchronous operation. - public async Task GetAllCataloguesAsync(int pageSize, string filterChar, int userId) + public async Task GetAllCataloguesAsync(string filterChar, int userId) { var catalogueAlphaCount = this.catalogueNodeVersionRepository.GetAllCataloguesAlphaCount(userId); var filterCharMod = filterChar.Trim() == "0-9" ? "[0-9]" : filterChar; @@ -1010,7 +1009,7 @@ public async Task GetAllCataloguesAsync(int pageS } } - var catalogues = await this.catalogueNodeVersionRepository.GetAllCataloguesAsync(pageSize, filterCharMod, userId); + var catalogues = await this.catalogueNodeVersionRepository.GetAllCataloguesAsync(filterCharMod, userId); foreach (var catalogue in catalogues) { catalogue.Providers = await this.providerService.GetByCatalogueVersionIdAsync(catalogue.NodeVersionId);