mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Store-centric UI (#3091)
* Update layout structure and header * Implement store selector * Simplify homepage * Update layout * Use dropdown for store selector * Hide global nav in store context * Horizontal section nav * Remove outer section and container from content views * Update nav * Set store context for invoice and payment request lists * Test fixes * Persist menu collapse state on client-side * MainNav as view component * Update app routes to incorporate store context * Test fixes * Display ticker for altcoins build only * Plugins nav * Incorporate category for active page as well * Update invoice icon * Add apps list to nav * Add store context to app type controllers * Incorporate id for active page as well * Test fixes * AppsController cleanup * Nav: Display only apps for the current store * Remove leftover from merge * Nav styles optimization * Left-align content container * Increase sidebar padding on desktop * Use min-width for store selector menu * Store settings nav update * Update app and payment request routes * Test fixes * Refactor MainNav component to use StoresController * Set store context for invoice actions * Cleanups * Remove CurrentStore checks The response will be "Access denied" in case the CookieAuthorizationHandler cannot resolve the store. * Remove unnecessary store context setters * Test fix
This commit is contained in:
@@ -26,18 +26,7 @@ namespace BTCPayServer.Models.AppViewModels
|
||||
public string AppName { get; set; }
|
||||
|
||||
[Display(Name = "Store")]
|
||||
public string SelectedStore { get; set; }
|
||||
|
||||
public void SetStores(StoreData[] stores)
|
||||
{
|
||||
var defaultStore = stores[0].Id;
|
||||
var choices = stores.Select(o => new Format() { Name = o.StoreName, Value = o.Id }).ToArray();
|
||||
var chosen = choices.FirstOrDefault(f => f.Value == defaultStore) ?? choices.FirstOrDefault();
|
||||
Stores = new SelectList(choices, nameof(chosen.Value), nameof(chosen.Name), chosen);
|
||||
SelectedStore = chosen.Value;
|
||||
}
|
||||
|
||||
public SelectList Stores { get; set; }
|
||||
public string StoreId { get; set; }
|
||||
|
||||
[Display(Name = "App Type")]
|
||||
public string SelectedAppType { get; set; }
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace BTCPayServer.Models.InvoicingModels
|
||||
{
|
||||
public List<InvoiceModel> Invoices { get; set; } = new List<InvoiceModel>();
|
||||
public string[] StoreIds { get; set; }
|
||||
public string StoreId { get; set; }
|
||||
}
|
||||
|
||||
public class InvoiceModel
|
||||
|
||||
@@ -13,7 +13,6 @@ namespace BTCPayServer.Models.PaymentRequestViewModels
|
||||
public class ListPaymentRequestsViewModel : BasePagingViewModel
|
||||
{
|
||||
public List<ViewPaymentRequestViewModel> Items { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class UpdatePaymentRequestViewModel
|
||||
@@ -82,6 +81,7 @@ namespace BTCPayServer.Models.PaymentRequestViewModels
|
||||
public ViewPaymentRequestViewModel(PaymentRequestData data)
|
||||
{
|
||||
Id = data.Id;
|
||||
StoreId = data.StoreDataId;
|
||||
var blob = data.GetBlob();
|
||||
Archived = data.Archived;
|
||||
Title = blob.Title;
|
||||
@@ -121,6 +121,7 @@ namespace BTCPayServer.Models.PaymentRequestViewModels
|
||||
public string AmountDueFormatted { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string StoreId { get; set; }
|
||||
public string Currency { get; set; }
|
||||
public DateTime? ExpiryDate { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user