feat(liveview): header View link opens active design as read-only canvas
Add an authenticated GET /api/v1/liveview/config endpoint exposing the configured LIVEVIEW_KEY to logged-in admins, so the UI builds a ready-to-use share link. The header View button opens /view?key=...&design=<activeDesignId>; LiveView forwards ?design=<id> to the public endpoint, which renders that design's canvas. ha-relevant: maybe
This commit is contained in:
@@ -158,6 +158,16 @@ describe('api/client', () => {
|
||||
expect(api.get).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('liveviewApi.load forwards design as design_id when provided', () => {
|
||||
mod.liveviewApi.load('k-1', 'design-9')
|
||||
expect(publicApi.get).toHaveBeenCalledWith('/liveview', { params: { key: 'k-1', design_id: 'design-9' } })
|
||||
})
|
||||
|
||||
it('liveviewApi.getConfig hits the authenticated config endpoint', () => {
|
||||
mod.liveviewApi.getConfig()
|
||||
expect(api.get).toHaveBeenCalledWith('/liveview/config')
|
||||
})
|
||||
|
||||
it('scanApi endpoints route correctly', () => {
|
||||
mod.scanApi.trigger()
|
||||
expect(api.post).toHaveBeenCalledWith('/scan/trigger')
|
||||
|
||||
Reference in New Issue
Block a user