From fe6b7dc1e3e6cb46d1137d19a770a0ca54cbd961 Mon Sep 17 00:00:00 2001 From: Umar Bolatov Date: Mon, 11 Apr 2022 01:53:52 -0700 Subject: [PATCH] Fix visual bug when user clicks on "Create refund" without selecting an option (#3624) * Add missing refund option validation error element * Add missing hidden inputs for text elements * Move validation element above button * Update validation error message --- BTCPayServer/Controllers/UIInvoiceController.UI.cs | 2 +- BTCPayServer/Views/UIInvoice/Refund.cshtml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Controllers/UIInvoiceController.UI.cs b/BTCPayServer/Controllers/UIInvoiceController.UI.cs index 4c68e454a..2f5c92cb1 100644 --- a/BTCPayServer/Controllers/UIInvoiceController.UI.cs +++ b/BTCPayServer/Controllers/UIInvoiceController.UI.cs @@ -311,7 +311,7 @@ namespace BTCPayServer.Controllers model.RefundStep = RefundSteps.SelectCustomAmount; return View(model); default: - ModelState.AddModelError(nameof(model.SelectedRefundOption), "Invalid choice"); + ModelState.AddModelError(nameof(model.SelectedRefundOption), "Please select an option before proceeding"); return View(model); } diff --git a/BTCPayServer/Views/UIInvoice/Refund.cshtml b/BTCPayServer/Views/UIInvoice/Refund.cshtml index d736fb471..e8f9ed2e7 100644 --- a/BTCPayServer/Views/UIInvoice/Refund.cshtml +++ b/BTCPayServer/Views/UIInvoice/Refund.cshtml @@ -13,6 +13,10 @@
+ + + + @switch (Model.RefundStep) { case RefundSteps.SelectPaymentMethod: @@ -59,6 +63,9 @@ The specified amount with the specified currency, at the rate when the refund will be sent. +
+ +