Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.14" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="LearningHub.Nhs.Models" Version="4.0.3" />
<PackageReference Include="LearningHub.Nhs.Models" Version="4.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.13" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="Selenium.Axe" Version="4.0.19" />
Expand Down
5 changes: 5 additions & 0 deletions LearningHub.Nhs.WebUI/Configuration/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,10 @@ public Settings()
/// Gets or sets AllCataloguePageSize.
/// </summary>
public int AllCataloguePageSize { get; set; }

/// <summary>
/// Gets or sets the StatMandId.
/// </summary>
public int StatMandId { get; set; } = 12;
}
}
429 changes: 429 additions & 0 deletions LearningHub.Nhs.WebUI/Controllers/ReportsController.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,10 @@ public static class CommonValidationErrorMessages
/// Security question Required.
/// </summary>
public const string SecurityQuestionRequired = "Please select a security question";

/// <summary>
/// Course Required.
/// </summary>
public const string CourseRequired = "Select a course";
}
}
7 changes: 7 additions & 0 deletions LearningHub.Nhs.WebUI/Interfaces/IFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,12 @@ public interface IFileService
/// <param name="filePaths">.</param>
/// <returns>The <see cref="Task"/>.</returns>
Task PurgeResourceFile(ResourceVersionExtendedViewModel vm = null, List<string> filePaths = null);

