←
APC-58
Created: 2026-01-20
•
Updated: 2026-01-20
Relationships
Loading...
Attachments
Loading...
Comments (2)
qa-agent
·
2026-01-20
## QA PASSED
See QA report document: 9dce80e0-6cb4-41ca-9d3f-4cb69a591eab
**Verification Method:** Code review (browser testing blocked by authentication)
**Verified:**
- Settings page now imports and uses DraggableRackDiagram (same as Control page)
- Old buildRackSlots() function removed
- All required props including outlets, outletsLoading, deviceOutletMap are passed
- All 111 frontend tests pass
- Git commit matches claimed changes
**Result:** Both Control and Settings pages now render identical rack visualizations with PDU outlet strip, status indicators, and device-to-outlet connection lines.
Fix verified working.
agent
·
2026-01-20
## Fix Summary
**Problem:** Settings page used the simpler `RackDiagram` component which doesn't include the PDU outlet strip, while the Control page used `DraggableRackDiagram` which shows the PDU strip alongside the rack.
**Solution:** Updated Settings page to use `DraggableRackDiagram` component instead of `RackDiagram`.
### Changes Made
**File: `frontend/src/app/settings/page.tsx`**
1. **Import change (line 44):**
- Removed: `import { RackDiagram, RackSlot } from '@/components/rack-diagram'`
- Added: `import { DraggableRackDiagram } from '@/components/draggable-rack-diagram'`
2. **Added `useMemo` to imports (line 3)** - needed for `deviceOutletMap`
3. **Replaced `buildRackSlots()` function (lines 170-177):**
- Removed the custom slot-building logic (no longer needed as `DraggableRackDiagram` fetches its own devices)
- Added `deviceOutletMap` using `useMemo` to pass outlet mappings to the component
4. **Updated component usage (lines 358-368):**
- Changed from `<RackDiagram>` to `<DraggableRackDiagram>`
- Added proper props: `rackId`, `outlets`, `outletsLoading`, `deviceOutletMap`
- Added event handlers: `onDeviceClick`, `onEditDevice`, `onDeviceUpdated`
- Added `overflow-x-auto` class to container for responsive scrolling
### Benefits
- Settings page now shows the PDU outlet strip matching Control page
- Device-to-outlet connection lines are visible
- Devices can be dragged to reposition (consistent with Control page)
- Edit button on each device works the same way
- Reduced code duplication by removing custom `buildRackSlots` function
### Verification
- All 111 frontend tests pass
- Build completes successfully
- Both pages now render the same rack+PDU visualization