Rewording: Integrations become (store) plugins

We're keeping the `store-integrations-list` extension point name for backwards compatibility, otherwise I renamed all "integration" occurences in the views and also the routes.

Note: We still refer to external software like WooCommerce, Drupal, Magento and such as "integrations", I think that distinction makes sense.

Closes #3594.
This commit is contained in:
Dennis Reimann
2022-05-04 19:40:23 +02:00
committed by Andrew Camilleri
parent f1029fceff
commit 2ae4501de6
13 changed files with 31 additions and 38 deletions

View File

@@ -35,7 +35,7 @@
</a>
</li>
<li class="nav-item">
<a asp-area="" asp-controller="UIStores" asp-action="GeneralSettings" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(StoreNavPages.Rates) @ViewData.IsActivePage(StoreNavPages.CheckoutAppearance) @ViewData.IsActivePage(StoreNavPages.General) @ViewData.IsActivePage(StoreNavPages.Tokens) @ViewData.IsActivePage(StoreNavPages.Users) @ViewData.IsActivePage(StoreNavPages.Integrations) @ViewData.IsActivePage(StoreNavPages.Webhooks)" id="StoreNav-StoreSettings">
<a asp-area="" asp-controller="UIStores" asp-action="GeneralSettings" asp-route-storeId="@Model.Store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage(StoreNavPages.Rates) @ViewData.IsActivePage(StoreNavPages.CheckoutAppearance) @ViewData.IsActivePage(StoreNavPages.General) @ViewData.IsActivePage(StoreNavPages.Tokens) @ViewData.IsActivePage(StoreNavPages.Users) @ViewData.IsActivePage(StoreNavPages.Plugins) @ViewData.IsActivePage(StoreNavPages.Webhooks)" id="StoreNav-StoreSettings">
<vc:icon symbol="settings"/>
<span>Settings</span>
</a>

View File

