Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
409b1ee
TD-5291 Issue on 'Course set up' screen when selected Few course cont…
sherif-olaboye Jan 30, 2025
4c1d42f
TD-5291 Issue on 'Course set up' screen when selected Few course cont…
sherif-olaboye Jan 30, 2025
fc760ef
TD-5291 Issue on 'Course set up' screen when selected Few course cont…
sherif-olaboye Jan 31, 2025
a78c0a8
TD-5292 Issue with 'Go back' link when creating a course and adding '…
sherif-olaboye Jan 31, 2025
ef9eabd
TD-5306-self-assessments report file name format changed
Auldrin-Possa Jan 31, 2025
2f0d16c
TD-4475-matching proficiencies count added to screen
Auldrin-Possa Feb 4, 2025
6a4b4c2
TD-5222 Error when enrolling a staff on self assessment from the trac…
sherif-olaboye Feb 5, 2025
0584b6b
Merge pull request #3111 from TechnologyEnhancedLearning/Develop/feat…
rshrirohit Feb 7, 2025
1ab13f7
Merge pull request #3102 from TechnologyEnhancedLearning/Develop/Fix/…
rshrirohit Feb 7, 2025
c916149
TD-5333 Issue with optional proficiencies not retaining to previous s…
sherif-olaboye Feb 10, 2025
951c95f
Merge pull request #3096 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Feb 11, 2025
ec0e37c
Merge pull request #3099 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Feb 11, 2025
7ef6456
TD-3542 Console '500' error is seeing on the 'My staff' screen when c…
sherif-olaboye Feb 12, 2025
5dff09b
Merge pull request #3114 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Feb 12, 2025
0879dbf
Merge pull request #3118 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Feb 13, 2025
6c2d6e4
TD-5292 Issue on 'Course set up' screen when selected Few course cont…
sherif-olaboye Feb 13, 2025
25f6523
TD-5291 Issue on 'Course set up' screen when selected Few course cont…
sherif-olaboye Feb 13, 2025
28cf777
TD-5292 when clicking ‘go back’ links few course content screens are …
sherif-olaboye Feb 17, 2025
ac656d7
TD-5368 Adding Category To Email Content
rshrirohit Feb 21, 2025
252a582
Merge pull request #3126 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Feb 24, 2025
2f1cdd4
Merge pull request #3131 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Feb 24, 2025
49be5f1
TD-5367-Removed 'UPDATE CandidateAssessmentSupervisors..' while remov…
Auldrin-Possa Feb 24, 2025
f32043e
TD-5368 Updating the Tracking system-centre-admin area and promote to…
rshrirohit Feb 24, 2025
57133cc
TD-5368 removing commented code
rshrirohit Feb 24, 2025
b492564
Merge remote-tracking branch 'origin/DLS-Release-v1.1.2' into Develop…
sherif-olaboye Feb 24, 2025
bf29c8c
TD-3542 putting the validations in the viewmodels
sherif-olaboye Feb 24, 2025
9d20e5c
Merge pull request #3123 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Feb 25, 2025
9835d10
Merge pull request #3133 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Feb 25, 2025
9ab2364
Merge pull request #3134 from TechnologyEnhancedLearning/Develop/Fix/…
rshrirohit Feb 25, 2025
4e4f7a3
TD-5325 Updating Freshdesk Api Nuget Package
rshrirohit Feb 27, 2025
aa5e3a9
Merge pull request #3137 from TechnologyEnhancedLearning/Develop/Fixe…
rshrirohit Feb 27, 2025
fcdf44e
TD-5370- Added code to remove a pending sign-off request if the self-…
Auldrin-Possa Feb 27, 2025
d77ec78
Merge pull request #3138 from TechnologyEnhancedLearning/Develop/Fix/…
rshrirohit Feb 27, 2025
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,7 +9,7 @@
public interface ICourseCategoriesDataService
{
IEnumerable<Category> GetCategoriesForCentreAndCentrallyManagedCourses(int centreId);
string? GetCourseCategoryName(int categoryId);
string? GetCourseCategoryName(int? categoryId);
}

public class CourseCategoriesDataService : ICourseCategoriesDataService
Expand All @@ -34,7 +34,7 @@ FROM CourseCategories
);
}

