additional_tags 1.0.7 → 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/controllers/issue_tags_controller.rb +3 -0
- data/app/helpers/additional_tags_helper.rb +11 -2
- data/app/helpers/additional_tags_issues_helper.rb +12 -2
- data/app/views/additional_tags/settings/_manage_tags.html.slim +1 -1
- data/config/locales/bg.yml +0 -1
- data/config/locales/cs.yml +0 -1
- data/config/locales/de.yml +0 -1
- data/config/locales/en.yml +0 -1
- data/config/locales/es.yml +0 -1
- data/config/locales/fr.yml +0 -1
- data/config/locales/it.yml +0 -1
- data/config/locales/ja.yml +0 -1
- data/config/locales/ko.yml +0 -1
- data/config/locales/pl.yml +0 -1
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/ru.yml +0 -1
- data/db/migrate/20201123093214_migrate_existing_tags.rb +1 -1
- data/lib/additional_tags/hooks/view_hook.rb +13 -10
- data/lib/additional_tags/patches/auto_completes_controller_patch.rb +13 -11
- data/lib/additional_tags/patches/issue_patch.rb +4 -5
- data/lib/additional_tags/patches/queries_helper_patch.rb +13 -1
- data/lib/additional_tags/patches/query_patch.rb +2 -2
- data/lib/additional_tags/plugin_version.rb +1 -1
- data/lib/additional_tags/tags.rb +12 -4
- metadata +7 -50
- data/.eslintrc.yml +0 -17
- data/.github/workflows/codeql-analysis.yml +0 -70
- data/.github/workflows/linters.yml +0 -55
- data/.github/workflows/tests.yml +0 -137
- data/.gitignore +0 -13
- data/.rubocop.yml +0 -138
- data/.slim-lint.yml +0 -27
- data/.stylelintrc.json +0 -20
- data/Rakefile +0 -13
- data/additional_tags.gemspec +0 -32
- data/app/views/auto_completes/_additional_tag_list.slim +0 -1
- data/doc/images/additional-tags-framework.png +0 -0
- data/doc/images/additional-tags.gif +0 -0
- data/doc/images/tag-overview.png +0 -0
- data/package.json +0 -8
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
|
|
|
@@ -34,8 +34,11 @@ class IssueTagsController < ApplicationController
|
|
|
34
34
|
|
|
35
35
|
Issue.transaction do
|
|
36
36
|
@issues.each do |issue|
|
|
37
|
+
issue.init_journal User.current
|
|
37
38
|
# add tags added in placeholder for a single/multiple issue or overwrite tags for single issue
|
|
38
39
|
params[:append] == 'true' ? issue.tag_list << tags : issue.tag_list = tags
|
|
40
|
+
|
|
41
|
+
issue.tags_to_journal issue.tag_list_was&.to_s, issue.tag_list.to_s
|
|
39
42
|
issue.save!
|
|
40
43
|
end
|
|
41
44
|
end
|
|
@@ -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
|
|
@@ -53,7 +62,7 @@ module AdditionalTagsHelper
|
|
|
53
62
|
when 'name:desc'
|
|
54
63
|
tags = AdditionalTags::Tags.sort_tag_list(tags).reverse
|
|
55
64
|
when 'count:asc'
|
|
56
|
-
tags.
|
|
65
|
+
tags.sort_by!(&:count)
|
|
57
66
|
when 'count:desc'
|
|
58
67
|
tags.sort! { |a, b| b.count <=> a.count }
|
|
59
68
|
else
|
|
@@ -190,7 +199,7 @@ module AdditionalTagsHelper
|
|
|
190
199
|
end
|
|
191
200
|
|
|
192
201
|
def link_to_issue_tags_totals(entries:, project:, open_issues_only:)
|
|
193
|
-
sum = if entries.blank? || entries.
|
|
202
|
+
sum = if entries.blank? || entries.empty?
|
|
194
203
|
0
|
|
195
204
|
else
|
|
196
205
|
query = IssueQuery.new project: project, name: '_'
|
|
@@ -10,8 +10,18 @@ module AdditionalTagsIssuesHelper
|
|
|
10
10
|
AdditionalTags.setting?(:active_issue_tags) && User.current.allowed_to?(:view_issue_tags, @project)
|
|
11
11
|
|
|
12
12
|
api.array :tags do
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
# support tags, which are not saved to database
|
|
14
|
+
if @issue.tag_list.present?
|
|
15
|
+
if @issue.tags.present? && @issue.tags.map(&:name) == @issue.tag_list
|
|
16
|
+
@issue.tags.each do |tag|
|
|
17
|
+
api.tag id: tag.id, name: tag.name
|
|
18
|
+
end
|
|
19
|
+
else
|
|
20
|
+
@issue.tag_list.each do |tag_name|
|
|
21
|
+
# there is no id for unsaved tags
|
|
22
|
+
api.tag name: tag_name
|
|
23
|
+
end
|
|
24
|
+
end
|
|
15
25
|
end
|
|
16
26
|
end
|
|
17
27
|
end
|
data/config/locales/bg.yml
CHANGED
|
@@ -15,7 +15,6 @@ bg:
|
|
|
15
15
|
label_manage_tags: "Управление на маркерите"
|
|
16
16
|
label_merge_selected_tags: "Обединение на избраните маркери"
|
|
17
17
|
label_open_issues_only: "Показване само на отворените задачи"
|
|
18
|
-
label_quantity: "Количество"
|
|
19
18
|
label_show_with_count: "Показване на брой маркирани обекти"
|
|
20
19
|
label_tag_color_theme: "Тема на цвета %{value}"
|
|
21
20
|
label_tags_color_theme: "Цвят"
|
data/config/locales/cs.yml
CHANGED
|
@@ -15,7 +15,6 @@ cs:
|
|
|
15
15
|
label_manage_tags: "Spravovat štítky"
|
|
16
16
|
label_merge_selected_tags: "Sloučit vybrané značky"
|
|
17
17
|
label_open_issues_only: "Zobrazit pouze otevřené problémy"
|
|
18
|
-
label_quantity: "Množství"
|
|
19
18
|
label_show_with_count: "Zobrazit částku na značce"
|
|
20
19
|
label_tag_color_theme: "Barevné téma %{value}"
|
|
21
20
|
label_tags_color_theme: "Barva"
|
data/config/locales/de.yml
CHANGED
|
@@ -15,7 +15,6 @@ de:
|
|
|
15
15
|
label_manage_tags: TAGs verwalten
|
|
16
16
|
label_merge_selected_tags: Ausgewählte TAGs zusammenführen
|
|
17
17
|
label_open_issues_only: Zeige nur offene Tickets
|
|
18
|
-
label_quantity: Anzahl
|
|
19
18
|
label_show_with_count: Zeige Anzahl zu TAG
|
|
20
19
|
label_tag_color_theme: Farbschema %{value}
|
|
21
20
|
label_tags_color_theme: Farbe
|
data/config/locales/en.yml
CHANGED
|
@@ -15,7 +15,6 @@ en:
|
|
|
15
15
|
label_manage_tags: "Manage tags"
|
|
16
16
|
label_merge_selected_tags: "Merge selected tags"
|
|
17
17
|
label_open_issues_only: "Display open issues only"
|
|
18
|
-
label_quantity: "Quantity"
|
|
19
18
|
label_show_with_count: "Display amount on tag"
|
|
20
19
|
label_tag_color_theme: Color theme %{value}
|
|
21
20
|
label_tags_color_theme: Color
|
data/config/locales/es.yml
CHANGED
|
@@ -15,7 +15,6 @@ es:
|
|
|
15
15
|
label_manage_tags: "Manejar tags"
|
|
16
16
|
label_merge_selected_tags: "Fusionar tags seleccionadas"
|
|
17
17
|
label_open_issues_only: "Mostrar sólo las peticiones abiertas"
|
|
18
|
-
label_quantity: "Ctd."
|
|
19
18
|
label_show_with_count: "Mostrar la cantidad en la tags"
|
|
20
19
|
label_tag_color_theme: "Tema del color %{value}"
|
|
21
20
|
label_tags_colors: "Color"
|
data/config/locales/fr.yml
CHANGED
|
@@ -15,7 +15,6 @@ fr:
|
|
|
15
15
|
label_manage_tags: "Gérer les tags"
|
|
16
16
|
label_merge_selected_tags: "Fusionner les tags sélectionnées"
|
|
17
17
|
label_open_issues_only: "Afficher uniquement les demandes ouverts"
|
|
18
|
-
label_quantity: "Quantité"
|
|
19
18
|
label_show_with_count: "Afficher le montant sur l'tags"
|
|
20
19
|
label_tag_color_theme: "Thème de la couleur %{value}"
|
|
21
20
|
label_tags_colors: "Couleur"
|
data/config/locales/it.yml
CHANGED
|
@@ -15,7 +15,6 @@ it:
|
|
|
15
15
|
label_manage_tags: "Gestire i tag"
|
|
16
16
|
label_merge_selected_tags: "Unisci i tag selezionati"
|
|
17
17
|
label_open_issues_only: "Mostra solo i segnalazione"
|
|
18
|
-
label_quantity: "Numero"
|
|
19
18
|
label_show_with_count: "Visualizzare l'importo sul tag"
|
|
20
19
|
label_tag_color_theme: "Tema colore %{value}"
|
|
21
20
|
label_tags_colors: Colore
|
data/config/locales/ja.yml
CHANGED
data/config/locales/ko.yml
CHANGED
data/config/locales/pl.yml
CHANGED
|
@@ -15,7 +15,6 @@ pl:
|
|
|
15
15
|
label_manage_tags: "Zarządzaj tagami"
|
|
16
16
|
label_merge_selected_tags: "Łączenie wybranych tagów"
|
|
17
17
|
label_open_issues_only: "Wyświetlaj tylko sprawy otwarte"
|
|
18
|
-
label_quantity: "Ilość"
|
|
19
18
|
label_show_with_count: "Wyświetlanie ilości na etykiecie"
|
|
20
19
|
label_tag_color_theme: "Kolorowy motyw %{value}"
|
|
21
20
|
label_tags_colors: Kolor
|
data/config/locales/pt-BR.yml
CHANGED
|
@@ -15,7 +15,6 @@ pt-BR:
|
|
|
15
15
|
label_manage_tags: "Gerenciar etiquetas"
|
|
16
16
|
label_merge_selected_tags: "Fundir tags selecionadas"
|
|
17
17
|
label_open_issues_only: "Exibir apenas questões em aberto"
|
|
18
|
-
label_quantity: "Quantidade"
|
|
19
18
|
label_show_with_count: "Mostrar quantidade na etiqueta"
|
|
20
19
|
label_tag_color_theme: "Tema da cor %{value}"
|
|
21
20
|
label_tags_colors: "Cor"
|
data/config/locales/ru.yml
CHANGED
|
@@ -15,7 +15,6 @@ ru:
|
|
|
15
15
|
label_manage_tags: "Управление метками"
|
|
16
16
|
label_merge_selected_tags: "Объединить выбранные метки"
|
|
17
17
|
label_open_issues_only: "Отображать только открытые задачи"
|
|
18
|
-
label_quantity: "Количество"
|
|
19
18
|
label_show_with_count: "Отображать количество на метке"
|
|
20
19
|
label_tag_color_theme: "Цветовая тема %{value}"
|
|
21
20
|
label_tags_colors: "Цвет"
|
|
@@ -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
|
|
|
@@ -63,14 +67,14 @@ module AdditionalTags
|
|
|
63
67
|
def issues_bulk_tags_fix(issue, params)
|
|
64
68
|
return unless params && params[:issue]
|
|
65
69
|
|
|
66
|
-
common_tags =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
common_tags = if params[:common_tags].present?
|
|
71
|
+
params[:common_tags].split(ActsAsTaggableOn.delimiter).map(&:strip)
|
|
72
|
+
else
|
|
73
|
+
[]
|
|
74
|
+
end
|
|
75
|
+
|
|
72
76
|
current_tags = ActsAsTaggableOn::TagList.new issue.tags.to_a
|
|
73
|
-
new_tags = Array(params[:issue][:tag_list]).
|
|
77
|
+
new_tags = Array(params[:issue][:tag_list]).compact_blank
|
|
74
78
|
|
|
75
79
|
tags_to_add = new_tags - common_tags
|
|
76
80
|
tags_to_remove = common_tags - new_tags
|
|
@@ -84,8 +88,7 @@ module AdditionalTags
|
|
|
84
88
|
def tags_journal(issue, params)
|
|
85
89
|
return unless params && params[:issue] && params[:issue][:tag_list]
|
|
86
90
|
|
|
87
|
-
issue.tags_to_journal
|
|
88
|
-
issue.tag_list.to_s
|
|
91
|
+
issue.tags_to_journal issue.tag_list_was&.to_s, issue.tag_list.to_s
|
|
89
92
|
end
|
|
90
93
|
end
|
|
91
94
|
end
|
|
@@ -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
|
|
|
@@ -101,8 +101,6 @@ module AdditionalTags
|
|
|
101
101
|
tags = attrs.delete :tag_list
|
|
102
102
|
tags = Array(tags).reject(&:empty?)
|
|
103
103
|
|
|
104
|
-
# Additionals.debug "tags: #{tags.inspect} - project: #{project&.id} - access: #{user.allowed_to? :create_issue_tags, project}"
|
|
105
|
-
|
|
106
104
|
if user.allowed_to?(:create_issue_tags, project) ||
|
|
107
105
|
user.allowed_to?(:edit_issue_tags, project) && Issue.allowed_tags?(tags)
|
|
108
106
|
attrs[:tag_list] = tags # required fix for journal details
|
|
@@ -115,7 +113,8 @@ module AdditionalTags
|
|
|
115
113
|
|
|
116
114
|
copy_from_without_tags arg, **options
|
|
117
115
|
issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg)
|
|
118
|
-
self.
|
|
116
|
+
self.tags = issue.tags # required for bulk copy
|
|
117
|
+
self.tag_list = tags.map(&:name) # required for copy
|
|
119
118
|
self
|
|
120
119
|
end
|
|
121
120
|
|
|
@@ -15,7 +15,19 @@ module AdditionalTags
|
|
|
15
15
|
module InstanceMethods
|
|
16
16
|
def column_content_with_tags(column, item)
|
|
17
17
|
if column.name == :issue_tags || item.is_a?(Issue) && column.name == :tags
|
|
18
|
-
|
|
18
|
+
tags = if item.instance_variable_defined? :@visible_tags
|
|
19
|
+
item.instance_variable_get :@visible_tags
|
|
20
|
+
elsif Setting.display_subprojects_issues?
|
|
21
|
+
# permission check required (expensive)
|
|
22
|
+
return unless User.current.allowed_to? :view_issue_tags, item.project
|
|
23
|
+
|
|
24
|
+
column.value item
|
|
25
|
+
else
|
|
26
|
+
# no permission check required
|
|
27
|
+
column.value item
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
additional_tag_links tags, tag_controller: 'issues'
|
|
19
31
|
else
|
|
20
32
|
column_content_without_tags column, item
|
|
21
33
|
end
|
|
@@ -69,7 +69,7 @@ module AdditionalTags
|
|
|
69
69
|
when '=', '!'
|
|
70
70
|
ids_list = klass.tagged_with(values, any: true).ids
|
|
71
71
|
# special case: filter with deleted tag
|
|
72
|
-
return
|
|
72
|
+
return AdditionalsQuery::NO_RESULT_CONDITION if ids_list.blank? && values.present? && operator == '='
|
|
73
73
|
else
|
|
74
74
|
allowed_projects = Project.where(Project.allowed_to_condition(User.current, permission))
|
|
75
75
|
.select(:id)
|
|
@@ -90,7 +90,7 @@ module AdditionalTags
|
|
|
90
90
|
"(#{klass.table_name}.id #{compare} (#{ids_list.join ','}))"
|
|
91
91
|
elsif values.present? && operator == '='
|
|
92
92
|
# special case: filter with deleted tag
|
|
93
|
-
|
|
93
|
+
AdditionalsQuery::NO_RESULT_CONDITION
|
|
94
94
|
end
|
|
95
95
|
else
|
|
96
96
|
entries = ActsAsTaggableOn::Tagging.where taggable_type: klass.name
|
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)
|
|
@@ -208,7 +216,7 @@ module AdditionalTags
|
|
|
208
216
|
if projects_allowed.present?
|
|
209
217
|
"#{Project.table_name}.id IN (#{projects_allowed.join ','})" unless projects_allowed.empty?
|
|
210
218
|
else
|
|
211
|
-
|
|
219
|
+
AdditionalsQuery::NO_RESULT_CONDITION
|
|
212
220
|
end
|
|
213
221
|
end
|
|
214
222
|
end
|
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: 1.0
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- AlphaNodes
|
|
8
8
|
autorequire:
|
|
9
|
-
bindir:
|
|
9
|
+
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
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
|
|
@@ -38,34 +38,6 @@ dependencies:
|
|
|
38
38
|
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: bundler
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - ">="
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - ">="
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: rake
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - ">="
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - ">="
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
69
41
|
description: Redmine plugin for adding tag functionality
|
|
70
42
|
email:
|
|
71
43
|
- alex@alphanodes.com
|
|
@@ -73,18 +45,8 @@ executables: []
|
|
|
73
45
|
extensions: []
|
|
74
46
|
extra_rdoc_files: []
|
|
75
47
|
files:
|
|
76
|
-
- ".eslintrc.yml"
|
|
77
|
-
- ".github/workflows/codeql-analysis.yml"
|
|
78
|
-
- ".github/workflows/linters.yml"
|
|
79
|
-
- ".github/workflows/tests.yml"
|
|
80
|
-
- ".gitignore"
|
|
81
|
-
- ".rubocop.yml"
|
|
82
|
-
- ".slim-lint.yml"
|
|
83
|
-
- ".stylelintrc.json"
|
|
84
48
|
- LICENSE
|
|
85
49
|
- README.md
|
|
86
|
-
- Rakefile
|
|
87
|
-
- additional_tags.gemspec
|
|
88
50
|
- app/controllers/additional_tags_controller.rb
|
|
89
51
|
- app/controllers/issue_tags_controller.rb
|
|
90
52
|
- app/helpers/additional_tags_helper.rb
|
|
@@ -106,7 +68,6 @@ files:
|
|
|
106
68
|
- app/views/additional_tags/settings/_general.html.slim
|
|
107
69
|
- app/views/additional_tags/settings/_manage_tags.html.slim
|
|
108
70
|
- app/views/additional_tags/settings/_settings.html.slim
|
|
109
|
-
- app/views/auto_completes/_additional_tag_list.slim
|
|
110
71
|
- app/views/common/_tag_summary_block.html.slim
|
|
111
72
|
- app/views/context_menus/_issues_tags.html.slim
|
|
112
73
|
- app/views/dashboards/blocks/_issue_tags.html.slim
|
|
@@ -142,9 +103,6 @@ files:
|
|
|
142
103
|
- config/settings.yml
|
|
143
104
|
- db/migrate/20201116145429_acts_as_taggable_migration.rb
|
|
144
105
|
- db/migrate/20201123093214_migrate_existing_tags.rb
|
|
145
|
-
- doc/images/additional-tags-framework.png
|
|
146
|
-
- doc/images/additional-tags.gif
|
|
147
|
-
- doc/images/tag-overview.png
|
|
148
106
|
- init.rb
|
|
149
107
|
- lib/additional_tags.rb
|
|
150
108
|
- lib/additional_tags/hooks/model_hook.rb
|
|
@@ -177,7 +135,6 @@ files:
|
|
|
177
135
|
- lib/additional_tags/plugin_version.rb
|
|
178
136
|
- lib/additional_tags/tags.rb
|
|
179
137
|
- lib/tasks/additional_tags.rake
|
|
180
|
-
- package.json
|
|
181
138
|
homepage: https://github.com/alphanodes/additional_tags
|
|
182
139
|
licenses:
|
|
183
140
|
- GPL-2.0
|
|
@@ -191,14 +148,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
191
148
|
requirements:
|
|
192
149
|
- - ">="
|
|
193
150
|
- !ruby/object:Gem::Version
|
|
194
|
-
version: '
|
|
151
|
+
version: '3.0'
|
|
195
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
153
|
requirements:
|
|
197
154
|
- - ">="
|
|
198
155
|
- !ruby/object:Gem::Version
|
|
199
156
|
version: '0'
|
|
200
157
|
requirements: []
|
|
201
|
-
rubygems_version: 3.
|
|
158
|
+
rubygems_version: 3.4.10
|
|
202
159
|
signing_key:
|
|
203
160
|
specification_version: 4
|
|
204
161
|
summary: Redmine plugin for adding tag functionality
|
data/.eslintrc.yml
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
-
# to commit it to your repository.
|
|
3
|
-
#
|
|
4
|
-
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
-
# or to provide custom queries or build logic.
|
|
6
|
-
#
|
|
7
|
-
# ******** NOTE ********
|
|
8
|
-
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
-
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
-
# supported CodeQL languages.
|
|
11
|
-
#
|
|
12
|
-
name: "CodeQL"
|
|
13
|
-
|
|
14
|
-
on:
|
|
15
|
-
push:
|
|
16
|
-
branches: [ main ]
|
|
17
|
-
pull_request:
|
|
18
|
-
# The branches below must be a subset of the branches above
|
|
19
|
-
branches: [ main ]
|
|
20
|
-
schedule:
|
|
21
|
-
- cron: '35 20 * * 2'
|
|
22
|
-
|
|
23
|
-
jobs:
|
|
24
|
-
analyze:
|
|
25
|
-
name: Analyze
|
|
26
|
-
runs-on: ubuntu-latest
|
|
27
|
-
permissions:
|
|
28
|
-
actions: read
|
|
29
|
-
contents: read
|
|
30
|
-
security-events: write
|
|
31
|
-
|
|
32
|
-
strategy:
|
|
33
|
-
fail-fast: false
|
|
34
|
-
matrix:
|
|
35
|
-
language: [ 'javascript', 'ruby' ]
|
|
36
|
-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
37
|
-
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
|
38
|
-
|
|
39
|
-
steps:
|
|
40
|
-
- name: Checkout repository
|
|
41
|
-
uses: actions/checkout@v3
|
|
42
|
-
|
|
43
|
-
# Initializes the CodeQL tools for scanning.
|
|
44
|
-
- name: Initialize CodeQL
|
|
45
|
-
uses: github/codeql-action/init@v2
|
|
46
|
-
with:
|
|
47
|
-
languages: ${{ matrix.language }}
|
|
48
|
-
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
49
|
-
# By default, queries listed here will override any specified in a config file.
|
|
50
|
-
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
51
|
-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
52
|
-
|
|
53
|
-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
54
|
-
# If this step fails, then you should remove it and run the build manually (see below)
|
|
55
|
-
- name: Autobuild
|
|
56
|
-
uses: github/codeql-action/autobuild@v2
|
|
57
|
-
|
|
58
|
-
# ℹ️ Command-line programs to run using the OS shell.
|
|
59
|
-
# 📚 https://git.io/JvXDl
|
|
60
|
-
|
|
61
|
-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
62
|
-
# and modify them (or add more) to build your code if your project
|
|
63
|
-
# uses a compiled language
|
|
64
|
-
|
|
65
|
-
#- run: |
|
|
66
|
-
# make bootstrap
|
|
67
|
-
# make release
|
|
68
|
-
|
|
69
|
-
- name: Perform CodeQL Analysis
|
|
70
|
-
uses: github/codeql-action/analyze@v2
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
name: Run Linters
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
pull_request:
|
|
5
|
-
|
|
6
|
-
jobs:
|
|
7
|
-
test:
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
|
|
10
|
-
steps:
|
|
11
|
-
- uses: actions/checkout@v3
|
|
12
|
-
|
|
13
|
-
- name: Install package dependencies
|
|
14
|
-
run: >
|
|
15
|
-
sudo apt-get install --yes --quiet pandoc
|
|
16
|
-
|
|
17
|
-
- name: Setup Gemfile
|
|
18
|
-
run: |
|
|
19
|
-
touch .enable_linters
|
|
20
|
-
sed -i "3isource 'https://rubygems.org'" Gemfile
|
|
21
|
-
|
|
22
|
-
- name: Setup Ruby
|
|
23
|
-
uses: ruby/setup-ruby@v1
|
|
24
|
-
with:
|
|
25
|
-
ruby-version: 3.1
|
|
26
|
-
|
|
27
|
-
- name: Run bundle install
|
|
28
|
-
run: |
|
|
29
|
-
bundle install --jobs 4 --retry 3
|
|
30
|
-
|
|
31
|
-
- name: Run RuboCop
|
|
32
|
-
run: |
|
|
33
|
-
bundle exec rubocop -S
|
|
34
|
-
|
|
35
|
-
- name: Run Slim-Lint
|
|
36
|
-
run: |
|
|
37
|
-
bundle exec slim-lint app/views
|
|
38
|
-
if: always()
|
|
39
|
-
|
|
40
|
-
- name: Run Brakeman
|
|
41
|
-
run: |
|
|
42
|
-
bundle exec brakeman -5
|
|
43
|
-
|
|
44
|
-
- name: Setup node
|
|
45
|
-
uses: actions/setup-node@v2
|
|
46
|
-
with:
|
|
47
|
-
node-version: '16'
|
|
48
|
-
|
|
49
|
-
- run: yarn install
|
|
50
|
-
|
|
51
|
-
- name: Run Stylelint
|
|
52
|
-
run: node_modules/.bin/stylelint assets/stylesheets/
|
|
53
|
-
|
|
54
|
-
- name: Run ESLint
|
|
55
|
-
run: node_modules/.bin/eslint assets/javascripts/
|
data/.github/workflows/tests.yml
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
name: Tests
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
pull_request:
|
|
5
|
-
|
|
6
|
-
jobs:
|
|
7
|
-
test:
|
|
8
|
-
name: ${{ matrix.redmine }} ${{ matrix.db }} ruby-${{ matrix.ruby }}
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
|
|
11
|
-
strategy:
|
|
12
|
-
matrix:
|
|
13
|
-
ruby: ['2.7', '3.0', '3.1', '3.2']
|
|
14
|
-
redmine: ['5.0-stable', 'master']
|
|
15
|
-
db: ['postgres', 'mysql']
|
|
16
|
-
exclude:
|
|
17
|
-
- ruby: '3.2'
|
|
18
|
-
redmine: 5.0-stable
|
|
19
|
-
fail-fast: false
|
|
20
|
-
|
|
21
|
-
services:
|
|
22
|
-
postgres:
|
|
23
|
-
image: postgres:14
|
|
24
|
-
env:
|
|
25
|
-
POSTGRES_DB: redmine
|
|
26
|
-
POSTGRES_USER: postgres
|
|
27
|
-
POSTGRES_PASSWORD: postgres
|
|
28
|
-
ports:
|
|
29
|
-
- 5432:5432
|
|
30
|
-
|
|
31
|
-
options: >-
|
|
32
|
-
--health-cmd pg_isready
|
|
33
|
-
--health-interval 10s
|
|
34
|
-
--health-timeout 5s
|
|
35
|
-
--health-retries 5
|
|
36
|
-
|
|
37
|
-
mysql:
|
|
38
|
-
image: mysql:8.0
|
|
39
|
-
env:
|
|
40
|
-
MYSQL_ROOT_PASSWORD: 'BestPasswordEver'
|
|
41
|
-
ports:
|
|
42
|
-
# will assign a random free host port
|
|
43
|
-
- 3306/tcp
|
|
44
|
-
options: >-
|
|
45
|
-
--health-cmd="mysqladmin ping"
|
|
46
|
-
--health-interval=10s
|
|
47
|
-
--health-timeout=5s
|
|
48
|
-
--health-retries=3
|
|
49
|
-
|
|
50
|
-
steps:
|
|
51
|
-
- name: Verify MySQL connection from host
|
|
52
|
-
run: |
|
|
53
|
-
mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -pBestPasswordEver -e "SHOW DATABASES"
|
|
54
|
-
if: matrix.db == 'mysql'
|
|
55
|
-
|
|
56
|
-
- name: Checkout Redmine
|
|
57
|
-
uses: actions/checkout@v3
|
|
58
|
-
with:
|
|
59
|
-
repository: redmine/redmine
|
|
60
|
-
ref: ${{ matrix.redmine }}
|
|
61
|
-
path: redmine
|
|
62
|
-
|
|
63
|
-
- name: Checkout additionals
|
|
64
|
-
uses: actions/checkout@v3
|
|
65
|
-
with:
|
|
66
|
-
repository: AlphaNodes/additionals
|
|
67
|
-
path: redmine/plugins/additionals
|
|
68
|
-
|
|
69
|
-
- name: Checkout additional_tags
|
|
70
|
-
uses: actions/checkout@v3
|
|
71
|
-
with:
|
|
72
|
-
path: redmine/plugins/additional_tags
|
|
73
|
-
|
|
74
|
-
- name: Update package archives
|
|
75
|
-
run: sudo apt-get update --yes --quiet
|
|
76
|
-
|
|
77
|
-
- name: Install package dependencies
|
|
78
|
-
run: >
|
|
79
|
-
sudo apt-get install --yes --quiet
|
|
80
|
-
build-essential
|
|
81
|
-
cmake
|
|
82
|
-
libicu-dev
|
|
83
|
-
libpq-dev
|
|
84
|
-
libmysqlclient-dev
|
|
85
|
-
|
|
86
|
-
- name: Setup Gemfile
|
|
87
|
-
run: |
|
|
88
|
-
touch .enable_test
|
|
89
|
-
|
|
90
|
-
- name: Setup Ruby
|
|
91
|
-
uses: ruby/setup-ruby@v1
|
|
92
|
-
with:
|
|
93
|
-
ruby-version: ${{ matrix.ruby }}
|
|
94
|
-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
95
|
-
|
|
96
|
-
- name: Prepare Redmine source
|
|
97
|
-
working-directory: redmine
|
|
98
|
-
run: |
|
|
99
|
-
cp plugins/additional_tags/test/support/database-${{ matrix.db }}.yml config/database.yml
|
|
100
|
-
cp plugins/additional_tags/test/support/configuration.yml config/configuration.yml
|
|
101
|
-
cp plugins/additionals/test/support/additional_environment.rb config/additional_environment.rb
|
|
102
|
-
|
|
103
|
-
- name: Install Ruby dependencies
|
|
104
|
-
working-directory: redmine
|
|
105
|
-
run: |
|
|
106
|
-
bundle config set --local without 'development'
|
|
107
|
-
bundle install --jobs=4 --retry=3
|
|
108
|
-
|
|
109
|
-
- name: Generate session store secret
|
|
110
|
-
env:
|
|
111
|
-
RAILS_ENV: test
|
|
112
|
-
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
|
|
113
|
-
working-directory: redmine
|
|
114
|
-
run: |
|
|
115
|
-
bundle exec rake generate_secret_token
|
|
116
|
-
|
|
117
|
-
- name: Run Redmine DB and migration tasks
|
|
118
|
-
env:
|
|
119
|
-
RAILS_ENV: test
|
|
120
|
-
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
|
|
121
|
-
working-directory: redmine
|
|
122
|
-
run: |
|
|
123
|
-
bundle exec rake db:create db:migrate redmine:plugins:migrate
|
|
124
|
-
|
|
125
|
-
- name: Run tests
|
|
126
|
-
env:
|
|
127
|
-
RAILS_ENV: test
|
|
128
|
-
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
|
|
129
|
-
working-directory: redmine
|
|
130
|
-
run: bundle exec rake redmine:plugins:test NAME=additional_tags RUBYOPT="-W0"
|
|
131
|
-
|
|
132
|
-
- name: Run uninstall test
|
|
133
|
-
env:
|
|
134
|
-
RAILS_ENV: test
|
|
135
|
-
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}
|
|
136
|
-
working-directory: redmine
|
|
137
|
-
run: bundle exec rake redmine:plugins:migrate NAME=additional_tags VERSION=0
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
require:
|
|
2
|
-
- rubocop-performance
|
|
3
|
-
- rubocop-rails
|
|
4
|
-
- rubocop-minitest
|
|
5
|
-
|
|
6
|
-
AllCops:
|
|
7
|
-
TargetRubyVersion: 2.7
|
|
8
|
-
TargetRailsVersion: 6.1
|
|
9
|
-
NewCops: enable
|
|
10
|
-
ActiveSupportExtensionsEnabled: true
|
|
11
|
-
|
|
12
|
-
Rails:
|
|
13
|
-
Enabled: true
|
|
14
|
-
|
|
15
|
-
Minitest/MultipleAssertions:
|
|
16
|
-
Max: 15
|
|
17
|
-
Enabled: true
|
|
18
|
-
|
|
19
|
-
Minitest/AssertPredicate:
|
|
20
|
-
Enabled: false
|
|
21
|
-
|
|
22
|
-
Metrics/AbcSize:
|
|
23
|
-
Enabled: false
|
|
24
|
-
|
|
25
|
-
Metrics/BlockLength:
|
|
26
|
-
Enabled: false
|
|
27
|
-
|
|
28
|
-
Metrics/ParameterLists:
|
|
29
|
-
Enabled: true
|
|
30
|
-
CountKeywordArgs: false
|
|
31
|
-
|
|
32
|
-
Metrics/ClassLength:
|
|
33
|
-
Enabled: false
|
|
34
|
-
|
|
35
|
-
Metrics/CyclomaticComplexity:
|
|
36
|
-
Max: 25
|
|
37
|
-
|
|
38
|
-
Layout/LineLength:
|
|
39
|
-
Max: 140
|
|
40
|
-
|
|
41
|
-
Metrics/MethodLength:
|
|
42
|
-
Max: 60
|
|
43
|
-
|
|
44
|
-
Metrics/ModuleLength:
|
|
45
|
-
Enabled: false
|
|
46
|
-
|
|
47
|
-
Metrics/PerceivedComplexity:
|
|
48
|
-
Max: 25
|
|
49
|
-
|
|
50
|
-
Style/ExpandPathArguments:
|
|
51
|
-
Enabled: true
|
|
52
|
-
Exclude:
|
|
53
|
-
- additional_tags.gemspec
|
|
54
|
-
- test/**/*
|
|
55
|
-
|
|
56
|
-
Rails/ApplicationJob:
|
|
57
|
-
Enabled: false
|
|
58
|
-
|
|
59
|
-
Lint/AmbiguousOperatorPrecedence:
|
|
60
|
-
Enabled: false
|
|
61
|
-
|
|
62
|
-
Rails/ContentTag:
|
|
63
|
-
Enabled: true
|
|
64
|
-
Exclude:
|
|
65
|
-
- app/helpers/additional_tags_issues_helper.rb
|
|
66
|
-
|
|
67
|
-
Rails/ApplicationRecord:
|
|
68
|
-
Enabled: false
|
|
69
|
-
|
|
70
|
-
Rails/CreateTableWithTimestamps:
|
|
71
|
-
Enabled: false
|
|
72
|
-
|
|
73
|
-
Rails/HelperInstanceVariable:
|
|
74
|
-
Enabled: false
|
|
75
|
-
|
|
76
|
-
Rails/SkipsModelValidations:
|
|
77
|
-
Enabled: false
|
|
78
|
-
|
|
79
|
-
Performance/ChainArrayAllocation:
|
|
80
|
-
Enabled: true
|
|
81
|
-
|
|
82
|
-
Style/AutoResourceCleanup:
|
|
83
|
-
Enabled: true
|
|
84
|
-
|
|
85
|
-
Style/FrozenStringLiteralComment:
|
|
86
|
-
Enabled: true
|
|
87
|
-
Exclude:
|
|
88
|
-
- '/**/*.rsb'
|
|
89
|
-
|
|
90
|
-
Style/Documentation:
|
|
91
|
-
Enabled: false
|
|
92
|
-
|
|
93
|
-
Style/OptionHash:
|
|
94
|
-
Enabled: true
|
|
95
|
-
SuspiciousParamNames:
|
|
96
|
-
- options
|
|
97
|
-
- api_options
|
|
98
|
-
- opts
|
|
99
|
-
- args
|
|
100
|
-
- params
|
|
101
|
-
- parameters
|
|
102
|
-
- settings
|
|
103
|
-
|
|
104
|
-
# postgresql and mysql are supported
|
|
105
|
-
# autodetect does not work without database configuration
|
|
106
|
-
Rails/BulkChangeTable:
|
|
107
|
-
Enabled: true
|
|
108
|
-
Database: postgresql
|
|
109
|
-
|
|
110
|
-
Style/ReturnNil:
|
|
111
|
-
Enabled: true
|
|
112
|
-
|
|
113
|
-
Style/UnlessLogicalOperators:
|
|
114
|
-
Enabled: true
|
|
115
|
-
|
|
116
|
-
Style/MethodCallWithArgsParentheses:
|
|
117
|
-
Enabled: true
|
|
118
|
-
AllowParenthesesInMultilineCall: true
|
|
119
|
-
AllowParenthesesInChaining: true
|
|
120
|
-
EnforcedStyle: omit_parentheses
|
|
121
|
-
|
|
122
|
-
Naming/VariableNumber:
|
|
123
|
-
Enabled: true
|
|
124
|
-
Exclude:
|
|
125
|
-
- 'test/**/*'
|
|
126
|
-
|
|
127
|
-
Layout/LineContinuationLeadingSpace:
|
|
128
|
-
Enabled: false
|
|
129
|
-
|
|
130
|
-
# see https://github.com/rubocop/rubocop-rails/issues/578
|
|
131
|
-
# redmine does not use load_defaults: https://rails.rubystyle.guide/#config-defaults
|
|
132
|
-
Rails/RedundantPresenceValidationOnBelongsTo:
|
|
133
|
-
Enabled: false
|
|
134
|
-
|
|
135
|
-
# see https://github.com/rubocop/rubocop-rails/issues/825
|
|
136
|
-
# should be removed and corrected in code, if this bug is fixed
|
|
137
|
-
Rails/ActionControllerFlashBeforeRender:
|
|
138
|
-
Enabled: false
|
data/.slim-lint.yml
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
linters:
|
|
2
|
-
LineLength:
|
|
3
|
-
max: 140
|
|
4
|
-
RuboCop:
|
|
5
|
-
ignored_cops:
|
|
6
|
-
- Layout/ArgumentAlignment
|
|
7
|
-
- Layout/ArrayAlignment
|
|
8
|
-
- Layout/BlockEndNewline
|
|
9
|
-
- Layout/EmptyLineAfterGuardClause
|
|
10
|
-
- Layout/HashAlignment
|
|
11
|
-
- Layout/IndentationWidth
|
|
12
|
-
- Layout/MultilineArrayBraceLayout
|
|
13
|
-
- Layout/MultilineAssignmentLayout
|
|
14
|
-
- Layout/MultilineBlockLayout
|
|
15
|
-
- Layout/MultilineHashBraceLayout
|
|
16
|
-
- Layout/MultilineMethodCallBraceLayout
|
|
17
|
-
- Layout/MultilineMethodCallIndentation
|
|
18
|
-
- Layout/MultilineMethodDefinitionBraceLayout
|
|
19
|
-
- Layout/MultilineOperationIndentation
|
|
20
|
-
- Layout/SpaceBeforeBrackets
|
|
21
|
-
- Layout/TrailingEmptyLines
|
|
22
|
-
- Lint/Void
|
|
23
|
-
- Rails/OutputSafety
|
|
24
|
-
- Style/FrozenStringLiteralComment
|
|
25
|
-
- Style/IfUnlessModifier
|
|
26
|
-
- Style/Next
|
|
27
|
-
- Style/WhileUntilModifier
|
data/.stylelintrc.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "stylelint-config-standard",
|
|
3
|
-
"rules": {
|
|
4
|
-
"string-quotes": "single",
|
|
5
|
-
"selector-class-pattern": "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$|block_column",
|
|
6
|
-
"font-family-no-missing-generic-family-keyword": [
|
|
7
|
-
true,
|
|
8
|
-
{
|
|
9
|
-
"ignoreFontFamilies": [
|
|
10
|
-
"Font Awesome 5 Free",
|
|
11
|
-
"Font Awesome 5 Brands",
|
|
12
|
-
"Apple Color Emoji",
|
|
13
|
-
"Segoe UI Emoji",
|
|
14
|
-
"Segoe UI Symbol",
|
|
15
|
-
"Noto Color Emoji"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
}
|
data/Rakefile
DELETED
data/additional_tags.gemspec
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
lib = File.expand_path '../lib', __FILE__
|
|
4
|
-
$LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib
|
|
5
|
-
require 'additional_tags/plugin_version'
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |spec|
|
|
8
|
-
spec.name = 'additional_tags'
|
|
9
|
-
spec.version = AdditionalTags::PluginVersion::VERSION
|
|
10
|
-
spec.authors = ['AlphaNodes']
|
|
11
|
-
spec.email = ['alex@alphanodes.com']
|
|
12
|
-
spec.metadata = { 'rubygems_mfa_required' => 'true' }
|
|
13
|
-
|
|
14
|
-
spec.summary = 'Redmine plugin for adding tag functionality'
|
|
15
|
-
spec.description = 'Redmine plugin for adding tag functionality'
|
|
16
|
-
spec.homepage = 'https://github.com/alphanodes/additional_tags'
|
|
17
|
-
spec.license = 'GPL-2.0'
|
|
18
|
-
|
|
19
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
20
|
-
f.match %r{^((test|spec|features)/|Gemfile)}
|
|
21
|
-
end
|
|
22
|
-
spec.bindir = 'exe'
|
|
23
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename f }
|
|
24
|
-
spec.require_paths = ['lib']
|
|
25
|
-
spec.required_ruby_version = '>= 2.7'
|
|
26
|
-
|
|
27
|
-
spec.add_runtime_dependency 'acts-as-taggable-on', '~> 9.0'
|
|
28
|
-
spec.add_runtime_dependency 'redmine_plugin_kit'
|
|
29
|
-
|
|
30
|
-
spec.add_development_dependency 'bundler'
|
|
31
|
-
spec.add_development_dependency 'rake'
|
|
32
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
== @tags.collect { |tag| { 'id' => tag.name, 'text' => tag.name } }.to_json
|
|
Binary file
|
|
Binary file
|
data/doc/images/tag-overview.png
DELETED
|
Binary file
|