mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Use AddUIExtension
This commit is contained in:
parent
68f24e47cd
commit
dd35af3c55
10 changed files with 15 additions and 12 deletions
|
@ -1,9 +1,11 @@
|
||||||
|
using System;
|
||||||
using BTCPayServer.Abstractions.Contracts;
|
using BTCPayServer.Abstractions.Contracts;
|
||||||
|
|
||||||
namespace BTCPayServer.Abstractions.Services
|
namespace BTCPayServer.Abstractions.Services
|
||||||
{
|
{
|
||||||
public class UIExtension : IUIExtension
|
public class UIExtension : IUIExtension
|
||||||
{
|
{
|
||||||
|
[Obsolete("Use extension method BTCPayServer.Extensions.AddUIExtension(this IServiceCollection services, string location, string partialViewName) instead")]
|
||||||
public UIExtension(string partial, string location)
|
public UIExtension(string partial, string location)
|
||||||
{
|
{
|
||||||
Partial = partial;
|
Partial = partial;
|
||||||
|
|
|
@ -294,7 +294,9 @@ namespace BTCPayServer
|
||||||
|
|
||||||
public static IServiceCollection AddUIExtension(this IServiceCollection services, string location, string partialViewName)
|
public static IServiceCollection AddUIExtension(this IServiceCollection services, string location, string partialViewName)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension(partialViewName, location));
|
services.AddSingleton<IUIExtension>(new UIExtension(partialViewName, location));
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
public static IServiceCollection AddReportProvider<T>(this IServiceCollection services)
|
public static IServiceCollection AddReportProvider<T>(this IServiceCollection services)
|
||||||
|
|
|
@ -402,8 +402,7 @@ o.GetRequiredService<IEnumerable<IPaymentLinkExtension>>().ToDictionary(o => o.P
|
||||||
services.AddSingleton<IHostedService, NBXplorerListener>();
|
services.AddSingleton<IHostedService, NBXplorerListener>();
|
||||||
|
|
||||||
|
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("LNURL/LightningAddressNav",
|
services.AddUIExtension("store-integrations-nav", "LNURL/LightningAddressNav");
|
||||||
"store-integrations-nav"));
|
|
||||||
services.AddSingleton<IHostedService, LightningListener>();
|
services.AddSingleton<IHostedService, LightningListener>();
|
||||||
services.AddSingleton<IHostedService, LightningPendingPayoutListener>();
|
services.AddSingleton<IHostedService, LightningPendingPayoutListener>();
|
||||||
|
|
||||||
|
|
|
@ -70,9 +70,9 @@ public partial class AltcoinsPlugin
|
||||||
services.AddSingleton<ICheckoutModelExtension>(provider =>
|
services.AddSingleton<ICheckoutModelExtension>(provider =>
|
||||||
(ICheckoutModelExtension)ActivatorUtilities.CreateInstance(provider, typeof(MoneroCheckoutModelExtension), new object[] { network, pmi }));
|
(ICheckoutModelExtension)ActivatorUtilities.CreateInstance(provider, typeof(MoneroCheckoutModelExtension), new object[] { network, pmi }));
|
||||||
|
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("Monero/StoreNavMoneroExtension", "store-nav"));
|
services.AddUIExtension("store-nav", "Monero/StoreNavMoneroExtension");
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("Monero/StoreWalletsNavMoneroExtension", "store-wallets-nav"));
|
services.AddUIExtension("store-wallets-nav", "Monero/StoreWalletsNavMoneroExtension");
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("Monero/ViewMoneroLikePaymentData", "store-invoices-payments"));
|
services.AddUIExtension("store-invoices-payments", "Monero/ViewMoneroLikePaymentData");
|
||||||
services.AddSingleton<ISyncSummaryProvider, MoneroSyncSummaryProvider>();
|
services.AddSingleton<ISyncSummaryProvider, MoneroSyncSummaryProvider>();
|
||||||
}
|
}
|
||||||
private static MoneroLikeConfiguration ConfigureMoneroLikeConfiguration(IServiceProvider serviceProvider)
|
private static MoneroLikeConfiguration ConfigureMoneroLikeConfiguration(IServiceProvider serviceProvider)
|
||||||
|
|
|
@ -61,8 +61,8 @@ public partial class AltcoinsPlugin
|
||||||
|
|
||||||
services.AddSingleton<ZcashLikePaymentMethodHandler>();
|
services.AddSingleton<ZcashLikePaymentMethodHandler>();
|
||||||
services.AddSingleton<IPaymentMethodHandler>(provider => provider.GetRequiredService<ZcashLikePaymentMethodHandler>());
|
services.AddSingleton<IPaymentMethodHandler>(provider => provider.GetRequiredService<ZcashLikePaymentMethodHandler>());
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("Zcash/StoreNavZcashExtension", "store-nav"));
|
services.AddUIExtension("store-nav", "Zcash/StoreNavZcashExtension");
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("Zcash/ViewZcashLikePaymentData", "store-invoices-payments"));
|
services.AddUIExtension("store-invoices-payments", "Zcash/ViewZcashLikePaymentData");
|
||||||
services.AddSingleton<ISyncSummaryProvider, ZcashSyncSummaryProvider>();
|
services.AddSingleton<ISyncSummaryProvider, ZcashSyncSummaryProvider>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace BTCPayServer.Plugins.Crowdfund
|
||||||
|
|
||||||
public override void Execute(IServiceCollection services)
|
public override void Execute(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("Crowdfund/NavExtension", "header-nav"));
|
services.AddUIExtension("header-nav", "Crowdfund/NavExtension");
|
||||||
services.AddSingleton<CrowdfundAppType>();
|
services.AddSingleton<CrowdfundAppType>();
|
||||||
services.AddSingleton<AppBaseType, CrowdfundAppType>();
|
services.AddSingleton<AppBaseType, CrowdfundAppType>();
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace BTCPayServer.Plugins.PayButton
|
||||||
|
|
||||||
public override void Execute(IServiceCollection services)
|
public override void Execute(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("PayButton/NavExtension", "header-nav"));
|
services.AddUIExtension("header-nav", "PayButton/NavExtension");
|
||||||
base.Execute(services);
|
base.Execute(services);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace BTCPayServer.Plugins.PointOfSale
|
||||||
|
|
||||||
public override void Execute(IServiceCollection services)
|
public override void Execute(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddSingleton<IUIExtension>(new UIExtension("PointOfSale/NavExtension", "header-nav"));
|
services.AddUIExtension("header-nav", "PointOfSale/NavExtension");
|
||||||
services.AddSingleton<AppBaseType, PointOfSaleAppType>();
|
services.AddSingleton<AppBaseType, PointOfSaleAppType>();
|
||||||
base.Execute(services);
|
base.Execute(services);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace BTCPayServer.Plugins.Shopify
|
||||||
{
|
{
|
||||||
applicationBuilder.AddSingleton<ShopifyService>();
|
applicationBuilder.AddSingleton<ShopifyService>();
|
||||||
applicationBuilder.AddSingleton<IHostedService, ShopifyService>(provider => provider.GetRequiredService<ShopifyService>());
|
applicationBuilder.AddSingleton<IHostedService, ShopifyService>(provider => provider.GetRequiredService<ShopifyService>());
|
||||||
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("Shopify/NavExtension", "header-nav"));
|
applicationBuilder.AddUIExtension("header-nav", "Shopify/NavExtension");
|
||||||
base.Execute(applicationBuilder);
|
base.Execute(applicationBuilder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,7 @@ function initApp() {
|
||||||
: null;
|
: null;
|
||||||
},
|
},
|
||||||
paymentMethodIds () {
|
paymentMethodIds () {
|
||||||
return this.srvModel.availablePaymentMethod.map(function (c) { return c.paymentMethodId });
|
return this.srvModel.availablePaymentMethods.map(function (c) { return c.paymentMethodId });
|
||||||
},
|
},
|
||||||
paymentMethodComponent() {
|
paymentMethodComponent() {
|
||||||
return this.isPluginPaymentMethod
|
return this.isPluginPaymentMethod
|
||||||
|
|
Loading…
Add table
Reference in a new issue