-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for showing MQ deleted events in change log (#1060)
- Loading branch information
Showing
12 changed files
with
404 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
<td class="govuk-table__cell" data-testid="[email protected]"><a href="@LinkGenerator.EditChangeRequest(changeRequestInfo.RequestReference)" class="govuk-link">@changeRequestInfo.RequestReference</a></td> | ||
<td class="govuk-table__cell" data-testid="[email protected]">@changeRequestInfo.Customer</td> | ||
<td class="govuk-table__cell" data-testid="[email protected]">@changeRequestInfo.ChangeType</td> | ||
<td class="govuk-table__cell" data-testid="[email protected]">@changeRequestInfo.CreatedOn.ToString("dd/MM/yyyy")</td> | ||
<td class="govuk-table__cell" data-testid="[email protected]">@changeRequestInfo.CreatedOn.ToString("d MMMM yyyy")</td> | ||
</tr> | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
.../src/TeachingRecordSystem.SupportUi/Pages/Persons/PersonDetail/Timeline/Events/DqtUser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace TeachingRecordSystem.SupportUi.Pages.Persons.PersonDetail.Timeline.Events; | ||
|
||
public record DqtUser | ||
{ | ||
public required Guid? UserId { get; set; } | ||
public required string? Name { get; set; } | ||
} |
62 changes: 62 additions & 0 deletions
62
...rtUi/Pages/Persons/PersonDetail/Timeline/Events/MandatoryQualificationDeletedEvent.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@using TeachingRecordSystem.Core.Events | ||
@using TeachingRecordSystem.Core.Services.Files | ||
@inject IFileService FileService | ||
@model TimelineItem<TimelineEvent<MandatoryQualificationDeletedEvent>> | ||
@{ | ||
var deletedEvent = Model.ItemModel.Event; | ||
var mandatoryQualification = deletedEvent.MandatoryQualification; | ||
var evidenceFileUrl = deletedEvent.EvidenceFile is not null ? await FileService.GetFileUrl(deletedEvent.EvidenceFile!.FileId, TimeSpan.FromMinutes(15)) : null; | ||
var raisedByUser = Model.ItemModel.RaisedByUser; | ||
var raisedBy = deletedEvent.RaisedBy.IsDqtUser ? (raisedByUser.DqtUser?.Name ?? "Unknown") : (raisedByUser.User?.Name) ?? "Unknown"; | ||
} | ||
|
||
<div class="moj-timeline__item govuk-!-padding-bottom-2" data-testid="timeline-item"> | ||
<div class="moj-timeline__header"> | ||
<h2 class="moj-timeline__title">Mandatory qualification deleted</h2> | ||
</div> | ||
<p class="moj-timeline__date"> | ||
<span data-testid="raised-by">By @raisedBy on</span> | ||
<time datetime="@deletedEvent.CreatedUtc.ToString("O")" data-testid="timeline-item-time"> | ||
@deletedEvent.CreatedUtc.ToString("dd MMMMM yyyy 'at' h:mm tt") | ||
</time> | ||
</p> | ||
<div class="moj-timeline__description"> | ||
<govuk-summary-list> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>Reason for deleting</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="deletion-reason">@(!string.IsNullOrEmpty(deletedEvent.DeletionReason) ? deletedEvent.DeletionReason : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>More detail about the reason for deleting</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="deletion-reason-detail"><multi-line-text text="@(!string.IsNullOrEmpty(deletedEvent.DeletionReasonDetail) ? deletedEvent.DeletionReasonDetail : "None")" /></govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>Training provider</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="provider">@(mandatoryQualification.Provider is not null ? mandatoryQualification.Provider.Name : "None" )</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>Specialism</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="specialism">@(mandatoryQualification.Specialism.HasValue ? mandatoryQualification.Specialism.Value.GetTitle() : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>Start date</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="start-date">@(mandatoryQualification.StartDate.HasValue ? mandatoryQualification.StartDate.Value.ToString("d MMMM yyyy") : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>Status</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="status">@(mandatoryQualification.Status.HasValue ? mandatoryQualification.Status.Value.GetTitle() : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>End date</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="end-date">@(mandatoryQualification.EndDate.HasValue ? mandatoryQualification.EndDate.Value.ToString("d MMMM yyyy") : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
</govuk-summary-list> | ||
|
||
@if (evidenceFileUrl is not null) | ||
{ | ||
<p class="govuk-body"> | ||
<a href="@evidenceFileUrl" class="govuk-link" rel="noreferrer noopener" target="_blank" data-testid="uploaded-evidence-link">@($"{deletedEvent.EvidenceFile!.Name} (opens in new tab)")</a> | ||
</p> | ||
} | ||
</div> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
...TeachingRecordSystem.SupportUi/Pages/Persons/PersonDetail/Timeline/Events/RaisedByUser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using TeachingRecordSystem.Core.DataStore.Postgres.Models; | ||
|
||
namespace TeachingRecordSystem.SupportUi.Pages.Persons.PersonDetail.Timeline.Events; | ||
|
||
public record RaisedByUser | ||
{ | ||
public required User? User { get; set; } | ||
public required DqtUser? DqtUser { get; set; } | ||
} |
10 changes: 10 additions & 0 deletions
10
...eachingRecordSystem.SupportUi/Pages/Persons/PersonDetail/Timeline/Events/TimelineEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using TeachingRecordSystem.Core.Events; | ||
|
||
namespace TeachingRecordSystem.SupportUi.Pages.Persons.PersonDetail.Timeline.Events; | ||
|
||
public record TimelineEvent(EventBase Event, RaisedByUser RaisedByUser); | ||
|
||
public record TimelineEvent<TEvent>(TEvent Event, RaisedByUser RaisedByUser) : TimelineEvent(Event, RaisedByUser) where TEvent : EventBase | ||
{ | ||
public new TEvent Event => (TEvent)base.Event; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.