Refactor: Remove cshtml duplication for back/url buttons in wizards

This commit is contained in:
nicolas.dorier
2025-02-07 16:13:44 +09:00
parent 4fbcd89bb6
commit c37584328b
17 changed files with 74 additions and 87 deletions

View File

@@ -4,7 +4,7 @@ using NBitcoin;
namespace BTCPayServer.Models.WalletViewModels
{
public class SignWithSeedViewModel
public class SignWithSeedViewModel : IHasBackAndReturnUrl
{
public SigningContextModel SigningContext { get; set; } = new SigningContextModel();

View File

@@ -7,7 +7,7 @@ using NBitcoin;
namespace BTCPayServer.Models.WalletViewModels
{
public class WalletPSBTCombineViewModel
public class WalletPSBTCombineViewModel : IHasBackAndReturnUrl
{
public string OtherPSBT { get; set; }
[Display(Name = "PSBT to combine with…")]

View File

@@ -5,7 +5,7 @@ using NBitcoin;
namespace BTCPayServer.Models.WalletViewModels
{
public class WalletPSBTReadyViewModel
public class WalletPSBTReadyViewModel : IHasBackAndReturnUrl
{
public SigningContextModel SigningContext { get; set; } = new SigningContextModel();
public string SigningKey { get; set; }
@@ -27,6 +27,12 @@ namespace BTCPayServer.Models.WalletViewModels
public string BalanceChange { get; set; }
public IEnumerable<TransactionTagModel> Labels { get; set; } = new List<TransactionTagModel>();
}
public class AmountViewModel
{
public bool Positive { get; set; }
public string BalanceChange { get; set; }
}
public AmountViewModel ReplacementBalanceChange { get; set; }
public bool HasErrors => Inputs.Count == 0 || Inputs.Any(i => !string.IsNullOrEmpty(i.Error));
public string BalanceChange { get; set; }
public bool CanCalculateBalance { get; set; }

View File

@@ -5,7 +5,7 @@ using BTCPayServer.Services.Labels;
namespace BTCPayServer.Models.WalletViewModels
{
public class WalletSendModel
public class WalletSendModel : IHasBackAndReturnUrl
{
public enum ThreeStateBool
{

View File

@@ -1,6 +1,6 @@
namespace BTCPayServer.Models.WalletViewModels
{
public class WalletSendVaultModel
public class WalletSendVaultModel : IHasBackAndReturnUrl
{
public string WalletId { get; set; }
public string WebsocketPath { get; set; }

View File

@@ -2,7 +2,7 @@ using System;
namespace BTCPayServer.Models.WalletViewModels
{
public class WalletSigningOptionsModel
public class WalletSigningOptionsModel : IHasBackAndReturnUrl
{
public SigningContextModel SigningContext { get; set; }
public string BackUrl { get; set; }