Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
@using CulinaryCommand.Services
@using CulinaryCommand.Data.Enums;
@using CulinaryCommand.Services.UserContextSpace
@using CulinaryCommandApp.Recipe.Services;
@using CulinaryCommandApp.Recipe.Services.Interfaces;
@using CulinaryCommandApp.Recipe.Entities;
@inject IUserContextService UserCtx
@inject NavigationManager Nav
@inject ILocationService LocationService
@inject IUserService UserService
@inject LocationState LocationState
@inject ITaskAssignmentService TaskService
@inject RecipeService RecipeService
@inject IRecipeService RecipeService

@implements IDisposable
@rendermode InteractiveServer
Expand Down Expand Up @@ -346,11 +349,8 @@ else

try
{
var all = await RecipeService.GetAllAsync();
recipes = all
.Where(r => r.LocationId == selectedLocationId.Value)
.OrderBy(r => r.Title)
.ToList();
recipes = await RecipeService.GetAllByLocationIdAsync(selectedLocationId.Value);
recipes = recipes.OrderBy(r => r.Title).ToList();
}
catch
{
Expand Down
64 changes: 64 additions & 0 deletions CulinaryCommandApp/Components/Pages/EmployeeView.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
@rendermode InteractiveServer

@using CulinaryCommand.Components.Custom
@using CulinaryCommand.Services.UserContextSpace
@using CulinaryCommand.Services

@inject IUserContextService UserCtx
@inject LocationState LocationState

<div class="employee-dashboard">
<h2 class="mb-4 text-primary">Employee Dashboard</h2>

@if (!_ready)
{
<div class="text-center mt-5">Loading...</div>
}
else if (LocationState.CurrentLocation is null)
{
<p class="text-muted">No location assigned. Please contact your manager.</p>
}
else
{
<p class="text-muted mb-4">Welcome to <strong>@LocationState.CurrentLocation.Name</strong>.</p>

<div class="container mt-2">
<div class="row g-5">
<div class="col-12 col-md-6">
<DashboardCard Title="My Assigned Tasks"
Value="View Tasks"
Color="#3662e3"
IconClass="bi bi-list-check"
Link="/my-tasks" />
<DashboardCard Title="Recipes"
Value="Browse Recipes"
Color="#688f72"
IconClass="bi bi-journal-richtext"
Link="/recipes" />
</div>
<div class="col-12 col-md-6">
<DashboardCard Title="Inventory"
Value="View Inventory"
Color="#ca3a31"
IconClass="bi bi-box-seam"
Link="/inventory-management" />
<DashboardCard Title="Purchase Orders"
Value="View Orders"
Color="#e28743"
IconClass="bi bi-file-earmark-check"
Link="/purchase-orders" />
</div>
</div>
</div>
}
</div>

@code {

private bool _ready;

protected override async Task OnInitializedAsync()
{
_ready = true;
}
}
31 changes: 0 additions & 31 deletions CulinaryCommandApp/Components/Pages/Recipes/Create.razor

This file was deleted.

33 changes: 0 additions & 33 deletions CulinaryCommandApp/Components/Pages/Recipes/Edit.razor

This file was deleted.

5 changes: 0 additions & 5 deletions CulinaryCommandApp/Components/Pages/Recipes/Index.razor

This file was deleted.

Loading
Loading