MayamaTakeshi / redmine_rt

Redmine plugin for Real-Time notification of events
GNU General Public License v3.0
24 stars 4 forks source link

Added notes don't show up with hearts #34

Open MayamaTakeshi opened 1 year ago

MayamaTakeshi commented 1 year ago

Testing with https://github.com/cat-in-136/redmine_hearts when we add a quick note, the note is added dynamically in the issue but the heart doesn't show up. This happens because the code that adds the hearts ("transplant hearts") operates at the client side by doing a JQuery(ELEMENTS_TO_OPERATE).each() inside a callback to event 'load' (page finished loading).

See: https://github.com/cat-in-136/redmine_hearts/blob/2bbab489e0534d52b142901f0352e667b874ec5f/assets/javascripts/transplant_heart_link_with_counter.js

So this kind of issue cannot be solved by redmine_rt. It would be necessary to adjust redmine_hearts to for example, override the redmine views so that the hearts come with the HTML from the server.

MayamaTakeshi commented 1 year ago

Then we can eventually integrate it with redmine_rt to show likes updated in real-time.

MayamaTakeshi commented 1 year ago

However moving the addition of the heart transplant to the server side code might not be doable. Because although this might be easy to do for an issue, it might not be doable for journals because currently redmine doesn't have a partial for it. So we cannot use Deface:Override for it.

So, we might need to do something like: Add redmine_hearts javascript code react to websocket notifications. Make ajax call to get value of the heart for the specific Heartable element and update the heart.