From ead0f284f247a716389f742d443bbf953a7e1c84 Mon Sep 17 00:00:00 2001 From: dstrukt Date: Sun, 21 Nov 2021 20:57:20 -0800 Subject: [PATCH] Simple Invoice Detail View Cleanup (#3100) * changes copy to "unarchive", more clear * adds semibold custom class * adds class to TH elements & uppercases labels * whitespace and padding patches * uppercase patches * removes class in site.css + updates class name * Fix test Co-authored-by: Dennis Reimann --- BTCPayServer.Tests/SeleniumTests.cs | 4 +- BTCPayServer/Views/Invoice/Invoice.cshtml | 150 +++++++++++----------- 2 files changed, 76 insertions(+), 78 deletions(-) diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 32659c933..c46f507c7 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -411,7 +411,7 @@ namespace BTCPayServer.Tests //let's test archiving an invoice Assert.DoesNotContain("Archived", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text); s.Driver.FindElement(By.Id("btn-archive-toggle")).Click(); - Assert.Contains("Archived", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text); + Assert.Contains("Unarchive", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text); //check that it no longer appears in list s.GoToInvoices(); @@ -420,7 +420,7 @@ namespace BTCPayServer.Tests s.Driver.Navigate().GoToUrl(invoiceUrl); s.Driver.FindElement(By.Id("btn-archive-toggle")).Click(); s.FindAlertMessage(); - Assert.DoesNotContain("Archived", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text); + Assert.DoesNotContain("Unarchive", s.Driver.FindElement(By.Id("btn-archive-toggle")).Text); s.GoToInvoices(); Assert.Contains(invoiceId, s.Driver.PageSource); diff --git a/BTCPayServer/Views/Invoice/Invoice.cshtml b/BTCPayServer/Views/Invoice/Invoice.cshtml index 35216c49b..0119e3a0f 100644 --- a/BTCPayServer/Views/Invoice/Invoice.cshtml +++ b/BTCPayServer/Views/Invoice/Invoice.cshtml @@ -46,8 +46,7 @@
- -
+

@ViewData["Title"]

@@ -58,24 +57,23 @@ Checkout } - @if (Model.CanRefund) { - Issue refund + Issue Refund } else { - + } -
+
@@ -83,20 +81,20 @@
-
-
+
+

Invoice Information

- +
- + - + - + - + - + - + - + - + - + - + @if (!string.IsNullOrEmpty(Model.RefundEmail)) { - + } @if (!string.IsNullOrEmpty(Model.NotificationUrl)) { - + } @if (!string.IsNullOrEmpty(Model.RedirectUrl)) { - + }
StoreStore @Model.StoreName
Invoice IdInvoice Id @Model.Id
Order IdOrder Id @if (string.IsNullOrEmpty(Model.TypedMetadata.OrderUrl)) { @@ -118,11 +116,11 @@
Payment Request IdPayment Request Id @Model.TypedMetadata.PaymentRequestId
StateState @if (Model.CanMarkStatus) { @@ -145,132 +143,133 @@ } - } - else { + } + else + { @Model.State }
Created dateCreated Date @Model.CreatedDate.ToBrowserDate()
Expiration dateExpiration Date @Model.ExpirationDate.ToBrowserDate()
Monitoring dateMonitoring Date @Model.MonitoringDate.ToBrowserDate()
Transaction speedTransaction Speed @Model.TransactionSpeed
Total fiat dueTotal Fiat Due @Model.Fiat
Refund emailRefund Email @Model.RefundEmail
Notification UrlNotification Url @Model.NotificationUrl
Redirect UrlRedirect Url @Model.RedirectUrl
-
-
-

Buyer Information

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name@Model.TypedMetadata.BuyerName
Email@Model.TypedMetadata.BuyerEmail
Phone@Model.TypedMetadata.BuyerPhone
Address 1@Model.TypedMetadata.BuyerAddress1
Address 2@Model.TypedMetadata.BuyerAddress2
City@Model.TypedMetadata.BuyerCity
State@Model.TypedMetadata.BuyerState
Country@Model.TypedMetadata.BuyerCountry
Zip@Model.TypedMetadata.BuyerZip
@if (Model.PosData.Count == 0) {

Product Information

- +
@if (!string.IsNullOrEmpty(Model.TypedMetadata.ItemCode)) { - + } @if (!string.IsNullOrEmpty(Model.TypedMetadata.ItemDesc)) { - + } - + - +
Item codeItem code @Model.TypedMetadata.ItemCode
Item DescriptionItem Description @Model.TypedMetadata.ItemDesc
PricePrice @Model.Fiat
Tax includedTax Included @Model.TaxIncluded
}
+
+

Buyer Information

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name@Model.TypedMetadata.BuyerName
Email@Model.TypedMetadata.BuyerEmail
Phone@Model.TypedMetadata.BuyerPhone
Address 1@Model.TypedMetadata.BuyerAddress1
Address 2@Model.TypedMetadata.BuyerAddress2
City@Model.TypedMetadata.BuyerCity
State@Model.TypedMetadata.BuyerState
Country@Model.TypedMetadata.BuyerCountry
Zip@Model.TypedMetadata.BuyerZip
+
@if (Model.PosData.Count != 0) {
-
+

Product information

- +
@if (!string.IsNullOrEmpty(Model.TypedMetadata.ItemCode)) { @@ -362,7 +361,6 @@ } } -

Events

@@ -386,4 +384,4 @@
- + \ No newline at end of file