additional_tags 1.0.7 → 3.0.9
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/app/controllers/issue_tags_controller.rb +3 -0
- data/app/helpers/additional_tags_helper.rb +2 -2
- data/app/helpers/additional_tags_issues_helper.rb +12 -2
- 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/lib/additional_tags/hooks/view_hook.rb +8 -9
- data/lib/additional_tags/patches/issue_patch.rb +2 -3
- 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 +1 -1
- metadata +4 -46
- 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/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: c412788c20ba3626ad2707dea2a34a96b9d2e0378c70b55bd5b8f116d92dc8cf
|
4
|
+
data.tar.gz: 6b2dd7625fe8b4e4249631bee75ad0e2a0f1be4a481382e1f346026683059246
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9293e12799c232dca72262bf3af55c84a23481e0fd1b0c6a38199f145ce3f7dca95ee218bb661f764eb49251de602abaefef41dc4da1463f4e97714097d0aa93
|
7
|
+
data.tar.gz: 57377f76241c07b63651ddece4ee6a14f983dd1faea0544b2d7ca5e3453a302142b19442252b6d71c1884c54fed4083eb84f818dc72e0b0f91927de39b381b8f
|
@@ -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
|
@@ -53,7 +53,7 @@ module AdditionalTagsHelper
|
|
53
53
|
when 'name:desc'
|
54
54
|
tags = AdditionalTags::Tags.sort_tag_list(tags).reverse
|
55
55
|
when 'count:asc'
|
56
|
-
tags.
|
56
|
+
tags.sort_by!(&:count)
|
57
57
|
when 'count:desc'
|
58
58
|
tags.sort! { |a, b| b.count <=> a.count }
|
59
59
|
else
|
@@ -190,7 +190,7 @@ module AdditionalTagsHelper
|
|
190
190
|
end
|
191
191
|
|
192
192
|
def link_to_issue_tags_totals(entries:, project:, open_issues_only:)
|
193
|
-
sum = if entries.blank? || entries.
|
193
|
+
sum = if entries.blank? || entries.empty?
|
194
194
|
0
|
195
195
|
else
|
196
196
|
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: "Цвет"
|
@@ -63,14 +63,14 @@ module AdditionalTags
|
|
63
63
|
def issues_bulk_tags_fix(issue, params)
|
64
64
|
return unless params && params[:issue]
|
65
65
|
|
66
|
-
common_tags =
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
66
|
+
common_tags = if params[:common_tags].present?
|
67
|
+
params[:common_tags].split(ActsAsTaggableOn.delimiter).map(&:strip)
|
68
|
+
else
|
69
|
+
[]
|
70
|
+
end
|
71
|
+
|
72
72
|
current_tags = ActsAsTaggableOn::TagList.new issue.tags.to_a
|
73
|
-
new_tags = Array(params[:issue][:tag_list]).
|
73
|
+
new_tags = Array(params[:issue][:tag_list]).compact_blank
|
74
74
|
|
75
75
|
tags_to_add = new_tags - common_tags
|
76
76
|
tags_to_remove = common_tags - new_tags
|
@@ -84,8 +84,7 @@ module AdditionalTags
|
|
84
84
|
def tags_journal(issue, params)
|
85
85
|
return unless params && params[:issue] && params[:issue][:tag_list]
|
86
86
|
|
87
|
-
issue.tags_to_journal
|
88
|
-
issue.tag_list.to_s
|
87
|
+
issue.tags_to_journal issue.tag_list_was&.to_s, issue.tag_list.to_s
|
89
88
|
end
|
90
89
|
end
|
91
90
|
end
|
@@ -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
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:
|
4
|
+
version: 3.0.9
|
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-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acts-as-taggable-on
|
@@ -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
|
@@ -142,9 +104,6 @@ files:
|
|
142
104
|
- config/settings.yml
|
143
105
|
- db/migrate/20201116145429_acts_as_taggable_migration.rb
|
144
106
|
- 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
107
|
- init.rb
|
149
108
|
- lib/additional_tags.rb
|
150
109
|
- lib/additional_tags/hooks/model_hook.rb
|
@@ -177,7 +136,6 @@ files:
|
|
177
136
|
- lib/additional_tags/plugin_version.rb
|
178
137
|
- lib/additional_tags/tags.rb
|
179
138
|
- lib/tasks/additional_tags.rake
|
180
|
-
- package.json
|
181
139
|
homepage: https://github.com/alphanodes/additional_tags
|
182
140
|
licenses:
|
183
141
|
- GPL-2.0
|
@@ -198,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
156
|
- !ruby/object:Gem::Version
|
199
157
|
version: '0'
|
200
158
|
requirements: []
|
201
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.1.6
|
202
160
|
signing_key:
|
203
161
|
specification_version: 4
|
204
162
|
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
|
Binary file
|
Binary file
|
data/doc/images/tag-overview.png
DELETED
Binary file
|