Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18a2856aa2 | ||
|
|
df46bf0f15 | ||
|
|
5d6495f009 | ||
|
|
8162eeb01d | ||
|
|
7e9a994c03 | ||
|
|
2e2e2c4286 | ||
|
|
5882bad2cb | ||
|
|
92f0c40b50 | ||
|
|
a91795a818 | ||
|
|
6295fb3b26 | ||
|
|
a68e3a2fb1 |
@@ -1,7 +1,13 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
## 0.9.9
|
||||
## 1.0.0
|
||||
|
||||
* Redmine 3.4.x compatibility
|
||||
* Commit message issue bug fix
|
||||
* Some code cleanups
|
||||
|
||||
## 0.9.9
|
||||
|
||||
* All global messenger settings can be overwritten project based
|
||||
* Locale support added
|
||||
|
||||
@@ -56,7 +56,7 @@ Install ``redmine_messenger`` plugin for `Redmine`
|
||||
|
||||
cd $REDMINE_ROOT
|
||||
git clone git://github.com/alphanodes/redmine_messenger.git plugins/redmine_messenger
|
||||
bundle exec rake db:migrate_plugins
|
||||
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
|
||||
|
||||
Restart Redmine (application server) and you should see the plugin show up in the Plugins page.
|
||||
Under the configuration options, set the Messenger API URL to the URL for an
|
||||
@@ -71,7 +71,7 @@ and clicking the down-arrow and selecting view info).
|
||||
Uninstall ``redmine_messenger``
|
||||
|
||||
cd $REDMINE_ROOT
|
||||
bundle exec rake db:migrate_plugins NAME=redmine_messenger VERSION=0
|
||||
bundle exec rake redmine:plugins:migrate NAME=redmine_messenger VERSION=0 RAILS_ENV=production
|
||||
rm -rf plugins/redmine_messenger
|
||||
|
||||
Restart Redmine (application server)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<% @settings = ActionController::Parameters.new(@settings) %>
|
||||
|
||||
<div class="info"><%= t(:messenger_settings_intro) %></div><br />
|
||||
|
||||
<p>
|
||||
@@ -24,7 +26,7 @@
|
||||
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_messenger_verify_ssl)) %>
|
||||
<%= check_box_tag 'settings[messenger_verify_ssl]', 1, @settings[:messenger_verify_ssl] %>
|
||||
<%= check_box_tag 'settings[messenger_verify_ssl]', 1, @settings[:messenger_verify_ssl].to_i == 1 %>
|
||||
<em class="info"><%= t(:messenger_verify_ssl_info_html) %></em>
|
||||
</p>
|
||||
|
||||
@@ -35,32 +37,32 @@
|
||||
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_auto_mentions)) %>
|
||||
<%= check_box_tag 'settings[auto_mentions]', 1, @settings[:auto_mentions] %>
|
||||
<%= check_box_tag 'settings[auto_mentions]', 1, @settings[:auto_mentions].to_i == 1 %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_display_watchers)) %>
|
||||
<%= check_box_tag 'settings[display_watchers]', 1, @settings[:display_watchers] %>
|
||||
<%= check_box_tag 'settings[display_watchers]', 1, @settings[:display_watchers].to_i == 1 %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_updates)) %>
|
||||
<%= check_box_tag 'settings[post_updates]', 1, @settings[:post_updates] %>
|
||||
<%= check_box_tag 'settings[post_updates]', 1, @settings[:post_updates].to_i == 1 %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_new_include_description)) %>
|
||||
<%= check_box_tag 'settings[new_include_description]', 1, @settings[:new_include_description] %>
|
||||
<%= check_box_tag 'settings[new_include_description]', 1, @settings[:new_include_description].to_i == 1 %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_updated_include_description)) %>
|
||||
<%= check_box_tag 'settings[updated_include_description]', 1, @settings[:updated_include_description] %>
|
||||
<%= check_box_tag 'settings[updated_include_description]', 1, @settings[:updated_include_description].to_i == 1 %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_private_issues)) %>
|
||||
<%= check_box_tag 'settings[post_private_issues]', 1, @settings[:post_private_issues] %>
|
||||
<%= check_box_tag 'settings[post_private_issues]', 1, @settings[:post_private_issues].to_i == 1 %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_private_notes)) %>
|
||||
<%= check_box_tag 'settings[post_private_notes]', 1, @settings[:post_private_notes] %>
|
||||
<%= check_box_tag 'settings[post_private_notes]', 1, @settings[:post_private_notes].to_i == 1 %>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
@@ -70,11 +72,11 @@
|
||||
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_wiki)) %>
|
||||
<%= check_box_tag 'settings[post_wiki]', 1, @settings[:post_wiki] %>
|
||||
<%= check_box_tag 'settings[post_wiki]', 1, @settings[:post_wiki].to_i == 1 %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_wiki_updates)) %>
|
||||
<%= check_box_tag 'settings[post_wiki_updates]', 1, @settings[:post_wiki_updates] %>
|
||||
<%= check_box_tag 'settings[post_wiki_updates]', 1, @settings[:post_wiki_updates].to_i == 1 %>
|
||||
</p>
|
||||
|
||||
<% if RedmineMessenger::REDMINE_DB_SUPPORT %>
|
||||
@@ -85,11 +87,11 @@
|
||||
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_db)) %>
|
||||
<%= check_box_tag 'settings[post_db]', 1, @settings[:post_db] %>
|
||||
<%= check_box_tag 'settings[post_db]', 1, @settings[:post_db].to_i == 1 %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_db_updates)) %>
|
||||
<%= check_box_tag 'settings[post_db_updates]', 1, @settings[:post_db_updates] %>
|
||||
<%= check_box_tag 'settings[post_db_updates]', 1, @settings[:post_db_updates].to_i == 1 %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@@ -101,11 +103,11 @@
|
||||
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_contact)) %>
|
||||
<%= check_box_tag 'settings[post_contact]', 1, @settings[:post_contact] %>
|
||||
<%= check_box_tag 'settings[post_contact]', 1, @settings[:post_contact].to_i == 1 %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_contact_updates)) %>
|
||||
<%= check_box_tag 'settings[post_contact_updates]', 1, @settings[:post_contact_updates] %>
|
||||
<%= check_box_tag 'settings[post_contact_updates]', 1, @settings[:post_contact_updates].to_i == 1 %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@@ -117,10 +119,10 @@
|
||||
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_password)) %>
|
||||
<%= check_box_tag 'settings[post_password]', 1, @settings[:post_password] %>
|
||||
<%= check_box_tag 'settings[post_password]', 1, @settings[:post_password].to_i == 1 %>
|
||||
</p>
|
||||
<p>
|
||||
<%= content_tag(:label, l(:label_settings_post_password_updates)) %>
|
||||
<%= check_box_tag 'settings[post_password_updates]', 1, @settings[:post_password_updates] %>
|
||||
<%= check_box_tag 'settings[post_password_updates]', 1, @settings[:post_password_updates].to_i == 1 %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
4
init.rb
4
init.rb
@@ -9,7 +9,7 @@ Redmine::Plugin.register :redmine_messenger do
|
||||
url 'https://github.com/alphanodes/redmine_messenger'
|
||||
author_url 'https://alphanodes.com/'
|
||||
description 'Messenger integration for Slack, Rocketchat and Mattermost support'
|
||||
version '0.9.9'
|
||||
version '1.0.0'
|
||||
|
||||
requires_redmine version_or_higher: '3.0.0'
|
||||
|
||||
@@ -21,7 +21,7 @@ Redmine::Plugin.register :redmine_messenger do
|
||||
messenger_channel: 'redmine',
|
||||
messenger_username: 'robot',
|
||||
messenger_verify_ssl: '1',
|
||||
auto_mentions: '1',
|
||||
auto_mentions: '0',
|
||||
display_watchers: '0',
|
||||
post_updates: '1',
|
||||
new_include_description: '1',
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
# Redmine Messenger plugin for Redmine
|
||||
|
||||
Rails.configuration.to_prepare do
|
||||
module RedmineMessenger
|
||||
REDMINE_CONTACTS_SUPPORT = Redmine::Plugin.installed?('redmine_contacts') ? true : false
|
||||
REDMINE_DB_SUPPORT = Redmine::Plugin.installed?('redmine_db') ? true : false
|
||||
# this does not work at the moment, because redmine loads passwords after messener plugin
|
||||
REDMINE_PASSWORDS_SUPPORT = Redmine::Plugin.installed?('redmine_passwords') ? true : false
|
||||
|
||||
def self.settings
|
||||
ActionController::Parameters.new(Setting[:plugin_redmine_messenger])
|
||||
end
|
||||
end
|
||||
|
||||
# Patches
|
||||
require_dependency 'redmine_messenger/patches/issue_patch'
|
||||
require_dependency 'redmine_messenger/patches/wiki_page_patch'
|
||||
@@ -16,14 +27,3 @@ Rails.configuration.to_prepare do
|
||||
# Hooks
|
||||
require_dependency 'redmine_messenger/hooks'
|
||||
end
|
||||
|
||||
module RedmineMessenger
|
||||
REDMINE_CONTACTS_SUPPORT = Redmine::Plugin.installed?('redmine_contacts') ? true : false
|
||||
REDMINE_DB_SUPPORT = Redmine::Plugin.installed?('redmine_db') ? true : false
|
||||
# this does not work at the moment, because redmine loads passwords after messener plugin
|
||||
REDMINE_PASSWORDS_SUPPORT = Redmine::Plugin.installed?('redmine_passwords') ? true : false
|
||||
|
||||
def self.settings
|
||||
Setting[:plugin_redmine_messenger].blank? ? {} : Setting[:plugin_redmine_messenger]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,8 +10,8 @@ module RedmineMessenger
|
||||
channels = Messenger.channels_for_project issue.project
|
||||
url = Messenger.url_for_project issue.project
|
||||
|
||||
return unless channels.present? && url && issue.save
|
||||
return if issue.is_private? && !Messenger.setting_for_project(project, :post_private_issues)
|
||||
return unless channels.present? && url && issue.changes.any? && Messenger.setting_for_project(issue.project, :post_updates)
|
||||
return if issue.is_private? && !Messenger.setting_for_project(issue.project, :post_private_issues)
|
||||
|
||||
msg = "[#{ERB::Util.html_escape(issue.project)}] #{ERB::Util.html_escape(journal.user.to_s)} updated <#{Messenger.object_url issue}|#{ERB::Util.html_escape(issue)}>"
|
||||
|
||||
@@ -48,7 +48,7 @@ module RedmineMessenger
|
||||
attachment[:text] = ll(Setting.default_language, :text_status_changed_by_changeset, "<#{revision_url}|#{ERB::Util.html_escape(changeset.comments)}>")
|
||||
attachment[:fields] = journal.details.map { |d| Messenger.detail_to_field d }
|
||||
|
||||
Messenger.speak(msg, channels, url, attachment: attachment, project: project)
|
||||
Messenger.speak(msg, channels, url, attachment: attachment, project: repository.project)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# Redmine Messenger plugin for Redmine
|
||||
|
||||
require 'simplecov'
|
||||
require 'simplecov-rcov'
|
||||
|
||||
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
||||
SimpleCov::Formatter::HTMLFormatter,
|
||||
SimpleCov::Formatter::RcovFormatter
|
||||
]
|
||||
|
||||
SimpleCov.start :rails do
|
||||
add_filter 'init.rb'
|
||||
root File.expand_path(File.dirname(__FILE__) + '/..')
|
||||
end
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')
|
||||
|
||||
module RedmineMessenger
|
||||
|
||||
Reference in New Issue
Block a user