/// <summary>
/// The DownloadBlobFile.
/// </summary>
/// <param name="uri">uri.</param>
/// <returns>The <see cref="Task"/>.</returns>
Task<(Stream Stream, string FileName, string ContentType)> DownloadBlobFileAsync(string uri);
}
}
57 changes: 57 additions & 0 deletions LearningHub.Nhs.WebUI/Interfaces/IReportService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
namespace LearningHub.Nhs.WebUI.Interfaces
{
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using elfhHub.Nhs.Models.Common;
using LearningHub.Nhs.Models.Common;
using LearningHub.Nhs.Models.Databricks;
using LearningHub.Nhs.Models.Paging;

/// <summary>
/// Defines the <see cref="IRegionService" />.
/// </summary>
public interface IReportService
{
/// <summary>
/// The GetReporterPermission.
/// </summary>
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
Task<bool> GetReporterPermission();

/// <summary>
/// The GetCourseCompletionReport.
/// </summary>
/// <param name="requestModel">The requestModel.<see cref="int"/>.</param>
/// <returns>The <see cref="Task{LearningHubValidationResult}"/>.</returns>
Task<DatabricksDetailedViewModel> GetCourseCompletionReport(DatabricksRequestModel requestModel);

/// <summary>
/// The GetReportHistory.
/// </summary>
/// <param name="requestModel">The requestModel.<see cref="int"/>.</param>
/// <returns>The <see cref="Task{LearningHubValidationResult}"/>.</returns>
Task<PagedResultSet<ReportHistoryModel>> GetReportHistory(PagingRequestModel requestModel);

/// <summary>
/// The GetReportHistory.
/// </summary>
/// <param name="reportHistoryId">The reportHistoryId.<see cref="int"/>.</param>
/// <returns>The <see cref="Task{LearningHubValidationResult}"/>.</returns>
Task<ReportHistoryModel> GetReportHistoryById(int reportHistoryId);

/// <summary>
/// The QueueReportDownload.
/// </summary>
/// <param name="reportHistoryId">The reportHistoryId.<see cref="int"/>.</param>
/// <returns>The <see cref="Task{LearningHubValidationResult}"/>.</returns>
Task<bool> QueueReportDownload(int reportHistoryId);

/// <summary>
/// The DownloadReport.
/// </summary>
/// <param name="reportHistoryId">reportHistoryId.</param>
/// <returns>The <see cref="Task{LearningHubValidationResult}"/>.</returns>
Task<ReportHistoryModel> DownloadReport(int reportHistoryId);
}
}
2 changes: 1 addition & 1 deletion LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<PackageReference Include="HtmlAgilityPack" Version="1.11.72" />
<PackageReference Include="IdentityModel" Version="4.6.0" />
<PackageReference Include="LearningHub.Nhs.Caching" Version="2.0.0" />
<PackageReference Include="LearningHub.Nhs.Models" Version="4.0.3" />
<PackageReference Include="LearningHub.Nhs.Models" Version="4.0.10" />
<PackageReference Include="linqtotwitter" Version="6.9.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.19.0" />
<PackageReference Include="Microsoft.ApplicationInsights.EventCounterCollector" Version="2.21.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace LearningHub.Nhs.WebUI.Models.DynamicCheckbox
{
/// <summary>
/// DynamicCheckboxItemViewModel.
/// </summary>
public class DynamicCheckboxItemViewModel
{
/// <summary>
/// Gets or sets a value.
/// </summary>
public string Value { get; set; }

/// <summary>
/// Gets or sets a Label.
/// </summary>
public string Label { get; set; }

/// <summary>
/// Gets or sets a HintText.
/// </summary>
public string? HintText { get; set; }

/// <summary>
/// Gets or sets a value indicating whether gets or sets a selected.
/// </summary>
public bool Selected { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
namespace LearningHub.Nhs.WebUI.Models.DynamicCheckbox
{
using System.Collections.Generic;

/// <summary>
/// DynamicCheckboxesViewModel.
/// </summary>
public class DynamicCheckboxesViewModel
{
/// <summary>
/// Gets or sets a Label.
/// </summary>
public string Label { get; set; }

/// <summary>
/// Gets or sets a HintText.
/// </summary>
public string HintText { get; set; }

/// <summary>
/// Gets or sets a ErrorMessage.
/// </summary>
public string ErrorMessage { get; set; }

/// <summary>
/// Gets or sets a value indicating whether gets or sets a Required.
/// </summary>
public bool Required { get; set; }

/// <summary>
/// Gets or sets a CssClass.
/// </summary>
public string CssClass { get; set; }

/// <summary>
/// Gets or sets SelectedValues.
/// </summary>
public List<string> SelectedValues { get; set; } = [];

/// <summary>
/// Gets or sets a Checkboxes.
/// </summary>
public List<DynamicCheckboxItemViewModel> Checkboxes { get; set; } = [];
}
}
5 changes: 5 additions & 0 deletions LearningHub.Nhs.WebUI/Models/NavigationModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public class NavigationModel
/// </summary>
public bool ShowBrowseCatalogues { get; set; }

/// <summary>
/// Gets or sets a value indicating whether to show reports.
/// </summary>
public bool ShowReports { get; set; }

/// <summary>
/// Gets or sets a value indicating whether ShowHome.
/// </summary>
Expand Down
66 changes: 66 additions & 0 deletions LearningHub.Nhs.WebUI/Models/Report/CourseCompletionViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
namespace LearningHub.Nhs.WebUI.Models.Report
{
using System.Collections.Generic;
using System.Reflection;
using LearningHub.Nhs.Models.Databricks;
using LearningHub.Nhs.Models.MyLearning;
using LearningHub.Nhs.Models.Paging;
using LearningHub.Nhs.WebUI.Models.Learning;

/// <summary>
/// CourseCompletionViewModel.
/// </summary>
public class CourseCompletionViewModel : DatabricksRequestModel
{
/// <summary>
/// Initializes a new instance of the <see cref="CourseCompletionViewModel"/> class.
/// </summary>
public CourseCompletionViewModel()
{
this.CourseCompletionRecords = new List<DatabricksDetailedItemViewModel>();
}

/// <summary>
/// Initializes a new instance of the <see cref="CourseCompletionViewModel"/> class.
/// </summary>
/// <param name="requestModel">DatabricksRequestModel.</param>
public CourseCompletionViewModel(DatabricksRequestModel requestModel)
{
this.CourseCompletionRecords = new List<DatabricksDetailedItemViewModel>();
foreach (PropertyInfo prop in requestModel.GetType().GetProperties())
{
this.GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(requestModel, null), null);
}
}

/// <summary>
/// Gets or sets the CurrentPageIndex.
/// </summary>
public int CurrentPageIndex { get; set; } = 0;

/// <summary>
/// Gets or sets the TotalCount.
/// </summary>
public int TotalCount { get; set; }

/// <summary>
/// Gets or sets the report result paging.
/// </summary>
public PagingViewModel ReportPaging { get; set; }

/// <summary>
/// Gets or sets the ReportFormActionTypeEnum.
/// </summary>
public ReportFormActionTypeEnum ReportFormActionType { get; set; }

/// <summary>
/// Gets or sets the CourseCompletionRecords.
/// </summary>
public List<DatabricksDetailedItemViewModel> CourseCompletionRecords { get; set; }

/// <summary>
/// Gets or sets the ReportHistoryModel.
/// </summary>
public ReportHistoryModel ReportHistoryModel { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
namespace LearningHub.Nhs.WebUI.Models.Report
{
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using LearningHub.Nhs.WebUI.Models.DynamicCheckbox;
using NHSUKViewComponents.Web.ViewModels;

/// <summary>
/// CourseSelection.
/// </summary>
public class ReportCreationCourseSelection
{
/// <summary>
/// Gets or sets the list of courses.
/// </summary>
public List<string> Courses { get; set; }

/// <summary>
/// Gets or sets the list of all courses.
/// </summary>
public List<DynamicCheckboxItemViewModel> AllCources { get; set; }

/// <summary>
/// Gets or sets the list of SearchText.
/// </summary>
public string SearchText { get; set; }

/// <summary>
/// BuildCourses.
/// </summary>
/// <param name="allCourses">The all Courses.</param>
/// <returns>The <see cref="List{RadiosItemViewModel}"/>.</returns>
public List<DynamicCheckboxItemViewModel> BuildCourses(List<KeyValuePair<string, string>> allCourses)
{
this.AllCources = allCourses.Select(r => new DynamicCheckboxItemViewModel
{
Value = r.Key.ToString(),
Label = r.Value,
}).ToList();
this.AllCources.Insert(0, new DynamicCheckboxItemViewModel { Value = "all", Label = "All Courses", });
return this.AllCources;
}
}
}
Loading
Loading