refactor: optimize and clean up alertManagementModal.js

- Add constants for timeouts, validation rules, and default values
- Implement DOM element caching with getElement() function
- Add event listener tracking to prevent memory leaks
- Create common error handling function for consistent error reporting
- Consolidate duplicate test email functions
- Add try-catch blocks to async event handlers
- Remove over 480 lines of duplicate/dead code including:
  - Duplicate handleGlobalEmailToggle and handleGlobalWebhookToggle functions
  - Redundant setupEmailTestButton function
  - Commented out duplicate functions
- Fix XSS vulnerability in error message display
- Add email provider setup guides with helpful links
- Replace hardcoded values with constants throughout
- Improve button state management with reusable helper function

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
rcourtman
2025-06-11 20:53:00 +01:00
parent 3d1d8b64e0
commit e18ed9a75b
File diff suppressed because it is too large Load Diff