diff --git a/src/Application/Features/Participants/DTOs/ConsentDto.cs b/src/Application/Features/Participants/DTOs/ConsentDto.cs index 5b271e16..37a0af7b 100644 --- a/src/Application/Features/Participants/DTOs/ConsentDto.cs +++ b/src/Application/Features/Participants/DTOs/ConsentDto.cs @@ -19,7 +19,6 @@ public Mapping() .ForMember(c => c.DocumentId, options => options.MapFrom(source => source.Document!.Id)) .ForMember(c => c.FileName, options => options.MapFrom(source => source.Document!.Title)) .ForMember(c => c.ConsentDate, options => options.MapFrom(source => source.Lifetime.StartDate)); - } } } diff --git a/src/Application/Features/Participants/DTOs/ExternalIdentifierDto.cs b/src/Application/Features/Participants/DTOs/ExternalIdentifierDto.cs new file mode 100644 index 00000000..67904fdf --- /dev/null +++ b/src/Application/Features/Participants/DTOs/ExternalIdentifierDto.cs @@ -0,0 +1,20 @@ +using Cfo.Cats.Domain.Entities.Participants; + +namespace Cfo.Cats.Application.Features.Participants.DTOs; + +public class ExternalIdentifierDto +{ + public string Type {get; set;} = default!; + public string Value {get;set;} = default!; + + private class Mapping : Profile + { + public Mapping() + { + CreateMap(MemberList.None) + .ForMember(x => x.Value, o => o.MapFrom(s => s.Value)) + .ForMember(x => x.Type, o => o.MapFrom(s => s.Type.Name)); + } + } + +} \ No newline at end of file diff --git a/src/Application/Features/Participants/DTOs/ParticipantDto.cs b/src/Application/Features/Participants/DTOs/ParticipantDto.cs index b4e8446f..4c1b7cfd 100644 --- a/src/Application/Features/Participants/DTOs/ParticipantDto.cs +++ b/src/Application/Features/Participants/DTOs/ParticipantDto.cs @@ -37,8 +37,12 @@ public class ParticipantDto public ParticipantNoteDto[] Notes { get; set; } = []; + public ExternalIdentifierDto[] ExternalIdentifiers {get;set;} = []; + public string TenantId { get; set; } = default!; - + + public string SupportWorker { get;set; } = default!; + private class Mapping : Profile { public Mapping() @@ -52,7 +56,10 @@ public Mapping() options => options.MapFrom(source => source.RightToWorks.ToArray())) .ForMember(target => target.Notes, options => options.MapFrom(source => source.Notes.ToArray())) - .ForMember(target => target.TenantId, options => options.MapFrom(s => s.Owner!.TenantId)); + .ForMember(target => target.TenantId, options => options.MapFrom(s => s.Owner!.TenantId)) + .ForMember(target => target.ExternalIdentifiers, options => options.MapFrom(s => s.ExternalIdentifiers.ToArray())) +#nullable disable + .ForMember(target => target.SupportWorker, options => options.MapFrom(source => source.Owner.DisplayName)); } } } diff --git a/src/Application/Features/QualityAssurance/DTOs/EnrolmentQaNoteDto.cs b/src/Application/Features/QualityAssurance/DTOs/EnrolmentQaNoteDto.cs index acb8e98a..ab0722ca 100644 --- a/src/Application/Features/QualityAssurance/DTOs/EnrolmentQaNoteDto.cs +++ b/src/Application/Features/QualityAssurance/DTOs/EnrolmentQaNoteDto.cs @@ -9,9 +9,10 @@ namespace Cfo.Cats.Application.Features.QualityAssurance.DTOs #nullable disable public class EnrolmentQaNoteDto { - public required DateTime Created {get;set;} - public required string Message { get;set; } - public required string CreatedBy { get;set; } + public required DateTime Created {get; set;} + public required string Message { get; set; } + public required string CreatedBy { get; set; } + public required string TenantName { get; set; } private class Mapper : Profile { @@ -21,7 +22,8 @@ public Mapper() CreateMap() .ForMember(target => target.CreatedBy, options => options.MapFrom(source=>source.CreatedByUser.DisplayName)) .ForMember(target => target.Message, options => options.MapFrom(source => source.Message)) - .ForMember(target => target.Created, options => options.MapFrom(source => source.Created)); + .ForMember(target => target.Created, options => options.MapFrom(source => source.Created)) + .ForMember(target => target.TenantName, options => options.MapFrom(source => source.CreatedByUser.TenantName)); } diff --git a/src/Domain/Common/Enums/EnrolmentStatus.cs b/src/Domain/Common/Enums/EnrolmentStatus.cs index a56e4784..97b859f8 100644 --- a/src/Domain/Common/Enums/EnrolmentStatus.cs +++ b/src/Domain/Common/Enums/EnrolmentStatus.cs @@ -53,7 +53,7 @@ public SubmittedToProvider() : base("Submitted to Provider", 1) { } protected override EnrolmentStatus[] GetAllowedTransitions() - => [ArchivedStatus, PendingStatus, SubmittedToAuthorityStatus]; + => [ArchivedStatus, EnrolmentConfirmedStatus, SubmittedToAuthorityStatus]; public override bool StatusSupportsReassessment() => false; diff --git a/src/Server.UI/Pages/QA/Enrolments/Components/AssessmentTabPanel.razor b/src/Server.UI/Pages/QA/Enrolments/Components/AssessmentTabPanel.razor new file mode 100644 index 00000000..4695e18f --- /dev/null +++ b/src/Server.UI/Pages/QA/Enrolments/Components/AssessmentTabPanel.razor @@ -0,0 +1,28 @@ +@using Cfo.Cats.Application.Features.Participants.DTOs +@using Cfo.Cats.Server.UI.Pages.Participants.Components + + + + + + @if (ParticipantDto.AssessmentJustification is not null) + { + + Justification + + @ParticipantDto.AssessmentJustification + + + } + + + + + +@code { + + [Parameter, EditorRequired] + public ParticipantDto ParticipantDto { get; set; } = default!; + + +} \ No newline at end of file diff --git a/src/Server.UI/Pages/QA/Enrolments/Components/ConsentTabPanel.razor b/src/Server.UI/Pages/QA/Enrolments/Components/ConsentTabPanel.razor new file mode 100644 index 00000000..fa3da8b8 --- /dev/null +++ b/src/Server.UI/Pages/QA/Enrolments/Components/ConsentTabPanel.razor @@ -0,0 +1,44 @@ +@using Cfo.Cats.Application.Features.Documents.Queries +@using Cfo.Cats.Application.Features.Participants.DTOs + + + + + @foreach (var consent in ParticipantDto.Consents.OrderByDescending(c => c.ConsentDate)) + { + + @consent.FileName (@consent.ConsentDate.ToShortDateString()) + + } + + + @if (_selectedDocument != Guid.Empty) + { + + + } + + + + +@code { + + private Guid _selectedDocument = Guid.Empty; + + [Parameter] [EditorRequired] + public ParticipantDto ParticipantDto { get; set; } = default!; + + protected override void OnInitialized() + { + if (_selectedDocument == Guid.Empty) + { + var latest = ParticipantDto.Consents.MaxBy(c => c.ConsentDate); + if (latest is not null) + { + _selectedDocument = latest.DocumentId.GetValueOrDefault(); + } + } + } + + +} \ No newline at end of file diff --git a/src/Server.UI/Pages/QA/Enrolments/Components/DocumentDisplay.razor b/src/Server.UI/Pages/QA/Enrolments/Components/DocumentDisplay.razor new file mode 100644 index 00000000..618c51d6 --- /dev/null +++ b/src/Server.UI/Pages/QA/Enrolments/Components/DocumentDisplay.razor @@ -0,0 +1,68 @@ +@using Cfo.Cats.Application.Features.Documents.Queries +@inherits CatsComponentBase + + + @if (fileBase64 != null && extension!.Equals("pdf", StringComparison.CurrentCultureIgnoreCase)) + { + +

