From 9c9b1a1fcef57b8dfbe1d7152fbd5d974caa502d Mon Sep 17 00:00:00 2001 From: AnjuJose011 <154979799+AnjuJose011@users.noreply.github.com> Date: Thu, 28 Mar 2024 08:46:04 +0000 Subject: [PATCH 01/64] TD-3703-Changes --- LearningHub.Nhs.WebUI/Views/Shared/_Breadcrumbs.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Shared/_Breadcrumbs.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/_Breadcrumbs.cshtml index a721fcae6..886579ba4 100644 --- a/LearningHub.Nhs.WebUI/Views/Shared/_Breadcrumbs.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Shared/_Breadcrumbs.cshtml @@ -13,11 +13,11 @@ diff --git a/LearningHub.Nhs.WebUI/Views/Bookmark/Toggle.cshtml b/LearningHub.Nhs.WebUI/Views/Bookmark/Toggle.cshtml index d06b16fdd..8f77215ae 100644 --- a/LearningHub.Nhs.WebUI/Views/Bookmark/Toggle.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Bookmark/Toggle.cshtml @@ -1,136 +1,142 @@ @using System.Text.RegularExpressions @model LearningHub.Nhs.WebUI.Models.Bookmark.EditBookmarkViewModel @{ - var bookmarkType = (Model.BookmarkTypeId == 1) ? "Folder" : "Bookmark"; - var titleAction = Model.Bookmarked ? "Delete" : "Add"; - var buttonAction = Model.Bookmarked ? "Delete" : "Continue"; + var bookmarkType = (Model.BookmarkTypeId == 1) ? "Folder" : "Bookmark"; + var titleAction = Model.Bookmarked ? "Delete" : "Add"; + var buttonAction = Model.Bookmarked ? "Delete" : "Continue"; - ViewData["Title"] = $"{titleAction} {bookmarkType}"; + ViewData["Title"] = $"{titleAction} {bookmarkType}"; - // Prepare the parameters for the back-link component. - var backToText = "Back to: "; - var returnUrl = ViewBag.ReturnUrl.ToLower(); - var controller = string.Empty; - var action = string.Empty; - var routeParams = new Dictionary(); + // Prepare the parameters for the back-link component. + var backToText = "Back to: "; + var returnUrl = ViewBag.ReturnUrl.ToLower(); + var controller = string.Empty; + var action = string.Empty; + var routeParams = new Dictionary(); - if (returnUrl == "/") + if (returnUrl == "/") + { + backToText += "Learning Hub"; + controller = "home"; + action = "index"; + } + else if (returnUrl.Contains("/bookmark")) + { + backToText += "My bookmarks"; + controller = "bookmark"; + action = "index"; + } + else + { + var resourceMatches = Regex.Matches(returnUrl, @"^/resource/([0-9]+)(/item)?$"); + var catalogueMatches = Regex.Matches(returnUrl, @"^/catalogue/(\w+)$"); + + if (resourceMatches.Count > 0) { - backToText += "Learning Hub"; - controller = "home"; - action = "index"; + backToText += "Learning Resource"; + controller = "resource"; + action = "Index"; + routeParams = new Dictionary { { "resourceReferenceId", resourceMatches[0].Groups[1].Value } }; } - else if (returnUrl == "/bookmark") + else if (catalogueMatches.Count > 0) { - backToText += "My bookmarks"; - controller = "bookmark"; - action = "index"; + backToText += "Catalogue"; + controller = "catalogue"; + action = "Index"; + routeParams = new Dictionary { { "reference", catalogueMatches[0].Groups[1].Value } }; } else { - var resourceMatches = Regex.Matches(returnUrl, @"^/resource/([0-9]+)(/item)?$"); - var catalogueMatches = Regex.Matches(returnUrl, @"^/catalogue/(\w+)$"); - - if (resourceMatches.Count > 0) - { - backToText += "Learning Resource"; - controller = "resource"; - action = "Index"; - routeParams = new Dictionary { { "resourceReferenceId", resourceMatches[0].Groups[1].Value } }; - } - else if (catalogueMatches.Count > 0) - { - backToText += "Catalogue"; - controller = "catalogue"; - action = "Index"; - routeParams = new Dictionary { { "reference", catalogueMatches[0].Groups[1].Value } }; - } + backToText += "Learning Hub"; + controller = "home"; + action = "index"; } + } } @section styles{ - + }
-
- +
+ -
+ - + - @if (Model.Bookmarked) - { - @if (Model.BookmarkTypeId == 1) - { -

Are you sure you want to delete this folder?

-
-

All bookmarks contained within the folder will also be deleted. To save any bookmarks move them out of the folder.

-
- -
-
-
- -
-

@Model.Title

-
-
-
-
- } - else - { -

Are you sure you want to remove this bookmark?

-
-
-
- -
-

@Model.Title

-
-
-
-
- } - } - else - { -

Add @(Model.BookmarkTypeId == 1 ? "a folder" : "bookmark")

+ @if (Model.Bookmarked) + { + @if (Model.BookmarkTypeId == 1) + { +

Are you sure you want to delete this folder?

+
+

All bookmarks contained within the folder will also be deleted. To save any bookmarks move them out of the folder.

+
-
-
-
- You must enter a folder name" : "You must enter a bookmark name")" /> -
-
+
+
+
+ +
+

@Model.Title

- } - -
- -
- Cancel +
+
+
+ } + else + { +

Are you sure you want to remove this bookmark?

+
+
+
+ +
+

@Model.Title

+
+
+ } + } + else + { +

Add @(Model.BookmarkTypeId == 1 ? "a folder" : "bookmark")

+ +
+
+
+ +
+
+
+ } + +
+ +
+ Cancel +
+
- - - - - - - - -
+ + + + + + + + +
\ No newline at end of file From 29446c29bd6dd4e22a0707b3a6e44774899a9a5f Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Wed, 10 Apr 2024 10:32:50 +0100 Subject: [PATCH 04/64] TD-4009: Google Tag Manager tracking for all Non Prod Environments --- .../_GoogleTagManagerNoScriptPartial.cshtml | 4 +-- .../Shared/_GoogleTagManagerPartial.cshtml | 26 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Shared/_GoogleTagManagerNoScriptPartial.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/_GoogleTagManagerNoScriptPartial.cshtml index 0213d8aee..f090cb2a5 100644 --- a/LearningHub.Nhs.WebUI/Views/Shared/_GoogleTagManagerNoScriptPartial.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Shared/_GoogleTagManagerNoScriptPartial.cshtml @@ -1,6 +1,6 @@ @inject LearningHub.Nhs.WebUI.Configuration.Settings settings - -@if (settings.GoogleTagManagerEnabled) +@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment hostingEnv +@if (settings.GoogleTagManagerEnabled && hostingEnv.EnvironmentName == "Production") {