Project

General

Profile

Plugin redmine stealth is unsupported for v5.x. something is existing to replace it ?

Added by Loïc Lemire 4 months ago

Hello,
I upgraded my redmine from 2.6 to 5.1.
I miss some plugin , especially Redmine-stealth.
it seem to not be supported by v5.x
There is something to replace it ?
Thank you 4 your help.


Replies (1)

RE: Plugin redmine stealth is unsupported for v5.x. something is existing to replace it ? - Added by Jan Catrysse 3 months ago

Hi Loïc,

This is a small patch for https://github.com/omegacodepl/redmine_stealth.git

Let me know if it helps. I will update Github in a few weeks.

---
 init.rb                                      |  8 ++---
 lib/redmine_stealth/issue_stealth_patch.rb   | 30 ++++++++++---------
 lib/redmine_stealth/journal_stealth_patch.rb | 31 ++++++++++----------
 3 files changed, 36 insertions(+), 33 deletions(-)

diff --git a/init.rb b/init.rb
index 0345d45..78b3860 100644
--- a/init.rb
+++ b/init.rb
@@ -1,9 +1,9 @@
 require 'redmine'
 require 'redmine/i18n'
-require 'redmine_stealth'
-require 'redmine_stealth/hooks'
-require 'redmine_stealth/issue_stealth_patch'
-require 'redmine_stealth/journal_stealth_patch'
+require File.dirname(__FILE__) + '/lib/redmine_stealth'
+require File.dirname(__FILE__) + '/lib/redmine_stealth/hooks'
+require File.dirname(__FILE__) + '/lib/redmine_stealth/issue_stealth_patch'
+require File.dirname(__FILE__) + '/lib/redmine_stealth/journal_stealth_patch'

 Redmine::Plugin.register :redmine_stealth do

diff --git a/lib/redmine_stealth/issue_stealth_patch.rb b/lib/redmine_stealth/issue_stealth_patch.rb
index 9b9413c..be7cbb2 100644
--- a/lib/redmine_stealth/issue_stealth_patch.rb
+++ b/lib/redmine_stealth/issue_stealth_patch.rb
@@ -1,20 +1,22 @@
-module IssueStealthPatch
-  def self.included(base)
-    unloadable
-    base.class_eval do
-      alias_method :send_notification_without_stealth, :send_notification
-      alias_method :send_notification, :send_notification_with_stealth
+module RedmineStealth
+  module IssueStealthPatch
+    def self.included(base)
+      unloadable
+      base.class_eval do
+        alias_method :send_notification_without_stealth, :send_notification
+        alias_method :send_notification, :send_notification_with_stealth
+      end
     end
-  end

-  def send_notification_with_stealth
-    return if RedmineStealth.cloaked?
-    send_notification_without_stealth
-  end
+    def send_notification_with_stealth
+      return if RedmineStealth.cloaked?
+      send_notification_without_stealth
+    end

-  class Initializer < Rails::Railtie
-    config.before_initialize do
-      Issue.send(:include, IssueStealthPatch)
+    class Initializer < Rails::Railtie
+      config.before_initialize do
+        Issue.send(:include, IssueStealthPatch)
+      end
     end
   end
 end
diff --git a/lib/redmine_stealth/journal_stealth_patch.rb b/lib/redmine_stealth/journal_stealth_patch.rb
index 7cb7c75..c5c6739 100644
--- a/lib/redmine_stealth/journal_stealth_patch.rb
+++ b/lib/redmine_stealth/journal_stealth_patch.rb
@@ -1,21 +1,22 @@
-module JournalStealthPatch
-  def self.included(base)
-    unloadable
-    base.class_eval do
-      alias_method :send_notification_without_stealth, :send_notification
-      alias_method :send_notification, :send_notification_with_stealth
+module RedmineStealth
+  module JournalStealthPatch
+    def self.included(base)
+      unloadable
+      base.class_eval do
+        alias_method :send_notification_without_stealth, :send_notification
+        alias_method :send_notification, :send_notification_with_stealth
+      end
     end
-  end

-  def send_notification_with_stealth
-    return if RedmineStealth.cloaked?
-    send_notification_without_stealth
-  end
+    def send_notification_with_stealth
+      return if RedmineStealth.cloaked?
+      send_notification_without_stealth
+    end

-  class Initializer < Rails::Railtie
-    config.before_initialize do
-      Journal.send(:include, JournalStealthPatch)
+    class Initializer < Rails::Railtie
+      config.before_initialize do
+        Journal.send(:include, JournalStealthPatch)
+      end
     end
   end
 end
-
---
 .../menu_manager_extensions.rb => redmine/menu_manager.rb}        | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename lib/{redmine_ext/menu_manager_extensions.rb => redmine/menu_manager.rb} (100%)

diff --git a/lib/redmine_ext/menu_manager_extensions.rb b/lib/redmine/menu_manager.rb
similarity index 100%
rename from lib/redmine_ext/menu_manager_extensions.rb
rename to lib/redmine/menu_manager.rb
    (1-1/1)