MayamaTakeshi / redmine_rt

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

Add support for issue popup using custom item in the top menu #13

Closed MayamaTakeshi closed 1 year ago

MayamaTakeshi commented 1 year ago

This is to not have to depend on https://github.com/MayamaTakeshi/redmine_rt_webextension to popup issues when calls are answered in a pbx. Instead we should create one top menu item called RealTime (temporary name) that would take care of subscribing to popup channel and based on the user currently logged in, to check if a tab for the issue URL already exists. If yes, switch the focus to that tab. Otherwise open a new tab for the issue. For this we can use https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel to communicate with tabs from the same origin:

Ref: https://www.redmine.org/boards/3/topics/19994

Later we can add a summary like: "Your last open tickets" that could be also updated in real time. And this could also be used to popup a desktop notification informing the phone_number/name/company of a customer that might be ringing the call-center group.

Obs: this would be still an inferior solution in comparison to a webextension since we will have to deal with intertab communication timeout but still it should be worthy to have it as it eliminates webextension security concerns.

MayamaTakeshi commented 1 year ago

In the end we didn't use BroadcastChannel as there are other problems:

So we will not check if there is a tab already open for the ticket and will always popup a new tab for it.