39 lines
1.2 KiB
Markdown
39 lines
1.2 KiB
Markdown
# 2026-07-17 — P1-4 modal migration: Inventory.tsx (4 of 4)
|
||
|
||
Branch: `feat/p1-4-modals-inventory`
|
||
Worktree: `.worktrees/feat-p1-4-modals-inventory`
|
||
|
||
## Why
|
||
|
||
P1-4 from the readiness audit asks for every inline modal to use the
|
||
shared `<Modal>` component. Continues the sweep with
|
||
`admin/Inventory.tsx`.
|
||
|
||
## Changes
|
||
|
||
### `client/src/pages/admin/Inventory.tsx`
|
||
|
||
Migrated 4 of 4 modals to `<Modal>` + `<ModalBody>`:
|
||
|
||
- **Add Stock** — 5-field form (quantity, unit price, store, reference,
|
||
notes)
|
||
- **Issue** — multi-section form (item search, borrower type,
|
||
quantity, due date, notes)
|
||
- **Return** — 5-field form (quantity returned, condition, notes,
|
||
damage)
|
||
- **Add Item** — 7-field form (name, code, category, supplier, unit,
|
||
prices, reorder level)
|
||
|
||
Each modal's inline `bg-card rounded-[2.5rem]` shell + chip+title
|
||
header + × close button are removed; `<Modal>` injects its own
|
||
header / close. The body keeps its existing classes
|
||
(`p-6 md:p-8 space-y-6`, etc.) — wrapped in `<ModalBody>` so the
|
||
default `px-6 py-5` is overridden visually by the body content.
|
||
|
||
## Verification
|
||
|
||
- `node scripts/lint-no-inline-modals.js` → `Inventory.tsx` count
|
||
dropped 4 → 0.
|
||
- `node scripts/lint-no-inline-modals.js` (whole-tree) — no other
|
||
regressions.
|