anteo / redmine_custom_workflows

Allows to create custom workflows for Redmine
http://www.redmine.org/plugins/custom-workflows
GNU General Public License v2.0
182 stars 72 forks source link

Issue auto refresher #215

Closed DolezalDavid closed 3 years ago

DolezalDavid commented 3 years ago

Hi all, is it possible to use custom workflows for issues refresher?

For example: "I am on issue, send note, and stay on detail. Somebody reply me back and if I haven't opened email client for notification, or I don't hit F5 for refresh, I don't know about reply on my note."

Something like if @issue.changed? refresh_page / redirect_to back:

Thx friends.

David

DolezalDavid commented 3 years ago

I tried something like this, but it doesn't work if @issue.changed? @issue.current.reload end After safe

AirTibu commented 3 years ago

Hi,

This is not really the case, as clicking on the submit button will start running the program code. If you do not click on it, the code will not run. If the person who sent the message clicks on it, the code will run for him, but the refresh command will only apply to his browser.

DolezalDavid commented 3 years ago

Ah OK, what some timer? Like, countdown from 120 sec to 0 and then reload?

AirTibu commented 3 years ago

Hi,

Maybe you should try to refresh the browser itself:

https://chrome.google.com/webstore/detail/easy-auto-refresh/aabcgdmkeabbnleenpncegpcngjpnjkc?hl=hu

DolezalDavid commented 3 years ago

Hi,

Maybe you should try to refresh the browser itself:

https://chrome.google.com/webstore/detail/easy-auto-refresh/aabcgdmkeabbnleenpncegpcngjpnjkc?hl=hu @AirTibu thank you. But it's not what I want to use.

I tried in past days something like:

window.setTimeout(function () {
  window.location.reload();
}, 30000);

This refresh every 30 s page. It's not acceptible to work with it, when you have limited time to save your work before refresh. So I tried to refresh only part of page without refreshing whole page.

setInterval(function(){
   $('#history').load('?tab=notes');
}, 30000);
$(document).ready(function(){
setInterval(function(){
      $( "#tab-content-history.tab-content" ).load(window.location.href + " #tab-content-history.tab-content    " );
}, 30000);
});
$(document).ready(function(){
SetInterval(function(){
  $("div[id^='change_']").load(window.location.href + " div[id^='change_']");
}, 30000);
});

All I putted in application.js file in /public/javascript/.

But after all I think this is not good way to success. What do you think about Server-Sent Event Notifications? Some info is here https://www.w3schools.com/html/html5_serversentevents.asp

DolezalDavid commented 3 years ago

Sorry guys. This is completly bad idea... I try to solve it diffrent way with websocket, actioncable and redis, ...