Skip to content
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

Question: Webhook Event on card-click/render #2518

Open
jymcheong opened this issue Jun 28, 2019 · 12 comments

Comments

Projects
None yet
2 participants
@jymcheong
Copy link

commented Jun 28, 2019

Background

I manage to use Wekan as a means to triage "cases", which are basically alerts generated from some sensors as part of project that is going to be open-sourced.

I am using card activities (eg. card create, move..) to signal a backend to populate/modify the cards. Demo: https://www.youtube.com/watch?v=5_DsuOGkh2M

Use-Case

I intend to use Wekan in such a manner:

Questions

  • Where to modify such that I can generate a Webhook event for card-render/click?
  • Any other methods achieve the above use-case?

Thanks for this awesome Kanban!

Cheers,
Jym

@jymcheong jymcheong changed the title Question: Webhook on card-click/render Question: Webhook Event on card-click/render Jun 28, 2019

@xet7

This comment has been minimized.

Copy link
Member

commented Jun 28, 2019

@jymcheong

You can add Outgoing Webhooks to Wekan board at board hamburger menu / Cog settings icon at right side of members / Outgoing Webhooks.

It sends most board actions as this kind of JSON format as POST message to HTTP server, for example to Chat, Node-RED or other webserver, for example you could have PowerShell webserver receiving those messages and do some actions when something happens on board, like checkmarking checkbox. Some functionality could also be done with Excel and VBA.

Keep backups of your code, because if Windows Defender is enabled, it could have some heuristics that detects your code as malicious and deletes it. When I sometime installed Nim programming language to Win10, Windows Defender deleted it.

You could also add Javascript Clippy that would ask "It seems you are trying to exploit this computer, would you like help with that?"

@jymcheong

This comment has been minimized.

Copy link
Author

commented Jun 28, 2019

@xet7

Thanks for the heads up regarding Windows Defender!

I am already using Webhook with my nodejs Webhook-receiver, but Card events are only emitted for creation, deletion, move, archival & restore as per the documentation.

I can double check again if there are any Webhook event when I click on any Card (which will display card details & so on) but I believe there is none.

I need that event so that my existing Webhook-receiver can populate another list dynamically.

@xet7

This comment has been minimized.

Copy link
Member

commented Jun 28, 2019

Hmm, I think there is no such event yet at API for opening card:
https://wekan.github.io/api/

I'll check how to add it.

@jymcheong

This comment has been minimized.

Copy link
Author

commented Jun 28, 2019

@xet7

This comment has been minimized.

Copy link
Member

commented Jun 28, 2019

Hmm, I did not figure it out yet. Anyway, some pointers for your search:

  • you can use wekan/find.sh to search code, like ./find.sh isSelected and other words, like minicard, Activities, outgoing, js-open
  • at wekan/models/cards.js , wekan/models/activities.js , wekan/client/components/ could be some related code
  • you can search closed github pull requests for activities
  • for new activity, add translation in pull request only to wekan/i18n/en.i18n.json
  • see Wekan GitHub wiki for developer docs, directory structure etc.
  • look minicard with webbrowser right click/Inspect, what it triggers
@jymcheong

This comment has been minimized.

Copy link
Author

commented Jun 28, 2019

@xet7 Thanks, appreciate it. Will try those.

@jymcheong jymcheong closed this Jun 28, 2019

@jymcheong

This comment has been minimized.

Copy link
Author

commented Jun 29, 2019

https://stackoverflow.com/questions/15875128/how-to-tell-when-a-dynamically-created-element-has-rendered

Within the link, there's a MutationObserver thread... in the context of Wekan, when a mini-card is clicked, the full Card details are rendered (ie. dynamically added) into the interface, which can be "observed" & further process for custom use-cases.

@jymcheong

This comment has been minimized.

Copy link
Author

commented Jul 1, 2019

@xet7

I tried adding html codes via layout,

Screenshot 2019-07-01 09 41 16

It seems nothing happen. I used browser developer view to try to locate the stuff I included, can't seem to find it.

@xet7

This comment has been minimized.

Copy link
Member

commented Jul 1, 2019

Yes, it does not work yet.

@xet7 xet7 reopened this Jul 1, 2019

@jymcheong

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

@xet7 if in the event we are keen to pay for this modification (sending out a Webhook when CardDetails is rendered), what amount of fees are we looking at?

Rgds,
Jym

@jymcheong

This comment has been minimized.

Copy link
Author

commented Jul 12, 2019

@xet7 Thanks. Let me check with my partners. Will get back soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.