From d0e11f1ec429a8d948a98b763ddb16d7eb840c46 Mon Sep 17 00:00:00 2001 From: Chukwuleta Tobechi <47084273+TChukwuleta@users.noreply.github.com> Date: Thu, 14 Mar 2024 15:16:48 +0100 Subject: [PATCH] changing check box to toggle in various setting views (#5769) * Resolves: check box to toggle in various setting views * resolve conflicts * Notification logic reversal * remove transform property in the toggle * Handle email tls certificate check * Unifications and fixes --------- Co-authored-by: Dennis Reimann --- .../Models/EmailSettingsData.cs | 9 +++ .../UIManageController.Notifications.cs | 4 +- .../Shared/Crowdfund/UpdateCrowdfund.cshtml | 30 ++++---- BTCPayServer/Views/Shared/EmailsBody.cshtml | 9 ++- .../PointOfSale/UpdatePointOfSale.cshtml | 10 +-- .../Views/Shared/TemplateEditor.cshtml | 4 +- .../Configure.cshtml | 4 +- .../UIManage/NotificationSettings.cshtml | 53 ++++++++------- .../Configure.cshtml | 4 +- .../EditPaymentRequest.cshtml | 4 +- BTCPayServer/Views/UIServer/Branding.cshtml | 2 +- BTCPayServer/Views/UIServer/Emails.cshtml | 2 +- BTCPayServer/Views/UIServer/Policies.cshtml | 20 +++--- .../Views/UIStores/CheckoutAppearance.cshtml | 68 ++++++++++--------- .../Views/UIStores/GeneralSettings.cshtml | 2 +- .../Views/UIStores/LightningSettings.cshtml | 8 +-- BTCPayServer/Views/UIStores/Rates.cshtml | 2 +- .../Views/UIStores/WalletSettings.cshtml | 20 +++--- .../Views/UIStores/_GenerateWalletForm.cshtml | 4 +- 19 files changed, 140 insertions(+), 119 deletions(-) diff --git a/BTCPayServer.Client/Models/EmailSettingsData.cs b/BTCPayServer.Client/Models/EmailSettingsData.cs index 482800c66..b5a89bf95 100644 --- a/BTCPayServer.Client/Models/EmailSettingsData.cs +++ b/BTCPayServer.Client/Models/EmailSettingsData.cs @@ -1,3 +1,5 @@ +using Newtonsoft.Json; + namespace BTCPayServer.Client.Models; public class EmailSettingsData @@ -26,4 +28,11 @@ public class EmailSettingsData get; set; } public bool DisableCertificateCheck { get; set; } + + [JsonIgnore] + public bool EnabledCertificateCheck + { + get => !DisableCertificateCheck; + set { DisableCertificateCheck = !value; } + } } diff --git a/BTCPayServer/Controllers/UIManageController.Notifications.cs b/BTCPayServer/Controllers/UIManageController.Notifications.cs index da39c3d52..15c436df9 100644 --- a/BTCPayServer/Controllers/UIManageController.Notifications.cs +++ b/BTCPayServer/Controllers/UIManageController.Notifications.cs @@ -26,7 +26,7 @@ namespace BTCPayServer.Controllers new List(); var notifications = notificationHandlers.SelectMany(handler => handler.Meta.Select(tuple => new SelectListItem(tuple.name, tuple.identifier, - disabledNotifications.Contains(tuple.identifier, StringComparer.InvariantCultureIgnoreCase)))) + !disabledNotifications.Contains(tuple.identifier, StringComparer.InvariantCultureIgnoreCase)))) .ToList(); return View(new NotificationSettingsViewModel { DisabledNotifications = notifications }); @@ -46,7 +46,7 @@ namespace BTCPayServer.Controllers } else if (command == "update") { - var disabled = vm.DisabledNotifications.Where(item => item.Selected).Select(item => item.Value) + var disabled = vm.DisabledNotifications.Where(item => !item.Selected).Select(item => item.Value) .ToArray(); user.DisabledNotifications = disabled.Any() ? string.Join(';', disabled) + ";" diff --git a/BTCPayServer/Views/Shared/Crowdfund/UpdateCrowdfund.cshtml b/BTCPayServer/Views/Shared/Crowdfund/UpdateCrowdfund.cshtml index 300bd0b45..55863aa83 100644 --- a/BTCPayServer/Views/Shared/Crowdfund/UpdateCrowdfund.cshtml +++ b/BTCPayServer/Views/Shared/Crowdfund/UpdateCrowdfund.cshtml @@ -80,7 +80,7 @@
- +
The crowdfund will be visible to anyone.
@@ -146,7 +146,7 @@
- +
Reset goal after a specific period of time, based on your crowdfund's start date.
@@ -178,30 +178,30 @@

Contributions

-
- +
+
-
- +
+
-
- +
+
-
- +
+

Crowdfund Behavior

-
- +
+
@@ -228,7 +228,7 @@
- +
@@ -254,7 +254,7 @@
- +
@@ -280,7 +280,7 @@
- +
diff --git a/BTCPayServer/Views/Shared/EmailsBody.cshtml b/BTCPayServer/Views/Shared/EmailsBody.cshtml index 87c5454a5..2e1816f86 100644 --- a/BTCPayServer/Views/Shared/EmailsBody.cshtml +++ b/BTCPayServer/Views/Shared/EmailsBody.cshtml @@ -68,11 +68,9 @@
-
-
- - -
+
+ +
@@ -83,6 +81,7 @@ + diff --git a/BTCPayServer/Views/UIOnChainAutomatedPayoutProcessors/Configure.cshtml b/BTCPayServer/Views/UIOnChainAutomatedPayoutProcessors/Configure.cshtml index 4d12ce2ec..e2da9c569 100644 --- a/BTCPayServer/Views/UIOnChainAutomatedPayoutProcessors/Configure.cshtml +++ b/BTCPayServer/Views/UIOnChainAutomatedPayoutProcessors/Configure.cshtml @@ -19,8 +19,8 @@
}
-
- +
+
diff --git a/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml b/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml index 4df02098a..8f668ef41 100644 --- a/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml +++ b/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml @@ -66,8 +66,8 @@
-
- +
+
diff --git a/BTCPayServer/Views/UIServer/Branding.cshtml b/BTCPayServer/Views/UIServer/Branding.cshtml index de9ca0e68..78d63f7e1 100644 --- a/BTCPayServer/Views/UIServer/Branding.cshtml +++ b/BTCPayServer/Views/UIServer/Branding.cshtml @@ -68,7 +68,7 @@
- +
Adjust the design of your BTCPay Server instance to your needs. diff --git a/BTCPayServer/Views/UIServer/Emails.cshtml b/BTCPayServer/Views/UIServer/Emails.cshtml index 6d39a9ba5..c2664761f 100644 --- a/BTCPayServer/Views/UIServer/Emails.cshtml +++ b/BTCPayServer/Views/UIServer/Emails.cshtml @@ -9,7 +9,7 @@
- +
This can be overridden at the Store level. diff --git a/BTCPayServer/Views/UIServer/Policies.cshtml b/BTCPayServer/Views/UIServer/Policies.cshtml index 60bda2199..acc4be42e 100644 --- a/BTCPayServer/Views/UIServer/Policies.cshtml +++ b/BTCPayServer/Views/UIServer/Policies.cshtml @@ -50,7 +50,7 @@ }
- + @@ -64,14 +64,14 @@
- +
- +