diff --git a/CHANGELOG.md b/CHANGELOG.md index c43c7b0..eca6c42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.3.0 + +* Use redmine_bots instead of redmine_telegram_common +* Add Slack support (and transparent support for custom protocols) +* Fix redmine_helpdesk integration + # 1.2.1 * Fix helpdesk support diff --git a/README.md b/README.md index 668e9de..5aaef71 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ Please help us make this plugin better telling us of any [issues](https://github * **Ruby 2.3+** * **Redmine 3.1+** -* Configured [redmine_telegram_common](https://github.com/centosadmin/redmine_telegram_common) -* You should have Telegram bot account +* Configured [redmine_bots](https://github.com/centosadmin/redmine_bots) * Install [Redis](https://redis.io) 2.8 or higher. Run Redis and add it to autorun. * Install the [redmine_sidekiq](https://github.com/ogom/redmine_sidekiq) plugin. [Redis](https://redis.io) 2.8 or greater is required. * You need to configure Sidekiq queues `default` and `telegram`. [Config example](https://github.com/centosadmin/redmine_intouch/blob/master/extras/sidekiq.yml) - place it to `redmine/config` directory (Or copy from plugins/redmine_intouch/extras/sidekiq.yml to config/sidekiq.yml). @@ -33,6 +32,11 @@ bundle exec rake redmine:plugins:migrate RAILS_ENV=production The `extras` folder has the examples of the plugin config files and the `init.d` startup script +### Upgrade from 1.2 to 1.3+ + +From 1.3.0 redmine_intouch depends on [redmine_bots](https://github.com/centosadmin/redmine_bots) instead of redmine_telegram_common. +Make sure to remove redmine_telegram_common from plugins and follow installation instruction for [redmine_bots](https://github.com/centosadmin/redmine_bots). + ### Upgrade from 1.0.2 to 1.1.0+ From 1.1.0 redmine_intouch (as well as other Southbridge telegram plugins) is using bot from redmine_telegram_common. @@ -66,7 +70,7 @@ Since 0.4 version, model `TelegramUser` will be removed, also table `telegram_us ## General settings -You should specify all the necessary notification protocols in the "Protocols" section. These are 'telegram' and 'email' available at the moment. +You should specify all the necessary notification protocols in the "Protocols" section. These are 'telegram', 'slack' and 'email' available at the moment. The section "Working days" should contain: diff --git a/app/models/intouch_sender.rb b/app/models/intouch_sender.rb deleted file mode 100644 index ce63e54..0000000 --- a/app/models/intouch_sender.rb +++ /dev/null @@ -1,27 +0,0 @@ -class IntouchSender - unloadable - - def self.send_email_message(issue_id, state) - EmailSenderWorker.perform_async(issue_id, state) - end - - def self.send_telegram_message(issue_id, state) - TelegramSenderWorker.perform_async(issue_id, state) - end - - def self.send_telegram_group_message(issue_id, group_ids, state) - TelegramGroupSenderWorker.perform_async(issue_id, group_ids, state) - end - - def self.send_live_email_message(issue_id, journal_id, required_recipients = []) - EmailLiveSenderWorker.perform_async(issue_id, journal_id, required_recipients) - end - - def self.send_live_telegram_message(issue_id, journal_id, required_recipients = []) - TelegramLiveSenderWorker.perform_async(issue_id, journal_id, required_recipients) - end - - def self.send_live_telegram_group_message(issue_id, journal_id) - TelegramGroupLiveSenderWorker.perform_async(issue_id, journal_id) - end -end diff --git a/app/models/settings_template.rb b/app/models/settings_template.rb index caaead6..5918a3a 100644 --- a/app/models/settings_template.rb +++ b/app/models/settings_template.rb @@ -3,7 +3,7 @@ class SettingsTemplate < ActiveRecord::Base attr_accessible :name, :intouch_settings - store :intouch_settings, accessors: %w[assigner_groups assigner_roles reminder_settings telegram_settings email_settings] + store :intouch_settings, accessors: %w[assigner_groups assigner_roles reminder_settings] | Intouch.protocols.keys.map { |p| "#{p}_settings" } def copy_from(settings_template) self.attributes = settings_template.attributes.dup.except('id', 'created_on', 'updated_on') diff --git a/app/views/projects/settings/intouch/issue_update/_common.html.erb b/app/views/projects/settings/intouch/issue_update/_common.html.erb index c24b4bd..a6f680e 100644 --- a/app/views/projects/settings/intouch/issue_update/_common.html.erb +++ b/app/views/projects/settings/intouch/issue_update/_common.html.erb @@ -47,7 +47,7 @@ <% IssuePriority.order(:position).each do |priority| %> - <% Intouch.active_protocols.each do |protocol| %> + <% Intouch.active_protocols.each do |protocol, _| %> <%= check_box_tag "intouch_settings[#{protocol}_settings][#{kind}][#{status.id}][]", priority.id, settings_source.send("#{protocol}_settings").try(:[], kind). diff --git a/app/views/projects/settings/intouch/reminder/_common.html.erb b/app/views/projects/settings/intouch/reminder/_common.html.erb index 75d2a6b..d0c6d7d 100644 --- a/app/views/projects/settings/intouch/reminder/_common.html.erb +++ b/app/views/projects/settings/intouch/reminder/_common.html.erb @@ -10,7 +10,7 @@ <% %w(author assigned_to watchers).each do |receiver| %> - <% Intouch.active_protocols.each do |protocol| %> + <% Intouch.active_protocols.each do |protocol, _| %> <%= check_box_tag "intouch_settings[#{protocol}_settings][#{status}][#{receiver}]", '1', settings_source.send("#{protocol}_settings").try(:[], status).try(:[], receiver), class: "#{protocol}_#{receiver}", diff --git a/app/views/projects/settings/intouch/reminder/_overdue.html.erb b/app/views/projects/settings/intouch/reminder/_overdue.html.erb index 8483de8..0fb4238 100644 --- a/app/views/projects/settings/intouch/reminder/_overdue.html.erb +++ b/app/views/projects/settings/intouch/reminder/_overdue.html.erb @@ -23,7 +23,7 @@ <% %w(author assigned_to watchers).each do |receiver| %> - <% Intouch.active_protocols.each do |protocol| %> + <% Intouch.active_protocols.each do |protocol, _| %> <%= check_box_tag "intouch_settings[#{protocol}_settings][overdue][#{receiver}]", '1', settings_source.send("#{protocol}_settings").try(:[], 'overdue').try(:[], receiver), diff --git a/app/views/projects/settings/intouch/reminder/_unassigned.html.erb b/app/views/projects/settings/intouch/reminder/_unassigned.html.erb index e3e491b..c4ab984 100644 --- a/app/views/projects/settings/intouch/reminder/_unassigned.html.erb +++ b/app/views/projects/settings/intouch/reminder/_unassigned.html.erb @@ -22,7 +22,7 @@ <% %w(author watchers).each do |receiver| %> - <% Intouch.active_protocols.each do |protocol| %> + <% Intouch.active_protocols.each do |protocol, _| %> <%= check_box_tag "intouch_settings[#{protocol}_settings][unassigned][#{receiver}]", '1', settings_source.send("#{protocol}_settings").try(:[], 'unassigned').try(:[], receiver), class: "#{protocol}_#{receiver}", diff --git a/app/views/settings/_common.html.erb b/app/views/settings/_common.html.erb index fea52f6..ab22420 100644 --- a/app/views/settings/_common.html.erb +++ b/app/views/settings/_common.html.erb @@ -4,7 +4,7 @@

<%= t 'intouch.settings.common.protocols.description' %>