split
split copied to clipboard
Refactor Confirmation Dialogs and Event Handling in Dashboard
Summary
This pull request refactors the confirmation dialog handling in the Split dashboard. The changes improve the maintainability of the code by removing unused functions and replacing inline event handlers with class-based event listeners.
Changes Made
- Removed the
confirmStepfunction as it was not utilized. - Introduced a centralized event handler setup that listens for click events on elements with specific class names related to various actions (e.g., reopen, enable cohorting, disable cohorting, reset, delete, and confirm winner).
- Updated the form elements in the
_controls.erband_experiment.erbviews to use class names instead of inlineonclickattributes for triggering confirmation dialogs.
Benefits
- Enhances code readability and maintainability.
- Reduces the amount of inline JavaScript, promoting a cleaner separation of concerns.
- Simplifies the addition of new confirmation dialogs in the future.