redmineup 1.0.10 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitlab-ci.yml +33 -0
- data/README.md +74 -153
- data/app/assets/javascripts/consumer.js +53 -0
- data/app/assets/javascripts/consumer_worker.js +219 -0
- data/app/assets/javascripts/jquery.colorPicker.min.js +26 -0
- data/app/assets/javascripts/select2_helpers.js +10 -0
- data/app/assets/stylesheets/redmineup.css +509 -0
- data/app/views/redmineup/_additional_assets.html.erb +1 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/ru.yml +1 -0
- data/config/routes.rb +4 -0
- data/doc/CHANGELOG +99 -16
- data/doc/active-record-mixins.md +156 -0
- data/doc/assets-money-and-utilities.md +71 -0
- data/doc/tagging-and-select2.md +108 -0
- data/lib/action_cable/connection/rup_connection.rb +17 -0
- data/lib/action_cable/server/rup_configuration.rb +17 -0
- data/lib/action_cable/server/rup_server.rb +17 -0
- data/lib/redmineup/acts_as_taggable/tag.rb +26 -2
- data/lib/redmineup/acts_as_taggable/up_acts_as_taggable.rb +42 -2
- data/lib/redmineup/acts_as_viewed/up_acts_as_viewed.rb +1 -1
- data/lib/redmineup/engine.rb +12 -2
- data/lib/redmineup/helpers/datetime_helper.rb +23 -0
- data/lib/redmineup/helpers/external_assets_helper.rb +14 -6
- data/lib/redmineup/helpers/form_tag_helper.rb +43 -0
- data/lib/redmineup/helpers/tags_helper.rb +41 -0
- data/lib/redmineup/helpers/test_helper.rb +12 -0
- data/lib/redmineup/hooks/views_layouts_hook.rb +1 -4
- data/lib/redmineup/liquid/drops/version_drop.rb +0 -2
- data/lib/redmineup/money_helper.rb +10 -2
- data/lib/redmineup/patches/action_cable_base_patch.rb +25 -0
- data/lib/redmineup/patches/action_cable_patch.rb +19 -0
- data/lib/redmineup/patches/auto_completes_controller_patch.rb +17 -0
- data/lib/redmineup/patches/compatibility/routing_mapper_patch.rb +5 -18
- data/lib/redmineup/patches/compatibility/sprite_patch.rb +3 -11
- data/lib/redmineup/patches/compatibility_patch.rb +0 -6
- data/lib/redmineup/patches/liquid_patch.rb +13 -22
- data/lib/redmineup/version.rb +1 -1
- data/lib/redmineup.rb +47 -42
- data/test/acts_as_taggable/tag_test.rb +16 -0
- data/test/acts_as_votable/votable_test.rb +9 -9
- data/test/acts_as_votable/voter_test.rb +4 -4
- data/test/database.yml +3 -3
- data/test/fixtures/tags.yml +2 -0
- data/test/liquid/filters/additional_filter_test.rb +5 -1
- data/test/liquid/filters/arrays_filter_test.rb +6 -3
- data/test/schema.rb +6 -1
- data/test/tags_helper_view_test.rb +41 -0
- data/test/test_helper.rb +13 -12
- metadata +21 -5
- data/bitbucket-pipelines.yml +0 -50
- data/lib/redmineup/patches/compatibility/application_controller_patch.rb +0 -32
- data/lib/redmineup/patches/compatibility/user_patch.rb +0 -21
data/test/schema.rb
CHANGED
|
@@ -36,6 +36,7 @@ ActiveRecord::Schema.define version: 0 do
|
|
|
36
36
|
|
|
37
37
|
create_table :tags, force: true do |t|
|
|
38
38
|
t.string :name
|
|
39
|
+
t.string :color
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
create_table :taggings, force: true do |t|
|
|
@@ -50,6 +51,10 @@ ActiveRecord::Schema.define version: 0 do
|
|
|
50
51
|
t.string :language
|
|
51
52
|
end
|
|
52
53
|
|
|
54
|
+
create_table :categories, force: true do |t|
|
|
55
|
+
t.string :name
|
|
56
|
+
end
|
|
57
|
+
|
|
53
58
|
create_table :issue_relations, force: true do |t|
|
|
54
59
|
t.integer :issue_from_id
|
|
55
60
|
t.integer :issue_to_id
|
|
@@ -145,7 +150,7 @@ ActiveRecord::Schema.define version: 0 do
|
|
|
145
150
|
t.column :viewer_id, :integer
|
|
146
151
|
t.column :viewed_id, :integer
|
|
147
152
|
t.column :viewed_type, :string
|
|
148
|
-
t.column :ip, :string, limit: '
|
|
153
|
+
t.column :ip, :string, limit: '45'
|
|
149
154
|
t.column :created_at, :datetime
|
|
150
155
|
end
|
|
151
156
|
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
|
2
|
+
|
|
3
|
+
class TagsHelperViewTest < ActionView::TestCase
|
|
4
|
+
include Redmineup::TagsHelper
|
|
5
|
+
include Redmineup::FormTagHelper
|
|
6
|
+
|
|
7
|
+
def stub_tag_url(name)
|
|
8
|
+
"/stub_tags/#{name}" # URL stub for tag_cloud_links(tags, :stub)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def test_tag_link
|
|
12
|
+
result = tag_link('/tags/error', 'error', count: 3)
|
|
13
|
+
assert_includes result, 'tag-label-color'
|
|
14
|
+
assert_includes result, 'background-color: #'
|
|
15
|
+
assert_includes result, '(3)'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def test_tag_links
|
|
19
|
+
result = tag_links(['error', 'bug']) { |t| "/tags/#{t}" }
|
|
20
|
+
assert_includes result, 'class="tag_list"'
|
|
21
|
+
assert_nil tag_links([]) { |t| "/tags/#{t}" }
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def test_tag_cloud_links
|
|
25
|
+
result = tag_cloud_links(Issue.tag_counts, :stub)
|
|
26
|
+
assert_includes result, 'class="tag_list"'
|
|
27
|
+
assert_includes result, '/stub_tags/'
|
|
28
|
+
assert_nil tag_cloud_links([], :stub)
|
|
29
|
+
assert_raises(NoMethodError) { tag_cloud_links(Issue.tag_counts, :unknown_xyz) }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def test_tag_list_field_tag
|
|
33
|
+
result = tag_list_field_tag('issue[tag_list]', ['bug'],
|
|
34
|
+
url: '/auto_completes/taggable_tags',
|
|
35
|
+
width: '60%', tags: false,
|
|
36
|
+
placeholder: '+ add tag')
|
|
37
|
+
assert_includes result, 'name="issue[tag_list][]"'
|
|
38
|
+
assert_includes result, '"width":"60%"'
|
|
39
|
+
assert_includes result, '"tags":false'
|
|
40
|
+
end
|
|
41
|
+
end
|
data/test/test_helper.rb
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
require 'rails/all'
|
|
2
2
|
require 'redmineup'
|
|
3
3
|
require 'minitest/autorun'
|
|
4
|
+
require 'minitest/mock'
|
|
4
5
|
|
|
5
6
|
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + '/debug.log')
|
|
6
7
|
ActiveRecord::Base.configurations = YAML.load_file(File.dirname(__FILE__) + '/database.yml')
|
|
7
8
|
ActiveRecord::Base.establish_connection(ENV['DB'].try(:to_sym) || :sqlite)
|
|
8
9
|
|
|
9
10
|
load(File.dirname(__FILE__) + '/schema.rb')
|
|
10
|
-
Dir.glob(File.expand_path('
|
|
11
|
+
Dir.glob(File.expand_path('models/*.rb', __dir__)).each { |f| require f }
|
|
11
12
|
|
|
12
|
-
class ActiveSupport::TestCase
|
|
13
|
+
class ActiveSupport::TestCase # :nodoc:
|
|
13
14
|
include ActiveRecord::TestFixtures
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
gem_fixtures_path = File.dirname(__FILE__) + '/fixtures/'
|
|
17
|
+
respond_to?(:fixture_paths=) ? self.fixture_paths = [gem_fixtures_path] : self.fixture_path = gem_fixtures_path
|
|
16
18
|
|
|
17
19
|
self.use_transactional_tests = true if RUBY_VERSION > '1.9.3'
|
|
18
20
|
self.use_instantiated_fixtures = false
|
|
19
|
-
set_fixture_class :
|
|
20
|
-
set_fixture_class :
|
|
21
|
+
set_fixture_class tags: Redmineup::ActsAsTaggable::Tag
|
|
22
|
+
set_fixture_class taggings: Redmineup::ActsAsTaggable::Tagging
|
|
21
23
|
|
|
22
|
-
set_fixture_class :
|
|
24
|
+
set_fixture_class votable_caches: VotableCache
|
|
23
25
|
fixtures :all
|
|
24
26
|
|
|
25
27
|
def assert_equivalent(expected, actual, message = nil)
|
|
@@ -32,9 +34,8 @@ class ActiveSupport::TestCase #:nodoc:
|
|
|
32
34
|
|
|
33
35
|
def assert_tag_counts(tags, expected_values)
|
|
34
36
|
# Map the tag fixture names to real tag names
|
|
35
|
-
expected_values = expected_values.
|
|
37
|
+
expected_values = expected_values.each_with_object({}) do |(tag, count), hash|
|
|
36
38
|
hash[tags(tag).name] = count
|
|
37
|
-
hash
|
|
38
39
|
end
|
|
39
40
|
|
|
40
41
|
tags.each do |tag|
|
|
@@ -44,14 +45,14 @@ class ActiveSupport::TestCase #:nodoc:
|
|
|
44
45
|
assert_equal value, tag.count, "Expected value of #{value} for #{tag.name}, but was #{tag.count}"
|
|
45
46
|
end
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
return if expected_values.empty?
|
|
49
|
+
|
|
50
|
+
assert false, "The following tag counts were not present: #{expected_values.inspect}"
|
|
50
51
|
end
|
|
51
52
|
|
|
52
53
|
# From Rails trunk
|
|
53
54
|
def assert_difference(expressions, difference = 1, message = nil, &block)
|
|
54
|
-
expression_evaluations = [expressions].flatten.collect{ |expression|
|
|
55
|
+
expression_evaluations = [expressions].flatten.collect { |expression| -> { eval(expression, block.binding) } }
|
|
55
56
|
|
|
56
57
|
original_values = expression_evaluations.inject([]) { |memo, expression| memo << expression.call }
|
|
57
58
|
yield
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: redmineup
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RedmineUP
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-08-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -109,6 +109,7 @@ extensions: []
|
|
|
109
109
|
extra_rdoc_files: []
|
|
110
110
|
files:
|
|
111
111
|
- ".gitignore"
|
|
112
|
+
- ".gitlab-ci.yml"
|
|
112
113
|
- Gemfile
|
|
113
114
|
- README.md
|
|
114
115
|
- Rakefile
|
|
@@ -117,15 +118,19 @@ files:
|
|
|
117
118
|
- app/assets/images/vcard.png
|
|
118
119
|
- app/assets/javascripts/Chart.bundle.min.js.bak
|
|
119
120
|
- app/assets/javascripts/chart.min.js
|
|
121
|
+
- app/assets/javascripts/consumer.js
|
|
122
|
+
- app/assets/javascripts/consumer_worker.js
|
|
123
|
+
- app/assets/javascripts/jquery.colorPicker.min.js
|
|
120
124
|
- app/assets/javascripts/select2.js
|
|
121
125
|
- app/assets/javascripts/select2_helpers.js
|
|
122
126
|
- app/assets/stylesheets/calendars.css
|
|
123
127
|
- app/assets/stylesheets/money.css
|
|
128
|
+
- app/assets/stylesheets/redmineup.css
|
|
124
129
|
- app/assets/stylesheets/select2.css
|
|
125
130
|
- app/controllers/redmineup_controller.rb
|
|
131
|
+
- app/views/redmineup/_additional_assets.html.erb
|
|
126
132
|
- app/views/redmineup/_money.html.erb
|
|
127
133
|
- app/views/redmineup/settings.html.erb
|
|
128
|
-
- bitbucket-pipelines.yml
|
|
129
134
|
- config/currency_iso.json
|
|
130
135
|
- config/locales/cs.yml
|
|
131
136
|
- config/locales/de.yml
|
|
@@ -135,6 +140,12 @@ files:
|
|
|
135
140
|
- config/routes.rb
|
|
136
141
|
- doc/CHANGELOG
|
|
137
142
|
- doc/LICENSE.txt
|
|
143
|
+
- doc/active-record-mixins.md
|
|
144
|
+
- doc/assets-money-and-utilities.md
|
|
145
|
+
- doc/tagging-and-select2.md
|
|
146
|
+
- lib/action_cable/connection/rup_connection.rb
|
|
147
|
+
- lib/action_cable/server/rup_configuration.rb
|
|
148
|
+
- lib/action_cable/server/rup_server.rb
|
|
138
149
|
- lib/application_record.rb
|
|
139
150
|
- lib/redmineup.rb
|
|
140
151
|
- lib/redmineup/acts_as_draftable/draft.rb
|
|
@@ -159,9 +170,11 @@ files:
|
|
|
159
170
|
- lib/redmineup/currency/loader.rb
|
|
160
171
|
- lib/redmineup/engine.rb
|
|
161
172
|
- lib/redmineup/helpers/calendars_helper.rb
|
|
173
|
+
- lib/redmineup/helpers/datetime_helper.rb
|
|
162
174
|
- lib/redmineup/helpers/external_assets_helper.rb
|
|
163
175
|
- lib/redmineup/helpers/form_tag_helper.rb
|
|
164
176
|
- lib/redmineup/helpers/tags_helper.rb
|
|
177
|
+
- lib/redmineup/helpers/test_helper.rb
|
|
165
178
|
- lib/redmineup/helpers/vote_helper.rb
|
|
166
179
|
- lib/redmineup/hooks/views_layouts_hook.rb
|
|
167
180
|
- lib/redmineup/liquid/drops/attachment_drop.rb
|
|
@@ -178,10 +191,11 @@ files:
|
|
|
178
191
|
- lib/redmineup/liquid/filters/base.rb
|
|
179
192
|
- lib/redmineup/liquid/filters/colors.rb
|
|
180
193
|
- lib/redmineup/money_helper.rb
|
|
181
|
-
- lib/redmineup/patches/
|
|
194
|
+
- lib/redmineup/patches/action_cable_base_patch.rb
|
|
195
|
+
- lib/redmineup/patches/action_cable_patch.rb
|
|
196
|
+
- lib/redmineup/patches/auto_completes_controller_patch.rb
|
|
182
197
|
- lib/redmineup/patches/compatibility/routing_mapper_patch.rb
|
|
183
198
|
- lib/redmineup/patches/compatibility/sprite_patch.rb
|
|
184
|
-
- lib/redmineup/patches/compatibility/user_patch.rb
|
|
185
199
|
- lib/redmineup/patches/compatibility_patch.rb
|
|
186
200
|
- lib/redmineup/patches/liquid_patch.rb
|
|
187
201
|
- lib/redmineup/settings.rb
|
|
@@ -233,6 +247,7 @@ files:
|
|
|
233
247
|
- test/money_helper_test.rb
|
|
234
248
|
- test/schema.rb
|
|
235
249
|
- test/tags_helper_test.rb
|
|
250
|
+
- test/tags_helper_view_test.rb
|
|
236
251
|
- test/test_helper.rb
|
|
237
252
|
- test/vote_helper_test.rb
|
|
238
253
|
homepage: https://www.redmineup.com
|
|
@@ -304,5 +319,6 @@ test_files:
|
|
|
304
319
|
- test/money_helper_test.rb
|
|
305
320
|
- test/schema.rb
|
|
306
321
|
- test/tags_helper_test.rb
|
|
322
|
+
- test/tags_helper_view_test.rb
|
|
307
323
|
- test/test_helper.rb
|
|
308
324
|
- test/vote_helper_test.rb
|
data/bitbucket-pipelines.yml
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# This is a sample build configuration for Ruby.
|
|
2
|
-
# Check our guides at https://confluence.atlassian.com/x/8r-5Mw for more examples.
|
|
3
|
-
# Only use spaces to indent your .yml configuration.
|
|
4
|
-
# -----
|
|
5
|
-
# You can specify a custom docker image from Docker Hub as your build environment.
|
|
6
|
-
|
|
7
|
-
pipelines:
|
|
8
|
-
default:
|
|
9
|
-
- parallel:
|
|
10
|
-
- step:
|
|
11
|
-
name: 2.4.1 ruby
|
|
12
|
-
image: ruby:2.4.1
|
|
13
|
-
script:
|
|
14
|
-
- sed -i "s/'sqlite3'/'sqlite3', '~> 1.3.6'/g" redmineup.gemspec
|
|
15
|
-
- sed -i "s/'mysql2'/'mysql2', '~> 0.4.0'/g" redmineup.gemspec
|
|
16
|
-
- sed -i "s/'rubyzip'/'rubyzip'\n spec.add_runtime_dependency 'loofah', '~>2.19.1'/g" redmineup.gemspec
|
|
17
|
-
- bundle install
|
|
18
|
-
- bundle exec rake test DB=sqlite
|
|
19
|
-
- bundle exec rake test DB=postgresql
|
|
20
|
-
- bundle exec rake test DB=mysql
|
|
21
|
-
services:
|
|
22
|
-
- mysql
|
|
23
|
-
- postgres
|
|
24
|
-
- step:
|
|
25
|
-
name: 3.2.2 ruby
|
|
26
|
-
image: ruby:3.2.2
|
|
27
|
-
script:
|
|
28
|
-
- sed -i "s/'sqlite3'/'sqlite3', '~> 1.4.4'/g" redmineup.gemspec
|
|
29
|
-
- sed -i "s/'mysql2'/'mysql2', '~> 0.5.0'/g" redmineup.gemspec
|
|
30
|
-
- sed -i "s/'rubyzip'/'rubyzip'\n spec.add_runtime_dependency 'loofah', '~>2.19.1'/g" redmineup.gemspec
|
|
31
|
-
- bundle install
|
|
32
|
-
- bundle exec rake test DB=sqlite
|
|
33
|
-
- bundle exec rake test DB=postgresql
|
|
34
|
-
- bundle exec rake test DB=mysql
|
|
35
|
-
services:
|
|
36
|
-
- mysql
|
|
37
|
-
- postgres
|
|
38
|
-
|
|
39
|
-
definitions:
|
|
40
|
-
services:
|
|
41
|
-
mysql:
|
|
42
|
-
image: mysql:5.7
|
|
43
|
-
environment:
|
|
44
|
-
MYSQL_DATABASE: redmineup_test
|
|
45
|
-
MYSQL_ROOT_PASSWORD: password
|
|
46
|
-
postgres:
|
|
47
|
-
image: postgres
|
|
48
|
-
environment:
|
|
49
|
-
POSTGRES_DB: redmineup_test
|
|
50
|
-
POSTGRES_PASSWORD: password
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module Redmineup
|
|
2
|
-
module Patches
|
|
3
|
-
module Compatibility
|
|
4
|
-
module ApplicationControllerPatch
|
|
5
|
-
def self.included(base) # :nodoc:
|
|
6
|
-
base.extend(ClassMethods)
|
|
7
|
-
base.class_eval do
|
|
8
|
-
unloadable # Send unloadable so it will not be unloaded in development
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
module ClassMethods
|
|
13
|
-
def before_action(*filters, &block)
|
|
14
|
-
before_filter(*filters, &block)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def after_action(*filters, &block)
|
|
18
|
-
after_filter(*filters, &block)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def skip_before_action(*filters, &block)
|
|
22
|
-
skip_before_filter(*filters, &block)
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
unless ActionController::Base.methods.include?(:before_action)
|
|
31
|
-
ActionController::Base.send(:include,Redmineup::Patches::Compatibility::ApplicationControllerPatch)
|
|
32
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module Redmineup
|
|
2
|
-
module Patches
|
|
3
|
-
module Compatibility
|
|
4
|
-
module UserPatch
|
|
5
|
-
def self.included(base)
|
|
6
|
-
base.send(:include, InstanceMethods)
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
module InstanceMethods
|
|
10
|
-
def atom_key
|
|
11
|
-
rss_key
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
unless ActionDispatch::Routing::Mapper.included_modules.include?(Redmineup::Patches::Compatibility::UserPatch)
|
|
20
|
-
ActionDispatch::Routing::Mapper.send(:include, Redmineup::Patches::Compatibility::UserPatch)
|
|
21
|
-
end
|