Empty states: Setup guide for store and wallet (#3255)

* Store Selector: Create first store button

* Add setup guide to homepage

* Policy update for stores list

* Fix test

* Initial create store button as primary

* Add notifications list to homepage

* Remove back to list from store create view

* Adapt content padding on desktop

* Add store home view with setup guide

* Fix active page nav highlighting

* Test fix

* Remove What's Next section

* Rename Store Home to Dashboard

* Fix Lightning setup link

* Add tests for store setup guide

* Update BTCPayServer/Views/Home/Home.cshtml

Co-authored-by: Pavlenex <pavle@pavle.org>

* Update BTCPayServer/Views/Stores/Dashboard.cshtml

Co-authored-by: Pavlenex <pavle@pavle.org>

* Remove setup guide on global homepage

* Remove Shopify setup link from nav

* Fix content container max-width on desktop

Co-authored-by: Pavlenex <pavle@pavle.org>
This commit is contained in:
d11n
2022-01-13 09:08:15 +01:00
committed by GitHub
parent 0c0235a56e
commit 69d1acc797
25 changed files with 522 additions and 284 deletions

View File

@@ -136,6 +136,29 @@ namespace BTCPayServer.Controllers
return this.HttpContext.GetStoreData();
}
}
[HttpGet("{storeId}")]
public IActionResult Dashboard()
{
var store = CurrentStore;
var storeBlob = store.GetStoreBlob();
AddPaymentMethods(store, storeBlob,
out var derivationSchemes, out var lightningNodes);
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,
StoreName = CurrentStore.StoreName
};
return View("Dashboard", vm);
}
[HttpPost]
[Route("{storeId}/users")]
@@ -562,7 +585,7 @@ namespace BTCPayServer.Controllers
}
}
[HttpGet("{storeId}")]
[HttpGet("{storeId}/payment-methods")]
public IActionResult PaymentMethods()
{
var store = HttpContext.GetStoreData();
@@ -591,7 +614,7 @@ namespace BTCPayServer.Controllers
return View(vm);
}
[HttpPost("{storeId}")]
[HttpPost("{storeId}/payment-methods")]
public async Task<IActionResult> PaymentMethods(PaymentMethodsViewModel model, string command = null)
{
bool needUpdate = false;