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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
-- Deletes ResetPassword records older than 4 days. Should be run every night at 3AM.
BEGIN
UPDATE au
SET au.ResetPasswordID = NULL FROM AdminUsers AS au
INNER JOIN ResetPassword AS r
ON r.ID = au.ResetPasswordID
WHERE r.PasswordResetDateTime < DATEADD(day, -4, GETDATE())

UPDATE c
SET c.ResetPasswordID = NULL FROM Candidates AS c
INNER JOIN ResetPassword AS r
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public IEnumerable<CurrentSelfAssessment> GetSelfAssessmentsForCandidate(int can
SA.Description,
SA.IncludesSignposting,
SA.SupervisorResultsReview AS IsSupervisorResultsReviewed,
SA.ReviewerCommentsLabel,
COALESCE(SA.Vocabulary, 'Capability') AS Vocabulary,
COUNT(C.ID) AS NumberOfCompetencies,
CA.StartedDate,
Expand All @@ -39,7 +38,6 @@ INNER JOIN Competencies AS C
WHERE CA.CandidateID = @candidateId AND CA.RemovedDate IS NULL AND CA.CompletedDate IS NULL
GROUP BY
CA.SelfAssessmentID, SA.Name, SA.Description, SA.IncludesSignposting, SA.SupervisorResultsReview,
SA.ReviewerCommentsLabel,
COALESCE(SA.Vocabulary, 'Capability'), CA.StartedDate, CA.LastAccessed, CA.CompleteByDate,
CA.ID,
CA.UserBookmark, CA.UnprocessedUpdates, CA.LaunchCount, CA.SubmittedDate",
Expand All @@ -58,7 +56,6 @@ GROUP BY
SA.DescriptionLabel,
SA.IncludesSignposting,
SA.SupervisorResultsReview AS IsSupervisorResultsReviewed,
SA.ReviewerCommentsLabel,
SA.SupervisorSelfAssessmentReview,
SA.EnforceRoleRequirementsForSignOff,
COALESCE(SA.Vocabulary, 'Capability') AS Vocabulary,
Expand Down Expand Up @@ -115,8 +112,7 @@ GROUP BY
CA.StartedDate, CA.LastAccessed, CA.CompleteByDate,
CA.ID, CA.UserBookmark, CA.UnprocessedUpdates,
CA.LaunchCount, CA.SubmittedDate, SA.LinearNavigation, SA.UseDescriptionExpanders,
SA.ManageOptionalCompetenciesPrompt, SA.SupervisorSelfAssessmentReview, SA.SupervisorResultsReview,
SA.ReviewerCommentsLabel, SA.EnforceRoleRequirementsForSignOff, SA.ManageSupervisorsDescription",
SA.ManageOptionalCompetenciesPrompt, SA.SupervisorSelfAssessmentReview, SA.SupervisorResultsReview, SA.EnforceRoleRequirementsForSignOff, SA.ManageSupervisorsDescription",
new { candidateId, selfAssessmentId }
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ int candidateAssessmentSupervisorVerificationId
sar.ID,
sstrc.CompetencyGroupID,
sea.Vocabulary,
sasv.SignedOff,
sea.ReviewerCommentsLabel
sasv.SignedOff
FROM SelfAssessmentResultSupervisorVerifications AS sasv
INNER JOIN SelfAssessmentResults AS sar
ON sasv.SelfAssessmentResultId = sar.ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ public class CurrentSelfAssessment : SelfAssessment
public string? SignOffRequestorStatement { get; set; }
public bool EnforceRoleRequirementsForSignOff { get; set; }
public string? ManageSupervisorsDescription { get; set; }
public string? ReviewerCommentsLabel { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ public class SupervisorComment
public int? CompetencyGroupID { get; set; }
public string? Vocabulary { get; set; }
public bool SignedOff { get; set; }
public string? ReviewerCommentsLabel { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class DelegateSelfAssessment
public string? ProfessionalGroup { get; set; }
public string? QuestionLabel { get; set; }
public string? DescriptionLabel { get; set; }
public string? ReviewerCommentsLabel { get; set; }
public string? SubGroup { get; set; }
public string? RoleProfile { get; set; }
public int SignOffRequested { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions DigitalLearningSolutions.Data/Services/SupervisorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ FROM CandidateAssessmentSupervisors AS cas INNER JOIN
public DelegateSelfAssessment GetSelfAssessmentBaseByCandidateAssessmentId(int candidateAssessmentId)
{
return connection.Query<DelegateSelfAssessment>(
@$"SELECT ca.ID, sa.ID AS SelfAssessmentID, sa.Name AS RoleName, sa.QuestionLabel, sa.DescriptionLabel, sa.ReviewerCommentsLabel,
@$"SELECT ca.ID, sa.ID AS SelfAssessmentID, sa.Name AS RoleName, sa.QuestionLabel, sa.DescriptionLabel,
sa.SupervisorSelfAssessmentReview, sa.SupervisorResultsReview, ca.StartedDate,
COALESCE(ca.LastAccessed, ca.StartedDate) AS LastAccessed,
ca.CompleteByDate, ca.LaunchCount, ca.CompletedDate,
Expand Down Expand Up @@ -349,7 +349,7 @@ FROM SelfAssessmentResults AS sar2
public DelegateSelfAssessment GetSelfAssessmentByCandidateAssessmentId(int candidateAssessmentId, int adminId)
{
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 ca.ID, sa.ID AS SelfAssessmentID, sa.Name AS RoleName, sa.SupervisorSelfAssessmentReview, sa.SupervisorResultsReview, 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,
Expand Down Expand Up @@ -574,7 +574,7 @@ public bool InsertSelfAssessmentResultSupervisorVerification(int candidateAssess
connection.Execute(@"UPDATE SelfAssessmentResultSupervisorVerifications SET Superceded = 1 WHERE CandidateAssessmentSupervisorID = @candidateAssessmentSupervisorId AND SelfAssessmentResultId = @resultId", new { candidateAssessmentSupervisorId, resultId });
//Insert a new SelfAssessmentResultSupervisorVerifications record:
var numberOfAffectedRows = connection.Execute(
@"INSERT INTO SelfAssessmentResultSupervisorVerifications (CandidateAssessmentSupervisorID, SelfAssessmentResultId, EmailSent) VALUES (@candidateAssessmentSupervisorId, @resultId, GETUTCDATE())", new { candidateAssessmentSupervisorId, resultId });
@"INSERT INTO SelfAssessmentResultSupervisorVerifications (CandidateAssessmentSupervisorID, SelfAssessmentResultId, EmailSent) VALUES (@candidateAssessmentSupervisorId, @resultId, GETUTCDATE())", new { candidateAssessmentSupervisorId, resultId });
if (numberOfAffectedRows < 1)
{
logger.LogWarning(
Expand All @@ -597,7 +597,7 @@ FROM CandidateAssessmentSupervisors
public SelfAssessmentResultSummary GetSelfAssessmentResultSummary(int candidateAssessmentId, int supervisorDelegateId)
{
return connection.Query<SelfAssessmentResultSummary>(
@"SELECT ca.ID, ca.SelfAssessmentID, sa.Name AS RoleName, sa.ReviewerCommentsLabel, COALESCE (sasr.SelfAssessmentReview, 1) AS SelfAssessmentReview, COALESCE (sasr.ResultsReview, 1) AS SupervisorResultsReview, COALESCE (sasr.RoleName, 'Supervisor') AS SupervisorRoleTitle, ca.StartedDate,
@"SELECT ca.ID, ca.SelfAssessmentID, sa.Name AS RoleName, COALESCE (sasr.SelfAssessmentReview, 1) AS SelfAssessmentReview, COALESCE (sasr.ResultsReview, 1) AS SupervisorResultsReview, COALESCE (sasr.RoleName, 'Supervisor') AS SupervisorRoleTitle, ca.StartedDate,
ca.LastAccessed, ca.CompleteByDate, ca.LaunchCount, ca.CompletedDate, npg.ProfessionalGroup, nsg.SubGroup, nr.RoleProfile, casv.ID AS CandidateAssessmentSupervisorVerificationId,
(SELECT COUNT(sas1.CompetencyID) AS CompetencyAssessmentQuestionCount
FROM SelfAssessmentStructure AS sas1 INNER JOIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace DigitalLearningSolutions.Web.Controllers.FrameworksController
{
public partial class FrameworksController
{
[Route("/Framework/{frameworkId}/Structure/Import")]
public IActionResult ImportCompetencies(int frameworkId)
[Route("/Framework/{frameworkId}/{tabname}/Import")]
public IActionResult ImportCompetencies(int frameworkId, string tabname)
{
var adminId = GetAdminId();
var userRole = frameworkService.GetAdminUserRoleForFrameworkId(adminId, frameworkId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function drawChart() {

const chart = new Chartist.Line('.ct-chart', chartData, options);

chart.on(
chart.on(
'draw',
// The type here is Chartist.ChartDrawData, but the type specification is missing getNode()
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -103,7 +103,7 @@ function drawChart() {
transform: `translate(${translateX} ${translateY}) rotate(${rotation} ${xOrigin - translateX} ${yOrigin})`,
});
}
},
},
);

const dataPointErrorContainer = getActivityGraphDataErrorElement();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ $light-blue: #8EBAFF;
text-align: right;
transform-origin: 100% 0;
transform: translate(-100%) rotate(-45deg);
position: fixed;

@include mq($until: tablet) {
transform: translate(-100%) rotate(-60deg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ else
<div class="nhsuk-grid-column-full">
<a class="nhsuk-button" asp-action="AddEditFrameworkCompetencyGroup" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])">Add @Model.VocabSingular().ToLower() group</a>
<a class="nhsuk-button nhsuk-button--secondary" asp-action="AddEditFrameworkCompetency" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])">Add ungrouped @Model.VocabSingular().ToLower()</a>
<a class="nhsuk-button nhsuk-button--secondary" asp-action="ImportCompetencies" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])">Import @Model.VocabPlural().ToLower() from Excel</a>
<a class="nhsuk-button nhsuk-button--secondary" asp-action="ImportCompetencies" asp-route-frameworkId="@(ViewContext.RouteData.Values["frameworkId"])" asp-route-tabname="@(ViewContext.RouteData.Values["tabname"])">Import @Model.VocabPlural().ToLower() from Excel</a>
</div>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@
}
</p>
<h2>@Model.SelfAssessment.SignOffRoleName Sign-off</h2>
<partial name="../../Supervisor/Shared/_SupervisorSignOffSummary.cshtml" model="Model.SupervisorSignOffs"
view-data="@(new ViewDataDictionary(ViewData) { { "reviewerCommentsLabel", (Model.SelfAssessment.ReviewerCommentsLabel == null ? "Comments": Model.SelfAssessment.ReviewerCommentsLabel) } })" />
<partial name="../../Supervisor/Shared/_SupervisorSignOffSummary.cshtml" model="Model.SupervisorSignOffs" />
@if (Model.AllQuestionsVerifiedOrNotRequired())
{
@if (!Model.SupervisorSignOffs.Any())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
}
<link rel="stylesheet" href="@Url.Content("~/css/learningPortal/selfAssessment.css")" asp-append-version="true">
<link rel="stylesheet" href="@Url.Content("~/css/shared/searchableElements/pagination.css")" asp-append-version="true">
<partial name="../../Supervisor/Shared/_SignOffHistory.cshtml" model="@Model.SupervisorSignOffs"
view-data="@(new ViewDataDictionary(ViewData) { {"reviewerCommentsLabel", (Model.SelfAssessment.ReviewerCommentsLabel == null ? "Comments": Model.SelfAssessment.ReviewerCommentsLabel) } })" />
<partial name="../../Supervisor/Shared/_SignOffHistory.cshtml" model="@Model.SupervisorSignOffs" />
<div class="nhsuk-back-link">
<a class="nhsuk-back-link__link" asp-action="SelfAssessmentOverview" asp-route-selfAssessmentId="@Model.SelfAssessment.Id" asp-route-vocabulary="@Model.VocabPlural()">
<svg class="nhsuk-icon nhsuk-icon__chevron-left" focusable='false' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</div>
<div class="nhsuk-summary-list__row">
<dt class="nhsuk-summary-list__key">
@(Model.SupervisorComment.ReviewerCommentsLabel == null ? "Reviewer comments": Model.SupervisorComment.ReviewerCommentsLabel.ToString())
Confirmer comments
</dt>
<dd class="nhsuk-summary-list__value">
@Model.SupervisorComment.Comments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
</legend>
<input name="ResultSupervisorVerificationId" type="hidden" asp-for="ResultSupervisorVerificationId" />
<nhs-form-group nhs-validation-for="SupervisorComments">
<vc:text-area asp-for="SupervisorComments" character-count="null" label=@(Model.DelegateSelfAssessment.ReviewerCommentsLabel == null ? "Reviewer comments": Model.DelegateSelfAssessment.ReviewerCommentsLabel.ToString()) rows="5" css-class="" hint-text="" populate-with-current-value="true" spell-check="false"></vc:text-area>
<vc:text-area asp-for="SupervisorComments" character-count="null" label="Reviewer comments" rows="5" css-class="" hint-text="" populate-with-current-value="true" spell-check="false"></vc:text-area>
</nhs-form-group>

<nhs-form-group nhs-validation-for="SignedOff">
Expand Down Expand Up @@ -228,7 +228,7 @@ else if (ViewContext.RouteData.Values["viewMode"].ToString() == "View" && Model.
{
<div class="nhsuk-summary-list__row">
<dt class="nhsuk-summary-list__key">
@(Model.DelegateSelfAssessment.ReviewerCommentsLabel == null ? "Reviewer comments": Model.DelegateSelfAssessment.ReviewerCommentsLabel.ToString())
Reviewer comments
</dt>
<dd class="nhsuk-summary-list__value">
@Html.Raw(Model.SupervisorComments)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@
{
<div class="nhsuk-u-margin-top-4">
<h3>Self Assessment Sign-off Status</h3>
<partial name="Shared/_SupervisorSignOffSummary" model="@Model.SupervisorSignOffs"
view-data="@(new ViewDataDictionary(ViewData) { { "reviewerCommentsLabel", (Model.DelegateSelfAssessment.ReviewerCommentsLabel == null ? "Comments": Model.DelegateSelfAssessment.ReviewerCommentsLabel) } })" />
<partial name="Shared/_SupervisorSignOffSummary" model="@Model.SupervisorSignOffs" />
</div>
}
@if (Model.CompetencyGroups.Any())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Status
</th>
<th role="columnheader" class="" scope="col">
@ViewData["reviewerCommentsLabel"]
Comments
</th>
</tr>
</thead>
Expand All @@ -38,7 +38,7 @@
<span class="nhsuk-tag nhsuk-tag--red">Rejected @supervisorSignOff.Verified.Value.ToShortDateString()</span>}
</td>
<td role="cell" class="nhsuk-table__cell">
<span class="nhsuk-table-responsive__heading">@ViewData["reviewerCommentsLabel"]</span>@supervisorSignOff.Comments
<span class="nhsuk-table-responsive__heading">Comments </span>@supervisorSignOff.Comments
</td>
</tr>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</div>
<div class="nhsuk-summary-list__row">
<dt class="nhsuk-summary-list__key">
@ViewData["reviewerCommentsLabel"]
Comments
</dt>
<dd class="nhsuk-summary-list__value">
@Model.FirstOrDefault().Comments
Expand Down
Loading