-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Export event handlers to allow for customization #55
Comments
Very good idea and pretty easy to implement! Do you have time to work on this? I am currently quite busy but can take a look if there's no activity from the community. |
How about if we add support for the events backend and publish the changes through that? See https://github.com/backstage/backstage/tree/master/plugins%2Fevents-backend Or is there some need to have the callbacks in the frontend? |
@anestor6 I implemented the support for the events backend, see the docs/events.md for details. Would this be sufficient for your use case? |
Have yet to test this out / update. But just checking the docs. In the payload for events such as commenting or upvoting does the comment payload also contain the user profile info of the commenter? I see author (which i'm assuming is the question author). But in the case of sending notifications it'd be nice to have the info so you can say "Hi {author}, {commenter} left a comment!". Similarly for voting, etc... |
It contains the user entity reference of the user who did the action as well as all information about the question (& answer). Maybe it would make sense to document different events in the |
Hey i'm sorry, i tried following the docs for the events plugin, but I was wondering if you could provide more implementation details in the docs for EditThere's actually a typo in the events-backend docs In their docs:
However so to reference my example of simply logging a payload as an event arrives, here's a template for
|
Going to add though that the docs say that for the comment-answer event it includes the answer payload, but it doesnt. Just question, comment, and author. Not question, answer, comment, and author |
Hi, drodil, could you please add a deleted event? Because we have created an index on the search function. When deleting a question, existing events will not be triggered. We can only work on the permissions function. But this is not in compliance with the specification and will cause the coupling to be too strong. @drodil |
Thank you drodil. The delete events has been implemented. We have updated it and used it. No problems have been found so far. Thank you. |
I think it could useful to allow us to add custom functions to events like
post question
,post answer
,post reply
,upvote
, etc. In our case, we used thepatch-package
library to add a POST requests to a backend route with a custom Slack integration with thequestion
payload in the body to notify users when a question is asked / answer is posted. But it would be handy if these operations were exposed in the client to add a bit of customization on how we handle notifiable events. Perhaps in theQuestionContainer
component and theAskForm
, only thing would be to ensure these event handlers have all the appropriate information, for example, question title, content, time, reporter, entities, etc. And in the case of the reply, the reporter and the replier. Another thing for consideration would be on the editing of a question and how that argument would look. Thoughts? @drodilThe text was updated successfully, but these errors were encountered: