From 776b6e4532139f6e8bcb56c3587ba54eac35c9b6 Mon Sep 17 00:00:00 2001 From: AnjuJose011 <154979799+AnjuJose011@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:23:56 +0000 Subject: [PATCH 01/19] console Error Fix --- .../Views/Catalogue/Edit.cshtml | 778 +++++++++--------- 1 file changed, 384 insertions(+), 394 deletions(-) diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml index 19ed8d399..75f4cddf2 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml +++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml @@ -3,458 +3,448 @@ @using LearningHub.Nhs.Models.Enums @using Newtonsoft.Json @{ - var page = Model.CatalogueNodeVersionId == 0 ? CatalogueNavPage.Add : CatalogueNavPage.Edit; - ViewData["Title"] = page == CatalogueNavPage.Add ? "Add catalogue" : "Edit catalogue"; - var baseUrl = _settings.Value.LearningHubUrl + "catalogue/"; - var url = baseUrl + (Model.Url ?? ""); - var aToZ = (int)CatalogueOrder.AlphabeticalAscending; - var keywords = Model.Keywords ?? new List(); - var Providers = Model.Providers; - var CatalogueNodeVersionProviderId = Model.CatalogueNodeVersionProvider?.ProviderId ?? 0; - var CatalogueNodeVersionProvider = Model.CatalogueNodeVersionProvider; - var action = page.ToString(); - var keywordsJson = Html.Raw(JsonConvert.SerializeObject(keywords)); - var imageBaseUrl = "/file/download/CatalogueImageDirectory/"; - var lastModifiedDate = Model.LastModifiedDate?.ToString("dd MMM yyyy"); + var page = Model.CatalogueNodeVersionId == 0 ? CatalogueNavPage.Add : CatalogueNavPage.Edit; + ViewData["Title"] = page == CatalogueNavPage.Add ? "Add catalogue" : "Edit catalogue"; + var baseUrl = _settings.Value.LearningHubUrl + "catalogue/"; + var url = baseUrl + (Model.Url ?? ""); + var aToZ = (int)CatalogueOrder.AlphabeticalAscending; + var keywords = Model.Keywords ?? new List(); + var Providers = Model.Providers; + var CatalogueNodeVersionProviderId = Model.CatalogueNodeVersionProvider?.ProviderId ?? 0; + var CatalogueNodeVersionProvider = Model.CatalogueNodeVersionProvider; + var action = page.ToString(); + var keywordsJson = Html.Raw(JsonConvert.SerializeObject(keywords)); + var imageBaseUrl = "/file/download/CatalogueImageDirectory/"; + var lastModifiedDate = Model.LastModifiedDate?.ToString("dd MMM yyyy"); } @section SideMenu { - @{ - await Html.RenderPartialAsync("_NavSection"); - } + @{ + await Html.RenderPartialAsync("_NavSection"); + } } @if (!string.IsNullOrEmpty(ViewBag.ErrorMessage)) { - + } @if (page == CatalogueNavPage.Edit) { -
-
-

@Model.Name

+
+
+

@Model.Name

+
-
} @{ - await Html.RenderPartialAsync("_CatalogueNav.cshtml", new CatalogueNavViewModel { Page = page, CatalogueId = Model.CatalogueNodeVersionId }); + await Html.RenderPartialAsync("_CatalogueNav.cshtml", new CatalogueNavViewModel { Page = page, CatalogueId = Model.CatalogueNodeVersionId }); }
-
- - - - -
-
-
- @if (page == CatalogueNavPage.Edit) - { - var idString = Model.CatalogueNodeVersionId.ToString(); - var paddedIdString = idString.Length > 3 ? idString : idString.PadLeft(3, '0'); - ID: @paddedIdString - } - else - { - NEW - } + + + + + +
+
+
+ @if (page == CatalogueNavPage.Edit) + { + var idString = Model.CatalogueNodeVersionId.ToString(); + var paddedIdString = idString.Length > 3 ? idString : idString.PadLeft(3, '0'); + ID: @paddedIdString + } + else + { + NEW + } +
+ @if (page == CatalogueNavPage.Add || Model.Hidden) + { + Hidden + } + @if (lastModifiedDate != null) + { +

Last modified on: @lastModifiedDate

+ } +
- @if (page == CatalogueNavPage.Add || Model.Hidden) - { - Hidden - } - @if (lastModifiedDate != null) - { -

Last modified on: @lastModifiedDate

- } -
-
- - @if (!ViewData.ModelState.IsValid) - { -
This form failed to save because there are errors below.
- } -
-
- -

You can enter a maximum of 255 characters including spaces

- - -
-
-
-
- - @if (page == CatalogueNavPage.Add) - { - - } - else - { - - } - -
-
- @if (Model.Status == VersionStatusEnum.Published && !Model.Hidden) + @if (!ViewData.ModelState.IsValid) { - +
This form failed to save because there are errors below.
} - else - { -

- } -
-
-
-
- -
-
-
-
- - -
-
-
-
- -
-
-
-
- -
-
-
-
- - - Only the first 3,000 characters of the description will be used by search - -
-
-
-
- -

- Add one or more relevant keywords to help learners find this catalogue, ensuring that the keyword is specifically related to the catalogue rather than the resources associated with it. A maximum of 5 keywords can be added. Enter one keyword and add it before entering another. -

-
-
- -
- + +
+
+ +

You can enter a maximum of 255 characters including spaces

+ +
-
-
-
- - -
+
+
+ + @if (page == CatalogueNavPage.Add) + { + + } + else + { + + } + +
+
+ @if (Model.Status == VersionStatusEnum.Published && !Model.Hidden) + { + + } + else + { +

+ } +
-
-
- -
+
+
+ +
+
+
+
+ + +
+
+
+ +
+
+
+
+ +
+
+
+
+ + + Only the first 3,000 characters of the description will be used by search + +
+
+
+
+ +

+ Add one or more relevant keywords to help learners find this catalogue, ensuring that the keyword is specifically related to the catalogue rather than the resources associated with it. A maximum of 5 keywords can be added. Enter one keyword and add it before entering another. +

+
+
+ +
+ +
+
+
+
+
+ + +
+
+
+
+ +
+
-
-
-

You can enter a maximum of 50 characters per keyword.

-
- @{ - var i = 0; - } - @foreach (var keyword in keywords) - { -
-

@keyword

- -
- } +
+

You can enter a maximum of 50 characters per keyword.

+
+ @{ + var i = 0; + } + @foreach (var keyword in keywords) + { +
+

@keyword

+ + +
+ } +
+
-
-
-
+
-
-
- -
-
+
+
+ +
+
-
-
-
- @if (!Model.RestrictedAccess) - { - - } - else - { - - } - Unrestricted access (default) -
-
- @if (Model.RestrictedAccess) - { - - } - else +
+
+
+ @if (!Model.RestrictedAccess) + { + + } + else + { + + } + Unrestricted access (default) +
+
+ @if (Model.RestrictedAccess) + { + + } + else + { + + } + Restricted access +
+
+
+ @if (!Model.HasUserGroup) { - +
+

There are no user groups associated with this catalogue. You can add some in the User Groups tab.

+
} - Restricted access -
-
-
- @if (!Model.HasUserGroup) - { -
-

There are no user groups associated with this catalogue. You can add some in the User Groups tab.

- } -
-
+
-
-
- -

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.

-

Developed with;

-
-
+
+
+ +

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.

+

Developed with;

+
+
-
-
- @if (Providers != null && Providers.Count() > 0) - { -
- @foreach (var provider in Providers) - { - - @provider.Name -
- } - - Not applicable +
+
+ @if (Providers != null && Providers.Count() > 0) + { +
+ @foreach (var provider in Providers) + { + + @provider.Name +
+ } + + Not applicable +
+ } +
- }
-
-
-
-
- @if (page == CatalogueNavPage.Add) - { - - } - else - { - - } -
-
- -
+
+
+ @if (page == CatalogueNavPage.Add) + { + + } + else + { + + } +
+
+ +
@section Scripts { - - + + } From 4fa9c0a06b54bce21c922de5f7b6addd421d0d7b Mon Sep 17 00:00:00 2001 From: Arunima George Date: Thu, 28 Nov 2024 15:55:39 +0000 Subject: [PATCH 02/19] TD-4934: Rewording of General Users introduction sentence --- .../Views/Account/CreateAccountRegistrationInformation.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountRegistrationInformation.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountRegistrationInformation.cshtml index 12d51bbd2..160c64c56 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountRegistrationInformation.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountRegistrationInformation.cshtml @@ -24,7 +24,7 @@

General user account

- General users can access resources made available by contributors to all users. + General users have access to the resources that contributors have made available for public access.

Required information

From d3853cb0c4413de1bdd611da13008f48337d0c2b Mon Sep 17 00:00:00 2001 From: Arunima George Date: Thu, 28 Nov 2024 16:11:35 +0000 Subject: [PATCH 03/19] TD-4964: Rewording of list of additional required information --- .../Account/CreateAccountRegistrationInformation.cshtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountRegistrationInformation.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountRegistrationInformation.cshtml index 12d51bbd2..f36d4f91e 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountRegistrationInformation.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountRegistrationInformation.cshtml @@ -40,12 +40,12 @@

