Setup guide: Link wallet setup always to BTC (#3442)

This commit is contained in:
d11n 2022-02-10 04:17:15 +01:00 committed by GitHub
parent 699231fd92
commit 99c4ebe046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 48 deletions

View File

@ -228,7 +228,10 @@ namespace BTCPayServer.Tests
/// <param name="derivationScheme"></param>
public void AddDerivationScheme(string cryptoCode = "BTC", string derivationScheme = "xpub661MyMwAqRbcGABgHMUXDzPzH1tU7eZaAaJQXhDXsSxsqyQzQeU6kznNfSuAyqAK9UaWSaZaMFdNiY5BCF4zBPAzSnwfUAwUhwttuAKwfRX-[legacy]")
{
GoToWalletSettings(cryptoCode);
if (!Driver.PageSource.Contains($"Setup {cryptoCode} Wallet"))
{
GoToWalletSettings(cryptoCode);
}
Driver.FindElement(By.Id("ImportWalletOptionsLink")).Click();
Driver.FindElement(By.Id("ImportXpubLink")).Click();
@ -251,10 +254,9 @@ namespace BTCPayServer.Tests
public void AddLightningNode(string cryptoCode = null, LightningConnectionType? connectionType = null, bool test = true)
{
cryptoCode ??= "BTC";
Driver.FindElement(By.Id($"StoreNav-Lightning{cryptoCode}")).Click();
if (Driver.PageSource.Contains("id=\"SetupLightningNodeLink\""))
if (!Driver.PageSource.Contains("Connect to a Lightning node"))
{
Driver.FindElement(By.Id("SetupLightningNodeLink")).Click();
GoToLightningSettings();
}
var connectionString = connectionType switch

View File

@ -151,9 +151,6 @@ namespace BTCPayServer.Controllers
var vm = new StoreDashboardViewModel
{
#if ALTCOINS
AltcoinsBuild = true,
#endif
WalletEnabled = derivationSchemes.Any(scheme => !string.IsNullOrEmpty(scheme.Value) && scheme.Enabled),
LightningEnabled = lightningNodes.Any(ln => !string.IsNullOrEmpty(ln.Address) && ln.Enabled),
StoreId = CurrentStore.Id,

View File

@ -6,5 +6,4 @@ public class StoreDashboardViewModel
public string StoreName { get; set; }
public bool WalletEnabled { get; set; }
public bool LightningEnabled { get; set; }
public bool AltcoinsBuild { get; set; }
}

View File

@ -26,26 +26,13 @@ else
</div>
@if (!Model.WalletEnabled)
{
if (!Model.AltcoinsBuild)
{
<a asp-controller="UIStores" asp-action="SetupWallet" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="BTC" id="SetupGuide-Wallet" class="list-group-item list-group-item-action d-flex align-items-center order-1">
<vc:icon symbol="new-wallet"/>
<div class="content">
<h5 class="mb-0">Set up a wallet</h5>
</div>
<vc:icon symbol="caret-right"/>
</a>
}
else
{
<a asp-controller="UIStores" asp-action="GeneralSettings" asp-route-storeId="@Model.StoreId" id="SetupGuide-Wallet" class="list-group-item list-group-item-action d-flex align-items-center order-1">
<vc:icon symbol="new-wallet"/>
<div class="content">
<h5 class="mb-0">Set up a wallet</h5>
</div>
<vc:icon symbol="caret-right"/>
</a>
}
<a asp-controller="UIStores" asp-action="SetupWallet" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="BTC" id="SetupGuide-Wallet" class="list-group-item list-group-item-action d-flex align-items-center order-1">
<vc:icon symbol="new-wallet"/>
<div class="content">
<h5 class="mb-0">Set up a wallet</h5>
</div>
<vc:icon symbol="caret-right"/>
</a>
}
else
{
@ -58,26 +45,13 @@ else
}
@if (!Model.LightningEnabled)
{
if (!Model.AltcoinsBuild)
{
<a asp-controller="UIStores" asp-action="SetupLightningNode" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="BTC" id="SetupGuide-Lightning" class="list-group-item list-group-item-action d-flex align-items-center order-1">
<vc:icon symbol="new-wallet"/>
<div class="content">
<h5 class="mb-0">Set up a Lightning node</h5>
</div>
<vc:icon symbol="caret-right"/>
</a>
}
else
{
<a asp-controller="UIStores" asp-action="GeneralSettings" asp-route-storeId="@Model.StoreId" id="SetupGuide-Lightning" class="list-group-item list-group-item-action d-flex align-items-center order-1">
<vc:icon symbol="new-wallet"/>
<div class="content">
<h5 class="mb-0">Set up a Lightning node</h5>
</div>
<vc:icon symbol="caret-right"/>
</a>
}
<a asp-controller="UIStores" asp-action="SetupLightningNode" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="BTC" id="SetupGuide-Lightning" class="list-group-item list-group-item-action d-flex align-items-center order-1">
<vc:icon symbol="new-wallet"/>
<div class="content">
<h5 class="mb-0">Set up a Lightning node</h5>
</div>
<vc:icon symbol="caret-right"/>
</a>
}
else
{