public string? GetCourseCategoryName(int categoryId)
public string? GetCourseCategoryName(int? categoryId)
{
var name = connection.QueryFirstOrDefault<string?>(
@"SELECT CategoryName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ BEGIN TRANSACTION

UPDATE CandidateAssessmentSupervisors SET Removed = NULL
{((selfAssessmentSupervisorRoleId > 0) ? " ,SelfAssessmentSupervisorRoleID = @selfAssessmentSupervisorRoleID" : string.Empty)}
WHERE CandidateAssessmentID = @candidateAssessmentId AND SupervisorDelegateId = @supervisorDelegateId
WHERE CandidateAssessmentID = @candidateAssessmentId AND SupervisorDelegateId = @supervisorDelegateId AND SelfAssessmentSupervisorRoleID = @selfAssessmentSupervisorRoleID

COMMIT TRANSACTION";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ INNER JOIN CompetencyGroups AS CG
}
}

public void RemoveSignoffRequestById(int candidateAssessmentSupervisorVerificationsId)
{
var numberOfAffectedRows = connection.Execute(
@" DELETE FROM CandidateAssessmentSupervisorVerifications WHERE ID = @candidateAssessmentSupervisorVerificationsId ",
new { candidateAssessmentSupervisorVerificationsId });
}


public void SetCompleteByDate(int selfAssessmentId, int delegateUserId, DateTime? completeByDate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,16 +635,14 @@ FROM SelfAssessmentResults s inner join
SelfAssessmentResultSupervisorVerifications sv ON s.ID = sv.SelfAssessmentResultId AND sv.Superceded = 0
WHERE s.CompetencyID = @competencyId
AND s.SelfAssessmentID = @selfAssessmentId
AND s.DelegateUserID = @delegateUserId",
AND s.DelegateUserID = @delegateUserId AND sv.Verified IS NULL",
new { selfAssessmentId, delegateUserId, competencyId }
);
}

