Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<govuk-notification-banner data-testid="open-alert-notification">
<p class="govuk-notification-banner__heading">
Alert on record.
<a class="govuk-notification-banner__link" href="@LinkGenerator.PersonAlerts(Model.PersonId)">View alerts.</a>
<a class="govuk-notification-banner__link" href="@LinkGenerator.PersonAlerts(Model.PersonId)">View alerts</a>
</p>
</govuk-notification-banner>
}
Expand Down Expand Up @@ -56,7 +56,7 @@
</govuk-summary-list-row>
}
<govuk-summary-list-row>
<govuk-summary-list-row-key>Qualified Teacher Learning and Skills status (QTLS)</govuk-summary-list-row-key>
<govuk-summary-list-row-key>Qualified teacher learning and skills status (QTLS)</govuk-summary-list-row-key>
<govuk-summary-list-row-value>@(Model.PersonProfessionalStatus.QtlsStatus == QtlsStatus.None ? "No" : Model.PersonProfessionalStatus.QtlsStatus.ToString())</govuk-summary-list-row-value>
</govuk-summary-list-row>
@if (Model.PersonProfessionalStatus.InductionStatus != InductionStatus.None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
@{
Layout = "_Layout";
ViewBag.Title = Model.TargetStatus == PersonStatus.Deactivated
? "Check details and deactivate record"
: "Check details and reactivate record";
? "Check details before deactivating record"
: "Check details before reactivating record";
var caption = Model.TargetStatus == PersonStatus.Deactivated
? $"Deactivate record - {Model.PersonName}"
: $"Reactivate record - {Model.PersonName}";
Expand All @@ -29,14 +29,14 @@
@if (Model.TargetStatus == PersonStatus.Deactivated)
{
<govuk-summary-list-row>
<govuk-summary-list-row-key>Reason for deactivating record</govuk-summary-list-row-key>
<govuk-summary-list-row-key>Reason</govuk-summary-list-row-key>
<govuk-summary-list-row-value>@Model.DeactivateReason?.GetDisplayName()</govuk-summary-list-row-value>
<govuk-summary-list-row-actions>
<govuk-summary-list-row-action data-testid="change-deactivate-reason-link" [email protected] visually-hidden-text="reason">Change</govuk-summary-list-row-action>
</govuk-summary-list-row-actions>
</govuk-summary-list-row>
<govuk-summary-list-row>
<govuk-summary-list-row-key>Reason details</govuk-summary-list-row-key>
<govuk-summary-list-row-key>More details</govuk-summary-list-row-key>
<govuk-summary-list-row-value>
@if (Model.DeactivateReasonDetail is not null)
{
Expand All @@ -55,14 +55,14 @@
else
{
<govuk-summary-list-row>
<govuk-summary-list-row-key>Reason for reactivating record</govuk-summary-list-row-key>
<govuk-summary-list-row-key>Reason</govuk-summary-list-row-key>
<govuk-summary-list-row-value>@Model.ReactivateReason?.GetDisplayName()</govuk-summary-list-row-value>
<govuk-summary-list-row-actions>
<govuk-summary-list-row-action data-testid="change-reactivate-reason-link" [email protected] visually-hidden-text="reason">Change</govuk-summary-list-row-action>
</govuk-summary-list-row-actions>
</govuk-summary-list-row>
<govuk-summary-list-row>
<govuk-summary-list-row-key>Reason details</govuk-summary-list-row-key>
<govuk-summary-list-row-key>More details</govuk-summary-list-row-key>
<govuk-summary-list-row-value>
@if (Model.ReactivateReasonDetail is not null)
{
Expand All @@ -79,7 +79,7 @@
</govuk-summary-list-row>
}
<govuk-summary-list-row>
<govuk-summary-list-row-key>Evidence uploaded</govuk-summary-list-row-key>
<govuk-summary-list-row-key>Evidence</govuk-summary-list-row-key>
<govuk-summary-list-row-value>
@if (Model.UploadedEvidenceFileUrl is not null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ EvidenceFileId is Guid fileId
await JourneyInstance!.CompleteAsync();

var action = TargetStatus == PersonStatus.Deactivated ? "deactivated" : "reactivated";
TempData.SetFlashSuccess(messageText: $"{PersonName}\u2019s record has been {action}.");
TempData.SetFlashSuccess($"{PersonName}\u2019s record has been {action}.");

return Redirect(LinkGenerator.PersonDetail(PersonId));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
@if (Model.Options.HasFlag(PersonDetailViewModelOptions.ShowEmail))
{
<govuk-summary-list-row>
<govuk-summary-list-row-key>Email</govuk-summary-list-row-key>
<govuk-summary-list-row-key>Email address</govuk-summary-list-row-key>
<govuk-summary-list-row-value use-empty-fallback>@Model.Email</govuk-summary-list-row-value>
</govuk-summary-list-row>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ public async Task Get_WhenFieldChanged_ShowsReasonAndEvidenceFile_AsExpected(Per
// Assert
var doc = await AssertEx.HtmlResponseAsync(response);

doc.AssertRow(targetStatus == PersonStatus.Deactivated
? "Reason for deactivating record"
: "Reason for reactivating record", v => Assert.Equal("Another reason", v.TrimmedText()));
doc.AssertRow("Reason details", v => Assert.Equal(_changeReasonDetails, v.TrimmedText()));
doc.AssertRow("Reason", v => Assert.Equal("Another reason", v.TrimmedText()));
doc.AssertRow("More details", v => Assert.Equal(_changeReasonDetails, v.TrimmedText()));
var expectedFileUrl = $"{TestScopedServices.FakeBlobStorageFileUrlBase}{evidenceFileId}";
doc.AssertRow("Evidence uploaded", v =>
doc.AssertRow("Evidence", v =>
{
var link = Assert.IsAssignableFrom<IHtmlAnchorElement>(v.QuerySelector("a"));
Assert.Equal("evidence.pdf (opens in new tab)", link.TrimmedText());
Expand Down Expand Up @@ -96,14 +94,14 @@ public async Task Get_WhenFieldChanged_ShowsMissingAdditionalDetailAndEvidenceFi

if (targetStatus == PersonStatus.Deactivated)
{
doc.AssertRow("Reason for deactivating record", v => Assert.Equal("The record holder died", v.TrimmedText()));
doc.AssertRow("Reason", v => Assert.Equal("The record holder died", v.TrimmedText()));
}
else
{
doc.AssertRow("Reason for reactivating record", v => Assert.Equal("The record was deactivated by mistake", v.TrimmedText()));
doc.AssertRow("Reason", v => Assert.Equal("The record was deactivated by mistake", v.TrimmedText()));
}
doc.AssertRow("Reason details", v => Assert.Equal("Not provided", v.TrimmedText()));
doc.AssertRows("Evidence uploaded", v => Assert.Equal("Not provided", v.TrimmedText()));
doc.AssertRow("More details", v => Assert.Equal("Not provided", v.TrimmedText()));
doc.AssertRows("Evidence", v => Assert.Equal("Not provided", v.TrimmedText()));
}

[Theory]
Expand Down Expand Up @@ -148,10 +146,10 @@ public async Task Post_Confirm_UpdatesPersonStatusCreatesEventCompletesJourneyAn

var redirectResponse = await response.FollowRedirectAsync(HttpClient);
var redirectDoc = await redirectResponse.GetDocumentAsync();
var expectedMessage = targetStatus == PersonStatus.Deactivated
var expectedHeading = targetStatus == PersonStatus.Deactivated
? "Lily The Pink\u2019s record has been deactivated."
: "Lily The Pink\u2019s record has been reactivated.";
AssertEx.HtmlDocumentHasFlashSuccess(redirectDoc, expectedMessage: expectedMessage);
AssertEx.HtmlDocumentHasFlashSuccess(redirectDoc, expectedHeading);

await WithDbContext(async dbContext =>
{
Expand Down
Loading