From a7e7480c380943e84b1507b3ad14fb3501065b26 Mon Sep 17 00:00:00 2001 From: Sarathlal Sarangadharan Date: Tue, 27 Feb 2024 09:03:37 +0000 Subject: [PATCH 001/427] TD-3688: Fixed missing In progress resources in the My Accessed Learning tray issue --- .../Stored Procedures/Resources/GetDashboardResources.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetDashboardResources.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetDashboardResources.sql index f8fc7dfc5..b63696f1e 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetDashboardResources.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetDashboardResources.sql @@ -15,6 +15,7 @@ -- 15 Jun 2023 RS Re-added BadgeUrl column following design change -- 27 Sep 2023 HV Included Paging and user resource activity -- 08 Nov 2023 OA Fixed latest resource activity entry selection(with updated logic for media activities) and status check for incomplete assessment. +-- 27 Feb 2024 SS Fixed missing In progress resources in the My Accessed Learning tray issue ------------------------------------------------------------------------------- CREATE PROCEDURE [resources].[GetDashboardResources] @@ -222,8 +223,7 @@ BEGIN BEGIN INSERT INTO @MyActivity SELECT TOP (@MaxRows) ra.ResourceId, MAX(ra.Id) ResourceActivityId - FROM - (SELECT a.* FROM activity.ResourceActivity a INNER JOIN (SELECT ResourceId, MAX(Id) as id FROM activity.ResourceActivity GROUP BY ResourceId ) AS b ON a.ResourceId = b.ResourceId AND a.id = b.id order by a.Id desc OFFSET 0 ROWS) ra + 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 From 799424dc9a32d0e6ba2b0bb6edf87a92b16810f2 Mon Sep 17 00:00:00 2001 From: OluwatobiAwe <114475132+OluwatobiAwe@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:18:11 +0000 Subject: [PATCH 002/427] TD-3337 Updated Scorm Activity Summary where clause --- .../Stored Procedures/Activity/ScormActivityGetSummary.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/ScormActivityGetSummary.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/ScormActivityGetSummary.sql index e854a8c25..50c6d8a89 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/ScormActivityGetSummary.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/ScormActivityGetSummary.sql @@ -27,7 +27,7 @@ BEGIN INNER JOIN resources.[ResourceVersion] rv ON rv.id = r.CurrentResourceVersionId WHERE - rr.id = @ResourceReferenceId + rr.OriginalResourceReferenceId = @ResourceReferenceId AND rr.Deleted = 0 AND r.Deleted = 0 AND rv.Deleted = 0 @@ -61,4 +61,4 @@ BEGIN END END -GO \ No newline at end of file +GO From 433cacdb028e205d1c43b8b2738b0fa5d56b200e Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Thu, 29 Feb 2024 10:57:02 +0000 Subject: [PATCH 003/427] TD-3839-Logs are Getting Saved in Production Log-Content Server Issues --- .../GetScormContentServerDetailsForHistoricExternalUrl.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetScormContentServerDetailsForHistoricExternalUrl.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetScormContentServerDetailsForHistoricExternalUrl.sql index a1b9c55fc..0e9d36efb 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetScormContentServerDetailsForHistoricExternalUrl.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetScormContentServerDetailsForHistoricExternalUrl.sql @@ -19,7 +19,7 @@ BEGIN srv.EsrLinkTypeId EsrLinkType, er.Active IsActive, srv.ContentFilePath AS InternalResourceIdentifier, - svm.ManifestURL AS ManifestUrl + svm.ManifestURL AS DefaultUrl FROM [resources].[UrlRewriting] u join resources.ExternalReference er on u.ExternalReferenceId = er.Id From 4ea5015b29a6c018e1083ca6f489f082092e4bbc Mon Sep 17 00:00:00 2001 From: Anju Jose Date: Thu, 29 Feb 2024 11:27:07 +0000 Subject: [PATCH 004/427] TD-3603-TextUpdate --- .../Views/Catalogue/Edit.cshtml | 4 +- .../Views/Resource/Details.cshtml | 2 +- .../Views/User/Details.cshtml | 2 +- .../Views/User/_UserProviders.cshtml | 38 +++++++++---------- .../Helpers/ProviderHelper.cs | 2 +- .../vuesrc/contribute-resource/Contribute.vue | 2 +- .../ContributeProvideByTab.vue | 6 +-- .../vuesrc/contribute/ContentCommon.vue | 6 +-- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml index 788bfaba3..eb2d3312c 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml +++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml @@ -228,10 +228,10 @@
- +

