diff --git a/LearningHub.Nhs.WebUI/Views/Home/_CatalogueCard.cshtml b/LearningHub.Nhs.WebUI/Views/Home/_CatalogueCard.cshtml
index 341556517..90b803671 100644
--- a/LearningHub.Nhs.WebUI/Views/Home/_CatalogueCard.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Home/_CatalogueCard.cshtml
@@ -1,4 +1,5 @@
@using LearningHub.Nhs.Models.Dashboard
+@using LearningHub.Nhs.Shared.Helpers
@using LearningHub.Nhs.WebUI.Extensions
@using LearningHub.Nhs.WebUI.Helpers
@model DashboardCatalogueViewModel
diff --git a/LearningHub.Nhs.WebUI/Views/Home/_CourseEnrolled.cshtml b/LearningHub.Nhs.WebUI/Views/Home/_CourseEnrolled.cshtml
index 68ad72564..f739f661d 100644
--- a/LearningHub.Nhs.WebUI/Views/Home/_CourseEnrolled.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Home/_CourseEnrolled.cshtml
@@ -1,4 +1,5 @@
@using LearningHub.Nhs.Models.Dashboard
+@using LearningHub.Nhs.Shared.Helpers
@using LearningHub.Nhs.WebUI.Extensions
@using LearningHub.Nhs.WebUI.Helpers
@model MoodleCourseResponseViewModel
diff --git a/LearningHub.Nhs.WebUI/Views/Home/_ResourceCard.cshtml b/LearningHub.Nhs.WebUI/Views/Home/_ResourceCard.cshtml
index 7e70482ab..d9e826e98 100644
--- a/LearningHub.Nhs.WebUI/Views/Home/_ResourceCard.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Home/_ResourceCard.cshtml
@@ -1,6 +1,7 @@
@using LearningHub.Nhs.Models.Dashboard
@using LearningHub.Nhs.Models.Provider
@using LearningHub.Nhs.Models.Enums
+@using LearningHub.Nhs.Shared.Helpers
@using LearningHub.Nhs.WebUI.Extensions
@using LearningHub.Nhs.WebUI.Models
@using System.Linq
diff --git a/LearningHub.Nhs.WebUI/Views/MyLearning/LearningCertificate.cshtml b/LearningHub.Nhs.WebUI/Views/MyLearning/LearningCertificate.cshtml
index 120832cf7..83ef4c1e4 100644
--- a/LearningHub.Nhs.WebUI/Views/MyLearning/LearningCertificate.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/MyLearning/LearningCertificate.cshtml
@@ -1,6 +1,7 @@
@using LearningHub.Nhs.Models.Enums
@using LearningHub.Nhs.Models.Hierarchy
@using LearningHub.Nhs.Models.Resource.ResourceDisplay
+@using LearningHub.Nhs.Shared.Helpers
@using LearningHub.Nhs.WebUI.Configuration;
@using LearningHub.Nhs.WebUI.Models
@using LearningHub.Nhs.WebUI.Models.Learning
diff --git a/LearningHub.Nhs.WebUI/Views/MyLearning/_ActivityTablePaging.cshtml b/LearningHub.Nhs.WebUI/Views/MyLearning/_ActivityTablePaging.cshtml
index 2a67789be..6c724d5d6 100644
--- a/LearningHub.Nhs.WebUI/Views/MyLearning/_ActivityTablePaging.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/MyLearning/_ActivityTablePaging.cshtml
@@ -1,6 +1,6 @@
@using System.Web;
@using LearningHub.Nhs.WebUI.Models.Learning
-@using LearningHub.Nhs.WebUI.Models.Search;
+@using LearningHub.Nhs.Shared.Models.Search;
@model MyLearningViewModel;
diff --git a/LearningHub.Nhs.WebUI/Views/Resource/Resource.cshtml b/LearningHub.Nhs.WebUI/Views/Resource/Resource.cshtml
index 91d3e63eb..987df7244 100644
--- a/LearningHub.Nhs.WebUI/Views/Resource/Resource.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Resource/Resource.cshtml
@@ -1,5 +1,6 @@
@model ResourceIndexViewModel
@using LearningHub.Nhs.Models.Enums
+@using LearningHub.Nhs.Shared.Helpers
@using LearningHub.Nhs.WebUI.Extensions
@using LearningHub.Nhs.WebUI.Models
@using LearningHub.Nhs.WebUI.Models.Resource
diff --git a/LearningHub.Nhs.WebUI/Views/Resource/_ResourceInformation.cshtml b/LearningHub.Nhs.WebUI/Views/Resource/_ResourceInformation.cshtml
index 98342b4db..478c1be2e 100644
--- a/LearningHub.Nhs.WebUI/Views/Resource/_ResourceInformation.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Resource/_ResourceInformation.cshtml
@@ -1,5 +1,6 @@
@model ResourceIndexViewModel
@using LearningHub.Nhs.Models.Enums
+@using LearningHub.Nhs.Shared.Helpers
@using LearningHub.Nhs.WebUI.Helpers
@using LearningHub.Nhs.WebUI.Models
@using LearningHub.Nhs.WebUI.Models.Resource
diff --git a/LearningHub.Nhs.WebUI/Views/Resource/_ResourceItem.cshtml b/LearningHub.Nhs.WebUI/Views/Resource/_ResourceItem.cshtml
index 0913435ff..9b568b55e 100644
--- a/LearningHub.Nhs.WebUI/Views/Resource/_ResourceItem.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Resource/_ResourceItem.cshtml
@@ -1,5 +1,6 @@
@model ResourceIndexViewModel
@using LearningHub.Nhs.Models.Enums
+@using LearningHub.Nhs.Shared.Helpers
@using LearningHub.Nhs.WebUI.Helpers
@using LearningHub.Nhs.WebUI.Models
@using LearningHub.Nhs.WebUI.Models.Resource
diff --git a/LearningHub.Nhs.WebUI/Views/Search/Index.cshtml b/LearningHub.Nhs.WebUI/Views/Search/Index.cshtml
index 4b8e0e6e3..f1ff3ea06 100644
--- a/LearningHub.Nhs.WebUI/Views/Search/Index.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Search/Index.cshtml
@@ -1,4 +1,4 @@
-@model LearningHub.Nhs.WebUI.Models.Search.SearchResultViewModel
+@model LearningHub.Nhs.Shared.Models.Search.SearchResultViewModel
@{
ViewData["Title"] = "Search";
diff --git a/LearningHub.Nhs.WebUI/Views/Search/_CataloguePagination.cshtml b/LearningHub.Nhs.WebUI/Views/Search/_CataloguePagination.cshtml
index 04cd0a9c0..d06f7ff5e 100644
--- a/LearningHub.Nhs.WebUI/Views/Search/_CataloguePagination.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Search/_CataloguePagination.cshtml
@@ -1,5 +1,5 @@
@using Microsoft.AspNetCore.WebUtilities
-@model LearningHub.Nhs.WebUI.Models.Search.SearchResultViewModel
+@model LearningHub.Nhs.Shared.Models.Search.SearchResultViewModel
@{
var pagingModel = Model.CatalogueResultPaging;
diff --git a/LearningHub.Nhs.WebUI/Views/Search/_CatalogueSearchResult.cshtml b/LearningHub.Nhs.WebUI/Views/Search/_CatalogueSearchResult.cshtml
index 55b297410..48888b2f3 100644
--- a/LearningHub.Nhs.WebUI/Views/Search/_CatalogueSearchResult.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Search/_CatalogueSearchResult.cshtml
@@ -2,7 +2,7 @@
@using LearningHub.Nhs.WebUI.Extensions
@using LearningHub.Nhs.Models.Search.SearchClick;
-@model LearningHub.Nhs.WebUI.Models.Search.SearchResultViewModel
+@model LearningHub.Nhs.Shared.Models.Search.SearchResultViewModel
@{
var catalogueResult = Model.CatalogueSearchResult;
diff --git a/LearningHub.Nhs.WebUI/Views/Search/_ResourceFilter.cshtml b/LearningHub.Nhs.WebUI/Views/Search/_ResourceFilter.cshtml
index 429eae962..a0867096a 100644
--- a/LearningHub.Nhs.WebUI/Views/Search/_ResourceFilter.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Search/_ResourceFilter.cshtml
@@ -1,5 +1,5 @@
@using Microsoft.AspNetCore.WebUtilities
-@model LearningHub.Nhs.WebUI.Models.Search.SearchResultViewModel
+@model LearningHub.Nhs.Shared.Models.Search.SearchResultViewModel
@{
var resourceResult = Model.ResourceSearchResult;
diff --git a/LearningHub.Nhs.WebUI/Views/Search/_ResourcePagination.cshtml b/LearningHub.Nhs.WebUI/Views/Search/_ResourcePagination.cshtml
index b9b511dd5..563c052f9 100644
--- a/LearningHub.Nhs.WebUI/Views/Search/_ResourcePagination.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Search/_ResourcePagination.cshtml
@@ -1,5 +1,5 @@
@using Microsoft.AspNetCore.WebUtilities
-@model LearningHub.Nhs.WebUI.Models.Search.SearchResultViewModel
+@model LearningHub.Nhs.Shared.Models.Search.SearchResultViewModel
@{
var pagingModel = Model.ResourceResultPaging;
diff --git a/LearningHub.Nhs.WebUI/Views/Search/_ResourceSearchResult.cshtml b/LearningHub.Nhs.WebUI/Views/Search/_ResourceSearchResult.cshtml
index 647583787..94d5fd904 100644
--- a/LearningHub.Nhs.WebUI/Views/Search/_ResourceSearchResult.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Search/_ResourceSearchResult.cshtml
@@ -1,13 +1,14 @@
-@model LearningHub.Nhs.WebUI.Models.Search.SearchResultViewModel
+@model LearningHub.Nhs.Shared.Models.Search.SearchResultViewModel
@inject Microsoft.Extensions.Configuration.IConfiguration Configuration;
@using System.Linq;
@using System.Web;
+@using LearningHub.Nhs.Shared.Helpers
@using LearningHub.Nhs.WebUI.Helpers;
@using LearningHub.Nhs.Models.Search;
@using LearningHub.Nhs.Models.Search.SearchFeedback;
@using LearningHub.Nhs.Models.Enums;
-@using LearningHub.Nhs.WebUI.Models.Search;
+@using LearningHub.Nhs.Shared.Models.Search;
@using LearningHub.Nhs.Models.Search.SearchClick;
@{
diff --git a/LearningHub.Nhs.WebUI/Views/Search/_SearchBar.cshtml b/LearningHub.Nhs.WebUI/Views/Search/_SearchBar.cshtml
index a0139e3eb..da4a475e9 100644
--- a/LearningHub.Nhs.WebUI/Views/Search/_SearchBar.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Search/_SearchBar.cshtml
@@ -48,8 +48,8 @@
function autocomplete(input, minLength) {
if (input != null) {
input.addEventListener("input", function () {
- var val = this.value;
- if (val.length < minLength) {
+ var val = this.value.trimStart();
+ if (val.length < minLength || val.trim() === "") {
closeAllLists();
return false;
}
diff --git a/LearningHub.Nhs.WebUI/Views/Search/_SubmitFeedback.cshtml b/LearningHub.Nhs.WebUI/Views/Search/_SubmitFeedback.cshtml
index a1ab36e1a..317772449 100644
--- a/LearningHub.Nhs.WebUI/Views/Search/_SubmitFeedback.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Search/_SubmitFeedback.cshtml
@@ -1,5 +1,5 @@
@using Microsoft.AspNetCore.WebUtilities
-@model LearningHub.Nhs.WebUI.Models.Search.SearchResultViewModel
+@model LearningHub.Nhs.Shared.Models.Search.SearchResultViewModel
@{
var queryParams = QueryHelpers.ParseQuery(Context.Request.QueryString.ToString().ToLower());
diff --git a/LearningHub.Nhs.WebUI/Views/Shared/Components/NavigationItems/Searchbar.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/Components/NavigationItems/Searchbar.cshtml
index 8f7f8a738..f3a69f8e6 100644
--- a/LearningHub.Nhs.WebUI/Views/Shared/Components/NavigationItems/Searchbar.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Shared/Components/NavigationItems/Searchbar.cshtml
@@ -72,8 +72,8 @@
function autocomplete(input, minLength) {
if (input != null) {
input.addEventListener("input", function () {
- var val = this.value;
- if (val.length < minLength) {
+ var val = this.value.trimStart();
+ if (val.length < minLength || val.trim() === "") {
closeAllLists();
return false;
}
diff --git a/LearningHub.Nhs.WebUI/Views/Shared/Tenant/LearningHub/_Layout.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/Tenant/LearningHub/_Layout.cshtml
index c16fa837c..6b679b67e 100644
--- a/LearningHub.Nhs.WebUI/Views/Shared/Tenant/LearningHub/_Layout.cshtml
+++ b/LearningHub.Nhs.WebUI/Views/Shared/Tenant/LearningHub/_Layout.cshtml
@@ -21,6 +21,7 @@
+