Additional information needed

    -
  • Qualifying work email address (e.g. NHS email address)
  • +
  • Qualifying work email address (for example, NHS email address)
  • Current role
  • Professional registration number (if applicable)
  • -
  • Grade / Band
  • +
  • Grade or Band
  • Start date
  • -
  • Primary specialty (if applicable)
  • +
  • Primary speciality (if applicable)
  • Country
  • Place of work details
  • From 037d30851f19cbface340c0bb87f242616488fce Mon Sep 17 00:00:00 2001 From: Arunima George Date: Thu, 28 Nov 2024 16:25:15 +0000 Subject: [PATCH 04/19] TD-4967: Rewording of "Enter your work email address" --- .../Views/Account/CreateAccountEmailVerification.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml index b52b85569..905bcdacf 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml @@ -42,7 +42,7 @@ Date: Thu, 28 Nov 2024 16:47:12 +0000 Subject: [PATCH 05/19] TD-4968: Reword statement "Ideally you should provide a work email address so that your registration results in the most appropriate access." --- .../Views/Account/CreateAccountEmailVerification.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml index b52b85569..e53f8c0e6 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountEmailVerification.cshtml @@ -36,7 +36,7 @@

    Create an account

    Information: -

    Ideally you should provide a work email address so that your registration results in the most appropriate access.

    +

    Providing a work email address will ensure your registration receives the appropriate access.

    From 3a4023eef1f15cdd96aaeb2dac950a3208699ef1 Mon Sep 17 00:00:00 2001 From: Arunima George Date: Fri, 29 Nov 2024 11:02:40 +0000 Subject: [PATCH 06/19] TD-5001: Word "Support" placement --- .../ELFH Database Scripts/Update LH email content.sql | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/ELFH Database Scripts/Update LH email content.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/ELFH Database Scripts/Update LH email content.sql index 75af1e3ba..7715d73bc 100644 --- a/WebAPI/LearningHub.Nhs.Database/Scripts/ELFH Database Scripts/Update LH email content.sql +++ b/WebAPI/LearningHub.Nhs.Database/Scripts/ELFH Database Scripts/Update LH email content.sql @@ -28,7 +28,7 @@ Note that this link has a time limit of [TimeLimit]. If you select the link afte To log in at any other time go to [TenantUrl], enter your username and password and select the Sign in button.

    When you first log in you will be guided through a series of steps to complete your registration. Providing correct information means that we can offer you a better learning experience.

    Please do not reply to this email.

    -Support
    1. For more information on how to log in, access learning resources and contribute resources, visit the Learning Hub Support pages.
    2. If you have any problems or further questions, contact us using the following Support Form.
    3. You can also use our Live Chat service which will connect you to the Support team. Look for the Live Chat icon in the bottom right of your browser when you visit the Learning Hub.
    Thanks again for creating an account and we hope you enjoy your learning experience.

    +
    1. For more information on how to log in, access learning resources and contribute resources, visit the Learning Hub Support pages.
    2. If you have any problems or further questions, contact us using the following Support Form.
    3. You can also use our Live Chat service which will connect you to the Support team. Look for the Live Chat icon in the bottom right of your browser when you visit the Learning Hub.
    Thanks again for creating an account and we hope you enjoy your learning experience.

    The Learning Hub Support Team
    NHS England

    This e-mail and any files transmitted with it are confidential. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received.

    @@ -46,8 +46,7 @@ If this was not you, contact us using the following S In the unlikely event that selecting the above link does not work, please copy and paste this directly into the address bar of your browser: [PasswordValidateUrl]

    Note that this link has a time limit of [TimeLimit]. If you select the link after this time you will receive instructions on how to generate a new one.

    Once you have reset your password you will be given a link to log in with your new password.

    -Please do not reply to this email.

    -Support +Please do not reply to this email.

    1. For more information on how to log in, access learning resources and contribute resources, visit the Learning Hub Support pages.
    2. If you have any problems or further questions, contact us using the following Support Form.
    3. You can also use our Live Chat service which will connect you to the Support team. Look for the Live Chat icon in the bottom right of your browser when you visit the Learning Hub.
    @@ -67,7 +66,7 @@ We received a request to retrieve your username for the Learning Hub.

    If this was not you, contact us using the following Support Form.

    The username registered to this email address is: [UserName]

    If you know your password, you can log in straight away or do you need a password reminder password reminder?

    -Please do not reply to this email.

    Support
      +Please do not reply to this email.

      1. For more information on how to log in, access learning resources and contribute resources, visit the Learning Hub Support pages.
      2. If you have any problems or further questions, contact us using the following Support Form.
      3. You can also use our Live Chat service which will connect you to the Support team. Look for the Live Chat icon in the bottom right of your browser when you visit the Learning Hub.
      From a9383f5f3a973a2947d44cf33f38bef0c1f24ebf Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Mon, 27 Jan 2025 16:34:29 +0000 Subject: [PATCH 07/19] TD-5237: After requesting access to restricted catalogue, you can still request access --- .../Views/Catalogue/RequestAccess.cshtml | 114 ++++++++++-------- .../Shared/_RestrictedAccessBanner.cshtml | 42 +++---- 2 files changed, 85 insertions(+), 71 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Catalogue/RequestAccess.cshtml b/LearningHub.Nhs.WebUI/Views/Catalogue/RequestAccess.cshtml index dc7a202e3..b67917e35 100644 --- a/LearningHub.Nhs.WebUI/Views/Catalogue/RequestAccess.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Catalogue/RequestAccess.cshtml @@ -2,68 +2,82 @@ @using LearningHub.Nhs.WebUI.Models.Catalogue @using LearningHub.Nhs.Models.Enums @{ - ViewData["Title"] = "Request Access"; + ViewData["Title"] = "Request Access"; } -@section styles{ - +@section styles { + }
      -
      - -

      Catalogue access request

      +
      + +

      Catalogue access request

      -
      - @using (Html.BeginForm("RequestAccessPost", "Catalogue", FormMethod.Post)) - { - @if (Model.CatalogueAccessRequest != null && Model.CatalogueAccessRequest.Status == CatalogueAccessRequestStatus.Rejected) - { -

      Your last request to access this catalogue was denied on @Model.CatalogueAccessRequest.DateRejected.Value.ToString("dd MMM yyyy") for the following reason:

      -

      @Model.CatalogueAccessRequest.ResponseMessage

      - } +
      + @using (Html.BeginForm("RequestAccessPost", "Catalogue", FormMethod.Post)) + { + @if (Model.CatalogueAccessRequest != null && Model.CatalogueAccessRequest.Status == CatalogueAccessRequestStatus.Rejected) + { +

      Your last request to access this catalogue was denied on @Model.CatalogueAccessRequest.DateRejected.Value.ToString("dd MMM yyyy") for the following reason:

      +

      @Model.CatalogueAccessRequest.ResponseMessage

      + } + else if (Model.CatalogueAccessRequest != null && Model.CatalogueAccessRequest.Status == CatalogueAccessRequestStatus.Pending) + { +

      Your access request which was sent on @Model.CatalogueAccessRequest.DateRequested.ToString("dd MMM yyyy") is pending a decision.

      +

      If you need further information contact support

      + } -

      You are requesting access to the @Model.CatalogueName catalogue. Enter the information below which will be sent to the catalogue administrator. You will be notified of their decision by email.

      +

      You are requesting access to the @Model.CatalogueName catalogue. Enter the information below which will be sent to the catalogue administrator. You will be notified of their decision by email.

      - - - - - - - - - -
      Name:@Model.CurrentUser.FirstName @Model.CurrentUser.LastName
      Email:@Model.CurrentUser.EmailAddress
      + + + + + + + + + +
      Name:@Model.CurrentUser.FirstName @Model.CurrentUser.LastName
      Email:@Model.CurrentUser.EmailAddress
      -
      -
      - Enter your role, place of work, professional body number (if applicable) and information on why you are requesting access to this catalogue. -
      +
      +
      + Enter your role, place of work, professional body number (if applicable) and information on why you are requesting access to this catalogue. +
      - -
      -
      + +
      +
      - - - - - - - - @if (Model.CatalogueAccessRequest != null) - { - - - - } + + + + + + + + @if (Model.CatalogueAccessRequest != null) + { + + + + } -
      - Cancel - -
      - } +
      + + @if (Model.CatalogueAccessRequest != null && Model.CatalogueAccessRequest.Status == CatalogueAccessRequestStatus.Pending) + { + Cancel + + } + else + { + Cancel + + }
      + }
      +
      \ No newline at end of file diff --git a/LearningHub.Nhs.WebUI/Views/Shared/_RestrictedAccessBanner.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/_RestrictedAccessBanner.cshtml index 110a49be8..982e1492d 100644 --- a/LearningHub.Nhs.WebUI/Views/Shared/_RestrictedAccessBanner.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Shared/_RestrictedAccessBanner.cshtml @@ -4,26 +4,26 @@ @if (ViewBag.UserAuthenticated && Model.RestrictedAccess && !Model.HasCatalogueAccess) { -
      -
      - @if (Model.CatalogueAccessRequest == null || Model.UserGroups.Count == 0) - { -

      @Model.TitleText

      -

      @Model.BodyText

      - Request access - } - else if (Model.CatalogueAccessRequest != null && Model.CatalogueAccessRequest.Status == CatalogueAccessRequestStatus.Pending) - { -

      @Model.TitleText

      -

      Your access request which was sent on @Model.CatalogueAccessRequest.DateRequested.ToString("dd MMM yyyy") is pending a decision.

      -

      If you need further information contact support

      - } - else if (Model.CatalogueAccessRequest != null && Model.CatalogueAccessRequest.Status == CatalogueAccessRequestStatus.Rejected) - { -

      @Model.TitleText

      -

      The catalogue administrator did not approve your request to access this catalogue on @Model.CatalogueAccessRequest.DateRejected.Value.ToString("dd MMM yyyy"). If anything has changed in relation to your original request, you can request access again.

      - Request access - } -
      +
      +
      + @if (Model.CatalogueAccessRequest != null && Model.CatalogueAccessRequest.Status == CatalogueAccessRequestStatus.Pending) + { +

      @Model.TitleText

      +

      Your access request which was sent on @Model.CatalogueAccessRequest.DateRequested.ToString("dd MMM yyyy") is pending a decision.

      +

      If you need further information contact support

      + } + else if (Model.CatalogueAccessRequest != null && Model.CatalogueAccessRequest.Status == CatalogueAccessRequestStatus.Rejected) + { +

      @Model.TitleText

      +

      The catalogue administrator did not approve your request to access this catalogue on @Model.CatalogueAccessRequest.DateRejected.Value.ToString("dd MMM yyyy"). If anything has changed in relation to your original request, you can request access again.

      + Request access + } + else if (Model.CatalogueAccessRequest == null || Model.UserGroups.Count == 0) + { +

      @Model.TitleText

      +

      @Model.BodyText

      + Request access + }
      +
      } From 8a2549e1fc4c299d6272b7113c77c782418e25b2 Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Wed, 29 Jan 2025 14:19:00 +0000 Subject: [PATCH 08/19] TD-5048: Issue showing multiple entries for service updates/releases on 'Admin' section when clicked 'save' button multiple times --- .../Controllers/RoadmapController.cs | 16 ++- .../Interfaces/IRoadmapService.cs | 8 ++ .../Services/RoadmapService.cs | 29 ++++++ .../Views/Log/Index.cshtml | 3 + .../Views/Roadmap/Details.cshtml | 98 +++++++++++++++++++ .../Views/Roadmap/Updates.cshtml | 98 ++++++++++--------- .../Views/Shared/_NavSection.cshtml | 2 +- .../Controllers/RoadmapController.cs | 24 ++++- .../IRoadmapService.cs | 7 ++ .../RoadmapService.cs | 15 +++ 10 files changed, 248 insertions(+), 52 deletions(-) create mode 100644 AdminUI/LearningHub.Nhs.AdminUI/Views/Roadmap/Details.cshtml diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Controllers/RoadmapController.cs b/AdminUI/LearningHub.Nhs.AdminUI/Controllers/RoadmapController.cs index 319c8938c..bd7261a87 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Controllers/RoadmapController.cs +++ b/AdminUI/LearningHub.Nhs.AdminUI/Controllers/RoadmapController.cs @@ -99,7 +99,7 @@ public async Task AddUpdate(UpdateViewModel update) RoadmapTypeId = update.RoadmapTypeId, }; var roadmapId = await this.roadmapService.AddRoadmap(roadmap); - return this.RedirectToAction("EditUpdate", new { id = roadmapId }); + return this.RedirectToAction("Details", new { id = roadmapId }); } /// @@ -160,7 +160,7 @@ public async Task EditUpdate(UpdateViewModel update) Id = update.Id, }; await this.roadmapService.UpdateRoadmap(roadmap); - return this.RedirectToAction("EditUpdate", new { roadmap.Id }); + return this.RedirectToAction("Details", new { roadmap.Id }); } /// @@ -202,6 +202,18 @@ public async Task Updates(string searchTerm = null) return this.View(model); } + /// + /// The Details. + /// + /// The id. + /// The . + [HttpGet] + public async Task Details(int id) + { + var roadmap = await this.roadmapService.GetIdAsync(id); + return this.View(roadmap); + } + /// /// The UploadFile. /// diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IRoadmapService.cs b/AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IRoadmapService.cs index cb96b6037..a0606ebc3 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IRoadmapService.cs +++ b/AdminUI/LearningHub.Nhs.AdminUI/Interfaces/IRoadmapService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using LearningHub.Nhs.Models.Entities; + using LearningHub.Nhs.Models.RoadMap; /// /// Defines the . @@ -36,6 +37,13 @@ public interface IRoadmapService /// The . Task> GetUpdates(); + /// + /// The GetIdAsync. + /// + /// The id. + /// The . + Task GetIdAsync(int id); + /// /// The UpdateRoadmap. /// diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Services/RoadmapService.cs b/AdminUI/LearningHub.Nhs.AdminUI/Services/RoadmapService.cs index bf4878d8b..48507ae31 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Services/RoadmapService.cs +++ b/AdminUI/LearningHub.Nhs.AdminUI/Services/RoadmapService.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using LearningHub.Nhs.AdminUI.Interfaces; using LearningHub.Nhs.Models.Entities; + using LearningHub.Nhs.Models.RoadMap; using Newtonsoft.Json; /// @@ -134,6 +135,34 @@ public async Task> GetUpdates() return viewmodel; } + /// + /// The GetIdAsync. + /// + /// The id. + /// The . + public async Task GetIdAsync(int id) + { + RoadMapViewModel viewmodel = null; + + var client = await this.LearningHubHttpClient.GetClientAsync(); + var request = $"Roadmap/GetRoadMapsById/{id}"; + var response = await client.GetAsync(request).ConfigureAwait(false); + + if (response.IsSuccessStatusCode) + { + var result = response.Content.ReadAsStringAsync().Result; + viewmodel = JsonConvert.DeserializeObject(result); + } + else if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized + || + response.StatusCode == System.Net.HttpStatusCode.Forbidden) + { + throw new Exception("AccessDenied"); + } + + return viewmodel; + } + /// /// The UpdateRoadmap. /// diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Log/Index.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Log/Index.cshtml index 8e9c75ae2..8f3eb95d3 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Views/Log/Index.cshtml +++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Log/Index.cshtml @@ -23,6 +23,8 @@ + @if (Model.Results != null) + { @foreach (var item in Model.Results.Items) { @@ -46,6 +48,7 @@ } + }
      diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Roadmap/Details.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Roadmap/Details.cshtml new file mode 100644 index 000000000..983a1abc0 --- /dev/null +++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Roadmap/Details.cshtml @@ -0,0 +1,98 @@ +@model LearningHub.Nhs.Models.RoadMap.RoadMapViewModel; +@using LearningHub.Nhs.AdminUI.Services + +@{ + ViewData["Title"] = "Details"; +} +@section SideMenu { + @{ + await Html.RenderPartialAsync("_NavSection"); + } +} + +
      +
      +   Go back +
      + +
      +
      + @{ + string noneVal = ""; + } +
      +
      +
      ID @Model.Id
      + @ViewBag.UpdateSaveError +
      +
      + Title +
      +
      + @Html.DisplayFor(model => model.Title) +
      +
      + Date +
      +
      + @Html.DisplayFor(model => model.RoadmapDate) +
      +
      + Feature Image +
      +
      + +
      +
      + Description +
      +
      + @Html.Raw(Model.Description) +
      +
      + Status +
      + + + @if (Model.Published) + { +
      + Published +
      + } + else + { +
      + Not Published +
      + } +
      + Create User +
      +
      + @Html.DisplayFor(model => model.CreateUserName) +
      +
      + Create Date +
      +
      + @Html.DisplayFor(model => model.CreateDate) +
      +
      + Amend User +
      +
      + @Html.DisplayFor(model => model.AmendUserName) +
      +
      + Amend Date +
      +
      + @Html.DisplayFor(model => model.AmendDate) +
      +
      +
      +
      + +
      + diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Roadmap/Updates.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Roadmap/Updates.cshtml index 5a7a801b1..767896ab4 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Views/Roadmap/Updates.cshtml +++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Roadmap/Updates.cshtml @@ -1,68 +1,70 @@ @model LearningHub.Nhs.Models.Paging.TablePagingViewModel @{ - ViewData["Title"] = "Service updates and releases"; - ViewData["CurrentPage"] = Model.Paging.CurrentPage; - var searchTerm = ViewData["SearchTerm"]; + ViewData["Title"] = "Service updates and releases"; + ViewData["CurrentPage"] = Model.Paging.CurrentPage; + var searchTerm = ViewData["SearchTerm"]; } -@section Styles{ - +@section Styles { + } @section SideMenu { - @{await Html.RenderPartialAsync("_NavSection"); } + @{ + await Html.RenderPartialAsync("_NavSection"); + } }
      -
      -
      - Updates -
      +
      + - +
      +
      - - - - - - +
      Published
      + + + + + - - - - @foreach (var item in Model.Results.Items) + + + + @foreach (var item in Model.Results.Items) + { + + + + - - - - + } - -
      Published
      + @Html.ActionLink(item.Title.ToString(), "Details", new { id = item.Id }) + + @Html.ActionLink(item.RoadmapDate.Value.ToString("dd MMM yyyy"), "Details", new { id = item.Id }) + + @if (item.Published) { -
      - @Html.ActionLink(item.Title.ToString(), "EditUpdate", new { id = item.Id }) - - @Html.ActionLink(item.RoadmapDate.Value.ToString("dd MMM yyyy"), "EditUpdate", new { id = item.Id }) - - @if (item.Published) - { - - } - else - { - - } -
      + else + { + + } + + + } + +
      @section Scripts { - - + + } diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Shared/_NavSection.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Shared/_NavSection.cshtml index 995e1f42a..924c58475 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/Views/Shared/_NavSection.cshtml +++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Shared/_NavSection.cshtml @@ -13,9 +13,9 @@ sideMenu = "settings"; break; case "roadmap": + sideMenu = "settings"; if (activeItem.Contains("update")) { - sideMenu = "settings"; controller = "updates"; } break; diff --git a/WebAPI/LearningHub.Nhs.API/Controllers/RoadmapController.cs b/WebAPI/LearningHub.Nhs.API/Controllers/RoadmapController.cs index 3dc4c3c01..1c152a537 100644 --- a/WebAPI/LearningHub.Nhs.API/Controllers/RoadmapController.cs +++ b/WebAPI/LearningHub.Nhs.API/Controllers/RoadmapController.cs @@ -2,8 +2,10 @@ { using System.Collections.Generic; using System.Threading.Tasks; + using AutoMapper; using LearningHub.Nhs.Models.Common; using LearningHub.Nhs.Models.Entities; + using LearningHub.Nhs.Models.Notification; using LearningHub.Nhs.Models.RoadMap; using LearningHub.Nhs.Services.Interface; using Microsoft.AspNetCore.Authorization; @@ -19,6 +21,7 @@ public class RoadmapController : ApiControllerBase { private readonly IRoadmapService roadmapService; + private readonly IMapper mapper; /// /// Initializes a new instance of the class. @@ -26,13 +29,16 @@ public class RoadmapController : ApiControllerBase /// The user service. /// The roadmap service. /// The logger. + /// The mapper. public RoadmapController( IUserService userService, IRoadmapService roadmapService, - ILogger logger) + ILogger logger, + IMapper mapper) : base(userService, logger) { this.roadmapService = roadmapService; + this.mapper = mapper; } /// @@ -71,6 +77,22 @@ public async Task GetRoadmap(int id) return await this.roadmapService.GetRoadmap(id); } + /// + /// The GetRoadmap. + /// + /// The id. + /// The roadmap. + [HttpGet] + [Route("GetRoadMapsById/{id}")] + public async Task GetRoadMapsById(int id) + { + var roadMap = await this.roadmapService.GetRoadmapUser(id); + var roadmapviewmodel = this.mapper.Map(roadMap); + roadmapviewmodel.CreateUserName = roadMap.CreateUser.UserName; + roadmapviewmodel.AmendUserName = roadMap.AmendUser.UserName; + return roadmapviewmodel; + } + /// /// The AddRoadmap. /// diff --git a/WebAPI/LearningHub.Nhs.Services.Interface/IRoadmapService.cs b/WebAPI/LearningHub.Nhs.Services.Interface/IRoadmapService.cs index 26330690f..4d9a1176f 100644 --- a/WebAPI/LearningHub.Nhs.Services.Interface/IRoadmapService.cs +++ b/WebAPI/LearningHub.Nhs.Services.Interface/IRoadmapService.cs @@ -55,6 +55,13 @@ public interface IRoadmapService /// The roadmap. Task GetRoadmap(int id); + /// + /// The get roadmap with Userdetails. + /// + /// The id. + /// The roadmap. + Task GetRoadmapUser(int id); + /// /// The delete roadmap. /// diff --git a/WebAPI/LearningHub.Nhs.Services/RoadmapService.cs b/WebAPI/LearningHub.Nhs.Services/RoadmapService.cs index e3c7f8408..17d9fb8bf 100644 --- a/WebAPI/LearningHub.Nhs.Services/RoadmapService.cs +++ b/WebAPI/LearningHub.Nhs.Services/RoadmapService.cs @@ -107,6 +107,21 @@ public async Task GetRoadmap(int id) return await this.roadmapRepository.GetAll().SingleAsync(x => x.Id == id); } + /// + /// The get roadmap with Userdetails. + /// + /// The id. + /// The roadmap. + public async Task GetRoadmapUser(int id) + { + return await this.roadmapRepository.GetAll() + .Include(n => n.AmendUser) + .Include(n => n.CreateUser) + .Where(n => n.Id == id) + .AsNoTracking() + .SingleOrDefaultAsync(); + } + /// /// The delete roadmap. /// From a2fb42c1bc48845c19b687b2416f5bd72f16d774 Mon Sep 17 00:00:00 2001 From: AnjuJose011 <154979799+AnjuJose011@users.noreply.github.com> Date: Fri, 31 Jan 2025 15:37:54 +0000 Subject: [PATCH 09/19] fixes --- .../Scripts/vuesrc/notification/notification.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue index adbcd76f2..6c2a875c8 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue @@ -45,7 +45,7 @@
      - +
      From bc5d15d38dd601f25097cf94b0c6ba6172d0818f Mon Sep 17 00:00:00 2001 From: Anju Jose Date: Sun, 2 Feb 2025 08:48:36 +0000 Subject: [PATCH 10/19] Intial commit-Fix --- .../Controllers/CatalogueController.cs | 3 +-- .../Interfaces/ICatalogueService.cs | 3 +-- .../Services/CatalogueService.cs | 7 +++--- .../Controllers/CatalogueController.cs | 7 +++--- .../Hierarchy/GetCatalogues.sql | 22 +++++++++++-------- .../Hierarchy/GetCataloguesCount.sql | 7 +++++- .../ICatalogueNodeVersionRepository.cs | 3 +-- .../CatalogueNodeVersionRepository.cs | 7 ++---- .../ICatalogueService.cs | 3 +-- .../CatalogueService.cs | 5 ++--- 10 files changed, 33 insertions(+), 34 deletions(-) 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/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); From 32ce7c4bf278b8bce8f7681e12f355c8b2eca6a2 Mon Sep 17 00:00:00 2001 From: Anju Jose Date: Sun, 2 Feb 2025 08:55:35 +0000 Subject: [PATCH 11/19] fix on appsetting --- LearningHub.Nhs.WebUI/appsettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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": "", From 883b70c7a61b6f2878ece9c339cd8583f603e0cd Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Mon, 3 Feb 2025 12:46:40 +0000 Subject: [PATCH 12/19] TD-5300: Landing Page - Video player buttons focus right to left --- .../Views/Home/_CmsVideo.cshtml | 267 ++++++++++-------- .../wwwroot/js/mkplayer-ui-custom.js | 7 +- 2 files changed, 153 insertions(+), 121 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Home/_CmsVideo.cshtml b/LearningHub.Nhs.WebUI/Views/Home/_CmsVideo.cshtml index 1b9433b83..bfa65821f 100644 --- a/LearningHub.Nhs.WebUI/Views/Home/_CmsVideo.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Home/_CmsVideo.cshtml @@ -1,11 +1,11 @@ @using LearningHub.Nhs.Models.Content @model PageSectionDetailViewModel @{ - string mkPlayerLicence = (string)ViewData["mkPlayerLicenceKey"]; - var scheme = Context?.Request?.Scheme ?? "undefined"; - var host = Context?.Request?.Host; - var path = Context?.Request?.Path ?? "undefined"; - var requestURL = $"{scheme}://{host}{path}"; + string mkPlayerLicence = (string)ViewData["mkPlayerLicenceKey"]; + var scheme = Context?.Request?.Scheme ?? "undefined"; + var host = Context?.Request?.Host; + var path = Context?.Request?.Path ?? "undefined"; + var requestURL = $"{scheme}://{host}{path}"; } @@ -55,130 +55,161 @@ \ No newline at end of file diff --git a/LearningHub.Nhs.WebUI/wwwroot/js/mkplayer-ui-custom.js b/LearningHub.Nhs.WebUI/wwwroot/js/mkplayer-ui-custom.js index 9e8ec49e7..f2568cdbc 100644 --- a/LearningHub.Nhs.WebUI/wwwroot/js/mkplayer-ui-custom.js +++ b/LearningHub.Nhs.WebUI/wwwroot/js/mkplayer-ui-custom.js @@ -48,10 +48,11 @@ function buildControlbar(id, player) { let buttons = titlebar.querySelectorAll('button'); // Reverse the button list and append each button to the controlbar - Array.from(buttons).reverse().forEach(button => { - if (button.textContent != "Mute") { - button.classList.add('control-right'); // Add a class to align buttons to the right + Array.from(buttons).forEach(button => { + if (button.textContent == "Settings") { + button.classList.add('controlmargin'); } + controlbar.appendChild(button); // Append the button to the controlbar }); From c45072a129bcdf7a699b4fecb24cbb3a9ddf77dc Mon Sep 17 00:00:00 2001 From: AnjuJose011 <154979799+AnjuJose011@users.noreply.github.com> Date: Tue, 4 Feb 2025 11:29:06 +0000 Subject: [PATCH 13/19] fixes --- .../Views/Home/Contactus.cshtml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Home/Contactus.cshtml b/LearningHub.Nhs.WebUI/Views/Home/Contactus.cshtml index 83f69b5eb..a91205c49 100644 --- a/LearningHub.Nhs.WebUI/Views/Home/Contactus.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Home/Contactus.cshtml @@ -31,9 +31,9 @@
    1. -

      +

      Support site -

      +

      Visit our support site for help on using the Learning Hub.

      @@ -44,9 +44,9 @@
    2. -

      +

      Support team -

      +

      Complete our form to ask the support team for help.

      @@ -58,9 +58,9 @@
    3. -

      +

      Share feedback -

      +

      Share your feedback to help us improve the platform.

      @@ -71,9 +71,9 @@
    4. -

      +

      Contribute to user research -

      +

      Influence the future development of the Learning Hub.

      From 489cef37e40e3a2f22c1b0b0fbfd036bb9453290 Mon Sep 17 00:00:00 2001 From: Arunima George Date: Tue, 4 Feb 2025 12:22:07 +0000 Subject: [PATCH 14/19] TD-5299: Removed focus on visually hidden content --- .../Views/Shared/Components/NavigationItems/Searchbar.cshtml | 2 +- LearningHub.Nhs.WebUI/Views/Shared/_NavPartial.cshtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Views/Shared/Components/NavigationItems/Searchbar.cshtml b/LearningHub.Nhs.WebUI/Views/Shared/Components/NavigationItems/Searchbar.cshtml index 2a2bbb281..ba0200e2b 100644 --- a/LearningHub.Nhs.WebUI/Views/Shared/Components/NavigationItems/Searchbar.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Shared/Components/NavigationItems/Searchbar.cshtml @@ -9,7 +9,7 @@
      @if (Model.ShowSearch) { - + } @if (User.Identity.IsAuthenticated) { - +
      @await Html.PartialAsync("~/Views/Shared/_PageReviewPartial.cshtml", new PageReviewModel { LastReviewedDate = new DateTime(2023, 6, 01), NextReviewDate = new DateTime(2026, 8, 16) }) From 242d65e5792b8e48ee21f27fe4faf846bea28466 Mon Sep 17 00:00:00 2001 From: Oluwatobi Awe Date: Mon, 17 Feb 2025 12:38:33 +0000 Subject: [PATCH 17/19] TD-5348 azure file download service --- .../Controllers/Api/ResourceController.cs | 6 ++- .../Models/FileDownloadResponse.cs | 5 ++ LearningHub.Nhs.WebUI/Services/FileService.cs | 51 +++++++++++-------- 3 files changed, 38 insertions(+), 24 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Controllers/Api/ResourceController.cs b/LearningHub.Nhs.WebUI/Controllers/Api/ResourceController.cs index e5e8ab35e..61371b962 100644 --- a/LearningHub.Nhs.WebUI/Controllers/Api/ResourceController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/Api/ResourceController.cs @@ -69,9 +69,10 @@ public async Task DownloadResource(string filePath, string fileNa } var file = await this.fileService.DownloadFileAsync(filePath, fileName); + if (file != null) { - return this.File(file.Content, file.ContentType, fileName); + return !string.IsNullOrEmpty(file.DownloadUrl) ? this.Redirect(file.DownloadUrl) : this.File(file.Content, file.ContentType, fileName); } else { @@ -106,7 +107,8 @@ public async Task DownloadResourceAndRecordActivity(int resourceV ActivityStatus = ActivityStatusEnum.Completed, }; await this.activityService.CreateResourceActivityAsync(activity); - return this.File(file.Content, file.ContentType, fileName); + + return !string.IsNullOrEmpty(file.DownloadUrl) ? this.Redirect(file.DownloadUrl) : this.File(file.Content, file.ContentType, fileName); } else { diff --git a/LearningHub.Nhs.WebUI/Models/FileDownloadResponse.cs b/LearningHub.Nhs.WebUI/Models/FileDownloadResponse.cs index 8036e9320..1a4d76679 100644 --- a/LearningHub.Nhs.WebUI/Models/FileDownloadResponse.cs +++ b/LearningHub.Nhs.WebUI/Models/FileDownloadResponse.cs @@ -21,5 +21,10 @@ public class FileDownloadResponse /// Gets or sets the ContentType. /// public long ContentLength { get; set; } + + /// + /// Gets or sets when downloading large files, a SAS URL is returned so the client can download directly from Azure Files. + /// + public string DownloadUrl { get; set; } } } \ No newline at end of file diff --git a/LearningHub.Nhs.WebUI/Services/FileService.cs b/LearningHub.Nhs.WebUI/Services/FileService.cs index e0d19d7f2..0f2878c92 100644 --- a/LearningHub.Nhs.WebUI/Services/FileService.cs +++ b/LearningHub.Nhs.WebUI/Services/FileService.cs @@ -1,17 +1,13 @@ namespace LearningHub.Nhs.WebUI.Services { using System; - using System.Buffers; using System.Collections.Generic; using System.IO; using System.Linq; - using System.Threading; using System.Threading.Tasks; - using System.Threading.Tasks.Dataflow; - using Azure; - using Azure.Storage; using Azure.Storage.Files.Shares; using Azure.Storage.Files.Shares.Models; + using Azure.Storage.Sas; using LearningHub.Nhs.Models.Resource; using LearningHub.Nhs.WebUI.Configuration; using LearningHub.Nhs.WebUI.Interfaces; @@ -145,26 +141,19 @@ public async Task DownloadFileAsync(string filePath, strin try { - if (fileSize <= 900 * 1024 * 1024) + var response = new FileDownloadResponse { - // Directly download the entire file as a stream - var response = await file.DownloadAsync(); - return new FileDownloadResponse - { - Content = response.Value.Content, - ContentType = properties.Value.ContentType, - ContentLength = fileSize, - }; - } - else + ContentType = properties.Value.ContentType, + ContentLength = fileSize, + Content = await file.OpenReadAsync(), + }; + + if (fileSize >= 999 * 1024 * 1024) { - return new FileDownloadResponse - { - Content = await file.OpenReadAsync(), - ContentType = properties.Value.ContentType, - ContentLength = fileSize, - }; + response.DownloadUrl = this.GenerateSasUriForFile(file); } + + return response; } catch (Exception ex) { @@ -460,5 +449,23 @@ private async Task FindFileAsync(string filePath, string fileNa return null; } + + private string GenerateSasUriForFile(ShareFileClient fileClient) + { + if (fileClient.CanGenerateSasUri) + { + ShareSasBuilder sasBuilder = new ShareSasBuilder(ShareFileSasPermissions.Read, DateTimeOffset.UtcNow.AddMinutes(20)) + { + Protocol = SasProtocol.Https, + }; + + Uri sasUri = fileClient.GenerateSasUri(sasBuilder); + return sasUri.ToString(); + } + else + { + throw new InvalidOperationException("Unable to generate SAS URI for the file."); + } + } } } \ No newline at end of file From 040ef8dac623edc708fa116dea71becfdad6ad19 Mon Sep 17 00:00:00 2001 From: Swapnamol Abraham Date: Mon, 17 Feb 2025 15:15:38 +0000 Subject: [PATCH 18/19] TD-5301: Select Your Grade Page (Registration Process) - Error message is not clear --- .../Helpers/CommonValidationErrorMessages.cs | 2 +- .../Views/Account/ChangePassword.cshtml | 1 + .../CreateAccountGradeSelection.cshtml | 2 +- .../Views/Account/ForgotUserPassword.cshtml | 1 + .../Views/MyAccount/ChangeCountry.cshtml | 1 + .../Views/MyAccount/ChangeCurrentRole.cshtml | 176 ++++++++-------- .../Views/MyAccount/ChangeFirstname.cshtml | 1 + .../Views/MyAccount/ChangeGrade.cshtml | 3 +- .../Views/MyAccount/ChangeLastName.cshtml | 1 + .../ChangeMedicalCouncilNumber.cshtml | 1 + .../Views/MyAccount/ChangePassword.cshtml | 1 + .../Views/MyAccount/ChangePrimaryEmail.cshtml | 1 + .../MyAccount/ChangePrimarySpecialty.cshtml | 197 +++++++++--------- .../Views/MyAccount/ChangeRegion.cshtml | 1 + .../MyAccount/ChangeSecondaryEmail.cshtml | 1 + .../Views/MyAccount/ChangeWorkPlace.cshtml | 176 ++++++++-------- .../Views/MyAccount/ConfirmPassword.cshtml | 1 + .../MyAccount/_SecurityQuestionAnswer.cshtml | 1 + .../MyAccount/_SecurityQuestionSelect.cshtml | 2 +- 19 files changed, 292 insertions(+), 278 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Helpers/CommonValidationErrorMessages.cs b/LearningHub.Nhs.WebUI/Helpers/CommonValidationErrorMessages.cs index 3e2753448..c9b3aa7bc 100644 --- a/LearningHub.Nhs.WebUI/Helpers/CommonValidationErrorMessages.cs +++ b/LearningHub.Nhs.WebUI/Helpers/CommonValidationErrorMessages.cs @@ -58,7 +58,7 @@ public static class CommonValidationErrorMessages /// /// Grade Required. /// - public const string GradeRequired = "Select a grade"; + public const string GradeRequired = "Select a pay band. You can find this information from your paper payslip or online via ESR"; /// /// Primary specialty Not Applicable. diff --git a/LearningHub.Nhs.WebUI/Views/Account/ChangePassword.cshtml b/LearningHub.Nhs.WebUI/Views/Account/ChangePassword.cshtml index d7819faea..6bf906653 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/ChangePassword.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/ChangePassword.cshtml @@ -1,6 +1,7 @@ @model LearningHub.Nhs.WebUI.Models.Account.PasswordValidateViewModel @{ + ViewData["DisableValidation"] = true; ViewData["Title"] = "Account - Change password"; var errorHasOccurred = !ViewData.ModelState.IsValid; } diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountGradeSelection.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountGradeSelection.cshtml index 6a81474bc..fc703ec97 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountGradeSelection.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountGradeSelection.cshtml @@ -41,7 +41,7 @@ populate-with-current-values="true" radios="@Model.GradeRadio()" hint-text="You can find this on your payslip." - required-client-side-error-message="Select a grade" + required-client-side-error-message="Select a pay band. You can find this information from your paper payslip or online via ESR" required="true" is-page-heading="true" /> diff --git a/LearningHub.Nhs.WebUI/Views/Account/ForgotUserPassword.cshtml b/LearningHub.Nhs.WebUI/Views/Account/ForgotUserPassword.cshtml index 91160751e..27e886f88 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/ForgotUserPassword.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/ForgotUserPassword.cshtml @@ -5,6 +5,7 @@ @model ForgotPasswordViewModel; @{ + ViewData["DisableValidation"] = true; ViewData["Title"] = "ForgotPassword"; var errorHasOccurred = !ViewData.ModelState.IsValid; } diff --git a/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCountry.cshtml b/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCountry.cshtml index 2ad51ede1..0f8436e71 100644 --- a/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCountry.cshtml +++ b/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCountry.cshtml @@ -1,6 +1,7 @@ @using LearningHub.Nhs.WebUI.Models.UserProfile @model Tuple @{ + ViewData["DisableValidation"] = true; ViewData["Title"] = "My Account - Change country"; var errorHasOccurred = !ViewData.ModelState.IsValid; } diff --git a/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCurrentRole.cshtml b/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCurrentRole.cshtml index 40938608d..5cde300d8 100644 --- a/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCurrentRole.cshtml +++ b/LearningHub.Nhs.WebUI/Views/MyAccount/ChangeCurrentRole.cshtml @@ -1,97 +1,97 @@ @model LearningHub.Nhs.WebUI.Models.UserProfile.UserJobRoleUpdateViewModel @{ - ViewData["Title"] = "Update Current Role"; - var errorHasOccurred = !ViewData.ModelState.IsValid; + ViewData["DisableValidation"] = true; + ViewData["Title"] = "Update Current Role"; + var errorHasOccurred = !ViewData.ModelState.IsValid; }