towerops/lib/towerops_web/live
Graham McIntire 930885e21a
Add agent rename functionality
Implemented ability to rename agents through a new edit page following TDD:

Backend changes:
- Added update_agent_token/2 in Agents context for updating agent names
- Added update_changeset/2 in AgentToken schema that only allows name updates
- Security: Token field cannot be changed, only name field is allowed

LiveView implementation:
- Created AgentLive.Edit module with mount, validate, and save handlers
- Created edit.html.heex template with form for renaming agents
- Added route /orgs/:org_slug/agents/:id/edit
- Added Edit button to agent show page header
- Validates organization ownership using Repo.get_by!

Tests:
- Added comprehensive context tests for update_agent_token/2
- Added LiveView tests for edit page functionality
- Tests cover: loading, validation, save/redirect, auth, and org ownership

All 801 tests passing, no Credo warnings.
2026-01-17 15:48:47 -06:00
..
admin rename equipment to device 2026-01-17 14:48:46 -06:00
agent_live Add agent rename functionality 2026-01-17 15:48:47 -06:00
alert_live rename equipment to device 2026-01-17 14:48:46 -06:00
device_live more renames 2026-01-17 15:13:56 -06:00
graph_live rename equipment to device 2026-01-17 14:48:46 -06:00
org more renames 2026-01-17 15:13:56 -06:00
org_live rename equipment to device 2026-01-17 14:48:46 -06:00
site_live rename equipment to device 2026-01-17 14:48:46 -06:00
dashboard_live.ex rename equipment to device 2026-01-17 14:48:46 -06:00
dashboard_live.html.heex rename equipment to device 2026-01-17 14:48:46 -06:00
mobile_qr_live.ex Add comprehensive Dialyzer type specifications 2026-01-17 10:52:02 -06:00
user_settings_live.ex Convert User Settings from controller to LiveView 2026-01-15 16:29:50 -06:00