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 @@ -15,6 +15,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using DigitalLearningSolutions.Data.Extensions;
using DigitalLearningSolutions.Web.Services;

[FeatureGate(FeatureFlags.RefactoredTrackingSystem)]
[Authorize(Policy = CustomPolicies.UserCentreAdmin)]
Expand All @@ -30,11 +31,13 @@ public class SelfAssessmentReportsController : Controller
private readonly string tableauSiteName;
private readonly string workbookName;
private readonly string viewName;
private readonly ISelfAssessmentService selfAssessmentService;
public SelfAssessmentReportsController(
ISelfAssessmentReportService selfAssessmentReportService,
ITableauConnectionHelperService tableauConnectionHelper,
IClockUtility clockUtility,
IConfiguration config
IConfiguration config,
ISelfAssessmentService selfAssessmentService
)
{
this.selfAssessmentReportService = selfAssessmentReportService;
Expand All @@ -44,12 +47,14 @@ IConfiguration config
tableauSiteName = config.GetTableauSiteName();
workbookName = config.GetTableauWorkbookName();
viewName = config.GetTableauViewName();
this.selfAssessmentService = selfAssessmentService;
}
public IActionResult Index()
{
var centreId = User.GetCentreId();
var categoryId = User.GetAdminCategoryId();
var model = new SelfAssessmentReportsViewModel(selfAssessmentReportService.GetSelfAssessmentsForReportList((int)centreId, categoryId));
var adminCategoryId = User.GetAdminCategoryId();
var categoryId = this.selfAssessmentService.GetSelfAssessmentCategoryId(1);
var model = new SelfAssessmentReportsViewModel(selfAssessmentReportService.GetSelfAssessmentsForReportList((int)centreId, adminCategoryId), adminCategoryId, categoryId);
return View(model);
}
[HttpGet]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
public class SelfAssessmentReportsViewModel
{
public SelfAssessmentReportsViewModel(
IEnumerable<SelfAssessmentSelect> selfAssessmentSelects
IEnumerable<SelfAssessmentSelect> selfAssessmentSelects, int? adminCategoryId, int categoryId
)
{
SelfAssessmentSelects = selfAssessmentSelects;
AdminCategoryId = adminCategoryId;
CategoryId = categoryId;
}
public IEnumerable<SelfAssessmentSelect> SelfAssessmentSelects { get; set; }
public int? AdminCategoryId { get; set; }
public int CategoryId { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
<h2>Excel learner activity reports</h2>
<p class="nhsuk-lede-text">Download Excel competency self assessments activity reports for your centre.</p>
<ul>
@if((Model.AdminCategoryId == null) || (Model.AdminCategoryId == Model.CategoryId))
{
<li>
<a asp-controller="SelfAssessmentReports" asp-action="DownloadDigitalCapabilityToExcel">Digital Skills Assessment Tool - Download report</a>

</li>
}
@if (Model.SelfAssessmentSelects.Any())
{
@foreach (var report in Model.SelfAssessmentSelects)
Expand Down
Loading