-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
101 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/Client/Logistics.AdminApp/Pages/Subscription/ListSubscriptions.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@page "/subscriptions" | ||
@inherits PageBase | ||
|
||
<RadzenText TextStyle="TextStyle.H3">Subscription Plans</RadzenText> | ||
<hr/> | ||
|
||
<RadzenButton class="mb-3" Click="@(() => Navigation.NavigateTo("/tenants/add"))">Add</RadzenButton> | ||
|
||
<RadzenGrid Data="_subscriptions" | ||
LoadData="LoadData" | ||
Count="_totalRecords" | ||
AllowPaging="true" | ||
AllowSorting="true" | ||
PageSizeOptions="new[] { 10, 25, 50 }" | ||
PageSize="10"> | ||
<Columns> | ||
<RadzenGridColumn TItem="SubscriptionDto" | ||
Property="Tenant" | ||
Title="Tenant"> | ||
<Template Context="subscription"> | ||
<RadzenText Text="@subscription.Tenant.Name" /> | ||
</Template> | ||
</RadzenGridColumn> | ||
<RadzenGridColumn TItem="SubscriptionDto" | ||
Property="Tenant" | ||
Title="Company"> | ||
<Template Context="subscription"> | ||
<RadzenText Text="@subscription.Tenant.CompanyName" /> | ||
</Template> | ||
</RadzenGridColumn> | ||
<RadzenGridColumn TItem="SubscriptionDto" | ||
Property="Plan" | ||
Title="Subscription Plan"> | ||
<Template Context="subscription"> | ||
<RadzenText Text="@subscription.Plan.Name" /> | ||
</Template> | ||
</RadzenGridColumn> | ||
<RadzenGridColumn TItem="SubscriptionDto" | ||
Property="Status" | ||
Title="Status"> | ||
</RadzenGridColumn> | ||
<RadzenGridColumn TItem="SubscriptionDto" | ||
Property="StartDate" | ||
Title="Start Date"> | ||
</RadzenGridColumn> | ||
<RadzenGridColumn TItem="SubscriptionDto" | ||
Property="NextPaymentDate" | ||
Title="Next Payment Date"> | ||
</RadzenGridColumn> | ||
<RadzenGridColumn TItem="SubscriptionDto" | ||
Property="TrialEndDate" | ||
Title="Trial End Date"> | ||
</RadzenGridColumn> | ||
<RadzenGridColumn TItem="SubscriptionDto" | ||
Property="EndDate" | ||
Title="End Date"> | ||
</RadzenGridColumn> | ||
<RadzenGridColumn TItem="SubscriptionDto" Title="Action"> | ||
<Template Context="subscription"> | ||
<RadzenButton Click="@(() => Navigation.NavigateTo($"subscriptions/{subscription.Id}"))">Edit</RadzenButton> | ||
</Template> | ||
</RadzenGridColumn> | ||
</Columns> | ||
</RadzenGrid> |
31 changes: 31 additions & 0 deletions
31
src/Client/Logistics.AdminApp/Pages/Subscription/ListSubscriptions.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Logistics.Shared; | ||
using Logistics.Shared.Models; | ||
using Microsoft.AspNetCore.Components; | ||
using Radzen; | ||
|
||
namespace Logistics.AdminApp.Pages.Subscription; | ||
|
||
public partial class ListSubscriptions : PageBase | ||
{ | ||
private IEnumerable<SubscriptionDto>? _subscriptions; | ||
private int _totalRecords = 10; | ||
|
||
|
||
#region Injectable services | ||
|
||
[Inject] | ||
private NavigationManager Navigation { get; set; } = default!; | ||
|
||
#endregion | ||
|
||
|
||
private async void LoadData(LoadDataArgs e) | ||
{ | ||
var page = (e.Skip ?? 0) + 1; | ||
var pageSize = e.Top ?? 10; | ||
var pagedData = await CallApiAsync(api => api.GetSubscriptionsAsync(new PagedQuery(page, pageSize))); | ||
_subscriptions = pagedData?.Items; | ||
_totalRecords = pagedData?.TotalItems ?? 0; | ||
StateHasChanged(); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters