From 56cbc8d96e530eb38e4ab905639c4512febefb55 Mon Sep 17 00:00:00 2001 From: samgibsonmoj Date: Mon, 19 Aug 2024 13:26:54 +0100 Subject: [PATCH] Validation fixes for QA screens --- .../Features/QualityAssurance/Commands/SubmitPqaResponse.cs | 6 ++---- .../Features/QualityAssurance/Commands/SubmitQa1Response.cs | 4 +--- .../Features/QualityAssurance/Commands/SubmitQa2Response.cs | 4 +--- src/Server.UI/Pages/QA/Enrolments/PQA.razor | 4 ++-- src/Server.UI/Pages/QA/Enrolments/QA1.razor | 4 ++-- src/Server.UI/Pages/QA/Enrolments/QA2.razor | 4 ++-- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/Application/Features/QualityAssurance/Commands/SubmitPqaResponse.cs b/src/Application/Features/QualityAssurance/Commands/SubmitPqaResponse.cs index fe3d3bc4..14f606a8 100644 --- a/src/Application/Features/QualityAssurance/Commands/SubmitPqaResponse.cs +++ b/src/Application/Features/QualityAssurance/Commands/SubmitPqaResponse.cs @@ -44,16 +44,14 @@ public A_IsValidRequest() .NotNull() .WithMessage("You must accept or return the request"); - When(x => x.Accept == false, () => { + When(x => x.Accept is false, () => + { RuleFor(x => x.Message) - .NotNull() - .WithMessage("A message is required when returning") .NotEmpty() .WithMessage("A message is required when returning") .Matches(ValidationConstants.Notes) .WithMessage(string.Format(ValidationConstants.NotesMessage, "Message")); }); - } } diff --git a/src/Application/Features/QualityAssurance/Commands/SubmitQa1Response.cs b/src/Application/Features/QualityAssurance/Commands/SubmitQa1Response.cs index 93f1a31b..00e68891 100644 --- a/src/Application/Features/QualityAssurance/Commands/SubmitQa1Response.cs +++ b/src/Application/Features/QualityAssurance/Commands/SubmitQa1Response.cs @@ -44,10 +44,8 @@ public A_IsValidRequest() .NotNull() .WithMessage("You must accept or return the request"); - When(x => x.Accept == false, () => { + When(x => x.Accept is false, () => { RuleFor(x => x.Message) - .NotNull() - .WithMessage("A message is required when returning") .NotEmpty() .WithMessage("A message is required when returning") .Matches(ValidationConstants.Notes) diff --git a/src/Application/Features/QualityAssurance/Commands/SubmitQa2Response.cs b/src/Application/Features/QualityAssurance/Commands/SubmitQa2Response.cs index fdc408e8..1994f087 100644 --- a/src/Application/Features/QualityAssurance/Commands/SubmitQa2Response.cs +++ b/src/Application/Features/QualityAssurance/Commands/SubmitQa2Response.cs @@ -44,10 +44,8 @@ public A_IsValidRequest() .NotNull() .WithMessage("You must accept or return the request"); - When(x => x.Accept == false, () => { + When(x => x.Accept is false, () => { RuleFor(x => x.Message) - .NotNull() - .WithMessage("A message is required when returning") .NotEmpty() .WithMessage("A message is required when returning") .Matches(ValidationConstants.Notes) diff --git a/src/Server.UI/Pages/QA/Enrolments/PQA.razor b/src/Server.UI/Pages/QA/Enrolments/PQA.razor index 8092cdf9..8eab774b 100644 --- a/src/Server.UI/Pages/QA/Enrolments/PQA.razor +++ b/src/Server.UI/Pages/QA/Enrolments/PQA.razor @@ -87,7 +87,7 @@ { - + Accept @@ -97,7 +97,7 @@ - + Submit diff --git a/src/Server.UI/Pages/QA/Enrolments/QA1.razor b/src/Server.UI/Pages/QA/Enrolments/QA1.razor index 19f3effe..42314285 100644 --- a/src/Server.UI/Pages/QA/Enrolments/QA1.razor +++ b/src/Server.UI/Pages/QA/Enrolments/QA1.razor @@ -87,7 +87,7 @@ { - + Accept @@ -97,7 +97,7 @@ - + Submit diff --git a/src/Server.UI/Pages/QA/Enrolments/QA2.razor b/src/Server.UI/Pages/QA/Enrolments/QA2.razor index f885f502..0b2b43e7 100644 --- a/src/Server.UI/Pages/QA/Enrolments/QA2.razor +++ b/src/Server.UI/Pages/QA/Enrolments/QA2.razor @@ -96,8 +96,8 @@ - - + + Submit