additional_tags 3.0.9 → 3.1.0
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/README.md +11 -10
- data/app/helpers/additional_tags_helper.rb +9 -0
- data/app/views/additional_tags/settings/_manage_tags.html.slim +1 -1
- data/db/migrate/20201123093214_migrate_existing_tags.rb +1 -1
- data/lib/additional_tags/hooks/view_hook.rb +5 -1
- data/lib/additional_tags/patches/auto_completes_controller_patch.rb +13 -11
- data/lib/additional_tags/patches/issue_patch.rb +2 -2
- data/lib/additional_tags/plugin_version.rb +1 -1
- data/lib/additional_tags/tags.rb +11 -3
- metadata +6 -7
- data/app/views/auto_completes/_additional_tag_list.slim +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30f90dcfc93dd66550bb8087b9f3a94fa411484f4876ccb9d837548edf0b64ae
|
4
|
+
data.tar.gz: df63312af11e2ce492b5b36bb3b0b1ce9f3e0b28c7d901512301226e06dcd65b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40e8517cddee11354aa8979506352abdbbb4e10774ce74f7f3d5c637b7bb2c03fd1fc75bd0e51f39ea23525aa8da2a54cb8089e3738b49d42718e5ea54031657
|
7
|
+
data.tar.gz: 429ea55984a5c3225db53f9a5699bf897a54ae09f9c4bf76fb24b5358702a6bb7547c9efba57938bfeb3c6e3b877f3ce7bffafef7069f645914d6b9b38f8f4a9
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Additional Tags - Tags for Redmine
|
2
2
|
|
3
|
-
[](https://www.redmine.org/plugins/additional_tags) [](https://www.redmine.org/plugins/additional_tags) [](https://github.com/alphanodes/additional_tags/actions?query=workflow%3A%22Run+Linters%22) [](https://github.com/alphanodes/additional_tags/actions?query=workflow%3ATests)
|
4
4
|
|
5
5
|
## Features
|
6
6
|
|
@@ -8,15 +8,15 @@
|
|
8
8
|
- *Activate issue tags* in the plugin configuration
|
9
9
|
- and update your role permissions in the Redmine administration *Roles & permissions / Issue tracking*.
|
10
10
|
- Tags for wiki pages. To use them you need to:
|
11
|
-
- *Activate wiki tags* in the plugin configuration
|
11
|
+
- *Activate wiki tags* in the plugin configuration
|
12
12
|
- and update your role permissions in the Redmine administration *Roles & permissions / Wiki*
|
13
|
-
- Available role permissions for issue tags (section *Issue tracking*):
|
13
|
+
- Available role permissions for issue tags (section *Issue tracking*):
|
14
14
|
- Add issue tags
|
15
15
|
- Edit issue tags
|
16
16
|
- Display issue tags
|
17
17
|
- Available role permissions wiki tags (section *Wiki*):
|
18
18
|
- Add wiki tags
|
19
|
-
- Managing tags centrally in the plugin settings (edit, delete, merge)-
|
19
|
+
- Managing tags centrally in the plugin settings (edit, delete, merge)-
|
20
20
|
- Grouped tags.
|
21
21
|
- Grouping of tags possible, when using a colon in tag (all tags with same base name get the same color). Typo example: ``Plugin:HRM``
|
22
22
|
- Scoped tags:
|
@@ -29,11 +29,11 @@
|
|
29
29
|
used tags or tagging tables for issue or wiki tagging, tags will be migrated automatically there
|
30
30
|
- Based on the very popular [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on)
|
31
31
|
|
32
|
-

|
33
33
|
|
34
34
|
The screenshot shows: regular tags, grouped tags and scoped tags. The colors are assigned randomly. But you can change the color by choosing a *Color theme* in the plugin settings.
|
35
35
|
|
36
|
-

|
37
37
|
|
38
38
|
Other plugins use additional_tags as framework in order to support tags for their entities.
|
39
39
|
At the moment this are:
|
@@ -42,11 +42,12 @@ At the moment this are:
|
|
42
42
|
- redmine_passwords (password tagging)
|
43
43
|
- redmine_reporting (project tagging)
|
44
44
|
- redmine_hrm (holiday tagging)
|
45
|
-
- redmine_servicedesk (contact
|
45
|
+
- redmine_servicedesk (tagging of contact, canned responses, invoices, helpdesk issues)
|
46
|
+
- redmine_wiki_guide (wiki page tagging)
|
46
47
|
|
47
48
|
Start using it, too. The example image shows the centralized tag management in the plugin configuration.
|
48
49
|
|
49
|
-

|
50
51
|
|
51
52
|
## Why another Tag plugin?
|
52
53
|
|
@@ -58,12 +59,12 @@ Start using it, too. The example image shows the centralized tag management in t
|
|
58
59
|
## Requirements
|
59
60
|
|
60
61
|
- Redmine `>= 5.0`
|
61
|
-
- Ruby `>=
|
62
|
+
- Ruby `>= 3.0`
|
62
63
|
- Redmine plugins: [additionals](https://www.redmine.org/plugins/additionals)
|
63
64
|
|
64
65
|
## Installing
|
65
66
|
|
66
|
-
### 1. Get
|
67
|
+
### 1. Get correct plugin version
|
67
68
|
|
68
69
|
To install stable version of additional_tags, use
|
69
70
|
|
@@ -3,6 +3,15 @@
|
|
3
3
|
module AdditionalTagsHelper
|
4
4
|
include ActsAsTaggableOn::TagsHelper
|
5
5
|
|
6
|
+
def format_tags_json(tags)
|
7
|
+
tags.map do |tag|
|
8
|
+
{
|
9
|
+
'id' => tag.name,
|
10
|
+
'text' => tag.name
|
11
|
+
}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
6
15
|
def manageable_tags
|
7
16
|
AdditionalTags::Tags.sort_tag_list ActsAsTaggableOn::Tag.where({})
|
8
17
|
end
|
@@ -6,7 +6,7 @@ class MigrateExistingTags < ActiveRecord::Migration[5.2]
|
|
6
6
|
|
7
7
|
excluded_taggable_types = %w[Question Contact DriveEntry]
|
8
8
|
|
9
|
-
MigrateTag.
|
9
|
+
MigrateTag.find_each do |old_tag|
|
10
10
|
ActsAsTaggableOn::Tagging.transaction do
|
11
11
|
tag = ActsAsTaggableOn::Tag.find_by name: old_tag.name
|
12
12
|
cnt = 0
|
@@ -19,10 +19,14 @@ module AdditionalTags
|
|
19
19
|
render_on :view_wiki_show_sidebar_bottom, partial: 'wiki/tags_sidebar'
|
20
20
|
|
21
21
|
def controller_issues_edit_before_save(context = {})
|
22
|
+
return unless AdditionalTags.setting? :active_issue_tags
|
23
|
+
|
22
24
|
tags_journal context[:issue], context[:params]
|
23
25
|
end
|
24
26
|
|
25
27
|
def controller_issues_bulk_edit_before_save(context = {})
|
28
|
+
return unless AdditionalTags.setting? :active_issue_tags
|
29
|
+
|
26
30
|
issue = context[:issue]
|
27
31
|
params = context[:params]
|
28
32
|
|
@@ -54,7 +58,7 @@ module AdditionalTags
|
|
54
58
|
|
55
59
|
pdf.ln
|
56
60
|
pdf.SetFontStyle '', 8
|
57
|
-
pdf.RDMCell 190, 5, page.tag_list.
|
61
|
+
pdf.RDMCell 190, 5, page.tag_list.to_comma_list
|
58
62
|
pdf.ln
|
59
63
|
end
|
60
64
|
|
@@ -6,25 +6,27 @@ module AdditionalTags
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
8
|
included do
|
9
|
+
include AdditionalTagsHelper
|
9
10
|
include InstanceMethods
|
10
11
|
end
|
11
12
|
|
12
13
|
module InstanceMethods
|
13
14
|
def issue_tags
|
14
15
|
suggestion_order = AdditionalTags.setting(:tags_suggestion_order) || 'name'
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
tags = Issue.available_tags name_like: build_search_query_term(params),
|
17
|
+
sort_by: suggestion_order,
|
18
|
+
order: (suggestion_order == 'name' ? 'ASC' : 'DESC')
|
18
19
|
|
19
|
-
|
20
|
+
tags = AdditionalTags::Tags.sort_tag_list tags if suggestion_order == 'name'
|
20
21
|
|
21
|
-
render
|
22
|
+
render json: format_tags_json(tags)
|
22
23
|
end
|
23
24
|
|
24
25
|
def wiki_tags
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
tags = WikiPage.available_tags project: nil,
|
27
|
+
name_like: build_search_query_term(params)
|
28
|
+
|
29
|
+
render json: format_tags_json(tags)
|
28
30
|
end
|
29
31
|
|
30
32
|
def all_tags
|
@@ -32,10 +34,10 @@ module AdditionalTags
|
|
32
34
|
|
33
35
|
q = build_search_query_term params
|
34
36
|
sql_for_where = "LOWER(#{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.tags_table}.name) LIKE ?"
|
35
|
-
|
36
|
-
|
37
|
+
tags = ActsAsTaggableOn::Tag.where(sql_for_where, "%#{q.downcase}%")
|
38
|
+
.order(name: :asc)
|
37
39
|
|
38
|
-
render
|
40
|
+
render json: format_tags_json(tags)
|
39
41
|
end
|
40
42
|
end
|
41
43
|
end
|
@@ -10,8 +10,8 @@ module AdditionalTags
|
|
10
10
|
include InstanceMethods
|
11
11
|
acts_as_ordered_taggable
|
12
12
|
|
13
|
-
before_save :prepare_save_tag_change
|
14
|
-
before_save :sort_tag_list
|
13
|
+
before_save :prepare_save_tag_change, if: proc { AdditionalTags.setting?(:active_issue_tags) }
|
14
|
+
before_save :sort_tag_list, if: proc { AdditionalTags.setting?(:active_issue_tags) }
|
15
15
|
|
16
16
|
validate :validate_tags, if: proc { AdditionalTags.setting?(:active_issue_tags) }
|
17
17
|
|
data/lib/additional_tags/tags.rb
CHANGED
@@ -27,6 +27,15 @@ module AdditionalTags
|
|
27
27
|
elsif options[:visible_condition]
|
28
28
|
scope = scope.where klass.visible_condition(user)
|
29
29
|
end
|
30
|
+
|
31
|
+
# @TODO: this should be activated and replace next line
|
32
|
+
# Additionals::EntityMethodsGlobal should be included for this
|
33
|
+
#
|
34
|
+
# if options[:name_like]
|
35
|
+
# scope = scope.like_with_wildcard columns: "#{TAG_TABLE_NAME}.name",
|
36
|
+
# value: options[:name_like],
|
37
|
+
# wildcard: :both
|
38
|
+
# end
|
30
39
|
scope = scope.where "LOWER(#{TAG_TABLE_NAME}.name) LIKE ?", "%#{options[:name_like].downcase}%" if options[:name_like]
|
31
40
|
scope = scope.where "#{TAG_TABLE_NAME}.name=?", options[:name] if options[:name]
|
32
41
|
scope = scope.where "#{TAGGING_TABLE_NAME}.taggable_id!=?", options[:exclude_id] if options[:exclude_id]
|
@@ -39,8 +48,7 @@ module AdditionalTags
|
|
39
48
|
end
|
40
49
|
|
41
50
|
def all_type_tags(klass, without_projects: false)
|
42
|
-
ActsAsTaggableOn::Tag.
|
43
|
-
.joins(tag_for_joins(klass, without_projects: without_projects))
|
51
|
+
ActsAsTaggableOn::Tag.joins(tag_for_joins(klass, without_projects: without_projects))
|
44
52
|
.distinct
|
45
53
|
.order(:name)
|
46
54
|
end
|
@@ -146,7 +154,7 @@ module AdditionalTags
|
|
146
154
|
"COUNT(DISTINCT #{TAGGING_TABLE_NAME}.taggable_id) AS count"]
|
147
155
|
|
148
156
|
columns << "MIN(#{TAGGING_TABLE_NAME}.created_at) AS last_created" if sort_by == 'last_created'
|
149
|
-
columns.
|
157
|
+
columns.to_comma_list
|
150
158
|
end
|
151
159
|
|
152
160
|
def status_for_tag_value(scope:, tag_id:, group_id: nil, group_id_is_bool: false)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: additional_tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AlphaNodes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acts-as-taggable-on
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '10.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '10.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: redmine_plugin_kit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,7 +68,6 @@ files:
|
|
68
68
|
- app/views/additional_tags/settings/_general.html.slim
|
69
69
|
- app/views/additional_tags/settings/_manage_tags.html.slim
|
70
70
|
- app/views/additional_tags/settings/_settings.html.slim
|
71
|
-
- app/views/auto_completes/_additional_tag_list.slim
|
72
71
|
- app/views/common/_tag_summary_block.html.slim
|
73
72
|
- app/views/context_menus/_issues_tags.html.slim
|
74
73
|
- app/views/dashboards/blocks/_issue_tags.html.slim
|
@@ -149,14 +148,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
149
148
|
requirements:
|
150
149
|
- - ">="
|
151
150
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
151
|
+
version: '3.0'
|
153
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
153
|
requirements:
|
155
154
|
- - ">="
|
156
155
|
- !ruby/object:Gem::Version
|
157
156
|
version: '0'
|
158
157
|
requirements: []
|
159
|
-
rubygems_version: 3.
|
158
|
+
rubygems_version: 3.4.10
|
160
159
|
signing_key:
|
161
160
|
specification_version: 4
|
162
161
|
summary: Redmine plugin for adding tag functionality
|
@@ -1 +0,0 @@
|
|
1
|
-
== @tags.collect { |tag| { 'id' => tag.name, 'text' => tag.name } }.to_json
|