When applicable please select the provider of this content. This will allow a contributor to flag content from a specific provider.

This will enable learners to search for content produced by organisations and help separate learning resources from community contributions.

-

Provided by;

+

Developed with;

diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/Details.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/Details.cshtml index 83f90382b..a2df6a2c6 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/Details.cshtml +++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/Details.cshtml @@ -153,7 +153,7 @@
@if (Model.Providers != null && Model.Providers.Count > 0) { -
Provided by
+
Developed with
@foreach (var provider in Model.Providers) {
diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/User/Details.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/User/Details.cshtml index 1022dcd2b..4d82d8244 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Views/User/Details.cshtml +++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/User/Details.cshtml @@ -55,7 +55,7 @@ Contributions
  • - Provided by permission + Developed with permission
  • History diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/User/_UserProviders.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/User/_UserProviders.cshtml index ecbafa76f..42d886a60 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Views/User/_UserProviders.cshtml +++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/User/_UserProviders.cshtml @@ -3,27 +3,27 @@ @model List
    -
    -
    -

    Provided by permission

    -

    Give permission to allow a contributor to flag content from a specific provider. This helps to separate learning resources from community contributions.

    -

    Select the relevant providers;

    +
    +
    +

    Developed with permission

    +

    Give permission to allow a contributor to flag content from a specific provider. This helps to separate learning resources from community contributions.

    +

    Select the relevant providers;

    +
    -
    -
    -
    - @if (Model != null && Model.Count > 0) - { -
    - @foreach (var item in Model) - { - - @item.Text -
    - } +
    +
    + @if (Model != null && Model.Count > 0) + { +
    + @foreach (var item in Model) + { + + @item.Text +
    + } +
    + }
    - }
    -
    diff --git a/LearningHub.Nhs.WebUI/Helpers/ProviderHelper.cs b/LearningHub.Nhs.WebUI/Helpers/ProviderHelper.cs index 3f37a7291..c60282312 100644 --- a/LearningHub.Nhs.WebUI/Helpers/ProviderHelper.cs +++ b/LearningHub.Nhs.WebUI/Helpers/ProviderHelper.cs @@ -22,7 +22,7 @@ public static string GetProvidersString(List providerNames) if (providerNames != null && providerNames.Count > 0) { - providerstring += "Provided by "; + providerstring += "Developed with "; providerstring += string.Join(", ", providerNames.ToArray()); } diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/Contribute.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/Contribute.vue index 2ffac0564..0f958304b 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/Contribute.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/Contribute.vue @@ -95,7 +95,7 @@ @@ -65,6 +66,7 @@ color: String, shape: String, size: String, + iconRole: String, }, }); diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/blocks/QuestionBlock.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/blocks/QuestionBlock.vue index 6366ec7fe..20945e6f2 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/blocks/QuestionBlock.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/blocks/QuestionBlock.vue @@ -9,7 +9,8 @@ + :ariaLabel="isOpen ? `hide content` : `reveal content`" + iconRole="img">
    diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/blocks/SingleQuestionAnswerView.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/blocks/SingleQuestionAnswerView.vue index 21925aa52..c325b1446 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/blocks/SingleQuestionAnswerView.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/resource/blocks/SingleQuestionAnswerView.vue @@ -17,7 +17,8 @@ :class="getStyleFromAnswerType(answer.status)"/> + src="/images/medal-icon.svg" + alt="Medal Icon"/> {{ answer.blockCollection.blocks[0].textBlock.content }}
    diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/roadmap/roadmap.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/roadmap/roadmap.vue index 54d0c5f75..21307a74e 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/roadmap/roadmap.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/roadmap/roadmap.vue @@ -1,7 +1,7 @@ From 1067f5c0cf7e3b0eb74e5d454d1c7ccb8256ca36 Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Wed, 6 Nov 2024 12:45:54 +0000 Subject: [PATCH 419/427] TD-4194:DIG1302: Focus order is incorrect or illogical --- LearningHub.Nhs.WebUI/Views/Shared/_NavPartial.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LearningHub.Nhs.WebUI/Views/Shared/_NavPartial.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/_NavPartial.cshtml index 78154d41f..195611f8b 100644 --- a/LearningHub.Nhs.WebUI/Views/Shared/_NavPartial.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Shared/_NavPartial.cshtml @@ -56,7 +56,7 @@ - Close menu + Close menu

      From 4393e59415a6a4662ab368c50bff4c6e7218f55f Mon Sep 17 00:00:00 2001 From: Arunima George Date: Fri, 8 Nov 2024 09:19:31 +0000 Subject: [PATCH 420/427] TD-4870: Timeout page not showing properly in search page. --- LearningHub.Nhs.WebUI/Controllers/SearchController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LearningHub.Nhs.WebUI/Controllers/SearchController.cs b/LearningHub.Nhs.WebUI/Controllers/SearchController.cs index ac314f6c9..4f4e07e62 100644 --- a/LearningHub.Nhs.WebUI/Controllers/SearchController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/SearchController.cs @@ -306,6 +306,11 @@ public async Task Image(string name) public async Task GetAutoSuggestion(string term) { var autoSuggestions = await this.searchService.GetAutoSuggestionList(term); + if (!this.User.Identity.IsAuthenticated) + { + return this.RedirectToAction("AccessDenied", "Home"); + } + return this.PartialView("_AutoComplete", autoSuggestions); } } From 6cc45f273bdfd11adb34df3d26f53afc69db6f4d Mon Sep 17 00:00:00 2001 From: Arunima George Date: Thu, 14 Nov 2024 12:29:41 +0000 Subject: [PATCH 421/427] TD-4870: Fixed Timeout issue and mismatch in counts in ViewAllCatalogue page --- .../LearningHub.Nhs.AdminUI.csproj | 2 +- .../Controllers/CatalogueController.cs | 23 +++++++++++++++++++ .../Controllers/SearchController.cs | 3 ++- .../LearningHub.Nhs.WebUI.csproj | 2 +- .../Models/Search/SearchResultViewModel.cs | 5 ++++ .../Services/SearchService.cs | 3 +++ .../Views/Catalogue/Catalogues.cshtml | 5 ++-- .../Search/_CatalogueSearchResult.cshtml | 3 ++- .../Views/Search/_SearchBar.cshtml | 3 +++ .../NavigationItems/Searchbar.cshtml | 3 +++ .../LearningHub.Nhs.Api.csproj | 2 +- .../LearningHub.Nhs.Api.Shared.csproj | 2 +- .../LearningHub.Nhs.Api.UnitTests.csproj | 2 +- ...earningHub.Nhs.Repository.Interface.csproj | 2 +- .../LearningHub.Nhs.Repository.csproj | 2 +- .../LearningHub.Nhs.Services.Interface.csproj | 2 +- .../LearningHub.Nhs.Services.UnitTests.csproj | 2 +- .../LearningHub.Nhs.Services.csproj | 2 +- ...earningHub.Nhs.Migration.ConsoleApp.csproj | 2 +- ...LearningHub.Nhs.Migration.Interface.csproj | 2 +- .../LearningHub.Nhs.Migration.Models.csproj | 2 +- ...ub.Nhs.Migration.Staging.Repository.csproj | 2 +- ...LearningHub.Nhs.Migration.UnitTests.csproj | 2 +- .../LearningHub.Nhs.Migration.csproj | 2 +- 24 files changed, 60 insertions(+), 20 deletions(-) diff --git a/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj b/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj index f10d8aaab..0b26b9cd7 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj +++ b/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj @@ -89,7 +89,7 @@ - + diff --git a/LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs b/LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs index 477aabfbf..2fca0012e 100644 --- a/LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Net.Http; + using System.Text.RegularExpressions; using System.Threading.Tasks; using LearningHub.Nhs.Caching; using LearningHub.Nhs.Models.Catalogue; @@ -109,6 +110,28 @@ public async Task Index(int pageIndex = 1, string term = null) PageSize = itemsOnPage, }); + // Did you mean suggestion when no hits found + if (termCatalogues?.TotalHits == 0 && termCatalogues?.Spell?.Suggestions?.Count > 0) + { + // pass the spell suggestion as new search text - catalogues + if (termCatalogues?.Spell?.Suggestions?.Count > 0) + { + var suggestedCatalogue = Regex.Replace(termCatalogues?.Spell?.Suggestions?.FirstOrDefault().ToString(), "<.*?>", string.Empty); + + // calling findwise endpoint with new search text - catalogues + termCatalogues = await this.searchService.GetCatalogueSearchResultAsync( + new CatalogueSearchRequestModel + { + SearchText = suggestedCatalogue, + PageIndex = pageIndex - 1, + PageSize = itemsOnPage, + }); + + catalogues.DidYouMeanEnabled = true; + catalogues.SuggestedCatalogue = suggestedCatalogue; + } + } + catalogues.TotalCount = termCatalogues.TotalHits; catalogues.GroupId = Guid.NewGuid(); catalogues.Catalogues = termCatalogues.DocumentModel.Select(t => new DashboardCatalogueViewModel diff --git a/LearningHub.Nhs.WebUI/Controllers/SearchController.cs b/LearningHub.Nhs.WebUI/Controllers/SearchController.cs index 4f4e07e62..7272e9a27 100644 --- a/LearningHub.Nhs.WebUI/Controllers/SearchController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/SearchController.cs @@ -305,12 +305,13 @@ public async Task Image(string name) [HttpGet("GetAutoSuggestion")] public async Task GetAutoSuggestion(string term) { - var autoSuggestions = await this.searchService.GetAutoSuggestionList(term); if (!this.User.Identity.IsAuthenticated) { return this.RedirectToAction("AccessDenied", "Home"); } + var autoSuggestions = await this.searchService.GetAutoSuggestionList(term); + return this.PartialView("_AutoComplete", autoSuggestions); } } diff --git a/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj b/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj index aff1954b5..f20842a9a 100644 --- a/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj +++ b/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj @@ -108,7 +108,7 @@ - + diff --git a/LearningHub.Nhs.WebUI/Models/Search/SearchResultViewModel.cs b/LearningHub.Nhs.WebUI/Models/Search/SearchResultViewModel.cs index c4b0e6a6c..e17f3c851 100644 --- a/LearningHub.Nhs.WebUI/Models/Search/SearchResultViewModel.cs +++ b/LearningHub.Nhs.WebUI/Models/Search/SearchResultViewModel.cs @@ -83,5 +83,10 @@ public class SearchResultViewModel /// Gets or sets a value indicating whether Did You Mean Enabled or not. /// public bool DidYouMeanEnabled { get; set; } + + /// + /// Gets or sets Suggested Catalogue name. + /// + public string SuggestedCatalogue { get; set; } } } diff --git a/LearningHub.Nhs.WebUI/Services/SearchService.cs b/LearningHub.Nhs.WebUI/Services/SearchService.cs index c8628270f..45b7f4276 100644 --- a/LearningHub.Nhs.WebUI/Services/SearchService.cs +++ b/LearningHub.Nhs.WebUI/Services/SearchService.cs @@ -63,6 +63,7 @@ public async Task PerformSearch(IPrincipal user, SearchRe var selectedSortItem = searchSortItemList.Where(x => x.SearchSortType == (SearchSortTypeEnum)searchSortType).FirstOrDefault(); var groupId = Guid.Parse(searchRequest.GroupId); bool didYouMeanEnabled = false; + var suggestedCatalogue = string.Empty; var resourceSearchPageSize = this.settings.FindwiseSettings.ResourceSearchPageSize; var catalogueSearchPageSize = this.settings.FindwiseSettings.CatalogueSearchPageSize; @@ -133,6 +134,7 @@ public async Task PerformSearch(IPrincipal user, SearchRe if (catalogueResult?.Spell?.Suggestions?.Count > 0) { catalogueSearchRequestModel.SearchText = Regex.Replace(catalogueResult?.Spell?.Suggestions?.FirstOrDefault().ToString(), "<.*?>", string.Empty); + suggestedCatalogue = catalogueSearchRequestModel.SearchText; // calling findwise endpoint with new search text - catalogues catalogueResultTask = this.GetCatalogueSearchResultAsync(catalogueSearchRequestModel); @@ -230,6 +232,7 @@ public async Task PerformSearch(IPrincipal user, SearchRe TotalItems = catalogueResult?.TotalHits ?? 0, }, DidYouMeanEnabled = didYouMeanEnabled, + SuggestedCatalogue = suggestedCatalogue, }; return searchResultViewModel; diff --git a/LearningHub.Nhs.WebUI/Views/Catalogue/Catalogues.cshtml b/LearningHub.Nhs.WebUI/Views/Catalogue/Catalogues.cshtml index b976651b2..af1ecfab4 100644 --- a/LearningHub.Nhs.WebUI/Views/Catalogue/Catalogues.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Catalogue/Catalogues.cshtml @@ -12,6 +12,7 @@ var hasSearchTerm = queryParams.ContainsKey("term"); var searhTerm = hasSearchTerm ? queryParams["term"].ToString() : null; string cardStyle = "card-provider-details--blank"; + var suggestedTerm = Model.DidYouMeanEnabled ? Model.SuggestedCatalogue : searhTerm; string GetCatalogueUrl(string catalogueUrl, SearchClickPayloadModel list, int catalogueId) { @@ -19,7 +20,7 @@ string searchSignalQueryEncoded = HttpUtility.UrlEncode(HttpUtility.UrlDecode(list?.SearchSignal?.Query)); string groupId = HttpUtility.UrlEncode(Model.GroupId.ToString()); var url = $@"/search/record-catalogue-click?url={encodedCatalogueUrl}&itemIndex={list?.HitNumber} -&pageIndex={this.ViewBag.PageIndex}&totalNumberOfHits={list?.SearchSignal?.Stats.TotalHits}&searchText={searhTerm}&catalogueId={catalogueId} +&pageIndex={this.ViewBag.PageIndex}&totalNumberOfHits={list?.SearchSignal?.Stats.TotalHits}&searchText={suggestedTerm}&catalogueId={catalogueId} &GroupId={groupId}&searchId={list?.SearchSignal.SearchId}&timeOfSearch={list?.SearchSignal.TimeOfSearch}&userQuery={HttpUtility.UrlEncode(list?.SearchSignal?.UserQuery)} &query={searchSignalQueryEncoded}&name={list?.DocumentFields?.Name}"; return url; @@ -42,7 +43,7 @@ }

      - @(hasSearchTerm ? $"Search results for {searhTerm}" : "All catalogues") + @(hasSearchTerm ? $"Search results for {suggestedTerm}" : "All catalogues")

      diff --git a/LearningHub.Nhs.WebUI/Views/Search/_CatalogueSearchResult.cshtml b/LearningHub.Nhs.WebUI/Views/Search/_CatalogueSearchResult.cshtml index b26b4ba70..6c1149b38 100644 --- a/LearningHub.Nhs.WebUI/Views/Search/_CatalogueSearchResult.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Search/_CatalogueSearchResult.cshtml @@ -8,6 +8,7 @@ var catalogueResult = Model.CatalogueSearchResult; var pagingModel = Model.CatalogueResultPaging; var searchString = HttpUtility.UrlEncode(Model.SearchString); + var suggestedSearchString = Model.DidYouMeanEnabled ? HttpUtility.UrlEncode(Model.SuggestedCatalogue) : HttpUtility.UrlEncode(Model.SearchString); string GetCatalogueUrl(string catalogueUrl, int nodePathId, int itemIndex, int catalogueId, SearchClickPayloadModel payload) { @@ -17,7 +18,7 @@ string searchSignalQueryEncoded = HttpUtility.UrlEncode(HttpUtility.UrlDecode(searchSignal?.Query)); var url = $@"/search/record-catalogue-click?url={encodedCatalogueUrl}&nodePathId={nodePathId}&itemIndex={payload?.HitNumber} -&pageIndex={pagingModel.CurrentPage}&totalNumberOfHits={payload?.SearchSignal?.Stats?.TotalHits}&searchText={searchString}&catalogueId={catalogueId} +&pageIndex={pagingModel.CurrentPage}&totalNumberOfHits={payload?.SearchSignal?.Stats?.TotalHits}&searchText={suggestedSearchString}&catalogueId={catalogueId} &GroupId={groupId}&searchId={searchSignal?.SearchId}&timeOfSearch={searchSignal?.TimeOfSearch}&userQuery={HttpUtility.UrlEncode(searchSignal?.UserQuery)} &query={searchSignalQueryEncoded}&name={payload?.DocumentFields?.Name}"; return url; diff --git a/LearningHub.Nhs.WebUI/Views/Search/_SearchBar.cshtml b/LearningHub.Nhs.WebUI/Views/Search/_SearchBar.cshtml index 7ec19feef..a0139e3eb 100644 --- a/LearningHub.Nhs.WebUI/Views/Search/_SearchBar.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Search/_SearchBar.cshtml @@ -25,6 +25,9 @@ xhr.open("GET", '@Url.Action("GetAutoSuggestion", "Search")' + '?term=' + encodeURIComponent(term), true); xhr.onload = function () { if (xhr.status >= 200 && xhr.status < 400) { + if (xhr.responseText.includes('