@@ -474,7 +474,7 @@ namespace BTCPayServer
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[HttpGet("~/stores/{storeId}/integrations/lightning-address")]
[HttpGet("~/stores/{storeId}/plugins/lightning-address")]
public async Task<IActionResult> EditLightningAddress(string storeId)
{
if (ControllerContext.HttpContext.GetStoreData().GetEnabledPaymentIds(_btcPayNetworkProvider)
@@ -512,7 +512,7 @@ namespace BTCPayServer
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[HttpPost("~/stores/{storeId}/integrations/lightning-address")]
[HttpPost("~/stores/{storeId}/plugins/lightning-address")]
public async Task<IActionResult> EditLightningAddress(string storeId, [FromForm] EditLightningAddressVM vm,
string command, [FromServices] CurrencyNameTable currencyNameTable)
{

View File

@@ -15,10 +15,10 @@ namespace BTCPayServer.Controllers
{
public partial class UIStoresController
{
[HttpGet("{storeId}/integrations")]
public IActionResult Integrations()
[HttpGet("{storeId}/plugins")]
public IActionResult Plugins()
{
return View("Integrations", new IntegrationsViewModel());
return View("Plugins", new PluginsViewModel());
}
private async Task<Data.WebhookDeliveryData?> LastDeliveryForWebhook(string webhookId)

View File

@@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static BTCPayServer.Data.StoreBlob;
namespace BTCPayServer.Models.StoreViewModels
{
public class IntegrationsViewModel
{
}
}

View File

@@ -0,0 +1,6 @@
namespace BTCPayServer.Models.StoreViewModels
{
public class PluginsViewModel
{
}
}

View File

@@ -94,7 +94,7 @@ namespace BTCPayServer.Plugins.Shopify
}
[AllowAnonymous]
[HttpGet("stores/{storeId}/integrations/shopify/shopify.js")]
[HttpGet("stores/{storeId}/plugins/shopify/shopify.js")]
public async Task<IActionResult> ShopifyJavascript(string storeId)
{
var jsFile =
@@ -105,7 +105,7 @@ namespace BTCPayServer.Plugins.Shopify
[RateLimitsFilter(ZoneLimits.Shopify, Scope = RateLimitsScope.RemoteAddress)]
[AllowAnonymous]
[EnableCors(CorsPolicies.All)]
[HttpGet("stores/{storeId}/integrations/shopify/{orderId}")]
[HttpGet("stores/{storeId}/plugins/shopify/{orderId}")]
public async Task<IActionResult> ShopifyInvoiceEndpoint(
string storeId, string orderId, decimal amount, bool checkOnly = false)
{
@@ -202,8 +202,8 @@ namespace BTCPayServer.Plugins.Shopify
}
[HttpGet]
[Route("stores/{storeId}/integrations/shopify")]
public IActionResult EditShopifyIntegration()
[Route("stores/{storeId}/plugins/shopify")]
public IActionResult EditShopify()
{
var blob = CurrentStore.GetStoreBlob();
@@ -211,8 +211,8 @@ namespace BTCPayServer.Plugins.Shopify
}
[HttpPost("stores/{storeId}/integrations/shopify")]
public async Task<IActionResult> EditShopifyIntegration(string storeId,
[HttpPost("stores/{storeId}/plugins/shopify")]
public async Task<IActionResult> EditShopify(string storeId,
ShopifySettings vm, string command = "")
{
switch (command)
@@ -257,7 +257,7 @@ namespace BTCPayServer.Plugins.Shopify
await _storeRepository.UpdateStore(CurrentStore);
}
TempData[WellKnownTempData.SuccessMessage] = "Shopify integration successfully updated";
TempData[WellKnownTempData.SuccessMessage] = "Shopify plugin successfully updated";
break;
}
case "ShopifyClearCredentials":
@@ -269,12 +269,12 @@ namespace BTCPayServer.Plugins.Shopify
await _storeRepository.UpdateStore(CurrentStore);
}
TempData[WellKnownTempData.SuccessMessage] = "Shopify integration credentials cleared";
TempData[WellKnownTempData.SuccessMessage] = "Shopify plugin credentials cleared";
break;
}
}
return RedirectToAction(nameof(EditShopifyIntegration), new { storeId = CurrentStore.Id });
return RedirectToAction(nameof(EditShopify), new { storeId = CurrentStore.Id });
}
}

View File

@@ -26,7 +26,7 @@
Enabled
</span>
<span class="text-light ms-3 me-2">|</span>
<a lass="btn btn-link px-1 py-1 fw-semibold" asp-controller="UIShopify" asp-action="EditShopifyIntegration" asp-route-storeId="@Context.GetRouteValue("storeId")">
<a lass="btn btn-link px-1 py-1 fw-semibold" asp-controller="UIShopify" asp-action="EditShopify" asp-route-storeId="@Context.GetRouteValue("storeId")">
Modify
</a>
}
@@ -36,7 +36,7 @@
<span class="me-2 btcpay-status btcpay-status--disabled"></span>
Disabled
</span>
<a class="btn btn-primary btn-sm ms-4 px-3 py-1 fw-semibold" asp-controller="UIShopify" asp-action="EditShopifyIntegration" asp-route-storeId="@Context.GetRouteValue("storeId")">
<a class="btn btn-primary btn-sm ms-4 px-3 py-1 fw-semibold" asp-controller="UIShopify" asp-action="EditShopify" asp-route-storeId="@Context.GetRouteValue("storeId")">
Setup
</a>
}

View File

@@ -5,7 +5,7 @@
}
<li class="nav-item">
<a asp-area="" asp-controller="UIShopify" asp-action="EditShopifyIntegration" asp-route-storeId="@store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage("shopify", nameof(StoreNavPages))" id="StoreNav-Shopify">
<a asp-area="" asp-controller="UIShopify" asp-action="EditShopify" asp-route-storeId="@store.Id" class="nav-link js-scroll-trigger @ViewData.IsActivePage("shopify", nameof(StoreNavPages))" id="StoreNav-Shopify">
<vc:icon symbol="shopify"/>
<span>Shopify</span>
</a>

