Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions WebAPI/LearningHub.Nhs.API/Controllers/HierarchyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,6 @@ public async Task<IActionResult> PublishHierarchyEdit(PublishHierarchyEditViewMo
try
{
int publicationId = await this.hierarchyService.PublishHierarchyEditAsync(publishViewModel);

/* TODO - IT2 - confirm submission to Findwise (why here rather than in service method just called?)
if (publicationId > 0)
{
this.hierarchyService.ConfirmSubmissionToSearch(publicationId, publishViewModel.UserId);
} */
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public async Task<IActionResult> RemoveFromSyncList(List<int> resourceIds)
}

/// <summary>
/// The SyncWithFindwise.
/// The Sync.
/// </summary>
/// <returns>The action result.</returns>
[HttpPost("Sync")]
public async Task<IActionResult> SyncWithFindwise()
public async Task<IActionResult> Sync()
{
var vr = await this.resourceSyncService.SyncForUserAsync(this.CurrentUserId);
return this.Ok(new ApiResponse(vr.IsValid, vr));
Expand Down
6 changes: 3 additions & 3 deletions WebAPI/LearningHub.Nhs.API/Controllers/SearchController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ private async Task<SearchViewModel> GetSearchResults(SearchRequestModel searchRe
searchViewModel.DocumentModel = results.DocumentList.Documents.ToList();
searchViewModel.SearchString = searchRequestModel.SearchText;
searchViewModel.Hits = results.DocumentList.Documents.Count();
searchViewModel.DescriptionMaximumLength = this.settings.Findwise.MaximumDescriptionLength;
searchViewModel.DescriptionMaximumLength = this.settings.AzureSearch.MaximumDescriptionLength;
searchViewModel.ErrorOnAPI = results.ErrorsOnAPICall;
searchViewModel.Facets = results.Facets;

Expand Down Expand Up @@ -418,7 +418,7 @@ private async Task<SearchCatalogueViewModel> GetCatalogueSearchResults(Catalogue
DocumentModel = documents,
SearchString = catalogueSearchRequestModel.SearchText,
Hits = results.DocumentList.Documents.Count(),
DescriptionMaximumLength = this.settings.Findwise.MaximumDescriptionLength,
DescriptionMaximumLength = this.settings.AzureSearch.MaximumDescriptionLength,
ErrorOnAPI = results.ErrorsOnAPICall,
Facets = results.Facets,
};
Expand Down Expand Up @@ -491,7 +491,7 @@ private async Task<SearchAllCatalogueViewModel> GetAllCatalogueResults(AllCatalo
DocumentModel = documents,
SearchString = catalogueSearchRequestModel.SearchText,
Hits = results.DocumentList.Documents.Count(),
DescriptionMaximumLength = this.settings.Findwise.MaximumDescriptionLength,
DescriptionMaximumLength = this.settings.AzureSearch.MaximumDescriptionLength,
ErrorOnAPI = results.ErrorsOnAPICall,
Facets = results.Facets,
};
Expand Down
3 changes: 0 additions & 3 deletions WebAPI/LearningHub.Nhs.API/Startup/ServiceMappings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ namespace LearningHub.Nhs.Api
using LearningHub.Nhs.Repository.Report;
using LearningHub.Nhs.Repository.Resources;
using LearningHub.Nhs.Services;
using LearningHub.Nhs.Services.Findwise;
using LearningHub.Nhs.Services.Interface;
using LearningHub.Nhs.Services.Interface.Messaging;
using LearningHub.Nhs.Services.Interface.Report;
Expand Down Expand Up @@ -218,7 +217,6 @@ public static void AddLearningHubMappings(this IServiceCollection services, ICon
services.AddScoped<IFileTypeService, FileTypeService>();
services.AddScoped<IHierarchyService, HierarchyService>();
services.AddScoped<INotificationService, NotificationService>();
services.AddScoped<IFindWiseHttpClient, FindWiseHttpClient>();
services.AddScoped<ISearchService, SearchService>();
services.AddScoped<ISecurityService, SecurityService>();
services.AddScoped<IPermissionService, PermissionService>();
Expand All @@ -235,7 +233,6 @@ public static void AddLearningHubMappings(this IServiceCollection services, ICon
services.AddTransient<IEventService, EventService>();
services.AddTransient<ICatalogueService, CatalogueService>();
services.AddScoped<IResourceSyncService, ResourceSyncService>();
services.AddScoped<IFindwiseApiFacade, FindwiseApiFacade>();
services.AddScoped<IEmailSenderService, EmailSenderService>();
services.AddScoped<IEmailTemplateService, EmailTemplateService>();
services.AddScoped<IMessageService, MessageService>();
Expand Down
17 changes: 2 additions & 15 deletions WebAPI/LearningHub.Nhs.API/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,8 @@
}
},

"FindWise": {
"IndexUrl": "",
"SearchUrl": "",
"CollectionIds": {
"Resource": "",
"Catalogue": "",
"AutoSuggestion": ""
},
"UrlSearchComponent": "rest/apps/HEE/searchers/{0}",
"UrlClickComponent": "rest/apps/HEE/searchers/hee/signals/hee/signal/click",
"UrlAutoSuggestionClickComponent": "rest/apps/HEE/searchers/hee/signals/hee/signal/click-hee",
"Token": "",
"MaximumDescriptionLength": 150,
"IndexMethod": "/rest/v2/collections/{0}/documents",
"DescriptionLengthLimit": 3000
"AzureSearch": {
"MaximumDescriptionLength": 150
},
"Notifications": {
"PublishResourceTimeToProcessInSec": 30,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LearningHub.Nhs.Api.Shared.Configuration
{
/// <summary>
/// The Azure AI Search configuration settings.
/// </summary>
public class AzureSearchSettings
{
/// <summary>
/// Gets or sets the maximum description length.
/// </summary>
public int MaximumDescriptionLength { get; set; } = 150;
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace LearningHub.Nhs.Api.Shared.Configuration
{
/// <summary>
/// The FindwiseSettings.
/// The MigrationToolSettings.
/// </summary>
public class MigrationToolSettings
{
Expand Down
4 changes: 2 additions & 2 deletions WebAPI/LearningHub.Nhs.Api.Shared/Configuration/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ public class Settings
public MigrationToolSettings MigrationTool { get; set; }

/// <summary>
/// Gets or sets the findwise settings.
/// Gets or sets the Azure Search settings.
/// </summary>
public FindwiseSettings Findwise { get; set; }
public AzureSearchSettings AzureSearch { get; set; }

/// <summary>
/// Gets or sets the azure storage account connectionstring for queue.
Expand Down
18 changes: 0 additions & 18 deletions WebAPI/LearningHub.Nhs.Services.Interface/IFindWiseHttpClient.cs

This file was deleted.

37 changes: 0 additions & 37 deletions WebAPI/LearningHub.Nhs.Services.Interface/IFindwiseApiFacade.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public interface IResourceService
Task<int> PublishResourceVersionAsync(PublishViewModel publishViewModel);

/// <summary>
/// Submits a published resource version to the Findwise search.
/// Submits a published resource version to search.
/// </summary>
/// <param name="resourceVersionId">The resourceVersionId<see cref="int"/>.</param>
/// <param name="userId">The userId<see cref="int"/>.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class CatalogueServiceTests : TestBase
{
private readonly Mock<IUserRepository> mockUserRepository;
private readonly Mock<IResourceVersionRepository> mockResourceVersionRepository;
private readonly Mock<IFindwiseApiFacade> mockFindwiseApiFacade;
private Mock<IRoleUserGroupRepository> mockRoleUserGroupRepository;
private Mock<IUserUserGroupRepository> mockUserUserGroupRepository;
private MockRepository mockRepository;
Expand Down Expand Up @@ -62,7 +61,6 @@ public CatalogueServiceTests()
this.mockRoleUserGroupRepository = this.mockRepository.Create<IRoleUserGroupRepository>();
this.mockUserRepository = this.mockRepository.Create<IUserRepository>();
this.mockResourceVersionRepository = this.mockRepository.Create<IResourceVersionRepository>();
this.mockFindwiseApiFacade = this.mockRepository.Create<IFindwiseApiFacade>();
this.mockRoleUserGroupRepository = this.mockRepository.Create<IRoleUserGroupRepository>();
this.mockUserUserGroupRepository = this.mockRepository.Create<IUserUserGroupRepository>();
this.mockEmailSenderService = this.mockRepository.Create<IEmailSenderService>();
Expand Down Expand Up @@ -142,7 +140,6 @@ private CatalogueService CreateService()
this.mockUserRepository.Object,
this.mockRoleUserGroupRepository.Object,
this.mockResourceVersionRepository.Object,
this.mockFindwiseApiFacade.Object,
this.mockUserUserGroupRepository.Object,
this.mockEmailSenderService.Object,
////this.mockUserService.Object,
Expand Down
18 changes: 1 addition & 17 deletions WebAPI/LearningHub.Nhs.Services/BaseService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace LearningHub.Nhs.Services
{
using LearningHub.Nhs.Services.Interface;
using Microsoft.Extensions.Logging;

/// <summary>
Expand All @@ -16,20 +15,13 @@ public abstract class BaseService<T>
/// </summary>
private readonly ILogger logger;

/// <summary>
/// The Find Wise HTTP Client.
/// </summary>
private IFindWiseHttpClient findWiseHttpClient;

/// <summary>
/// Initializes a new instance of the <see cref="BaseService{T}"/> class.
/// The base service.
/// </summary>
/// <param name="findWiseHttpClient">The Find Wise http client.</param>
/// <param name="logger">The logger.</param>
protected BaseService(IFindWiseHttpClient findWiseHttpClient, ILogger<T> logger)
protected BaseService(ILogger<T> logger)
{
this.findWiseHttpClient = findWiseHttpClient;
this.logger = logger;
}

Expand All @@ -40,13 +32,5 @@ protected ILogger Logger
{
get { return this.logger; }
}

/// <summary>
/// Gets the Find Wise HTTP Client.
/// </summary>
protected IFindWiseHttpClient FindWiseHttpClient
{
get { return this.findWiseHttpClient; }
}
}
}
Loading
Loading