From 1c641fb462be352b53450375cfe46ecb4ed8f42f Mon Sep 17 00:00:00 2001 From: Martin Wilkins Date: Thu, 11 Nov 2021 09:23:51 +0000 Subject: [PATCH 1/5] HEEDLS-640 Add super admin centres page --- .../DataServices/CentresDataServiceTests.cs | 19 ++++ .../Services/CentresServiceTests.cs | 22 +++++ .../DataServices/CentresDataService.cs | 23 +++++ .../Models/Centre.cs | 3 + .../Services/CentresService.cs | 8 ++ .../BasicAuthenticatedAccessibilityTests.cs | 1 + .../Centres/CentreSummaryViewModelTests.cs | 48 ++++++++++ .../Centres/CentresViewModelTests.cs | 43 +++++++++ .../SuperAdmin/Centres/CentresController.cs | 35 ++++++++ .../Centres/CentreSummaryViewModel.cs | 30 +++++++ .../SuperAdmin/Centres/CentresViewModel.cs | 18 ++++ .../Views/SuperAdmin/Centres/Index.cshtml | 19 ++++ .../SuperAdmin/Centres/_CentreCard.cshtml | 90 +++++++++++++++++++ .../SuperAdmin/Shared/_NavMenuItems.cshtml | 2 +- 14 files changed, 360 insertions(+), 1 deletion(-) create mode 100644 DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs create mode 100644 DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs create mode 100644 DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs create mode 100644 DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs create mode 100644 DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs create mode 100644 DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/Index.cshtml create mode 100644 DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml diff --git a/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs b/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs index 30471677d8..0057900b7c 100644 --- a/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs +++ b/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs @@ -301,5 +301,24 @@ public void SetCentreAutoRegistered_should_set_AutoRegistered_true() transaction.Dispose(); } } + + [Test] + public void GetAllCentreSummaries_returns_all_summary_details_and_reference_data() + { + using var transaction = new TransactionScope(); + try + { + // When + var summaries = centresDataService.GetAllCentreSummaries(); + + // Then + summaries.Should() + .OnlyContain(c => c.CentreType != null && c.RegionName != null && (c.Active || !c.Active)); + } + finally + { + transaction.Dispose(); + } + } } } diff --git a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs index 42a2cf381e..6fa3d63a35 100644 --- a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs +++ b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs @@ -3,9 +3,12 @@ using System; using System.Linq; using DigitalLearningSolutions.Data.DataServices; + using DigitalLearningSolutions.Data.Models; using DigitalLearningSolutions.Data.Services; + using DigitalLearningSolutions.Data.Tests.NBuilderHelpers; using DigitalLearningSolutions.Data.Tests.TestHelpers; using FakeItEasy; + using FizzWare.NBuilder; using FluentAssertions; using NUnit.Framework; @@ -69,5 +72,24 @@ public void GetCentreRankForCentre_returns_null_with_no_data_for_centre() // Then result.Should().BeNull(); } + + [Test] + public void GetAllCentreSummaries_calls_dataService_and_returns_all_summary_details() + { + // Given + var centres = Builder.CreateListOfSize(10) + .All() + .With((c, i) => c.CentreId = i + 1) + .Build(); + A.CallTo(() => centresDataService.GetAllCentreSummaries()).Returns(centres); + + // When + var result = centresService.GetAllCentreSummaries(); + + // Then + result + .Should() + .HaveCount(10); + } } } diff --git a/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs b/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs index 98a5faf15f..1c0d7bfafb 100644 --- a/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs @@ -14,6 +14,7 @@ public interface ICentresDataService string? GetCentreName(int centreId); IEnumerable<(int, string)> GetCentresForDelegateSelfRegistrationAlphabetical(); Centre? GetCentreDetailsById(int centreId); + IEnumerable GetAllCentreSummaries(); void UpdateCentreManagerDetails( int centreId, @@ -161,6 +162,28 @@ FROM Centres AS c return centre; } + public IEnumerable GetAllCentreSummaries() + { + var centres = connection.Query( + @"SELECT c.CentreID, + c.CentreName, + c.RegionID, + r.RegionName, + c.ContactForename, + c.ContactSurname, + c.ContactEmail, + c.ContactTelephone, + c.CentreTypeId, + ct.CentreType, + c.Active + FROM Centres AS c + INNER JOIN Regions AS r ON r.RegionID = c.RegionID + INNER JOIN CentreTypes AS ct ON ct.CentreTypeId = c.CentreTypeId" + ); + + return centres; + } + public void UpdateCentreManagerDetails( int centreId, string firstName, diff --git a/DigitalLearningSolutions.Data/Models/Centre.cs b/DigitalLearningSolutions.Data/Models/Centre.cs index f0d7a7fcea..6598dccfc5 100644 --- a/DigitalLearningSolutions.Data/Models/Centre.cs +++ b/DigitalLearningSolutions.Data/Models/Centre.cs @@ -31,8 +31,11 @@ public class Centre public int TrainerSpots { get; set; } public string? IpPrefix { get; set; } public string? ContractType { get; set; } + public int CentreTypeId { get; set; } + public string CentreType { get; set; } public int CustomCourses { get; set; } public long ServerSpaceUsed { get; set; } public long ServerSpaceBytes { get; set; } + public bool Active { get; set; } } } diff --git a/DigitalLearningSolutions.Data/Services/CentresService.cs b/DigitalLearningSolutions.Data/Services/CentresService.cs index b6ec4d4560..bfc2d4f4da 100644 --- a/DigitalLearningSolutions.Data/Services/CentresService.cs +++ b/DigitalLearningSolutions.Data/Services/CentresService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using DigitalLearningSolutions.Data.DataServices; + using DigitalLearningSolutions.Data.Models; using DigitalLearningSolutions.Data.Models.DbModels; public interface ICentresService @@ -10,6 +11,8 @@ public interface ICentresService IEnumerable GetCentresForCentreRankingPage(int centreId, int numberOfDays, int? regionId); int? GetCentreRankForCentre(int centreId); + + IEnumerable GetAllCentreSummaries(); } public class CentresService : ICentresService @@ -39,5 +42,10 @@ public IEnumerable GetCentresForCentreRankingPage(int centreId, i var centreRanking = centreRankings.SingleOrDefault(cr => cr.CentreId == centreId); return centreRanking?.Ranking; } + + public IEnumerable GetAllCentreSummaries() + { + return centresDataService.GetAllCentreSummaries(); + } } } diff --git a/DigitalLearningSolutions.Web.AutomatedUiTests/AccessibilityTests/BasicAuthenticatedAccessibilityTests.cs b/DigitalLearningSolutions.Web.AutomatedUiTests/AccessibilityTests/BasicAuthenticatedAccessibilityTests.cs index d3cf08f858..39a2178154 100644 --- a/DigitalLearningSolutions.Web.AutomatedUiTests/AccessibilityTests/BasicAuthenticatedAccessibilityTests.cs +++ b/DigitalLearningSolutions.Web.AutomatedUiTests/AccessibilityTests/BasicAuthenticatedAccessibilityTests.cs @@ -80,6 +80,7 @@ public BasicAuthenticatedAccessibilityTests(AuthenticatedAccessibilityTestsFixtu [InlineData("/NotificationPreferences/Edit/DelegateUser", "Update notification preferences")] [InlineData("/ChangePassword", "Change password")] [InlineData("/TrackingSystem/Support", "Support")] + [InlineData("/SuperAdmin/Centres", "Centres")] public void Authenticated_page_has_no_accessibility_errors(string url, string pageTitle) { // when diff --git a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs new file mode 100644 index 0000000000..49940ecbd4 --- /dev/null +++ b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs @@ -0,0 +1,48 @@ +namespace DigitalLearningSolutions.Web.Tests.ViewModels.SuperAdmin.Centres +{ + using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres; + using FluentAssertions; + using FluentAssertions.Execution; + using NUnit.Framework; + + public class CentreSummaryViewModelTests + { + [Test] + public void CentreSummaryViewModel_constructor_should_populate_expected_properties() + { + // Given + var centre = new Centre + { + CentreId = 2, + CentreName = "North West Boroughs Healthcare NHS Foundation Trust", + RegionId = 5, + RegionName = "North West", + ContactForename = "TestForename", + ContactSurname = "TestSurname", + ContactEmail = "email@nhs.net", + ContactTelephone = "0123654789", + CentreTypeId = 4, + CentreType = "Social Care", + Active = true + }; + + // When + var model = new CentreSummaryViewModel(centre); + + // Then + using (new AssertionScope()) + { + model.CentreId.Should().Be(2); + model.CentreName.Should().Be("North West Boroughs Healthcare NHS Foundation Trust"); + model.RegionName.Should().Be("North West"); + model.ContactForename.Should().Be("TestForename"); + model.ContactSurname.Should().Be("TestSurname"); + model.ContactEmail.Should().Be("email@nhs.net"); + model.ContactTelephone.Should().Be("0123654789"); + model.CentreType.Should().Be("Social Care"); + model.Active.Should().BeTrue(); + } + } + } +} diff --git a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs new file mode 100644 index 0000000000..3b7c97c669 --- /dev/null +++ b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs @@ -0,0 +1,43 @@ +namespace DigitalLearningSolutions.Web.Tests.ViewModels.SuperAdmin.Centres +{ + using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres; + using FluentAssertions; + using FluentAssertions.Execution; + using NUnit.Framework; + using System.Collections.Generic; + + public class CentresViewModelTests + { + [Test] + public void CentresViewModel_default_should_return_first_page_of_centres_in_ascending_order() + { + // Given + var centres = new List + { + new Centre { CentreName = "A" }, + new Centre { CentreName = "b" }, + new Centre { CentreName = "C" }, + new Centre { CentreName = "F" }, + new Centre { CentreName = "J" }, + new Centre { CentreName = "e" }, + new Centre { CentreName = "w" }, + new Centre { CentreName = "S" }, + new Centre { CentreName = "r" }, + new Centre { CentreName = "H" }, + new Centre { CentreName = "m" }, + }; + + // When + var model = new CentresViewModel(centres); + + // Then + using (new AssertionScope()) + { + model.Centres + .Should().HaveCount(10) + .And.BeInAscendingOrder(o => o.CentreName); + } + } + } +} diff --git a/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs b/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs new file mode 100644 index 0000000000..aae71040d6 --- /dev/null +++ b/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs @@ -0,0 +1,35 @@ +namespace DigitalLearningSolutions.Web.Controllers.SuperAdmin.Admins +{ + using DigitalLearningSolutions.Data.Enums; + using DigitalLearningSolutions.Data.Services; + using DigitalLearningSolutions.Web.Attributes; + using DigitalLearningSolutions.Web.Helpers; + using DigitalLearningSolutions.Web.Models.Enums; + using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres; + using Microsoft.AspNetCore.Authorization; + using Microsoft.AspNetCore.Mvc; + using Microsoft.FeatureManagement.Mvc; + + [FeatureGate(FeatureFlags.RefactoredSuperAdminInterface)] + [Authorize(Policy = CustomPolicies.UserSuperAdmin)] + [Route("SuperAdmin/Centres")] + [SetDlsSubApplication(nameof(DlsSubApplication.SuperAdmin))] + [SetSelectedTab(nameof(NavMenuTab.Centres))] + public class CentresController : Controller + { + private readonly ICentresService centresService; + + public CentresController(ICentresService centresService) + { + this.centresService = centresService; + } + + public IActionResult Index() + { + var centres = centresService.GetAllCentreSummaries(); + var viewModel = new CentresViewModel(centres); + + return View(viewModel); + } + } +} diff --git a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs new file mode 100644 index 0000000000..2924026b63 --- /dev/null +++ b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs @@ -0,0 +1,30 @@ +using DigitalLearningSolutions.Data.Models; + +namespace DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres +{ + public class CentreSummaryViewModel + { + public CentreSummaryViewModel(Centre model) + { + CentreId = model.CentreId; + CentreName = model.CentreName; + RegionName = model.RegionName; + ContactForename = model.ContactForename; + ContactSurname = model.ContactSurname; + ContactEmail = model.ContactEmail; + ContactTelephone = model.ContactTelephone; + CentreType = model.CentreType; + Active = model.Active; + } + + public int CentreId { get; set; } + public string CentreName { get; set; } + public string RegionName { get; set; } + public string? ContactForename { get; set; } + public string? ContactSurname { get; set; } + public string? ContactEmail { get; set; } + public string? ContactTelephone { get; set; } + public string CentreType { get; set; } + public bool Active { get; set; } + } +} diff --git a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs new file mode 100644 index 0000000000..d2d7bb6176 --- /dev/null +++ b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs @@ -0,0 +1,18 @@ +namespace DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres +{ + using DigitalLearningSolutions.Data.Models; + using System.Collections.Generic; + using System.Linq; + + public class CentresViewModel + { + public CentresViewModel(IEnumerable centres) + { + // TODO: HEEDLS-641: add filters/sort/pagination + // .Take(10) should be removed in HEEDLS-641 in favour of the standard pagination functionality. + Centres = centres.OrderBy(c => c.CentreName).Take(10).Select(c => new CentreSummaryViewModel(c)); + } + + public IEnumerable Centres { get; set; } + } +} diff --git a/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/Index.cshtml b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/Index.cshtml new file mode 100644 index 0000000000..eafe0e366d --- /dev/null +++ b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/Index.cshtml @@ -0,0 +1,19 @@ +@using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres +@model CentresViewModel + +@* TODO: HEEDLS-641: add search/filter/pagination components *@ +@{ + ViewData["Title"] = "Centres"; +} + +
+
+

Centres

+
+ @foreach (var centre in Model.Centres) + { + + } +
+
+
diff --git a/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml new file mode 100644 index 0000000000..b66d46dfd9 --- /dev/null +++ b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml @@ -0,0 +1,90 @@ +@using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres +@model CentreSummaryViewModel + +
+
+ + + @Model.CentreName (@Model.CentreId) + + + +
+
+ +
+
+ Centre id +
+
+ @Model.CentreId +
+
+ +
+
+ Centre type +
+
+ @Model.CentreType +
+
+ +
+
+ Region +
+
+ @Model.RegionName +
+
+ +
+
+ Contact +
+
+ @Model.ContactForename @Model.ContactSurname +
+
+ +
+
+ Contact email +
+
+ @Model.ContactEmail +
+
+ +
+
+ Telephone +
+
+ @Model.ContactTelephone +
+
+ +
+ + Manage centre + + + View courses + + @if (Model.Active) + { + + Deactivate centre + + } +
+
+
diff --git a/DigitalLearningSolutions.Web/Views/SuperAdmin/Shared/_NavMenuItems.cshtml b/DigitalLearningSolutions.Web/Views/SuperAdmin/Shared/_NavMenuItems.cshtml index 9c7b711af7..5752b6d707 100644 --- a/DigitalLearningSolutions.Web/Views/SuperAdmin/Shared/_NavMenuItems.cshtml +++ b/DigitalLearningSolutions.Web/Views/SuperAdmin/Shared/_NavMenuItems.cshtml @@ -9,7 +9,7 @@
  • - + Centres From c285d79d4cb9874177b55f34e922d22bdde64638 Mon Sep 17 00:00:00 2001 From: Martin Wilkins Date: Tue, 16 Nov 2021 22:23:40 +0000 Subject: [PATCH 2/5] HEEDLS-640 markups --- .../DataServices/CentresDataServiceTests.cs | 24 +++++++++---------- .../Services/CentresServiceTests.cs | 5 ++-- .../DataServices/CentresDataService.cs | 4 +--- .../Centres/CentreSummaryViewModelTests.cs | 2 +- .../Centres/CentresViewModelTests.cs | 2 +- .../SuperAdmin/Centres/CentresController.cs | 2 +- .../SuperAdmin/Centres/CentresViewModel.cs | 2 +- 7 files changed, 19 insertions(+), 22 deletions(-) diff --git a/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs b/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs index 0057900b7c..88c0e6820e 100644 --- a/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs +++ b/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs @@ -303,22 +303,22 @@ public void SetCentreAutoRegistered_should_set_AutoRegistered_true() } [Test] - public void GetAllCentreSummaries_returns_all_summary_details_and_reference_data() + public void GetAllCentreSummaries_returns_active_and_inactive_summary_details_and_reference_data() { - using var transaction = new TransactionScope(); - try - { // When - var summaries = centresDataService.GetAllCentreSummaries(); + var summaries = centresDataService.GetAllCentreSummaries().ToList(); // Then - summaries.Should() - .OnlyContain(c => c.CentreType != null && c.RegionName != null && (c.Active || !c.Active)); - } - finally - { - transaction.Dispose(); - } + var activeCentre = summaries.Single(c => c.CentreId == 2); + var inActiveCentre = summaries.Single(c => c.CentreId == 6); + + activeCentre.Active.Should().BeTrue(); + activeCentre.CentreType.Should().Be("NHS Organisation"); + activeCentre.RegionName.Should().Be("North West"); + + inActiveCentre.Active.Should().BeFalse(); + inActiveCentre.CentreType.Should().Be("NHS Organisation"); + inActiveCentre.RegionName.Should().Be("East Of England"); } } } diff --git a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs index 6fa3d63a35..945514e3b1 100644 --- a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs +++ b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs @@ -5,7 +5,6 @@ using DigitalLearningSolutions.Data.DataServices; using DigitalLearningSolutions.Data.Models; using DigitalLearningSolutions.Data.Services; - using DigitalLearningSolutions.Data.Tests.NBuilderHelpers; using DigitalLearningSolutions.Data.Tests.TestHelpers; using FakeItEasy; using FizzWare.NBuilder; @@ -15,8 +14,8 @@ public class CentresServiceTests { private ICentresDataService centresDataService = null!; - private IClockService clockService = null!; private ICentresService centresService = null!; + private IClockService clockService = null!; [SetUp] public void Setup() @@ -38,7 +37,7 @@ public void Setup() CentreTestHelper.GetCentreRank(7), CentreTestHelper.GetCentreRank(8), CentreTestHelper.GetCentreRank(9), - CentreTestHelper.GetCentreRank(10) + CentreTestHelper.GetCentreRank(10), } ); } diff --git a/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs b/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs index 1c0d7bfafb..1fe0eff779 100644 --- a/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs @@ -164,7 +164,7 @@ FROM Centres AS c public IEnumerable GetAllCentreSummaries() { - var centres = connection.Query( + return connection.Query( @"SELECT c.CentreID, c.CentreName, c.RegionID, @@ -180,8 +180,6 @@ FROM Centres AS c INNER JOIN Regions AS r ON r.RegionID = c.RegionID INNER JOIN CentreTypes AS ct ON ct.CentreTypeId = c.CentreTypeId" ); - - return centres; } public void UpdateCentreManagerDetails( diff --git a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs index 49940ecbd4..47872f50da 100644 --- a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs +++ b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs @@ -24,7 +24,7 @@ public void CentreSummaryViewModel_constructor_should_populate_expected_properti ContactTelephone = "0123654789", CentreTypeId = 4, CentreType = "Social Care", - Active = true + Active = true, }; // When diff --git a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs index 3b7c97c669..7ad533aaf0 100644 --- a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs +++ b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs @@ -1,11 +1,11 @@ namespace DigitalLearningSolutions.Web.Tests.ViewModels.SuperAdmin.Centres { + using System.Collections.Generic; using DigitalLearningSolutions.Data.Models; using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres; using FluentAssertions; using FluentAssertions.Execution; using NUnit.Framework; - using System.Collections.Generic; public class CentresViewModelTests { diff --git a/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs b/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs index aae71040d6..45a454fde1 100644 --- a/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs +++ b/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs @@ -1,4 +1,4 @@ -namespace DigitalLearningSolutions.Web.Controllers.SuperAdmin.Admins +namespace DigitalLearningSolutions.Web.Controllers.SuperAdmin.Centres { using DigitalLearningSolutions.Data.Enums; using DigitalLearningSolutions.Data.Services; diff --git a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs index d2d7bb6176..66f8adcb70 100644 --- a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs @@ -1,8 +1,8 @@ namespace DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres { - using DigitalLearningSolutions.Data.Models; using System.Collections.Generic; using System.Linq; + using DigitalLearningSolutions.Data.Models; public class CentresViewModel { From af2a3fdfab1d3c16fc61b6e004cdd6944d821793 Mon Sep 17 00:00:00 2001 From: Martin Wilkins Date: Thu, 9 Dec 2021 22:29:49 +0000 Subject: [PATCH 3/5] HEEDLS-640 markups --- .../Services/CentresServiceTests.cs | 5 +- .../SuperAdmin/Centres/_CentreCard.cshtml | 129 +++++++++--------- 2 files changed, 66 insertions(+), 68 deletions(-) diff --git a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs index 945514e3b1..44db7123c7 100644 --- a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs +++ b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs @@ -76,10 +76,7 @@ public void GetCentreRankForCentre_returns_null_with_no_data_for_centre() public void GetAllCentreSummaries_calls_dataService_and_returns_all_summary_details() { // Given - var centres = Builder.CreateListOfSize(10) - .All() - .With((c, i) => c.CentreId = i + 1) - .Build(); + var centres = Builder.CreateListOfSize(10).Build(); A.CallTo(() => centresDataService.GetAllCentreSummaries()).Returns(centres); // When diff --git a/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml index b66d46dfd9..08f7953309 100644 --- a/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml @@ -13,78 +13,79 @@
    -
    - Centre id -
    -
    - @Model.CentreId -
    -
    +
    + Centre Id +
    +
    + @Model.CentreId +
    + -
    -
    - Centre type -
    -
    - @Model.CentreType -
    -
    +
    +
    + Centre type +
    +
    + @Model.CentreType +
    +
    -
    -
    - Region -
    -
    - @Model.RegionName -
    -
    +
    +
    + Region +
    +
    + @Model.RegionName +
    +
    -
    -
    - Contact -
    -
    - @Model.ContactForename @Model.ContactSurname -
    -
    +
    +
    + Contact +
    +
    + @Model.ContactForename @Model.ContactSurname +
    +
    -
    -
    - Contact email -
    -
    - @Model.ContactEmail -
    -
    +
    +
    + Contact email +
    + +
    -
    -
    - Telephone -
    -
    - @Model.ContactTelephone -
    -
    +
    +
    + Telephone +
    + +
    -
    - - Manage centre - - - View courses - - @if (Model.Active) - { - + - Deactivate centre + Manage centre - } - + + View courses + + @if (Model.Active) { + + Deactivate centre + + } else { + + Reactivate centre + + } + From e59996e33c314d8532815d5210b202d54407701e Mon Sep 17 00:00:00 2001 From: Martin Wilkins Date: Wed, 5 Jan 2022 11:08:46 +0000 Subject: [PATCH 4/5] HEEDLS-640 markups - add new CentreSummaryForSuperAdmin model --- .../DataServices/CentresDataServiceTests.cs | 4 +-- .../Services/CentresServiceTests.cs | 10 +++---- .../TestHelpers/CentreTestHelper.cs | 2 +- .../DataServices/CentresDataService.cs | 8 +++--- .../Models/CentreContractAdminUsage.cs | 1 + .../Models/{ => Centres}/Centre.cs | 2 +- .../Centres/CentreSummaryForSuperAdmin.cs | 17 ++++++++++++ .../Services/CentresService.cs | 8 +++--- .../Centres/CentreSummaryViewModelTests.cs | 4 +-- .../Centres/CentresViewModelTests.cs | 26 +++++++++---------- .../SuperAdmin/Centres/CentresController.cs | 2 +- .../Centres/CentreSummaryViewModel.cs | 8 +++--- .../SuperAdmin/Centres/CentresViewModel.cs | 6 ++--- .../CentreConfigurationViewModel.cs | 2 +- .../EditCentreDetailsViewModel.cs | 2 +- .../EditCentreManagerDetailsViewModel.cs | 2 +- .../EditCentreWebsiteDetailsViewModel.cs | 2 +- .../ContractDetailsViewModel.cs | 2 +- .../Dashboard/CentreDashboardViewModel.cs | 2 +- .../DashboardCentreDetailsViewModel.cs | 3 +-- .../SuperAdmin/Centres/_CentreCard.cshtml | 2 +- 21 files changed, 66 insertions(+), 49 deletions(-) rename DigitalLearningSolutions.Data/Models/{ => Centres}/Centre.cs (94%) create mode 100644 DigitalLearningSolutions.Data/Models/Centres/CentreSummaryForSuperAdmin.cs diff --git a/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs b/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs index 88c0e6820e..deb572fbc9 100644 --- a/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs +++ b/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs @@ -303,10 +303,10 @@ public void SetCentreAutoRegistered_should_set_AutoRegistered_true() } [Test] - public void GetAllCentreSummaries_returns_active_and_inactive_summary_details_and_reference_data() + public void GetAllCentreSummariesForSuperAdmin_returns_active_and_inactive_summary_details_and_reference_data() { // When - var summaries = centresDataService.GetAllCentreSummaries().ToList(); + var summaries = centresDataService.GetAllCentreSummariesForSuperAdmin().ToList(); // Then var activeCentre = summaries.Single(c => c.CentreId == 2); diff --git a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs index 44db7123c7..210fe4b309 100644 --- a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs +++ b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs @@ -3,7 +3,7 @@ using System; using System.Linq; using DigitalLearningSolutions.Data.DataServices; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Services; using DigitalLearningSolutions.Data.Tests.TestHelpers; using FakeItEasy; @@ -73,14 +73,14 @@ public void GetCentreRankForCentre_returns_null_with_no_data_for_centre() } [Test] - public void GetAllCentreSummaries_calls_dataService_and_returns_all_summary_details() + public void GetAllCentreSummariesForSuperAdmin_calls_dataService_and_returns_all_summary_details() { // Given - var centres = Builder.CreateListOfSize(10).Build(); - A.CallTo(() => centresDataService.GetAllCentreSummaries()).Returns(centres); + var centres = Builder.CreateListOfSize(10).Build(); + A.CallTo(() => centresDataService.GetAllCentreSummariesForSuperAdmin()).Returns(centres); // When - var result = centresService.GetAllCentreSummaries(); + var result = centresService.GetAllCentreSummariesForSuperAdmin(); // Then result diff --git a/DigitalLearningSolutions.Data.Tests/TestHelpers/CentreTestHelper.cs b/DigitalLearningSolutions.Data.Tests/TestHelpers/CentreTestHelper.cs index eba6df05a4..402cb32d70 100644 --- a/DigitalLearningSolutions.Data.Tests/TestHelpers/CentreTestHelper.cs +++ b/DigitalLearningSolutions.Data.Tests/TestHelpers/CentreTestHelper.cs @@ -1,6 +1,6 @@ namespace DigitalLearningSolutions.Data.Tests.TestHelpers { - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.DbModels; public static class CentreTestHelper diff --git a/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs b/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs index 1fe0eff779..a22d572832 100644 --- a/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Data; using Dapper; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.DbModels; using Microsoft.Extensions.Logging; @@ -14,7 +14,7 @@ public interface ICentresDataService string? GetCentreName(int centreId); IEnumerable<(int, string)> GetCentresForDelegateSelfRegistrationAlphabetical(); Centre? GetCentreDetailsById(int centreId); - IEnumerable GetAllCentreSummaries(); + IEnumerable GetAllCentreSummariesForSuperAdmin(); void UpdateCentreManagerDetails( int centreId, @@ -162,9 +162,9 @@ FROM Centres AS c return centre; } - public IEnumerable GetAllCentreSummaries() + public IEnumerable GetAllCentreSummariesForSuperAdmin() { - return connection.Query( + return connection.Query( @"SELECT c.CentreID, c.CentreName, c.RegionID, diff --git a/DigitalLearningSolutions.Data/Models/CentreContractAdminUsage.cs b/DigitalLearningSolutions.Data/Models/CentreContractAdminUsage.cs index 334185d44c..d2d9d11f46 100644 --- a/DigitalLearningSolutions.Data/Models/CentreContractAdminUsage.cs +++ b/DigitalLearningSolutions.Data/Models/CentreContractAdminUsage.cs @@ -2,6 +2,7 @@ { using System.Collections.Generic; using System.Linq; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.User; public class CentreContractAdminUsage diff --git a/DigitalLearningSolutions.Data/Models/Centre.cs b/DigitalLearningSolutions.Data/Models/Centres/Centre.cs similarity index 94% rename from DigitalLearningSolutions.Data/Models/Centre.cs rename to DigitalLearningSolutions.Data/Models/Centres/Centre.cs index 6598dccfc5..ea2f74957e 100644 --- a/DigitalLearningSolutions.Data/Models/Centre.cs +++ b/DigitalLearningSolutions.Data/Models/Centres/Centre.cs @@ -1,4 +1,4 @@ -namespace DigitalLearningSolutions.Data.Models +namespace DigitalLearningSolutions.Data.Models.Centres { public class Centre { diff --git a/DigitalLearningSolutions.Data/Models/Centres/CentreSummaryForSuperAdmin.cs b/DigitalLearningSolutions.Data/Models/Centres/CentreSummaryForSuperAdmin.cs new file mode 100644 index 0000000000..73d2794a93 --- /dev/null +++ b/DigitalLearningSolutions.Data/Models/Centres/CentreSummaryForSuperAdmin.cs @@ -0,0 +1,17 @@ +namespace DigitalLearningSolutions.Data.Models.Centres +{ + public class CentreSummaryForSuperAdmin + { + public int CentreId { get; set; } + public string CentreName { get; set; } + public int RegionId { get; set; } + public string RegionName { get; set; } + public string? ContactForename { get; set; } + public string? ContactSurname { get; set; } + public string? ContactEmail { get; set; } + public string? ContactTelephone { get; set; } + public int CentreTypeId { get; set; } + public string CentreType { get; set; } + public bool Active { get; set; } + } +} diff --git a/DigitalLearningSolutions.Data/Services/CentresService.cs b/DigitalLearningSolutions.Data/Services/CentresService.cs index bfc2d4f4da..c966d60279 100644 --- a/DigitalLearningSolutions.Data/Services/CentresService.cs +++ b/DigitalLearningSolutions.Data/Services/CentresService.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using DigitalLearningSolutions.Data.DataServices; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.DbModels; public interface ICentresService @@ -12,7 +12,7 @@ public interface ICentresService int? GetCentreRankForCentre(int centreId); - IEnumerable GetAllCentreSummaries(); + IEnumerable GetAllCentreSummariesForSuperAdmin(); } public class CentresService : ICentresService @@ -43,9 +43,9 @@ public IEnumerable GetCentresForCentreRankingPage(int centreId, i return centreRanking?.Ranking; } - public IEnumerable GetAllCentreSummaries() + public IEnumerable GetAllCentreSummariesForSuperAdmin() { - return centresDataService.GetAllCentreSummaries(); + return centresDataService.GetAllCentreSummariesForSuperAdmin(); } } } diff --git a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs index 47872f50da..aaf5c4f2c7 100644 --- a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs +++ b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs @@ -1,6 +1,6 @@ namespace DigitalLearningSolutions.Web.Tests.ViewModels.SuperAdmin.Centres { - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres; using FluentAssertions; using FluentAssertions.Execution; @@ -12,7 +12,7 @@ public class CentreSummaryViewModelTests public void CentreSummaryViewModel_constructor_should_populate_expected_properties() { // Given - var centre = new Centre + var centre = new CentreSummaryForSuperAdmin() { CentreId = 2, CentreName = "North West Boroughs Healthcare NHS Foundation Trust", diff --git a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs index 7ad533aaf0..69d29e1cee 100644 --- a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs +++ b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs @@ -1,7 +1,7 @@ namespace DigitalLearningSolutions.Web.Tests.ViewModels.SuperAdmin.Centres { using System.Collections.Generic; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres; using FluentAssertions; using FluentAssertions.Execution; @@ -13,19 +13,19 @@ public class CentresViewModelTests public void CentresViewModel_default_should_return_first_page_of_centres_in_ascending_order() { // Given - var centres = new List + var centres = new List { - new Centre { CentreName = "A" }, - new Centre { CentreName = "b" }, - new Centre { CentreName = "C" }, - new Centre { CentreName = "F" }, - new Centre { CentreName = "J" }, - new Centre { CentreName = "e" }, - new Centre { CentreName = "w" }, - new Centre { CentreName = "S" }, - new Centre { CentreName = "r" }, - new Centre { CentreName = "H" }, - new Centre { CentreName = "m" }, + new CentreSummaryForSuperAdmin { CentreName = "A" }, + new CentreSummaryForSuperAdmin { CentreName = "b" }, + new CentreSummaryForSuperAdmin { CentreName = "C" }, + new CentreSummaryForSuperAdmin { CentreName = "F" }, + new CentreSummaryForSuperAdmin { CentreName = "J" }, + new CentreSummaryForSuperAdmin { CentreName = "e" }, + new CentreSummaryForSuperAdmin { CentreName = "w" }, + new CentreSummaryForSuperAdmin { CentreName = "S" }, + new CentreSummaryForSuperAdmin { CentreName = "r" }, + new CentreSummaryForSuperAdmin { CentreName = "H" }, + new CentreSummaryForSuperAdmin { CentreName = "m" }, }; // When diff --git a/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs b/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs index 45a454fde1..20ce0caad1 100644 --- a/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs +++ b/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs @@ -26,7 +26,7 @@ public CentresController(ICentresService centresService) public IActionResult Index() { - var centres = centresService.GetAllCentreSummaries(); + var centres = centresService.GetAllCentreSummariesForSuperAdmin(); var viewModel = new CentresViewModel(centres); return View(viewModel); diff --git a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs index 2924026b63..fe1b9a6a6f 100644 --- a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs @@ -1,10 +1,10 @@ -using DigitalLearningSolutions.Data.Models; - -namespace DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres +namespace DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres { + using DigitalLearningSolutions.Data.Models.Centres; + public class CentreSummaryViewModel { - public CentreSummaryViewModel(Centre model) + public CentreSummaryViewModel(CentreSummaryForSuperAdmin model) { CentreId = model.CentreId; CentreName = model.CentreName; diff --git a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs index 66f8adcb70..aaf275c6c8 100644 --- a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs @@ -2,15 +2,15 @@ { using System.Collections.Generic; using System.Linq; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; public class CentresViewModel { - public CentresViewModel(IEnumerable centres) + public CentresViewModel(IEnumerable centreSummaries) { // TODO: HEEDLS-641: add filters/sort/pagination // .Take(10) should be removed in HEEDLS-641 in favour of the standard pagination functionality. - Centres = centres.OrderBy(c => c.CentreName).Take(10).Select(c => new CentreSummaryViewModel(c)); + Centres = centreSummaries.OrderBy(c => c.CentreName).Take(10).Select(c => new CentreSummaryViewModel(c)); } public IEnumerable Centres { get; set; } diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/CentreConfigurationViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/CentreConfigurationViewModel.cs index 6992833720..c72266e12d 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/CentreConfigurationViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/CentreConfigurationViewModel.cs @@ -1,6 +1,6 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Configuration { - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; public class CentreConfigurationViewModel { diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreDetailsViewModel.cs index 90824ac7cc..6cff263373 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreDetailsViewModel.cs @@ -1,7 +1,7 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Configuration { using System.ComponentModel.DataAnnotations; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.Attributes; using Microsoft.AspNetCore.Http; diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreManagerDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreManagerDetailsViewModel.cs index 29c457bf0c..3ec963e199 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreManagerDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreManagerDetailsViewModel.cs @@ -1,7 +1,7 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Configuration { using System.ComponentModel.DataAnnotations; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.Attributes; public class EditCentreManagerDetailsViewModel diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetailsViewModel.cs index f992fcf2b7..15a663d602 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetailsViewModel.cs @@ -1,7 +1,7 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Configuration { using System.ComponentModel.DataAnnotations; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.Attributes; public class EditCentreWebsiteDetailsViewModel diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/ContractDetails/ContractDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/ContractDetails/ContractDetailsViewModel.cs index f7272294e2..8f8e625744 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/ContractDetails/ContractDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/ContractDetails/ContractDetailsViewModel.cs @@ -2,7 +2,7 @@ { using System.Collections.Generic; using System.Linq; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.User; using DigitalLearningSolutions.Web.Helpers; diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/CentreDashboardViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/CentreDashboardViewModel.cs index 9a018f60f4..4de1d0e39b 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/CentreDashboardViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/CentreDashboardViewModel.cs @@ -1,6 +1,6 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Dashboard { - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.Helpers; public class CentreDashboardViewModel diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/DashboardCentreDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/DashboardCentreDetailsViewModel.cs index 8962d8e055..234a1f9c5e 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/DashboardCentreDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/DashboardCentreDetailsViewModel.cs @@ -1,7 +1,6 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Dashboard { - using DigitalLearningSolutions.Data.Models; - + using DigitalLearningSolutions.Data.Models.Centres; public class DashboardCentreDetailsViewModel { public DashboardCentreDetailsViewModel(Centre centre, string userIpAddress, int? centreRank) diff --git a/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml index 08f7953309..58fa01d083 100644 --- a/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml @@ -14,7 +14,7 @@
    - Centre Id + Centre ID
    @Model.CentreId From fea61c300aac5c755a77280c44bd027030b23516 Mon Sep 17 00:00:00 2001 From: Martin Wilkins Date: Fri, 7 Jan 2022 15:48:47 +0000 Subject: [PATCH 5/5] HEEDLS-640 Markup cleanup --- DigitalLearningSolutions.Data/Models/Centres/Centre.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/DigitalLearningSolutions.Data/Models/Centres/Centre.cs b/DigitalLearningSolutions.Data/Models/Centres/Centre.cs index ea2f74957e..8035cc6c56 100644 --- a/DigitalLearningSolutions.Data/Models/Centres/Centre.cs +++ b/DigitalLearningSolutions.Data/Models/Centres/Centre.cs @@ -31,11 +31,8 @@ public class Centre public int TrainerSpots { get; set; } public string? IpPrefix { get; set; } public string? ContractType { get; set; } - public int CentreTypeId { get; set; } - public string CentreType { get; set; } public int CustomCourses { get; set; } public long ServerSpaceUsed { get; set; } public long ServerSpaceBytes { get; set; } - public bool Active { get; set; } } }