View File

@@ -1,7 +1,7 @@
@model IntegrationsViewModel
@model PluginsViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePage(StoreNavPages.Integrations, "Integrations", Context.GetStoreData().Id);
ViewData.SetActivePage(StoreNavPages.Plugins, "Plugins", Context.GetStoreData().Id);
}
<div class="row">
@@ -16,8 +16,8 @@
<vc:ui-extension-point location="store-integrations-list" model="@Model" />
</ul>
<h3 class="mt-5 mb-3">Other Integrations</h3>
<p>Take a look at documentation for the list of other integrations we support and the directions on how to enable them:</p>
<h3 class="mt-5 mb-3">Integrations</h3>
<p>Take a look at documentation for the list of integrations we support and the directions on how to enable them:</p>
<ul>
<li><a href="https://docs.btcpayserver.org/WooCommerce/" target="_blank" rel="noreferrer noopener">WooCommerce</a></li>
<li><a href="https://docs.btcpayserver.org/Drupal/" target="_blank" rel="noreferrer noopener">Drupal</a></li>

View File

@@ -2,6 +2,6 @@ namespace BTCPayServer.Views.Stores
{
public enum StoreNavPages
{
Create, Dashboard, General, Rates, OnchainSettings, LightningSettings, Lightning, CheckoutAppearance, Tokens, Users, PayButton, Integrations, Webhooks, PullPayments, Payouts
Create, Dashboard, General, Rates, OnchainSettings, LightningSettings, Lightning, CheckoutAppearance, Tokens, Users, PayButton, Plugins, Webhooks, PullPayments, Payouts
}
}

View File

@@ -14,7 +14,7 @@
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.CheckoutAppearance))" class="nav-link @ViewData.IsActivePage(StoreNavPages.CheckoutAppearance)" asp-controller="UIStores" asp-action="CheckoutAppearance" asp-route-storeId="@storeId">Checkout Appearance</a>
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Tokens))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Tokens)" asp-controller="UIStores" asp-action="ListTokens" asp-route-storeId="@storeId">Access Tokens</a>
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Users))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Users)" asp-controller="UIStores" asp-action="StoreUsers" asp-route-storeId="@storeId">Users</a>
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Integrations))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Integrations)" asp-controller="UIStores" asp-action="Integrations" asp-route-storeId="@storeId">Integrations</a>
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Plugins))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Plugins)" asp-controller="UIStores" asp-action="Plugins" asp-route-storeId="@storeId">Plugins</a>
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-@(nameof(StoreNavPages.Webhooks))" class="nav-link @ViewData.IsActivePage(StoreNavPages.Webhooks)" asp-controller="UIStores" asp-action="Webhooks" asp-route-storeId="@storeId">Webhooks</a>
<a permission="@Policies.CanModifyStoreSettings" id="SectionNav-PayoutProcessors" class="nav-link @ViewData.IsActivePage("PayoutProcessors")" asp-controller="UIPayoutProcessors" asp-action="ConfigureStorePayoutProcessors" asp-route-storeId="@storeId">Payout Processors</a>
<vc:ui-extension-point location="store-nav" model="@Model"/>

View File

@@ -65,7 +65,7 @@ window.BTCPayShopifyIntegrationModule = function () {
}
function getOrCheckInvoice(backgroundCheck) {
const url = btcPayServerUrl + "/stores/" + storeId + "/integrations/shopify/" + shopify_order_id+"?amount="+Shopify.checkout.payment_due+ (backgroundCheck ? "&checkonly=true" : "");
const url = btcPayServerUrl + "/stores/" + storeId + "/plugins/shopify/" + shopify_order_id+"?amount="+Shopify.checkout.payment_due+ (backgroundCheck ? "&checkonly=true" : "");
return fetch(url, {
method: "GET",
mode: "cors", // no-cors, cors, *same-origin,