Skip to content

Implement Granular Webhook Controls & Refactor to OOP#8

Open
leecurrent04 wants to merge 19 commits into
perronosaurio:masterfrom
leecurrent04:dev_class
Open

Implement Granular Webhook Controls & Refactor to OOP#8
leecurrent04 wants to merge 19 commits into
perronosaurio:masterfrom
leecurrent04:dev_class

Conversation

@leecurrent04
Copy link
Copy Markdown
Contributor

image

This pull request introduces a major new feature allowing for granular, action-level control over webhook notifications. It also includes a significant architectural refactor of the event handling system to support this new functionality and improve code maintainability and extensibility.

🚀 New Feature: Granular Webhook Controls
Users are no longer limited to subscribing to all events of a certain type. They can now choose specific actions (create, change, delete) for each entity (User Story, Task, etc.) they want to receive notifications for.

  • UI Overhaul: The dashboard has been updated to replace simple entity checkboxes with an accordion-style interface. Each entity can be expanded to reveal checkboxes for its specific actions.
  • Backend Update: The webhook configuration storage has been changed from a simple array of entities to a record mapping entities to an array of selected actions (Record<string, string[]>), enabling this finer control.

🛠️ Architectural Refactor: OOP Event Handlers
The event handling system has been refactored from individual functions to an object-oriented (OOP) model.

  • Base EventHandler Class: A new EventHandler base class (src/lib/eventHandlers/eventHandler.ts) has been introduced to house common logic for creating embeds, processing diffs, and handling event data. This reduces code duplication and provides a clear, extensible pattern.

  • Specific Handler Classes: All individual event handlers (UserStoryHandler, TaskHandler, etc.) have been converted to classes that extend the new base class.

⚙️ Other Improvements & Fixes

Intelligent Comment Handling: New comments, which Taiga reports as a change action, are now intelligently re-classified as a create action on the backend. This allows users to subscribe to new comments separately from other updates.

  • API Robustness: Added a safeguard to automatically truncate embed field values that exceed Discord's 1024-character limit, preventing webhook send failures.

  • Dependency Upgrades: Upgraded key dependencies, including Next.js, and added the crypto package for more explicit handling.

Enhanced Documentation: The README.md has been significantly updated with setup images and more detailed instructions for a better developer onboarding experience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant