Skip to content

Self-hosted homelab infrastructure visualizer — interactive network diagram with live status monitoring

refactor(inventory): rename the Approve action to "Put in current Canvas"

Pouzorfb3966329302
diff --git a/frontend/src/components/modals/DeviceInventoryModal.tsx b/frontend/src/components/modals/DeviceInventoryModal.tsx
index a4e96d0..478de63 100644
--- a/frontend/src/components/modals/DeviceInventoryModal.tsx
+++ b/frontend/src/components/modals/DeviceInventoryModal.tsx
@@ -363,7 +363,7 @@ export function DeviceInventoryModal({ open, onClose, highlightId, initialStatus
})
injectAutoEdges(res.data.edges)
const extra = res.data.edges_created > 0 ? ` (+${res.data.edges_created} link${res.data.edges_created !== 1 ? 's' : ''})` : ''
- toast.success(`Approved ${nodeData.label}${extra}`)
+ toast.success(`Put ${nodeData.label} in the canvas${extra}`)
// Keep the row (now on-canvas, shown with an "In N canvas" badge); reload
// for a fresh canvas_count rather than dropping it until reopen.
setSelected(null)
@@ -547,7 +547,7 @@ export function DeviceInventoryModal({ open, onClose, highlightId, initialStatus
setSelectedIds(new Set())
await load()
const linkExtra = res.data.edges_created > 0 ? ` (+${res.data.edges_created} link${res.data.edges_created !== 1 ? 's' : ''})` : ''
- toast.success(`Approved ${res.data.approved} device${res.data.approved !== 1 ? 's' : ''}${linkExtra}`)
+ toast.success(`Put ${res.data.approved} device${res.data.approved !== 1 ? 's' : ''} in the canvas${linkExtra}`)
// Bulk can't prompt per-device, so report the ones already on this canvas
// (skipped as duplicates) instead of silently dropping them.
const dupes = res.data.skipped_devices ?? []
@@ -833,7 +833,7 @@ export function DeviceInventoryModal({ open, onClose, highlightId, initialStatus
disabled={selectedIds.size === 0}
className="text-xs px-3 py-1.5 rounded bg-[#39d353]/20 text-[#39d353] hover:bg-[#39d353]/30 disabled:opacity-40 font-medium transition-colors"
>
- Approve ({selectedIds.size})
+ Put in current Canvas ({selectedIds.size})
</button>
<button
onClick={handleBulkHide}
diff --git a/frontend/src/components/modals/InventoryDeviceModal.tsx b/frontend/src/components/modals/InventoryDeviceModal.tsx
index dca522d..31ac6aa 100644
--- a/frontend/src/components/modals/InventoryDeviceModal.tsx
+++ b/frontend/src/components/modals/InventoryDeviceModal.tsx
@@ -870,15 +870,15 @@ export function InventoryDeviceModal({ device, onClose, onApprove, onHide, onIgn
>
Delete
</Button>
- {/* Rack gear is mounted from a rack canvas, never approved onto a
- logical one — so it gets no Approve button at all. */}
+ {/* Rack gear is mounted from a rack canvas, never placed on a
+ logical one — so it gets no canvas button at all. */}
{!rackOnly && (
<Button
size="sm"
className="bg-[#39d353]/15 text-[#39d353] hover:bg-[#39d353]/25 border border-[#39d353]/30"
onClick={handleApprove}
>
- Approve
+ Put in current Canvas
</Button>
)}
</div>
diff --git a/frontend/src/components/modals/__tests__/DeviceInventoryModal.test.tsx b/frontend/src/components/modals/__tests__/DeviceInventoryModal.test.tsx
index ec88fe2..e777265 100644
--- a/frontend/src/components/modals/__tests__/DeviceInventoryModal.test.tsx
+++ b/frontend/src/components/modals/__tests__/DeviceInventoryModal.test.tsx
@@ -350,7 +350,7 @@ describe('DeviceInventoryModal', () => {
fireEvent.click(screen.getByRole('button', { name: 'Select mode' }))
fireEvent.click(screen.getByTestId('pending-card-dev-a'))
fireEvent.click(screen.getByTestId('pending-card-dev-b'))
- fireEvent.click(screen.getByRole('button', { name: /Approve \(2\)/ }))
+ fireEvent.click(screen.getByRole('button', { name: /Put in current Canvas \(2\)/ }))
await waitFor(() => expect(mockBulkApprove).toHaveBeenCalledWith(['dev-a', 'dev-b'], null))
})
@@ -368,7 +368,7 @@ describe('DeviceInventoryModal', () => {
fireEvent.click(screen.getByRole('button', { name: 'Select mode' }))
fireEvent.click(screen.getByTestId('pending-card-dev-a'))
fireEvent.click(screen.getByTestId('pending-card-dev-b'))
- fireEvent.click(screen.getByRole('button', { name: /Approve \(2\)/ }))
+ fireEvent.click(screen.getByRole('button', { name: /Put in current Canvas \(2\)/ }))
await waitFor(() =>
expect(toast.info).toHaveBeenCalledWith(
expect.stringContaining('1 already on this canvas'),
@@ -390,7 +390,7 @@ describe('DeviceInventoryModal', () => {
fireEvent.click(screen.getByRole('button', { name: 'Select mode' }))
fireEvent.click(screen.getByTestId('pending-card-dev-a'))
fireEvent.click(screen.getByTestId('pending-card-dev-b'))
- fireEvent.click(screen.getByRole('button', { name: /Approve \(2\)/ }))
+ fireEvent.click(screen.getByRole('button', { name: /Put in current Canvas \(2\)/ }))
await waitFor(() => expect(mockBulkApprove).toHaveBeenCalled())
// Reloaded, so rows remain visible instead of the list going empty.
await waitFor(() => expect(mockPending).toHaveBeenCalledTimes(2))
@@ -404,7 +404,7 @@ describe('DeviceInventoryModal', () => {
fireEvent.click(screen.getByRole('button', { name: 'Select mode' }))
fireEvent.click(screen.getByTestId('pending-card-dev-a'))
fireEvent.click(screen.getByTestId('pending-card-dev-b'))
- fireEvent.click(screen.getByRole('button', { name: /Approve \(2\)/ }))
+ fireEvent.click(screen.getByRole('button', { name: /Put in current Canvas \(2\)/ }))
await waitFor(() => expect(mockAddNode).toHaveBeenCalledTimes(2))
// dev-a is an IP device with a MAC → node carries mac + a MAC property row.
@@ -613,7 +613,7 @@ describe('DeviceInventoryModal', () => {
fireEvent.click(screen.getByRole('button', { name: 'Select mode' }))
fireEvent.click(screen.getByTestId('pending-card-dev-a'))
fireEvent.click(screen.getByTestId('pending-card-dev-rack'))
- fireEvent.click(screen.getByRole('button', { name: /Approve \(2\)/ }))
+ fireEvent.click(screen.getByRole('button', { name: /Put in current Canvas \(2\)/ }))
await waitFor(() => expect(mockBulkApprove).toHaveBeenCalledWith(['dev-a'], null))
expect(toast.error).toHaveBeenCalledWith(expect.stringContaining('1 rack device'))
@@ -630,7 +630,7 @@ describe('DeviceInventoryModal', () => {
await waitFor(() => expect(screen.getByTestId('pending-card-dev-rack')).toBeInTheDocument())
fireEvent.click(screen.getByRole('button', { name: 'Select mode' }))
fireEvent.click(screen.getByTestId('pending-card-dev-rack'))
- fireEvent.click(screen.getByRole('button', { name: /Approve \(1\)/ }))
+ fireEvent.click(screen.getByRole('button', { name: /Put in current Canvas \(1\)/ }))
await waitFor(() => expect(mockBulkApprove).not.toHaveBeenCalled())
})
@@ -692,7 +692,7 @@ describe('DeviceInventoryModal', () => {
expect(screen.queryByTitle(/Clear all pending/)).not.toBeInTheDocument()
// …and the keyboard shortcut cannot bring select mode back either.
fireEvent.keyDown(window, { key: 's' })
- expect(screen.queryByRole('button', { name: /Approve \(/ })).not.toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: /Put in current Canvas \(/ })).not.toBeInTheDocument()
})
})
})
diff --git a/frontend/src/components/modals/__tests__/InventoryDeviceModal.test.tsx b/frontend/src/components/modals/__tests__/InventoryDeviceModal.test.tsx
index dec2b8a..d919427 100644
--- a/frontend/src/components/modals/__tests__/InventoryDeviceModal.test.tsx
+++ b/frontend/src/components/modals/__tests__/InventoryDeviceModal.test.tsx
@@ -133,7 +133,7 @@ describe('InventoryDeviceModal', () => {
render(
<InventoryDeviceModal device={device} onClose={onClose} onApprove={onApprove} onHide={vi.fn()} onIgnore={vi.fn()} />
)
- fireEvent.click(screen.getByRole('button', { name: 'Approve' }))
+ fireEvent.click(screen.getByRole('button', { name: 'Put in current Canvas' }))
expect(onApprove).toHaveBeenCalledWith(device)
expect(onClose).not.toHaveBeenCalled()
})
@@ -176,7 +176,7 @@ describe('InventoryDeviceModal — rack gear', () => {
render(
<InventoryDeviceModal device={rackDevice} onClose={vi.fn()} onApprove={vi.fn()} onHide={vi.fn()} onIgnore={vi.fn()} />
)
- expect(screen.queryByRole('button', { name: 'Approve' })).toBeNull()
+ expect(screen.queryByRole('button', { name: 'Put in current Canvas' })).toBeNull()
// Hide and Delete still apply: the entry is inventory like any other.
expect(screen.getByRole('button', { name: 'Hide' })).toBeInTheDocument()
expect(screen.getByRole('button', { name: 'Delete' })).toBeInTheDocument()
@@ -186,6 +186,6 @@ describe('InventoryDeviceModal — rack gear', () => {
render(
<InventoryDeviceModal device={makeDevice()} onClose={vi.fn()} onApprove={vi.fn()} onHide={vi.fn()} onIgnore={vi.fn()} />
)
- expect(screen.getByRole('button', { name: 'Approve' })).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: 'Put in current Canvas' })).toBeInTheDocument()
})
})
diff --git a/frontend/src/components/modals/__tests__/InventoryDeviceModalEdit.test.tsx b/frontend/src/components/modals/__tests__/InventoryDeviceModalEdit.test.tsx
index ba4a6a6..c71b99a 100644
--- a/frontend/src/components/modals/__tests__/InventoryDeviceModalEdit.test.tsx
+++ b/frontend/src/components/modals/__tests__/InventoryDeviceModalEdit.test.tsx
@@ -74,10 +74,10 @@ describe('InventoryDeviceModal — edit mode', () => {
fireEvent.click(screen.getByRole('button', { name: 'Edit' }))
expect(screen.getByRole('button', { name: 'Save' })).toBeInTheDocument()
// Lifecycle buttons belong to the view; the form has Save / Cancel.
- expect(screen.queryByRole('button', { name: 'Approve' })).toBeNull()
+ expect(screen.queryByRole('button', { name: 'Put in current Canvas' })).toBeNull()
fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
- expect(screen.getByRole('button', { name: 'Approve' })).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: 'Put in current Canvas' })).toBeInTheDocument()
})
it('seeds the form from the row, falling back to the discovery type', async () => {
diff --git a/frontend/src/walkthrough/steps.ts b/frontend/src/walkthrough/steps.ts
index 68c1100..2e99b1c 100644
--- a/frontend/src/walkthrough/steps.ts
+++ b/frontend/src/walkthrough/steps.ts
@@ -57,7 +57,7 @@ export const STEPS: TourStep[] = [
{
id: 'nodes',
title: 'Your devices on the canvas',
- body: 'Approved devices become nodes on the canvas. Each shows live status, IP, hostname and running services. Drag to arrange them and draw links between them.',
+ body: 'Devices you put in the canvas become nodes. Each shows live status, IP, hostname and running services. Drag to arrange them and draw links between them.',
anchor: '.react-flow__node',
placement: 'auto',
mode: 'all',