PDF cannot be displayed.

+
+ } + else if (IsFileRejected) + { + + File cannot be displayed. Please contact support. + + } + else + { + + Please select a file to display + + } +
+ +@code { + + private string? fileBase64; + private string? extension; + + private bool IsFileRejected { get; set; } + + [Parameter] + public Guid DocumentId { get; set; } + + private Guid _previous = Guid.Empty; + + protected override async Task OnParametersSetAsync() + { + if (_previous != DocumentId) + { + var query = new GetDocumentById.Query + { + Id = DocumentId + }; + + var result = await GetNewMediator().Send(query); + if (result.Succeeded) + { + _previous = DocumentId; + IsFileRejected = false; + using (var memoryStream = new MemoryStream()) + { + await result.Data!.FileStream.CopyToAsync(memoryStream); + var bytes = memoryStream.ToArray(); + fileBase64 = Convert.ToBase64String(bytes); + } + extension = result.Data!.FileExtension; + } + else + { + IsFileRejected = true; + } + } + } + + + +} \ No newline at end of file diff --git a/src/Server.UI/Pages/QA/Enrolments/Components/ParticipantQaDetails.razor b/src/Server.UI/Pages/QA/Enrolments/Components/ParticipantQaDetails.razor new file mode 100644 index 00000000..1a05e025 --- /dev/null +++ b/src/Server.UI/Pages/QA/Enrolments/Components/ParticipantQaDetails.razor @@ -0,0 +1,73 @@ +@using Cfo.Cats.Application.Features.Participants.DTOs + + + + + Participant Confirmation + + + + @foreach (var item in Participant.ExternalIdentifiers) + { + + @item.Type + @item.Value + + } + + First Name + @Participant.FirstName + + + Last Name + @Participant.LastName + + + + Date Of Birth + + + @Participant.DateOfBirth + + + + + Delivery Location + @Participant.EnrolmentLocation?.Name + + @if (Participant.EnrolmentLocationJustification is not null) + { + + System Location + @Participant.CurrentLocation?.Name + + + Justification + @Participant.EnrolmentLocationJustification + + } + + + Staff Member Confirmation + + + + + Staff Member + @Participant.SupportWorker + + + Consent Date + @Participant.Consents.Max(c => c.ConsentDate).ToShortDateString() + + + + + + +@code{ + + [Parameter, EditorRequired] + public ParticipantDto Participant { get; set; } = default!; + +} \ No newline at end of file diff --git a/src/Server.UI/Pages/QA/Enrolments/Components/QaNotes.razor b/src/Server.UI/Pages/QA/Enrolments/Components/QaNotes.razor index 7993a61b..eacf14ea 100644 --- a/src/Server.UI/Pages/QA/Enrolments/Components/QaNotes.razor +++ b/src/Server.UI/Pages/QA/Enrolments/Components/QaNotes.razor @@ -1,4 +1,4 @@ -@inherits CatsComponentBase + @inherits CatsComponentBase @using System.Globalization @using ActualLab.Fusion.Extensions @@ -9,24 +9,25 @@ @if (_notes is { Length: > 0 }) { - - - Created By - Created Date - Message - - - @context.CreatedBy - - - @context.Created.Humanize() + + @foreach (var note in _notes.OrderByDescending(n => n.Created)) + { + + + + + + @note.Message + + + @note.CreatedBy (@note.TenantName) @note.Created.Humanize() + + + - - - @context.Message - - - + + } + } diff --git a/src/Server.UI/Pages/QA/Enrolments/Components/RightToWorkTabPanel.razor b/src/Server.UI/Pages/QA/Enrolments/Components/RightToWorkTabPanel.razor new file mode 100644 index 00000000..83a24d43 --- /dev/null +++ b/src/Server.UI/Pages/QA/Enrolments/Components/RightToWorkTabPanel.razor @@ -0,0 +1,45 @@ +@using Cfo.Cats.Application.Features.Documents.Queries +@using Cfo.Cats.Application.Features.Participants.DTOs +@inherits CatsComponentBase + + + + @foreach (var rtw in ParticipantDto.RightToWorks.OrderByDescending(c => c.ValidFrom)) + { + + @rtw.FileName (@rtw.ValidFrom.ToShortDateString()) + + } + + +@if (_selectedDocument != Guid.Empty) +{ + + +} + + + + + +@code{ + + private Guid _selectedDocument = Guid.Empty; + + [Parameter] [EditorRequired] + public ParticipantDto ParticipantDto { get; set; } = default!; + + protected override void OnInitialized() + { + if (_selectedDocument == Guid.Empty) + { + var latest = ParticipantDto.RightToWorks.MaxBy(c => c.ValidFrom); + if (latest is not null) + { + _selectedDocument = latest.DocumentId.GetValueOrDefault(); + } + } + } + + +} \ No newline at end of file diff --git a/src/Server.UI/Pages/QA/Enrolments/PQA.razor b/src/Server.UI/Pages/QA/Enrolments/PQA.razor index 418d4ade..147575a6 100644 --- a/src/Server.UI/Pages/QA/Enrolments/PQA.razor +++ b/src/Server.UI/Pages/QA/Enrolments/PQA.razor @@ -1,6 +1,7 @@ @page "/pages/qa/enrolments/pqa/{id:guid}" -@using Cfo.Cats.Application.Features.Documents.Queries +@attribute [Authorize(Policy = SecurityPolicies.Pqa)] + @using Cfo.Cats.Application.Features.Participants.DTOs @using Cfo.Cats.Application.Features.Participants.Queries @using Cfo.Cats.Application.Features.QualityAssurance.Commands @@ -9,15 +10,13 @@ @using Cfo.Cats.Application.SecurityConstants @using Cfo.Cats.Domain.Common.Enums @using Cfo.Cats.Server.UI.Pages.QA.Enrolments.Components - -@attribute [Authorize(Policy = SecurityPolicies.Pqa)] - +@using Cfo.Cats.Server.UI.Pages.Participants.Components @inherits CatsComponentBase @if (_participantDto is not null && _participantDto.EnrolmentStatus == EnrolmentStatus.SubmittedToProviderStatus) -{ - @if (_queueEntry!.IsAccepted) +{ + @if (_queueEntry!.IsAccepted || _queueEntry.IsCompleted) { This entry has already been processed } - + - - Participant - - - - - - - - - @if (_participantDto.EnrolmentLocation is not null) - { - - } - @if (_participantDto.EnrolmentLocationJustification is not null) - { - - } - - @if (_participantDto.AssessmentJustification is not null) - { - - } + + - @if (_participantDto.Consents.Length > 0) + + + + + + + + + + + + + + + + + @if (_queueEntry.IsCompleted == false) { - - + + + + + Accept + + + Return + + + + + + + + Submit + } - - - @if (_participantDto.RightToWorks.Length > 0) + else { - - - @if (_participantDto.RightToWorks[0].ValidTo.Date == new DateTime(9999, 12, 31)) - { - Indefinite - } - else - { - - } - + + This entry has already been processed + } - - - @foreach (var consent in _participantDto.Consents) - { - - @consent.FileName - - } - - @if (_participantDto.RightToWorks is []) - { - - No right to work provided - - } - - @foreach (var rtw in _participantDto.RightToWorks) - { - - @rtw.FileName - - } - - - @if (_queueEntry.IsCompleted == false) - { - - - - - - - - Accept - - - Return - - - - - - - - Submit - - } - - - - - - - @if (fileBase64 != null && extension!.Equals("pdf", StringComparison.CurrentCultureIgnoreCase)) - { - -

PDF cannot be displayed.

-
- } - else if(IsFileRejected) - { - - File cannot be displayed. Please contact support. - - } - else - { - - Please select a file to display - - } -
+ +
} @code { private MudForm? _form; - private EnrolmentQueueEntryDto? _queueEntry = null; - private ParticipantDto? _participantDto = null; - - private bool IsFileRejected {get; set;} + private EnrolmentQueueEntryDto? _queueEntry; + private ParticipantDto? _participantDto; [Parameter] public Guid Id { get; set; } [CascadingParameter] - public UserProfile? UserProfile { get; set; } = null!; - - protected Guid SelectedDocument { get; set; } = Guid.Empty; - - private string? fileBase64; - private string? extension; + public UserProfile? UserProfile { get; set; } private SubmitPqaResponse.Command Command { get; set; } = default!; @@ -198,7 +113,7 @@ { if (_participantDto is null) { - var result = await GetNewMediator().Send(new GetPqaEntryById.Query() + var result = await GetNewMediator().Send(new GetPqaEntryById.Query { Id = Id, CurrentUser = UserProfile @@ -207,18 +122,18 @@ if (result.Succeeded) { _queueEntry = result.Data!; - _participantDto = await GetNewMediator().Send(new GetParticipantById.Query() + _participantDto = await GetNewMediator().Send(new GetParticipantById.Query { Id = _queueEntry.ParticipantId }); - Command = new SubmitPqaResponse.Command() + Command = new SubmitPqaResponse.Command { QueueEntryId = Id, CurrentUser = UserProfile }; } - StateHasChanged(); + StateHasChanged(); } } @@ -229,20 +144,20 @@ { var result = await GetNewMediator().Send(Command); - string message = Command.Accept.GetValueOrDefault() ? "Participant submitted to QA" : "Participant returned to Support Worker"; - + var message = Command.Accept.GetValueOrDefault() ? "Participant submitted to QA" : "Participant returned to Support Worker"; + if (result.Succeeded) { Snackbar.Add(message, Severity.Info); - Navigation.NavigateTo("/pages/qa/enrolments/pqa"); + Navigation.NavigateTo("/pages/qa/enrolments/pqa"); } else { ShowActionFailure("Failed to return to support worker", result); } - } + } } - + private void ShowActionFailure(string title, IResult result) { Snackbar.Add( @@ -258,34 +173,8 @@ , Severity.Error, options => { options.RequireInteraction = true; options.SnackbarVariant = Variant.Text; - } ); + }); } - private async Task OnSelectedDocumentChanged(Guid documentId) - { - if (documentId != Guid.Empty) - { - var query = new GetDocumentById.Query() - { - Id = documentId - }; - - var result = await GetNewMediator().Send(query); - if(result.Succeeded) - { - IsFileRejected = false; - using (var memoryStream = new MemoryStream()) - { - await result.Data!.FileStream.CopyToAsync(memoryStream); - var bytes = memoryStream.ToArray(); - fileBase64 = Convert.ToBase64String(bytes); - } - extension = result.Data!.FileExtension; - } - else - { - IsFileRejected = true; - } - } - } + } \ No newline at end of file diff --git a/src/Server.UI/Pages/QA/Enrolments/PqaList.razor b/src/Server.UI/Pages/QA/Enrolments/PqaList.razor index 3b8112b3..2361e1e8 100644 --- a/src/Server.UI/Pages/QA/Enrolments/PqaList.razor +++ b/src/Server.UI/Pages/QA/Enrolments/PqaList.razor @@ -14,9 +14,15 @@ .mud-table-toolbar { height: 120px !important; } + + .pointer-cursor { + cursor: pointer; + } +
+
+ Provider QA +
@@ -56,19 +67,7 @@
- - - - - - @ConstantString.View - - - - - +
@@ -104,6 +103,14 @@
+ @* + + + @ConstantString.View + + + + *@
@@ -125,6 +132,11 @@ Navigation.NavigateTo($"/pages/qa/enrolments/pqa/{dto.Id}"); } + private void RowClicked(DataGridRowClickEventArgs args) + { + Navigation.NavigateTo($"/pages/qa/enrolments/pqa/{args.Item.Id}"); + } + private async Task> ServerReload(GridState state) { try diff --git a/src/Server.UI/Pages/QA/Enrolments/QA1.razor b/src/Server.UI/Pages/QA/Enrolments/QA1.razor index 29c7dbcd..c81c6a0c 100644 --- a/src/Server.UI/Pages/QA/Enrolments/QA1.razor +++ b/src/Server.UI/Pages/QA/Enrolments/QA1.razor @@ -8,6 +8,7 @@ @using Cfo.Cats.Application.SecurityConstants @using Cfo.Cats.Domain.Common.Enums @using Cfo.Cats.Server.UI.Pages.QA.Enrolments.Components +@using Cfo.Cats.Server.UI.Pages.Participants.Components @inherits CatsComponentBase @@ -32,7 +33,7 @@ margin-bottom: 0.5rem; } - + CFO Enrolment Queue First Pass @@ -55,92 +56,31 @@ } - + - - Participant - - - - - - - - - @if (_participantDto.EnrolmentLocation is not null) - { - - } - @if (_participantDto.EnrolmentLocationJustification is not null) - { - - } - - @if (_participantDto.AssessmentJustification is not null) - { - - } - - @if (_participantDto.Consents.Length > 0) - { - - - } - - - @if (_participantDto.RightToWorks.Length > 0) - { - - - @if (_participantDto.RightToWorks[0].ValidTo.Date == new DateTime(9999, 12, 31)) - { - Indefinite - } - else - { - - } - - } - - - @foreach (var consent in _participantDto.Consents) - { - - @consent.FileName - - } - - @if (_participantDto.RightToWorks is []) - { - - No right to work provided - - } - - @foreach (var rtw in _participantDto.RightToWorks) + + + + + + + + + + + + + + + + + + + @if (_queueEntry.IsCompleted == false) { - - @rtw.FileName - - } - - - @if (_queueEntry.IsCompleted == false) - { - - - + Accept @@ -150,44 +90,20 @@ - + Submit - - } - - - - - - - - - - - - - @if (fileBase64 != null && extension!.Equals("pdf", StringComparison.CurrentCultureIgnoreCase)) - { - -

PDF cannot be displayed.

-
- } - else if (IsFileRejected) - { - - File cannot be displayed. Please contact support. - - } - else - { - - Please select a file to display - - } -
+ } + else + { + + This entry has already been processed + + } + +
} @@ -202,16 +118,9 @@ private EnrolmentQueueEntryDto? _queueEntry = null; private ParticipantDto? _participantDto = null; - private bool IsFileRejected { get; set; } - [CascadingParameter] public UserProfile? UserProfile { get; set; } = null!; - protected Guid SelectedDocument { get; set; } = Guid.Empty; - - private string? fileBase64; - private string? extension; - private SubmitQa1Response.Command Command { get; set; } = default!; private async Task GetQueueItem() @@ -265,48 +174,19 @@ private void ShowActionFailure(string title, IResult result) { Snackbar.Add( - @
-

@title

-
    - @foreach (var e in result.Errors) - { -
  • @e
  • - } -
-
-, Severity.Error, options => -{ - options.RequireInteraction = true; - options.SnackbarVariant = Variant.Text; -}); - } - - private async Task OnSelectedDocumentChanged(Guid documentId) - { - if (documentId != Guid.Empty) - { - var query = new GetDocumentById.Query() - { - Id = documentId - }; - - var result = await GetNewMediator().Send(query); - - if (result.Succeeded) - { - IsFileRejected = false; - using (var memoryStream = new MemoryStream()) + @
+

@title

+
    + @foreach (var e in result.Errors) { - await result.Data!.FileStream.CopyToAsync(memoryStream); - var bytes = memoryStream.ToArray(); - fileBase64 = Convert.ToBase64String(bytes); +
  • @e
  • } - extension = result.Data!.FileExtension; - } - else - { - IsFileRejected = true; - } - } +
+
+ , Severity.Error, options => { + options.RequireInteraction = true; + options.SnackbarVariant = Variant.Text; + }); } + } \ No newline at end of file diff --git a/src/Server.UI/Pages/QA/Enrolments/QA2.razor b/src/Server.UI/Pages/QA/Enrolments/QA2.razor index fcacd0d2..ff951893 100644 --- a/src/Server.UI/Pages/QA/Enrolments/QA2.razor +++ b/src/Server.UI/Pages/QA/Enrolments/QA2.razor @@ -8,6 +8,7 @@ @using Cfo.Cats.Application.SecurityConstants @using Cfo.Cats.Domain.Common.Enums @using Cfo.Cats.Server.UI.Pages.QA.Enrolments.Components +@using Cfo.Cats.Server.UI.Pages.Participants.Components @inherits CatsComponentBase @@ -32,7 +33,7 @@ margin-bottom: 0.5rem; } - + CFO Enrolment Queue Second Pass @@ -55,92 +56,31 @@ } - + - - Participant - - - - - - - - - @if (_participantDto.EnrolmentLocation is not null) - { - - } - @if (_participantDto.EnrolmentLocationJustification is not null) - { - - } - - @if (_participantDto.AssessmentJustification is not null) - { - - } - - @if (_participantDto.Consents.Length > 0) - { - - - } - - - @if (_participantDto.RightToWorks.Length > 0) - { - - - @if (_participantDto.RightToWorks[0].ValidTo.Date == new DateTime(9999, 12, 31)) - { - Indefinite - } - else - { - - } - - } - - - @foreach (var consent in _participantDto.Consents) - { - - @consent.FileName - - } - - @if (_participantDto.RightToWorks is []) - { - - No right to work provided - - } - - @foreach (var rtw in _participantDto.RightToWorks) + + + + + + + + + + + + + + + + + + + @if (_queueEntry.IsCompleted == false) { - - @rtw.FileName - - } - - - @if (_queueEntry.IsCompleted == false) - { - - - + Accept @@ -150,37 +90,20 @@ - + Submit - - } - - - - - - @if (fileBase64 != null && extension!.Equals("pdf", StringComparison.CurrentCultureIgnoreCase)) - { - -

PDF cannot be displayed.

-
- } - else if (IsFileRejected) - { - - File cannot be displayed. Please contact support. - - } - else - { - - Please select a file to display - - } -
+ } + else + { + + This entry has already been processed + + } + +
} @@ -195,16 +118,9 @@ private EnrolmentQueueEntryDto? _queueEntry = null; private ParticipantDto? _participantDto = null; - private bool IsFileRejected { get; set; } - [CascadingParameter] public UserProfile? UserProfile { get; set; } = null!; - protected Guid SelectedDocument { get; set; } = Guid.Empty; - - private string? fileBase64; - private string? extension; - private SubmitQa2Response.Command Command { get; set; } = default!; private async Task GetQueueItem() @@ -259,47 +175,19 @@ private void ShowActionFailure(string title, IResult result) { Snackbar.Add( - @
-

@title

-
    - @foreach (var e in result.Errors) - { -
  • @e
  • - } -
-
-, Severity.Error, options => -{ - options.RequireInteraction = true; - options.SnackbarVariant = Variant.Text; -}); - } - - private async Task OnSelectedDocumentChanged(Guid documentId) - { - if (documentId != Guid.Empty) - { - var query = new GetDocumentById.Query() - { - Id = documentId - }; - - var result = await GetNewMediator().Send(query); - if (result.Succeeded) - { - IsFileRejected = false; - using (var memoryStream = new MemoryStream()) + @
+

@title

+
    + @foreach (var e in result.Errors) { - await result.Data!.FileStream.CopyToAsync(memoryStream); - var bytes = memoryStream.ToArray(); - fileBase64 = Convert.ToBase64String(bytes); +
  • @e
  • } - extension = result.Data!.FileExtension; - } - else - { - IsFileRejected = true; - } - } +
+
+ , Severity.Error, options => { + options.RequireInteraction = true; + options.SnackbarVariant = Variant.Text; + }); } + } \ No newline at end of file