public void RemoveReviewCandidateAssessmentOptionalCompetencies(int id)
{

connection.Execute(@"UPDATE SelfAssessmentResults SET Result = NULL WHERE ID = @id", new { id});

connection.Execute(
@"delete from SelfAssessmentResultSupervisorVerifications WHERE SelfAssessmentResultId = @id", new { id });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ int competencyId

void UpdateLastAccessed(int selfAssessmentId, int delegateUserId);
void RemoveSignoffRequests(int selfAssessmentId, int delegateUserId, int competencyGroupsId);
void RemoveSignoffRequestById(int candidateAssessmentSupervisorVerificationsId);
void SetCompleteByDate(int selfAssessmentId, int delegateUserId, DateTime? completeByDate);

void SetSubmittedDateNow(int selfAssessmentId, int delegateUserId);
Expand Down Expand Up @@ -173,7 +174,7 @@ int GetSelfAssessmentActivityDelegatesExportCount(string searchString, string so
bool IsCentreSelfAssessment(int selfAssessmentId, int centreId);
bool HasMinimumOptionalCompetencies(int selfAssessmentId, int delegateUserId);
int GetSelfAssessmentCategoryId(int selfAssessmentId);
void RemoveReviewCandidateAssessmentOptionalCompetencies(int id);
void RemoveReviewCandidateAssessmentOptionalCompetencies(int id);
public IEnumerable<SelfAssessmentResult> GetSelfAssessmentResultswithSupervisorVerificationsForDelegateSelfAssessmentCompetency(
int delegateUserId,
int selfAssessmentId,
Expand Down Expand Up @@ -683,9 +684,6 @@ BEGIN TRANSACTION
UPDATE CandidateAssessments SET RemovedDate = GETUTCDATE(), RemovalMethodID = 2
WHERE ID = @candidateAssessmentsId AND RemovedDate IS NULL

UPDATE CandidateAssessmentSupervisors SET Removed = GETUTCDATE()
WHERE CandidateAssessmentID = @candidateAssessmentsId AND Removed IS NULL

COMMIT TRANSACTION
END TRY
BEGIN CATCH
Expand Down
104 changes: 65 additions & 39 deletions DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -620,20 +620,21 @@ FROM CandidateAssessmentSupervisors AS cas INNER JOIN
{
return connection.Query<DelegateSelfAssessment>(
@$"SELECT ca.ID, sa.ID AS SelfAssessmentID, sa.Name AS RoleName, sa.QuestionLabel, sa.DescriptionLabel, sa.ReviewerCommentsLabel,
sa.SupervisorSelfAssessmentReview, sa.SupervisorResultsReview, ca.StartedDate,
COALESCE(ca.LastAccessed, ca.StartedDate) AS LastAccessed,
ca.CompleteByDate, ca.LaunchCount, ca.CompletedDate,
(SELECT COUNT(*) AS Expr1
FROM CandidateAssessmentSupervisorVerifications AS casv
WHERE (CandidateAssessmentSupervisorID = cas.ID) AND (Requested IS NOT NULL) AND (Verified IS NULL)) AS SignOffRequested,
{signedOffFields}
(SELECT COUNT(*) AS Expr1
FROM SelfAssessmentResultSupervisorVerifications AS sarsv
WHERE (CandidateAssessmentSupervisorID = cas.ID) AND (Verified IS NULL) AND (sarsv.Superceded = 0)) AS ResultsVerificationRequests
FROM CandidateAssessmentSupervisors AS cas INNER JOIN
CandidateAssessments AS ca ON cas.CandidateAssessmentID = ca.ID INNER JOIN
SelfAssessments AS sa ON sa.ID = ca.SelfAssessmentID
WHERE (ca.ID = @candidateAssessmentId) AND (ISNULL(@adminIdCategoryID, 0) = 0 OR sa.CategoryID = @adminIdCategoryId)", new { candidateAssessmentId, adminIdCategoryId }
sa.SupervisorSelfAssessmentReview, sa.SupervisorResultsReview, ca.StartedDate,
COALESCE(ca.LastAccessed, ca.StartedDate) AS LastAccessed,
ca.CompleteByDate, ca.LaunchCount, ca.CompletedDate,
(SELECT COUNT(*) AS Expr1
FROM CandidateAssessmentSupervisorVerifications AS casv
WHERE (CandidateAssessmentSupervisorID = cas.ID) AND (Requested IS NOT NULL) AND (Verified IS NULL)) AS SignOffRequested,
{signedOffFields}
(SELECT COUNT(*) AS Expr1
FROM SelfAssessmentResultSupervisorVerifications AS sarsv
WHERE (CandidateAssessmentSupervisorID = cas.ID) AND (Verified IS NULL) AND (sarsv.Superceded = 0)) AS ResultsVerificationRequests,
sa.Vocabulary
FROM CandidateAssessmentSupervisors AS cas INNER JOIN
CandidateAssessments AS ca ON cas.CandidateAssessmentID = ca.ID INNER JOIN
SelfAssessments AS sa ON sa.ID = ca.SelfAssessmentID
WHERE (ca.ID = @candidateAssessmentId) AND (ISNULL(@adminIdCategoryID, 0) = 0 OR sa.CategoryID = @adminIdCategoryId)", new { candidateAssessmentId, adminIdCategoryId }
).FirstOrDefault();
}
public DelegateSelfAssessment? GetSelfAssessmentBySupervisorDelegateCandidateAssessmentId(int candidateAssessmentId, int supervisorDelegateId)
Expand Down Expand Up @@ -696,23 +697,24 @@ FROM SelfAssessmentResults AS sar2
{
return connection.Query<DelegateSelfAssessment>(
@$"SELECT ca.ID, sa.ID AS SelfAssessmentID, sa.Name AS RoleName, sa.SupervisorSelfAssessmentReview, sa.SupervisorResultsReview, sa.ReviewerCommentsLabel, COALESCE (sasr.RoleName, 'Supervisor') AS SupervisorRoleTitle, ca.StartedDate, ca.LastAccessed, ca.CompleteByDate, ca.LaunchCount, ca.CompletedDate, r.RoleProfile, sg.SubGroup, pg.ProfessionalGroup, sa.SupervisorResultsReview AS IsSupervisorResultsReviewed,
(SELECT COUNT(*) AS Expr1
FROM CandidateAssessmentSupervisorVerifications AS casv
WHERE (CandidateAssessmentSupervisorID = cas.ID) AND (Requested IS NOT NULL) AND (Verified IS NULL)) AS SignOffRequested,
{signedOffFields}
(SELECT COUNT(*) AS Expr1
FROM SelfAssessmentResultSupervisorVerifications AS sarsv
WHERE (CandidateAssessmentSupervisorID = cas.ID) AND (Verified IS NULL) AND (Superceded = 0)) AS ResultsVerificationRequests,
ca.NonReportable,ca.DelegateUserID
(SELECT COUNT(*) AS Expr1
FROM CandidateAssessmentSupervisorVerifications AS casv
WHERE (CandidateAssessmentSupervisorID = cas.ID) AND (Requested IS NOT NULL) AND (Verified IS NULL)) AS SignOffRequested,
{signedOffFields}
(SELECT COUNT(*) AS Expr1
FROM SelfAssessmentResultSupervisorVerifications AS sarsv
WHERE (CandidateAssessmentSupervisorID = cas.ID) AND (Verified IS NULL) AND (Superceded = 0)) AS ResultsVerificationRequests,
ca.NonReportable,ca.DelegateUserID,
sa.Vocabulary
FROM CandidateAssessmentSupervisors AS cas INNER JOIN
CandidateAssessments AS ca ON cas.CandidateAssessmentID = ca.ID INNER JOIN
SelfAssessments AS sa ON sa.ID = ca.SelfAssessmentID INNER JOIN
SupervisorDelegates AS sd ON cas.SupervisorDelegateId = sd.ID LEFT OUTER JOIN
NRPProfessionalGroups AS pg ON sa.NRPProfessionalGroupID = pg.ID LEFT OUTER JOIN
NRPSubGroups AS sg ON sa.NRPSubGroupID = sg.ID LEFT OUTER JOIN
NRPRoles AS r ON sa.NRPRoleID = r.ID
LEFT OUTER JOIN SelfAssessmentSupervisorRoles AS sasr ON cas.SelfAssessmentSupervisorRoleID = sasr.ID
WHERE (ca.ID = @candidateAssessmentId) AND (cas.Removed IS NULL) AND (sd.SupervisorAdminID = @adminId) AND (ISNULL(@adminIdCategoryID, 0) = 0 OR sa.CategoryID = @adminIdCategoryId)",
CandidateAssessments AS ca ON cas.CandidateAssessmentID = ca.ID INNER JOIN
SelfAssessments AS sa ON sa.ID = ca.SelfAssessmentID INNER JOIN
SupervisorDelegates AS sd ON cas.SupervisorDelegateId = sd.ID LEFT OUTER JOIN
NRPProfessionalGroups AS pg ON sa.NRPProfessionalGroupID = pg.ID LEFT OUTER JOIN
NRPSubGroups AS sg ON sa.NRPSubGroupID = sg.ID LEFT OUTER JOIN
NRPRoles AS r ON sa.NRPRoleID = r.ID
LEFT OUTER JOIN SelfAssessmentSupervisorRoles AS sasr ON cas.SelfAssessmentSupervisorRoleID = sasr.ID
WHERE (ca.ID = @candidateAssessmentId) AND (cas.Removed IS NULL) AND (sd.SupervisorAdminID = @adminId) AND (ISNULL(@adminIdCategoryID, 0) = 0 OR sa.CategoryID = @adminIdCategoryId)",
new { candidateAssessmentId, adminId, adminIdCategoryId }
).FirstOrDefault();
}
Expand Down Expand Up @@ -941,18 +943,45 @@ FROM CandidateAssessmentSupervisors

if (candidateAssessmentSupervisorsId == 0)
{
//For a candidate assessment, only one supervisor role should be active (Removed = null)
var numberOfAffectedRows = connection.Execute(
@"INSERT INTO CandidateAssessmentSupervisors (CandidateAssessmentID, SupervisorDelegateId, SelfAssessmentSupervisorRoleID)
VALUES (@candidateAssessmentId, @supervisorDelegateId, @selfAssessmentSupervisorRoleId)", new { candidateAssessmentId, supervisorDelegateId, selfAssessmentSupervisorRoleId }
@"BEGIN TRY
BEGIN TRANSACTION
UPDATE CandidateAssessmentSupervisors SET Removed = getUTCDate() WHERE CandidateAssessmentID = @candidateAssessmentId
AND SupervisorDelegateId = @supervisorDelegateId
AND Removed IS NULL

INSERT INTO CandidateAssessmentSupervisors (CandidateAssessmentID, SupervisorDelegateId, SelfAssessmentSupervisorRoleID)
VALUES (@candidateAssessmentId, @supervisorDelegateId, @selfAssessmentSupervisorRoleId)

COMMIT TRANSACTION
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
END CATCH",
new { candidateAssessmentId, supervisorDelegateId, selfAssessmentSupervisorRoleId }
);
}
else
{
//For a candidate assessment, only one supervisor role should be active (Removed = null)
int numberOfAffectedRows = connection.Execute(
@"UPDATE CandidateAssessmentSupervisors SET Removed = NULL WHERE CandidateAssessmentID = @candidateAssessmentId
AND SupervisorDelegateId = @supervisorDelegateId
AND SelfAssessmentSupervisorRoleId=@selfAssessmentSupervisorRoleId",
new { candidateAssessmentId, supervisorDelegateId, selfAssessmentSupervisorRoleId });
@"BEGIN TRY
BEGIN TRANSACTION
UPDATE CandidateAssessmentSupervisors SET Removed = getUTCDate() WHERE CandidateAssessmentID = @candidateAssessmentId
AND SupervisorDelegateId = @supervisorDelegateId
AND Removed IS NULL

UPDATE CandidateAssessmentSupervisors SET Removed = NULL WHERE CandidateAssessmentID = @candidateAssessmentId
AND SupervisorDelegateId = @supervisorDelegateId
AND SelfAssessmentSupervisorRoleId = @selfAssessmentSupervisorRoleId

COMMIT TRANSACTION
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
END CATCH",
new { candidateAssessmentId, supervisorDelegateId, selfAssessmentSupervisorRoleId });
}
}
return candidateAssessmentId;
Expand All @@ -966,9 +995,6 @@ BEGIN TRANSACTION
UPDATE CandidateAssessments SET RemovedDate = getUTCDate(), RemovalMethodID = 2
WHERE ID = @candidateAssessmentId AND RemovedDate IS NULL

UPDATE CandidateAssessmentSupervisors SET Removed = getUTCDate()
WHERE CandidateAssessmentID = @candidateAssessmentId AND Removed IS NULL

COMMIT TRANSACTION
END TRY
BEGIN CATCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Dapper" Version="2.1.24" />
<PackageReference Include="Dapper.FluentMap" Version="2.0.0" />
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.8" />
<PackageReference Include="Freshdesk.Api" Version="0.13.6" />
<PackageReference Include="Freshdesk.Api" Version="0.17.2" />
<PackageReference Include="FuzzySharp" Version="2.0.2" />
<PackageReference Include="MailKit" Version="4.3.0" />
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="2.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ public class DelegateSelfAssessment
public bool IsSupervisorResultsReviewed { get; set; }
public bool IsAssignedToSupervisor { get; set; }
public bool NonReportable { get; set; }
public string? Vocabulary { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void Summary_post_registers_delegate_with_expected_values()
A<string>._, A<string>._, A<string>._, A<string>._,
A<bool>._, A<bool>._, A<bool>._, A<bool>._,
A<bool>._, A<bool>._, A<bool>._, A<bool>._,
A<string>._, A<string>._
A<string>._, A<string>._, A<string>._
)).Returns(adminRolesEmail);

// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ bool isCmsManager
const string supervisorFirstName = "TestAdminFirstName";
const string supervisorLastName = "TestAdminFirstName";
const string supervisorEmail = "[email protected]";
const string categoryName = "Digital Workplace";

const string centreName = "Test Centre Name";

Expand All @@ -65,7 +66,8 @@ bool isCmsManager
isCmsAdministrator,
isCmsManager,
delegateEmail,
centreName
centreName,
categoryName
);

// Then
Expand Down Expand Up @@ -164,6 +166,11 @@ bool isCmsManager
returnedEmail.Body.HtmlBody.Should().NotContain("<li>CMS manager</li>");
returnedEmail.Body.TextBody.Should().NotContain("CMS manager");
}
if (!string.IsNullOrEmpty(categoryName))
{
returnedEmail.Body.HtmlBody.Should().Contain("In the Digital Workplace category.");
returnedEmail.Body.TextBody.Should().Contain("In the Digital Workplace category.");
}

returnedEmail.Body.HtmlBody.Should().Contain("the next time you log in to " + centreName + ".</body>");
returnedEmail.Body.TextBody.Should().Contain("the next time you log in to " + centreName + ".");
Expand Down
Loading
Loading