feat(it-inventory): dynamic types, rented status, rack visualization, simplified form
- Rewrite types.ts: dynamic InventoryItemType (string-based), DEFAULT_EQUIPMENT_TYPES with server/switch/ups/patch-panel, RACK_MOUNTABLE_TYPES set, new 'rented' status with STATUS_LABELS export - Remove deprecated fields: assignedTo, assignedToContactId, purchaseDate, purchaseCost, warrantyExpiry - Add rack fields: rackPosition (1-42), rackSize (1-4U) on InventoryItem - New server-rack.tsx: 42U rack visualization with color-coded status slots, tooltips, occupied/empty rendering - Rewrite it-inventory-module.tsx: tabbed UI (Inventar + Rack 42U), 5 stat cards with purple pulse for rented count, inline custom type creation, conditional rack position fields for mountable types, simplified form - Fix search filter in use-inventory.ts: remove assignedTo reference, search rackLocation/location Task 3.08 complete
This commit is contained in:
@@ -4,6 +4,38 @@
|
||||
|
||||
---
|
||||
|
||||
## Session — 2026-02-27 late night (GitHub Copilot - Claude Opus 4.6)
|
||||
|
||||
### Context
|
||||
|
||||
Continued Phase 3. Fixed critical Registratura bugs reported by user + started next task.
|
||||
|
||||
### Completed
|
||||
|
||||
- **Registratura Bug Fixes (6 issues):**
|
||||
1. **File upload loading feedback** — Added `uploadingCount` state tracking FileReader progress. Shows spinner + "Se încarcă X fișiere…" next to Atașamente label. Submit button shows "Se încarcă fișiere…" and is disabled while files load.
|
||||
2. **Duplicate registration numbers** — Root cause: `generateRegistryNumber` counted entries instead of parsing max existing number. Fix: parse actual number from regex `PREFIX-NNNN/YYYY`, find max, +1. Also: `addEntry` now fetches fresh entries from storage before generating number (eliminates race condition from stale state).
|
||||
3. **Form submission lock** — Added `isSubmitting` state. Submit button disabled + shows Loader2 spinner during save. Prevents double-click creating multiple entries.
|
||||
4. **Unified close/resolve flow** — Added `ClosureResolution` type (finalizat/aprobat-tacit/respins/retras/altele) to `ClosureInfo`. CloseGuardDialog now has resolution selector matching deadline resolve options. ClosureBanner shows resolution badge.
|
||||
5. **Backdating support** — Date field renamed "Data document" with tooltip explaining retroactive registration. Added `registrationDate` field on RegistryEntry (auto = today). Registry table shows "(înr. DATE)" when registrationDate differs from document date. Numbers remain sequential regardless of document date.
|
||||
6. **"Actualizează" button feedback** — Submit button now shows loading spinner when saving, disabled during upload. `onSubmit` prop accepts `Promise<void>` for proper async tracking.
|
||||
|
||||
### Files Modified
|
||||
|
||||
- `src/modules/registratura/types.ts` — Added `ClosureResolution` type, `registrationDate` field on RegistryEntry, `resolution` field on ClosureInfo
|
||||
- `src/modules/registratura/services/registry-service.ts` — Rewrote `generateRegistryNumber` to parse max existing number via regex
|
||||
- `src/modules/registratura/hooks/use-registry.ts` — `addEntry` fetches fresh entries before generating number
|
||||
- `src/modules/registratura/components/registry-entry-form.tsx` — Upload progress tracking, submission lock, date tooltip, async submit
|
||||
- `src/modules/registratura/components/registry-table.tsx` — "Data doc." header, shows registrationDate when different
|
||||
- `src/modules/registratura/components/close-guard-dialog.tsx` — Resolution selector added
|
||||
- `src/modules/registratura/components/closure-banner.tsx` — Resolution badge display
|
||||
|
||||
### Commits
|
||||
|
||||
- `8042df4` fix(registratura): prevent duplicate numbers, add upload progress, submission lock, unified close/resolve, backdating support
|
||||
|
||||
---
|
||||
|
||||
## Session — 2026-02-27 night (GitHub Copilot - Claude Opus 4.6)
|
||||
|
||||
### Context
|
||||
|
||||
Reference in New Issue
Block a user