From e8291eb00e87aa2d1b8bd5de37b0b85969c796b1 Mon Sep 17 00:00:00 2001 From: d11n Date: Fri, 15 Jul 2022 05:38:33 +0200 Subject: [PATCH] Move ConfirmModel to Abstractions (#3964) To make it available to plugins. --- .../Models/ConfirmModel.cs | 2 +- BTCPayServer/Controllers/UIAppsController.cs | 1 + BTCPayServer/Controllers/UIManageController.APIKeys.cs | 1 - BTCPayServer/Controllers/UIStoresController.Integrations.cs | 1 + BTCPayServer/Controllers/UIStoresController.Onchain.cs | 4 +--- BTCPayServer/Controllers/UIStoresController.cs | 1 + BTCPayServer/Controllers/UIUserStoresController.cs | 1 + BTCPayServer/Views/Shared/Confirm.cshtml | 2 +- BTCPayServer/Views/Shared/ConfirmModal.cshtml | 2 +- BTCPayServer/Views/Shared/_Confirm.cshtml | 2 +- BTCPayServer/Views/UIApps/ListApps.cshtml | 1 + BTCPayServer/Views/UIApps/UpdateCrowdfund.cshtml | 1 + BTCPayServer/Views/UIApps/UpdatePointOfSale.cshtml | 1 + BTCPayServer/Views/UILNURL/EditLightningAddress.cshtml | 1 + BTCPayServer/Views/UIManage/APIKeys.cshtml | 1 + BTCPayServer/Views/UIManage/Index.cshtml | 1 + BTCPayServer/Views/UIManage/TwoFactorAuthentication.cshtml | 1 + .../UIPayoutProcessors/ConfigureStorePayoutProcessors.cshtml | 1 + BTCPayServer/Views/UIServer/DynamicDnsServices.cshtml | 3 ++- BTCPayServer/Views/UIServer/ListUsers.cshtml | 3 ++- BTCPayServer/Views/UIServer/LndSeedBackup.cshtml | 3 ++- BTCPayServer/Views/UIServer/SSHService.cshtml | 1 + BTCPayServer/Views/UIStorePullPayments/PullPayments.cshtml | 1 + BTCPayServer/Views/UIStores/GeneralSettings.cshtml | 1 + BTCPayServer/Views/UIStores/ListTokens.cshtml | 1 + BTCPayServer/Views/UIStores/Rates.cshtml | 1 + BTCPayServer/Views/UIStores/StoreUsers.cshtml | 3 ++- BTCPayServer/Views/UIStores/WalletSettings.cshtml | 1 + BTCPayServer/Views/UIStores/Webhooks.cshtml | 1 + 29 files changed, 32 insertions(+), 12 deletions(-) rename {BTCPayServer => BTCPayServer.Abstractions}/Models/ConfirmModel.cs (96%) diff --git a/BTCPayServer/Models/ConfirmModel.cs b/BTCPayServer.Abstractions/Models/ConfirmModel.cs similarity index 96% rename from BTCPayServer/Models/ConfirmModel.cs rename to BTCPayServer.Abstractions/Models/ConfirmModel.cs index e77f1bdf7..5235d562b 100644 --- a/BTCPayServer/Models/ConfirmModel.cs +++ b/BTCPayServer.Abstractions/Models/ConfirmModel.cs @@ -1,6 +1,6 @@ using System; -namespace BTCPayServer.Models +namespace BTCPayServer.Abstractions.Models { public class ConfirmModel { diff --git a/BTCPayServer/Controllers/UIAppsController.cs b/BTCPayServer/Controllers/UIAppsController.cs index f756de46c..e4230bd08 100644 --- a/BTCPayServer/Controllers/UIAppsController.cs +++ b/BTCPayServer/Controllers/UIAppsController.cs @@ -2,6 +2,7 @@ using System; using System.Linq; using System.Threading.Tasks; using BTCPayServer.Abstractions.Constants; +using BTCPayServer.Abstractions.Models; using BTCPayServer.Client; using BTCPayServer.Data; using BTCPayServer.Models; diff --git a/BTCPayServer/Controllers/UIManageController.APIKeys.cs b/BTCPayServer/Controllers/UIManageController.APIKeys.cs index 1a6ac18b2..1933a7335 100644 --- a/BTCPayServer/Controllers/UIManageController.APIKeys.cs +++ b/BTCPayServer/Controllers/UIManageController.APIKeys.cs @@ -41,7 +41,6 @@ namespace BTCPayServer.Controllers return View("Confirm", new ConfirmModel { Title = "Delete API key", - DescriptionHtml = true, Description = $"Any application using the API key {key.Label ?? key.Id} will immediately lose access.", Action = "Delete", ActionName = nameof(DeleteAPIKeyPost) diff --git a/BTCPayServer/Controllers/UIStoresController.Integrations.cs b/BTCPayServer/Controllers/UIStoresController.Integrations.cs index 4bd4ae639..4d97024a5 100644 --- a/BTCPayServer/Controllers/UIStoresController.Integrations.cs +++ b/BTCPayServer/Controllers/UIStoresController.Integrations.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using BTCPayServer.Abstractions.Constants; +using BTCPayServer.Abstractions.Models; using BTCPayServer.Client.Models; using BTCPayServer.Data; using BTCPayServer.Models; diff --git a/BTCPayServer/Controllers/UIStoresController.Onchain.cs b/BTCPayServer/Controllers/UIStoresController.Onchain.cs index ca734f914..0accff977 100644 --- a/BTCPayServer/Controllers/UIStoresController.Onchain.cs +++ b/BTCPayServer/Controllers/UIStoresController.Onchain.cs @@ -664,7 +664,6 @@ namespace BTCPayServer.Controllers { Title = $"Replace {network.CryptoCode} wallet", Description = WalletReplaceWarning(derivation.IsHotWallet), - DescriptionHtml = true, Action = "Setup new wallet" }); } @@ -702,7 +701,6 @@ namespace BTCPayServer.Controllers { Title = $"Remove {network.CryptoCode} wallet", Description = WalletRemoveWarning(derivation.IsHotWallet, network.CryptoCode), - DescriptionHtml = true, Action = "Remove" }); } @@ -803,7 +801,7 @@ namespace BTCPayServer.Controllers ? "" : " or imported it into an external wallet. If you no longer have access to your private key (recovery seed), immediately replace the wallet"; return - $"

Please note that this is a {walletType} wallet!

" + + $"

Please note that this is a {walletType} wallet!

" + $"

Do not proceed if you have not backed up the wallet{additionalText}.

" + $"

This action will erase the current wallet data from the server. {info}

"; } diff --git a/BTCPayServer/Controllers/UIStoresController.cs b/BTCPayServer/Controllers/UIStoresController.cs index 13c28761c..09c32160d 100644 --- a/BTCPayServer/Controllers/UIStoresController.cs +++ b/BTCPayServer/Controllers/UIStoresController.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using BTCPayServer.Abstractions.Constants; +using BTCPayServer.Abstractions.Models; using BTCPayServer.Client; using BTCPayServer.Configuration; using BTCPayServer.Data; diff --git a/BTCPayServer/Controllers/UIUserStoresController.cs b/BTCPayServer/Controllers/UIUserStoresController.cs index 94e711492..3da03feb9 100644 --- a/BTCPayServer/Controllers/UIUserStoresController.cs +++ b/BTCPayServer/Controllers/UIUserStoresController.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using BTCPayServer.Abstractions.Constants; +using BTCPayServer.Abstractions.Models; using BTCPayServer.Client; using BTCPayServer.Data; using BTCPayServer.Models; diff --git a/BTCPayServer/Views/Shared/Confirm.cshtml b/BTCPayServer/Views/Shared/Confirm.cshtml index 74e82ac3f..6e90764ec 100644 --- a/BTCPayServer/Views/Shared/Confirm.cshtml +++ b/BTCPayServer/Views/Shared/Confirm.cshtml @@ -1,4 +1,4 @@ -@model ConfirmModel +@model BTCPayServer.Abstractions.Models.ConfirmModel @{ ViewData["Title"] = Model.Title; diff --git a/BTCPayServer/Views/Shared/ConfirmModal.cshtml b/BTCPayServer/Views/Shared/ConfirmModal.cshtml index 7c0dfe1b5..8549f8a66 100644 --- a/BTCPayServer/Views/Shared/ConfirmModal.cshtml +++ b/BTCPayServer/Views/Shared/ConfirmModal.cshtml @@ -1,4 +1,4 @@ -@model ConfirmModel +@model BTCPayServer.Abstractions.Models.ConfirmModel @inject LinkGenerator linkGenerator @{ string actionUrl = null; diff --git a/BTCPayServer/Views/Shared/_Confirm.cshtml b/BTCPayServer/Views/Shared/_Confirm.cshtml index 3619619f5..19f777bbf 100644 --- a/BTCPayServer/Views/Shared/_Confirm.cshtml +++ b/BTCPayServer/Views/Shared/_Confirm.cshtml @@ -1,4 +1,4 @@ -@model ConfirmModel +@model BTCPayServer.Abstractions.Models.ConfirmModel diff --git a/BTCPayServer/Views/UIApps/ListApps.cshtml b/BTCPayServer/Views/UIApps/ListApps.cshtml index 255cd58c7..62f9cb614 100644 --- a/BTCPayServer/Views/UIApps/ListApps.cshtml +++ b/BTCPayServer/Views/UIApps/ListApps.cshtml @@ -1,4 +1,5 @@ @using BTCPayServer.Services.Apps +@using BTCPayServer.Abstractions.Models @model ListAppsViewModel @{ ViewData.SetActivePage(AppsNavPages.Index, "Apps"); diff --git a/BTCPayServer/Views/UIApps/UpdateCrowdfund.cshtml b/BTCPayServer/Views/UIApps/UpdateCrowdfund.cshtml index dbd87f065..53b27746f 100644 --- a/BTCPayServer/Views/UIApps/UpdateCrowdfund.cshtml +++ b/BTCPayServer/Views/UIApps/UpdateCrowdfund.cshtml @@ -1,5 +1,6 @@ @addTagHelper *, BundlerMinifier.TagHelpers @using System.Globalization +@using BTCPayServer.Abstractions.Models @model UpdateCrowdfundViewModel @{ ViewData.SetActivePage(AppsNavPages.Update, "Update Crowdfund", Model.AppId); diff --git a/BTCPayServer/Views/UIApps/UpdatePointOfSale.cshtml b/BTCPayServer/Views/UIApps/UpdatePointOfSale.cshtml index 3f5d9d057..f4c9558f8 100644 --- a/BTCPayServer/Views/UIApps/UpdatePointOfSale.cshtml +++ b/BTCPayServer/Views/UIApps/UpdatePointOfSale.cshtml @@ -1,4 +1,5 @@ @using BTCPayServer.Services.Apps +@using BTCPayServer.Abstractions.Models @addTagHelper *, BundlerMinifier.TagHelpers @model UpdatePointOfSaleViewModel @{ diff --git a/BTCPayServer/Views/UILNURL/EditLightningAddress.cshtml b/BTCPayServer/Views/UILNURL/EditLightningAddress.cshtml index 725aefe6e..a09507a89 100644 --- a/BTCPayServer/Views/UILNURL/EditLightningAddress.cshtml +++ b/BTCPayServer/Views/UILNURL/EditLightningAddress.cshtml @@ -1,5 +1,6 @@ @using BTCPayServer.Views.Stores @using BTCPayServer.Abstractions.Extensions +@using BTCPayServer.Abstractions.Models @model UILNURLController.EditLightningAddressVM @{ ViewData.SetActivePage("LightningAddress", nameof(StoreNavPages), "Lightning Address", Context.GetStoreData().Id); diff --git a/BTCPayServer/Views/UIManage/APIKeys.cshtml b/BTCPayServer/Views/UIManage/APIKeys.cshtml index d8f2ccb5e..ec5849148 100644 --- a/BTCPayServer/Views/UIManage/APIKeys.cshtml +++ b/BTCPayServer/Views/UIManage/APIKeys.cshtml @@ -1,4 +1,5 @@ @namespace BTCPayServer.Client +@using BTCPayServer.Abstractions.Models @model BTCPayServer.Controllers.UIManageController.ApiKeysViewModel @{ ViewData.SetActivePage(ManageNavPages.APIKeys, "API Keys"); diff --git a/BTCPayServer/Views/UIManage/Index.cshtml b/BTCPayServer/Views/UIManage/Index.cshtml index b136da1d1..f4bfd906d 100644 --- a/BTCPayServer/Views/UIManage/Index.cshtml +++ b/BTCPayServer/Views/UIManage/Index.cshtml @@ -1,3 +1,4 @@ +@using BTCPayServer.Abstractions.Models @model IndexViewModel @{ ViewData.SetActivePage(ManageNavPages.Index, "Update your account"); diff --git a/BTCPayServer/Views/UIManage/TwoFactorAuthentication.cshtml b/BTCPayServer/Views/UIManage/TwoFactorAuthentication.cshtml index 5315e547e..a7c51ffbe 100644 --- a/BTCPayServer/Views/UIManage/TwoFactorAuthentication.cshtml +++ b/BTCPayServer/Views/UIManage/TwoFactorAuthentication.cshtml @@ -1,4 +1,5 @@ @using Fido2NetLib +@using BTCPayServer.Abstractions.Models @model TwoFactorAuthenticationViewModel @{ ViewData.SetActivePage(ManageNavPages.TwoFactorAuthentication, "Two-Factor Authentication"); diff --git a/BTCPayServer/Views/UIPayoutProcessors/ConfigureStorePayoutProcessors.cshtml b/BTCPayServer/Views/UIPayoutProcessors/ConfigureStorePayoutProcessors.cshtml index 2eab1d5cd..6a47686aa 100644 --- a/BTCPayServer/Views/UIPayoutProcessors/ConfigureStorePayoutProcessors.cshtml +++ b/BTCPayServer/Views/UIPayoutProcessors/ConfigureStorePayoutProcessors.cshtml @@ -1,4 +1,5 @@ @using BTCPayServer.Abstractions.Extensions +@using BTCPayServer.Abstractions.Models @model List @{ ViewData["NavPartialName"] = "../UIStores/_Nav"; diff --git a/BTCPayServer/Views/UIServer/DynamicDnsServices.cshtml b/BTCPayServer/Views/UIServer/DynamicDnsServices.cshtml index 3e8777ec4..0bcd61988 100644 --- a/BTCPayServer/Views/UIServer/DynamicDnsServices.cshtml +++ b/BTCPayServer/Views/UIServer/DynamicDnsServices.cshtml @@ -1,4 +1,5 @@ -@model BTCPayServer.Models.ServerViewModels.DynamicDnsViewModel[] +@using BTCPayServer.Abstractions.Models +@model BTCPayServer.Models.ServerViewModels.DynamicDnsViewModel[] @{ ViewData.SetActivePage(ServerNavPages.Services, "Dynamic DNS Settings"); } diff --git a/BTCPayServer/Views/UIServer/ListUsers.cshtml b/BTCPayServer/Views/UIServer/ListUsers.cshtml index a4bd3e351..9906b9591 100644 --- a/BTCPayServer/Views/UIServer/ListUsers.cshtml +++ b/BTCPayServer/Views/UIServer/ListUsers.cshtml @@ -1,4 +1,5 @@ -@model UsersViewModel +@using BTCPayServer.Abstractions.Models +@model UsersViewModel @{ ViewData.SetActivePage(ServerNavPages.Users); var nextUserEmailSortOrder = (string)ViewData["NextUserEmailSortOrder"]; diff --git a/BTCPayServer/Views/UIServer/LndSeedBackup.cshtml b/BTCPayServer/Views/UIServer/LndSeedBackup.cshtml index 0a4cefe8a..b9f9fd8fe 100644 --- a/BTCPayServer/Views/UIServer/LndSeedBackup.cshtml +++ b/BTCPayServer/Views/UIServer/LndSeedBackup.cshtml @@ -1,4 +1,5 @@ -@model LndSeedBackupViewModel +@using BTCPayServer.Abstractions.Models +@model LndSeedBackupViewModel @{ ViewData.SetActivePage(ServerNavPages.Services, "LND Seed Backup"); } diff --git a/BTCPayServer/Views/UIServer/SSHService.cshtml b/BTCPayServer/Views/UIServer/SSHService.cshtml index a04553492..8546ed497 100644 --- a/BTCPayServer/Views/UIServer/SSHService.cshtml +++ b/BTCPayServer/Views/UIServer/SSHService.cshtml @@ -1,3 +1,4 @@ +@using BTCPayServer.Abstractions.Models @model BTCPayServer.Models.ServerViewModels.SSHServiceViewModel @{ ViewData.SetActivePage(ServerNavPages.Services, "SSH settings"); diff --git a/BTCPayServer/Views/UIStorePullPayments/PullPayments.cshtml b/BTCPayServer/Views/UIStorePullPayments/PullPayments.cshtml index b867679fe..967f298c1 100644 --- a/BTCPayServer/Views/UIStorePullPayments/PullPayments.cshtml +++ b/BTCPayServer/Views/UIStorePullPayments/PullPayments.cshtml @@ -1,5 +1,6 @@ @using BTCPayServer.Views.Stores @using BTCPayServer.Abstractions.Extensions +@using BTCPayServer.Abstractions.Models @using BTCPayServer.Client @using BTCPayServer.Client.Models @using ExchangeSharp diff --git a/BTCPayServer/Views/UIStores/GeneralSettings.cshtml b/BTCPayServer/Views/UIStores/GeneralSettings.cshtml index 596d15748..4f831c174 100644 --- a/BTCPayServer/Views/UIStores/GeneralSettings.cshtml +++ b/BTCPayServer/Views/UIStores/GeneralSettings.cshtml @@ -1,3 +1,4 @@ +@using BTCPayServer.Abstractions.Models @model GeneralSettingsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; diff --git a/BTCPayServer/Views/UIStores/ListTokens.cshtml b/BTCPayServer/Views/UIStores/ListTokens.cshtml index 2967f8da4..7dc8e5c85 100644 --- a/BTCPayServer/Views/UIStores/ListTokens.cshtml +++ b/BTCPayServer/Views/UIStores/ListTokens.cshtml @@ -1,3 +1,4 @@ +@using BTCPayServer.Abstractions.Models @model TokensViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; diff --git a/BTCPayServer/Views/UIStores/Rates.cshtml b/BTCPayServer/Views/UIStores/Rates.cshtml index 5bab2bac3..a98b13616 100644 --- a/BTCPayServer/Views/UIStores/Rates.cshtml +++ b/BTCPayServer/Views/UIStores/Rates.cshtml @@ -1,3 +1,4 @@ +@using BTCPayServer.Abstractions.Models @model BTCPayServer.Models.StoreViewModels.RatesViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; diff --git a/BTCPayServer/Views/UIStores/StoreUsers.cshtml b/BTCPayServer/Views/UIStores/StoreUsers.cshtml index 052fba9d9..06f9df928 100644 --- a/BTCPayServer/Views/UIStores/StoreUsers.cshtml +++ b/BTCPayServer/Views/UIStores/StoreUsers.cshtml @@ -1,4 +1,5 @@ -@model StoreUsersViewModel +@using BTCPayServer.Abstractions.Models +@model StoreUsersViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; ViewData.SetActivePage(StoreNavPages.Users, "Store Users", Context.GetStoreData().Id); diff --git a/BTCPayServer/Views/UIStores/WalletSettings.cshtml b/BTCPayServer/Views/UIStores/WalletSettings.cshtml index 2ece103b1..496061ce6 100644 --- a/BTCPayServer/Views/UIStores/WalletSettings.cshtml +++ b/BTCPayServer/Views/UIStores/WalletSettings.cshtml @@ -1,6 +1,7 @@ @using NBitcoin.DataEncoders @using Newtonsoft.Json @using System.Text +@using BTCPayServer.Abstractions.Models @model WalletSettingsViewModel @{ Layout = "../Shared/_NavLayout.cshtml"; diff --git a/BTCPayServer/Views/UIStores/Webhooks.cshtml b/BTCPayServer/Views/UIStores/Webhooks.cshtml index 7c0b46747..7efcd2e38 100644 --- a/BTCPayServer/Views/UIStores/Webhooks.cshtml +++ b/BTCPayServer/Views/UIStores/Webhooks.cshtml @@ -1,3 +1,4 @@ +@using BTCPayServer.Abstractions.Models @model WebhooksViewModel @{ Layout = "../Shared/_NavLayout.cshtml";