feat: Introduce dynamic tab management, sidebar, and search bar components, update backend database schema, and remove old SQL schema.

This commit is contained in:
2025-12-03 00:42:03 +01:00
parent 30a86848bf
commit 772d4632c9
13 changed files with 5183 additions and 665 deletions

View File

@@ -6,3 +6,7 @@ File riassuntivo dello stato di sviluppo di Zentral.
- [2025-12-02 Rebranding Apollinare to Zentral](./log/2025-12-02_rebranding.md) - **Completato**
- Rinomina completa del progetto (Backend & Frontend).
- [2025-12-03 UI Restructuring](./devlog/2025-12-03_ui_restructuring.md) - **Completato**
- Ristrutturazione interfaccia: Sidebar a 2 livelli, Tabs, SearchBar.
- [2025-12-03 Backend Fix](./devlog/2025-12-03_backend_fix.md) - **Completato**
- Fix mancata migrazione database e avvio backend.

View File

@@ -0,0 +1,17 @@
# Backend Fix - Sync Model Changes
## Problem
The backend was failing to start with a `System.InvalidOperationException` because the `ZentralDbContext` model had pending changes that were not captured in a migration.
## Solution
1. Created a new migration `SyncModelChanges` to synchronize the database schema with the code.
- Command: `dotnet ef migrations add SyncModelChanges --project Zentral.Infrastructure --startup-project Zentral.API`
2. Updated the database.
- Command: `dotnet ef database update --project Zentral.Infrastructure --startup-project Zentral.API`
## Status
- [x] Create Migration
- [x] Update Database
- [x] Verify Backend Startup
The backend now starts correctly and listens on the configured port.

View File

@@ -0,0 +1,53 @@
# UI Restructuring Plan
## Objective
Restructure the graphical interface according to the guidelines:
- 2-level sidebar (Apps -> Functions).
- Top search bar.
- Tabbed interface for the main viewport.
- Responsive design.
## Components to Create/Update
### 1. TabContext (`src/frontend/src/contexts/TabContext.tsx`)
- **State**:
- `tabs`: Array of `{ id: string, path: string, label: string, icon?: ReactNode }`.
- `activeTabPath`: string.
- **Actions**:
- `openTab(tab)`: Adds tab if not exists, sets as active.
- `closeTab(path)`: Removes tab. If active, switches to neighbor.
- `setActiveTab(path)`: Updates active tab.
- **Persistence**: Save `tabs` and `activeTabPath` to `localStorage`.
### 2. TabsBar (`src/frontend/src/components/TabsBar.tsx`)
- Renders the list of open tabs using MUI `Tabs` or a custom horizontal list.
- Handles click (navigate) and close actions.
- Mobile: Show as a popup or scrollable bar.
### 3. Sidebar (`src/frontend/src/components/Sidebar.tsx`)
- Refactor existing Drawer content.
- Implement nested lists (Accordion style) for Modules.
- Structure:
- **Core**: Dashboard, Calendar, Events, Clients, Location, Articles, Resources.
- **Warehouse**: Dashboard, Articles, Locations, Movements, Stock, Inventory.
- **Purchases**: Suppliers, Orders.
- **Sales**: Orders.
- **Production**: Dashboard, Orders, BOM, Work Centers, Cycles, MRP.
- **Admin**: Modules, Auto Codes, Custom Fields.
### 4. SearchBar (`src/frontend/src/components/SearchBar.tsx`)
- Input field in AppBar.
- Filters available menu items.
- On selection, opens the corresponding tab.
### 5. Layout (`src/frontend/src/components/Layout.tsx`)
- Integrate `Sidebar`, `SearchBar`, and `TabsBar`.
- Ensure responsive behavior.
## Execution Steps
1. Create `TabContext`.
2. Create `TabsBar`.
3. Refactor `Layout` to include `TabsBar` and use `TabContext`.
4. Create `Sidebar` with nested structure.
5. Create `SearchBar` and integrate into `Layout`.
6. Verify functionality.