Skip to content

Commit

Permalink
Make First-Pass internal only
Browse files Browse the repository at this point in the history
  • Loading branch information
samgibsonmoj authored and carlsixsmith-moj committed Oct 17, 2024
1 parent 63312f4 commit c2889c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class Command : IRequest<Result>

public string Message { get; set; } = default!;

public bool IsMessageExternal { get; set; }
public UserProfile? CurrentUser { get; set; }
}

Expand All @@ -33,7 +32,7 @@ public async Task<Result> Handle(Command request, CancellationToken cancellation
return Result.Failure("Cannot find queue item");
}

entry.AddNote(request.Message, request.IsMessageExternal);
entry.AddNote(request.Message, isExternal: false);

if (request.Accept.GetValueOrDefault())
{
Expand Down
47 changes: 11 additions & 36 deletions src/Server.UI/Pages/QA/Enrolments/QA1.razor
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,12 @@

<MudDivider Class="py-4" />

@if (Command.IsMessageExternal)
{
<MudAlert Severity="Severity.Warning" Variant="Variant.Outlined">
This comment will be visible to PQA (and internal members of CFO staff)
</MudAlert>
}
else
{
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined">
This comment will only be visible to internal members of CFO staff
</MudAlert>
}
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined">
This comment will only be visible to internal members of CFO staff
</MudAlert>

<MudGrid Class="py-4">
<MudItem Class="d-flex align-center" xs="12" md="3" xl="2">
<MudSwitch @bind-Value="Command.IsMessageExternal"
For="() => Command.IsMessageExternal"
Label="External"
Color="Color.Primary" />
</MudItem>
<MudItem xs="12" md="9" xl="10">
<MudItem xs="12">
<MudTextField @bind-Value="Command.Message" Label="Message" Lines="5" For="() => Command.Message" MaxLength="@ValidationConstants.NotesLength" Immediate="true" oninput="UpdateCharacterCount" />
<MudText Class="ml-2">Characters: @characterCount / 1000</MudText>
</MudItem>
Expand Down Expand Up @@ -190,28 +175,18 @@
return;
}

bool submit = true;
var result = await GetNewMediator().Send(Command);

if (Command is { IsMessageExternal: true, Message.Length: > 0 })
if (result.Succeeded)
{
submit = await warningMessage!.ShowAsync();
Snackbar.Add("Participant submitted to QA2", Severity.Info);
Navigation.NavigateTo("/pages/qa/enrolments/qa1", true);
}

if(submit)
else
{
var result = await GetNewMediator().Send(Command);

if (result.Succeeded)
{
Snackbar.Add("Participant submitted to QA2", Severity.Info);
Navigation.NavigateTo("/pages/qa/enrolments/qa1", true);
}
else
{
ShowActionFailure("Failed to submit", result);
}
ShowActionFailure("Failed to submit", result);
}

}

private void ShowActionFailure(string title, IResult result)
Expand Down

0 comments on commit c2889c7

Please sign in to comment.