Products -> Layers
This commit is contained in:
@@ -4,8 +4,6 @@
|
|||||||
@inject AuthService AuthService
|
@inject AuthService AuthService
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<MudText Typo="Typo.body1" Class="mt-4">Witaj w DiunaBI!</MudText>
|
|
||||||
|
|
||||||
@if (AuthService.IsAuthenticated && AuthService.CurrentUser != null)
|
@if (AuthService.IsAuthenticated && AuthService.CurrentUser != null)
|
||||||
{
|
{
|
||||||
<MudCard Class="mt-4" Elevation="2">
|
<MudCard Class="mt-4" Elevation="2">
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
@using MudBlazor.Internal
|
@using MudBlazor.Internal
|
||||||
<MudText Typo="Typo.h4" Class="mb-4">Lista Produktów</MudText>
|
|
||||||
|
|
||||||
<MudExpansionPanels Class="mb-4">
|
<MudExpansionPanels Class="mb-4">
|
||||||
<MudExpansionPanel Icon="@Icons.Material.Filled.FilterList"
|
<MudExpansionPanel Icon="@Icons.Material.Filled.FilterList"
|
||||||
Text="Filtry"
|
Text="Filtry"
|
||||||
@@ -9,10 +7,10 @@
|
|||||||
<MudItem xs="12" sm="6" md="4">
|
<MudItem xs="12" sm="6" md="4">
|
||||||
<MudTextField @bind-Value="filterRequest.Search"
|
<MudTextField @bind-Value="filterRequest.Search"
|
||||||
Label="Szukaj"
|
Label="Szukaj"
|
||||||
Placeholder="Nazwa, Kod, EAN..."
|
Placeholder="Nazwa, numer..."
|
||||||
Immediate="true"
|
Immediate="true"
|
||||||
DebounceInterval="500"
|
DebounceInterval="500"
|
||||||
OnDebounceIntervalElapsed="SearchProducts"
|
OnDebounceIntervalElapsed="SearchLayers"
|
||||||
Clearable="true"/>
|
Clearable="true"/>
|
||||||
|
|
||||||
</MudItem>
|
</MudItem>
|
||||||
@@ -36,27 +34,15 @@
|
|||||||
Loading="isLoading"
|
Loading="isLoading"
|
||||||
LoadingProgressColor="Color.Info">
|
LoadingProgressColor="Color.Info">
|
||||||
<HeaderContent>
|
<HeaderContent>
|
||||||
<MudTh>Nazwa</MudTh>
|
<MudTh>Name</MudTh>
|
||||||
<MudTh>Kod</MudTh>
|
<MudTh>Type</MudTh>
|
||||||
<MudTh>EAN</MudTh>
|
|
||||||
<MudTh>Akcje</MudTh>
|
|
||||||
</HeaderContent>
|
</HeaderContent>
|
||||||
<RowTemplate>
|
<RowTemplate>
|
||||||
<MudTd DataLabel="Nazwa">@context.Name</MudTd>
|
<MudTd DataLabel="Name">@context.Name</MudTd>
|
||||||
<MudTd DataLabel="Kod">KOD</MudTd>
|
<MudTd DataLabel="Type">@context.Type</MudTd>
|
||||||
<MudTd DataLabel="EAN"></MudTd>
|
|
||||||
<MudTd DataLabel="Akcje">
|
|
||||||
<MudIconButton Icon="@Icons.Material.Filled.Edit"
|
|
||||||
Size="Size.Small"
|
|
||||||
OnClick="() => EditProduct(context.Id)"/>
|
|
||||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
|
||||||
Size="Size.Small"
|
|
||||||
Color="Color.Error"
|
|
||||||
OnClick="() => DeleteProduct(context.Id)"/>
|
|
||||||
</MudTd>
|
|
||||||
</RowTemplate>
|
</RowTemplate>
|
||||||
<NoRecordsContent>
|
<NoRecordsContent>
|
||||||
<MudText>Brak produktów do wyświetlenia</MudText>
|
<MudText>No layers to display</MudText>
|
||||||
</NoRecordsContent>
|
</NoRecordsContent>
|
||||||
<LoadingContent>
|
<LoadingContent>
|
||||||
Ładowanie...
|
Ładowanie...
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ public partial class LayerListComponent : ComponentBase
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
await LoadProducts();
|
await LoadLayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task LoadProducts()
|
private async Task LoadLayers()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ public partial class LayerListComponent : ComponentBase
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Loading products failed: {ex.Message}");
|
Console.WriteLine($"Loading layers failed: {ex.Message}");
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -39,33 +39,21 @@ public partial class LayerListComponent : ComponentBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task SearchProducts()
|
private async Task SearchLayers()
|
||||||
{
|
{
|
||||||
filterRequest.Page = 1;
|
filterRequest.Page = 1;
|
||||||
await LoadProducts();
|
await LoadLayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnPageChanged(int page)
|
private async Task OnPageChanged(int page)
|
||||||
{
|
{
|
||||||
filterRequest.Page = page;
|
filterRequest.Page = page;
|
||||||
await LoadProducts();
|
await LoadLayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ClearFilters()
|
private async Task ClearFilters()
|
||||||
{
|
{
|
||||||
filterRequest = new LayerFilterRequest();
|
filterRequest = new LayerFilterRequest();
|
||||||
await LoadProducts();
|
await LoadLayers();
|
||||||
}
|
|
||||||
|
|
||||||
private async Task EditProduct(Guid productId)
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
Console.WriteLine($"Edytuj produkt: {productId}");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task DeleteProduct(Guid productId)
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
Console.WriteLine($"Usuń produkt: {productId}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<MudNavLink href="dashboard" Icon="@Icons.Material.Filled.Dashboard" Match="NavLinkMatch.All">
|
<MudNavLink href="dashboard" Icon="@Icons.Material.Filled.Dashboard" Match="NavLinkMatch.All">
|
||||||
Dashboard
|
Dashboard
|
||||||
</MudNavLink>
|
</MudNavLink>
|
||||||
<MudNavLink Href="products" Icon="@Icons.Material.Filled.List" Match="NavLinkMatch.All">
|
<MudNavLink Href="layers" Icon="@Icons.Material.Filled.List" Match="NavLinkMatch.All">
|
||||||
Produkty
|
Layers
|
||||||
</MudNavLink>
|
</MudNavLink>
|
||||||
</MudNavMenu>
|
</MudNavMenu>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
Class="mud-width-250">
|
Class="mud-width-250">
|
||||||
<MudNavMenu>
|
<MudNavMenu>
|
||||||
<MudNavLink Href="/dashboard" Icon="@Icons.Material.Filled.Dashboard">Dashboard</MudNavLink>
|
<MudNavLink Href="/dashboard" Icon="@Icons.Material.Filled.Dashboard">Dashboard</MudNavLink>
|
||||||
<MudNavLink Href="/products" Icon="@Icons.Material.Filled.Inventory">Products</MudNavLink>
|
<MudNavLink Href="/layers" Icon="@Icons.Material.Filled.Inventory">Layers</MudNavLink>
|
||||||
</MudNavMenu>
|
</MudNavMenu>
|
||||||
</MudDrawer>
|
</MudDrawer>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@page "/products"
|
@page "/layers"
|
||||||
@using DiunaBI.UI.Shared.Components
|
@using DiunaBI.UI.Shared.Components
|
||||||
|
|
||||||
<PageTitle>Warstwy</PageTitle>
|
<PageTitle>Layers</PageTitle>
|
||||||
|
|
||||||
<MudContainer MaxWidth="MaxWidth.ExtraExtraLarge">
|
<MudContainer MaxWidth="MaxWidth.ExtraExtraLarge">
|
||||||
<LayerListComponent />
|
<LayerListComponent />
|
||||||
|
|||||||
Reference in New Issue
Block a user