Skip to content

Commit 2eb77c9

Browse files
authored
Merge pull request #3101 from TechnologyEnhancedLearning/DLS-Release-v1.2.0
Dls release v1.2.0
2 parents 8f9e3a3 + 3b5ee9b commit 2eb77c9

File tree

35 files changed

+2549
-21695
lines changed

35 files changed

+2549
-21695
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,35 @@
44
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
55

66
version: 2
7+
registries:
8+
tel-azure-package-source:
9+
type: nuget-feed
10+
url: "https://pkgs.dev.azure.com/e-LfH/_packaging/LearningHubFeed/nuget/v3/index.json"
11+
username: "kevin.whittaker"
12+
password: ${{ secrets.AZURE_DEVOPS_PAT }}
13+
nuget-package-source:
14+
type: nuget-feed
15+
url: "https://api.nuget.org/v3/index.json"
716
updates:
817
- package-ecosystem: "nuget"
918
directory: "/" # Location of package manifests
1019
schedule:
1120
interval: "daily"
1221
open-pull-requests-limit: 10
22+
registries:
23+
- tel-azure-package-source
24+
- nuget-package-source
1325
target-branch: "Automatic_version_update_dependabot"
1426
ignore:
1527
# Ignore updates to packages that start with 'Wildcards'
1628
- dependency-name: "Microsoft.FeatureManagement.AspNetCore*"
1729
# Ignore some updates to the package
1830
- dependency-name: "Microsoft.VisualStudio.Web.CodeGeneration.Design"
19-
versions: [">7.0.0"]
31+
versions: [">9.0.0"]
2032
- dependency-name: "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
21-
versions: [">7.0.0"]
33+
versions: [">9.0.0"]
2234
- dependency-name: "Microsoft.AspNetCore.Mvc.Testing"
23-
versions: [">7.0.0"]
35+
versions: [">9.0.0"]
2436
- dependency-name: "Selenium.WebDriver.ChromeDriver"
2537
versions: ">=113.0.5672.1278" # Recommended version
2638
# For all packages, ignore all patch updates
@@ -34,7 +46,7 @@ updates:
3446
interval: "daily"
3547
target-branch: "Automatic_version_update_dependabot"
3648
# - "dependencies"
37-
open-pull-requests-limit: 7
49+
open-pull-requests-limit: 10
3850
ignore:
3951
- dependency-name: "*"
4052
update-types: ["version-update:semver-major"]

.github/workflows/auto-merge.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ jobs:
6969
echo "Skipping 'auto-merge' workflow check to prevent self-referencing."
7070
continue
7171
fi
72-
72+
73+
# If any check is still queued, set ALL_COMPLETED to false
74+
if [[ "$status" == "QUEUED" ]]; then
75+
ALL_COMPLETED=false
76+
fi
77+
7378
# If any check is still in progress, set ALL_COMPLETED to false
7479
if [[ "$status" == "IN_PROGRESS" ]]; then
7580
ALL_COMPLETED=false

DigitalLearningSolutions.Data/DataServices/CourseDataService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,16 +537,16 @@ LEFT OUTER JOIN UserCentreDetails AS UCD ON
537537
if (candidateAssessmentId > 1 && supervisorDelegateId == 0)
538538
{
539539
connection.Execute(
540-
@"UPDATE CandidateAssessments SET RemovedDate = NULL, EnrolmentMethodId = @enrolmentMethodId, CompleteByDate = @completeByDateDynamic
540+
@"UPDATE CandidateAssessments SET RemovedDate = NULL, EnrolmentMethodId = @enrolmentMethodId, CompleteByDate = @completeByDateDynamic, EnrolledByAdminId = @enrolledByAdminId
541541
WHERE ID = @candidateAssessmentId",
542-
new { candidateAssessmentId, enrolmentMethodId, completeByDateDynamic }
542+
new { candidateAssessmentId, enrolmentMethodId, completeByDateDynamic, enrolledByAdminId }
543543
);
544544
}
545545
if (candidateAssessmentId > 1 && supervisorDelegateId != 0)
546546
{
547547
string sqlQuery = $@"
548548
BEGIN TRANSACTION
549-
UPDATE CandidateAssessments SET RemovedDate = NULL, EnrolmentMethodId = @enrolmentMethodId, CompleteByDate = @completeByDateDynamic
549+
UPDATE CandidateAssessments SET RemovedDate = NULL, EnrolmentMethodId = @enrolmentMethodId, CompleteByDate = @completeByDateDynamic, EnrolledByAdminId = @enrolledByAdminId
550550
WHERE ID = @candidateAssessmentId
551551
552552
UPDATE CandidateAssessmentSupervisors SET Removed = NULL
@@ -556,7 +556,7 @@ BEGIN TRANSACTION
556556
COMMIT TRANSACTION";
557557

558558
connection.Execute(sqlQuery
559-
, new { candidateAssessmentId, selfAssessmentSupervisorRoleId, enrolmentMethodId, completeByDateDynamic, supervisorDelegateId });
559+
, new { candidateAssessmentId, selfAssessmentSupervisorRoleId, enrolmentMethodId, completeByDateDynamic, supervisorDelegateId, enrolledByAdminId });
560560
}
561561

562562
if (supervisorId > 0)

DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1854,7 +1854,7 @@ public int GetAdminUserRoleForFrameworkId(int adminId, int frameworkId)
18541854
@"SELECT CASE WHEN FW.OwnerAdminID = @adminId THEN 3 WHEN fwc.CanModify = 1 THEN 2 WHEN fwc.CanModify = 0 THEN 1 ELSE 0 END AS UserRole
18551855
FROM Frameworks AS FW LEFT OUTER JOIN
18561856
FrameworkCollaborators AS fwc ON fwc.FrameworkID = FW.ID AND fwc.AdminID = @adminId
1857-
WHERE FW.ID = @frameworkId",
1857+
WHERE FW.ID = @frameworkId and FWC.IsDeleted=0",
18581858
new { adminId, frameworkId }
18591859
);
18601860
}

DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentSupervisorDataService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ int delegateUserId
153153
WHERE (sd.Removed IS NULL) AND (cas.Removed IS NULL) AND (sd.DelegateUserID = @delegateUserId) AND (ca.SelfAssessmentID = @selfAssessmentId)
154154
AND (sd.SupervisorAdminID IS NOT NULL) AND (coalesce(sasr.SelfAssessmentReview, 1) = 1)
155155
AND (cas.ID NOT IN (SELECT CandidateAssessmentSupervisorID FROM CandidateAssessmentSupervisorVerifications WHERE Verified IS NULL))
156-
AND au.Active = 1
156+
AND au.Active = 1 AND (au.Supervisor = 1 or au.NominatedSupervisor = 1)
157157
AND (au.CategoryID = 0 OR au.CategoryID IN (select CategoryID from SelfAssessments where ID = @selfAssessmentId))
158158
ORDER BY SupervisorName",
159159
new { selfAssessmentId, delegateUserId }

DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,35 @@ public SupervisorDataService(IDbConnection connection, ILogger<SupervisorDataSer
126126
public DashboardData? GetDashboardDataForAdminId(int adminId)
127127
{
128128
return connection.Query<DashboardData>(
129-
@" SELECT (SELECT COUNT(sd.ID) AS StaffCount
130-
FROM SupervisorDelegates sd
131-
LEFT OUTER JOIN users u
132-
ON u.id = sd.DelegateUserID
133-
AND u.Active = 1
134-
WHERE (sd.SupervisorAdminID = @adminId)
135-
AND (sd.Removed IS NULL)) AS StaffCount,
129+
@"SELECT (SELECT COUNT(sd.ID) AS StaffCount
130+
FROM CustomPrompts AS cp6
131+
RIGHT OUTER JOIN CustomPrompts AS cp5
132+
RIGHT OUTER JOIN DelegateAccounts AS da
133+
RIGHT OUTER JOIN SupervisorDelegates AS sd
134+
INNER JOIN AdminUsers AS au
135+
ON sd.SupervisorAdminID = au.AdminID
136+
INNER JOIN Centres AS ct
137+
ON au.CentreID = ct.CentreID
138+
ON da.CentreID = ct.CentreID
139+
AND da.UserID = sd.DelegateUserID
140+
LEFT OUTER JOIN Users AS u
141+
LEFT OUTER JOIN JobGroups AS jg
142+
ON u.JobGroupID = jg.JobGroupID
143+
ON da.UserID = u.ID
144+
LEFT OUTER JOIN CustomPrompts AS cp1
145+
ON ct.CustomField1PromptID = cp1.CustomPromptID
146+
LEFT OUTER JOIN CustomPrompts AS cp2
147+
ON ct.CustomField2PromptID = cp2.CustomPromptID
148+
LEFT OUTER JOIN CustomPrompts AS cp3
149+
ON ct.CustomField3PromptID = cp3.CustomPromptID
150+
LEFT OUTER JOIN CustomPrompts AS cp4
151+
ON ct.CustomField4PromptID = cp4.CustomPromptID
152+
ON cp5.CustomPromptID = ct.CustomField5PromptID
153+
ON cp6.CustomPromptID = ct.CustomField6PromptID
154+
LEFT OUTER JOIN AdminAccounts AS au2
155+
ON da.UserID = au2.UserID AND da.CentreID = au2.CentreID
156+
WHERE (sd.SupervisorAdminID = @adminId) AND (sd.Removed IS NULL) AND
157+
(u.ID = da.UserID OR sd.DelegateUserID IS NULL)) AS StaffCount,
136158
(SELECT COUNT(ID) AS StaffCount
137159
FROM SupervisorDelegates AS SupervisorDelegates_1
138160
WHERE (SupervisorAdminID = @adminId)

DigitalLearningSolutions.Data/Models/MultiPageFormData/AddNewCentreCourse/AddNewCentreCourseTempData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public AddNewCentreCourseTempData()
1717
public CourseOptionsTempData? CourseOptionsData { get; set; }
1818
public CourseContentTempData? CourseContentData { get; set; }
1919
public List<SectionContentTempData>? SectionContentData { get; set; }
20-
20+
public bool EditCourseContent { get; set; }
2121
public void SetApplicationAndResetModels(ApplicationDetails application)
2222
{
2323
if (Application == application)

DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/CourseSetup/CourseSetupControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public void SetCourseContent_get_redirects_to_summary_if_application_has_no_sect
416416
).Returns(new List<Section>());
417417

418418
// When
419-
var result = controller.SetCourseContent();
419+
var result = controller.SetCourseContent(false);
420420

421421
// Then
422422
result.Should().BeRedirectToActionResult().WithActionName("Summary");

DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ public IActionResult MyStaffList(
6060
var loggedInAdminUser = userService.GetAdminUserById(adminId);
6161
var centreRegistrationPrompts = centreRegistrationPromptsService.GetCentreRegistrationPromptsByCentreId(centreId);
6262
var supervisorDelegateDetails = supervisorService.GetSupervisorDelegateDetailsForAdminId(adminId, loggedInAdminUser.CategoryId);
63-
if (!supervisorDelegateDetails.Any())
64-
{
65-
supervisorDelegateDetails = supervisorService.GetSupervisorDelegateDetailsForAdminIdWithoutRemovedClause(adminId);
66-
}
6763
var isSupervisor = User.GetCustomClaimAsBool(CustomClaimTypes.IsSupervisor) ?? false;
6864
var allSupervisorDelegateDetailViewModels = supervisorDelegateDetails.Select(
6965
supervisor =>
@@ -1215,7 +1211,7 @@ public IActionResult SignOffProfileAssessment(
12151211
SignOffProfileAssessmentViewModel model
12161212
)
12171213
{
1218-
if ((!ModelState.IsValid) && (model.NumberOfSelfAssessedOptionalCompetencies > 0) && (!model.OptionalCompetenciesChecked))
1214+
if ((!ModelState.IsValid) && (model.NumberOfSelfAssessedOptionalCompetencies > 0) && (!model.OptionalCompetenciesChecked) && model.SignedOff)
12191215
{
12201216
SelfAssessmentResultSummary? selfAssessmentSummary =
12211217
supervisorService.GetSelfAssessmentResultSummary(candidateAssessmentId, supervisorDelegateId);
@@ -1231,7 +1227,10 @@ SignOffProfileAssessmentViewModel model
12311227
CandidateAssessmentSupervisorVerificationId =
12321228
selfAssessmentSummary.CandidateAssessmentSupervisorVerificationId,
12331229
CandidateAssessmentSupervisorVerificationSummaries = verificationsSummary,
1234-
NumberOfSelfAssessedOptionalCompetencies = optionalCompetencies.Count(x => x.IncludedInSelfAssessment)
1230+
NumberOfSelfAssessedOptionalCompetencies = optionalCompetencies.Count(x => x.IncludedInSelfAssessment),
1231+
SupervisorComments = model.SupervisorComments,
1232+
SignedOff = model.SignedOff,
1233+
IsSignOffverified = model.SignedOff
12351234
};
12361235
return View("SignOffProfileAssessment", newModel);
12371236
}

DigitalLearningSolutions.Web/Controllers/TrackingSystem/Centre/SelfAssessmentReports/SelfAssessmentReportsController.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using System.Threading.Tasks;
1616
using Microsoft.Extensions.Configuration;
1717
using DigitalLearningSolutions.Data.Extensions;
18+
using DigitalLearningSolutions.Web.Services;
1819

1920
[FeatureGate(FeatureFlags.RefactoredTrackingSystem)]
2021
[Authorize(Policy = CustomPolicies.UserCentreAdmin)]
@@ -30,11 +31,13 @@ public class SelfAssessmentReportsController : Controller
3031
private readonly string tableauSiteName;
3132
private readonly string workbookName;
3233
private readonly string viewName;
34+
private readonly ISelfAssessmentService selfAssessmentService;
3335
public SelfAssessmentReportsController(
3436
ISelfAssessmentReportService selfAssessmentReportService,
3537
ITableauConnectionHelperService tableauConnectionHelper,
3638
IClockUtility clockUtility,
37-
IConfiguration config
39+
IConfiguration config,
40+
ISelfAssessmentService selfAssessmentService
3841
)
3942
{
4043
this.selfAssessmentReportService = selfAssessmentReportService;
@@ -44,12 +47,14 @@ IConfiguration config
4447
tableauSiteName = config.GetTableauSiteName();
4548
workbookName = config.GetTableauWorkbookName();
4649
viewName = config.GetTableauViewName();
50+
this.selfAssessmentService = selfAssessmentService;
4751
}
4852
public IActionResult Index()
4953
{
5054
var centreId = User.GetCentreId();
51-
var categoryId = User.GetAdminCategoryId();
52-
var model = new SelfAssessmentReportsViewModel(selfAssessmentReportService.GetSelfAssessmentsForReportList((int)centreId, categoryId));
55+
var adminCategoryId = User.GetAdminCategoryId();
56+
var categoryId = this.selfAssessmentService.GetSelfAssessmentCategoryId(1);
57+
var model = new SelfAssessmentReportsViewModel(selfAssessmentReportService.GetSelfAssessmentsForReportList((int)centreId, adminCategoryId), adminCategoryId, categoryId);
5358
return View(model);
5459
}
5560
[HttpGet]

0 commit comments

Comments
 (0)