additional_tags 1.0.1 → 1.0.4
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/.github/workflows/codeql-analysis.yml +70 -0
- data/.github/workflows/linters.yml +6 -1
- data/.github/workflows/tests.yml +11 -2
- data/.gitignore +2 -0
- data/.rubocop.yml +55 -5
- data/.slim-lint.yml +3 -2
- data/README.md +16 -17
- data/Rakefile +2 -0
- data/additional_tags.gemspec +10 -6
- data/app/controllers/additional_tags_controller.rb +4 -1
- data/app/controllers/issue_tags_controller.rb +6 -4
- data/app/helpers/additional_tags_helper.rb +91 -52
- data/app/helpers/additional_tags_issues_helper.rb +15 -3
- data/app/helpers/additional_tags_wiki_helper.rb +4 -26
- data/app/jobs/additional_tags_job.rb +2 -0
- data/app/jobs/additional_tags_remove_unused_tag_job.rb +7 -0
- data/app/models/migrate_tag.rb +2 -0
- data/app/models/migrate_tagging.rb +2 -0
- data/app/models/query_tags_column.rb +7 -0
- data/app/views/additional_tags/_body_bottom.html.slim +19 -0
- data/app/views/additional_tags/_html_head.html.slim +1 -4
- data/app/views/additional_tags/_tag_list.html.slim +1 -1
- data/app/views/additional_tags/merge.html.slim +4 -3
- data/app/views/additional_tags/settings/_manage_tags.html.slim +24 -23
- data/app/views/common/_tag_summary_block.html.slim +11 -0
- data/app/views/context_menus/_issues_tags.html.slim +1 -1
- data/app/views/dashboards/blocks/_issue_tags.html.slim +58 -0
- data/app/views/dashboards/blocks/_issue_tags_settings.html.slim +20 -0
- data/app/views/issue_tags/_edit_modal.html.slim +6 -4
- data/app/views/issues/_tags_form.html.slim +1 -1
- data/assets/javascripts/tags.js +4 -3
- data/assets/stylesheets/tags.css +27 -13
- data/config/initializers/zeitwerk.rb +6 -0
- data/config/locales/bg.yml +5 -0
- data/config/locales/cs.yml +5 -0
- data/config/locales/de.yml +5 -0
- data/config/locales/en.yml +5 -0
- data/config/locales/es.yml +5 -0
- data/config/locales/fr.yml +5 -0
- data/config/locales/it.yml +5 -0
- data/config/locales/ja.yml +5 -0
- data/config/locales/ko.yml +5 -0
- data/config/locales/pl.yml +5 -0
- data/config/locales/pt-BR.yml +5 -0
- data/config/locales/ru.yml +28 -23
- data/config/routes.rb +2 -0
- data/db/migrate/20201116145429_acts_as_taggable_migration.rb +3 -1
- data/db/migrate/20201123093214_migrate_existing_tags.rb +5 -3
- data/init.rb +11 -6
- data/lib/additional_tags/hooks/model_hook.rb +13 -0
- data/lib/additional_tags/hooks/view_hook.rb +77 -0
- data/lib/additional_tags/patches/agile_boards_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/agile_query_patch.rb +11 -9
- data/lib/additional_tags/patches/agile_versions_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/agile_versions_query_patch.rb +3 -1
- data/lib/additional_tags/patches/auto_completes_controller_patch.rb +8 -7
- data/lib/additional_tags/patches/calendars_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/dashboard_async_blocks_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/dashboard_content_patch.rb +28 -0
- data/lib/additional_tags/patches/dashboards_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/gantts_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/imports_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/issue_patch.rb +19 -20
- data/lib/additional_tags/patches/issue_query_patch.rb +17 -14
- data/lib/additional_tags/patches/issues_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/journal_patch.rb +2 -0
- data/lib/additional_tags/patches/my_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/queries_helper_patch.rb +3 -15
- data/lib/additional_tags/patches/query_patch.rb +83 -0
- data/lib/additional_tags/patches/settings_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/time_entry_patch.rb +2 -0
- data/lib/additional_tags/patches/time_entry_query_patch.rb +5 -15
- data/lib/additional_tags/patches/time_report_patch.rb +2 -0
- data/lib/additional_tags/patches/timelog_controller_patch.rb +2 -0
- data/lib/additional_tags/patches/wiki_controller_patch.rb +3 -1
- data/lib/additional_tags/patches/wiki_page_patch.rb +54 -3
- data/lib/additional_tags/plugin_version.rb +7 -0
- data/lib/additional_tags/tags.rb +78 -18
- data/lib/additional_tags.rb +53 -74
- data/lib/tasks/additional_tags.rake +18 -0
- metadata +32 -9
- data/.github/workflows/brakeman.yml +0 -33
- data/app/views/reports/_tags_simple.html.slim +0 -11
- data/lib/additional_tags/hooks.rb +0 -73
- data/lib/additional_tags/patches/reports_controller_patch.rb +0 -32
- data/lib/additional_tags/version.rb +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d10d32f78d464486a2921a86274972ec068f3aad16c988f9037e89a433ac4efa
|
|
4
|
+
data.tar.gz: 50833ac552b8b3de0cba5eb5d9710cdbafdf17b3c2d53e742031ed22a52c9e86
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 837feb0dba819a2191dbd5151f523a3f65aac23918faaa2f93277a0b51c33e4483353c43dd7ae69ae98b43886099fe7f3005b33daafe9d05d4b593ce1866e657
|
|
7
|
+
data.tar.gz: 2d54a07615b231470a074e42ec5f4d275af5b5838338a360e8d7401fa742deeba0b500a1ca94069a3b37240e23947e9110c6b2f6f785ec3517ae1cfc63a66351
|
|
@@ -0,0 +1,70 @@
|
|
|
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: [ master ]
|
|
17
|
+
pull_request:
|
|
18
|
+
# The branches below must be a subset of the branches above
|
|
19
|
+
branches: [ master ]
|
|
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@v2
|
|
42
|
+
|
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
|
44
|
+
- name: Initialize CodeQL
|
|
45
|
+
uses: github/codeql-action/init@v1
|
|
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@v1
|
|
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@v1
|
|
@@ -16,7 +16,8 @@ jobs:
|
|
|
16
16
|
|
|
17
17
|
- name: Setup Gemfile
|
|
18
18
|
run: |
|
|
19
|
-
|
|
19
|
+
touch .enable_linters
|
|
20
|
+
sed -i "3isource 'https://rubygems.org'" Gemfile
|
|
20
21
|
|
|
21
22
|
- name: Setup Ruby
|
|
22
23
|
uses: ruby/setup-ruby@v1
|
|
@@ -36,3 +37,7 @@ jobs:
|
|
|
36
37
|
run: |
|
|
37
38
|
bundle exec slim-lint app/views
|
|
38
39
|
if: always()
|
|
40
|
+
|
|
41
|
+
- name: Run Brakeman
|
|
42
|
+
run: |
|
|
43
|
+
bundle exec brakeman -5
|
data/.github/workflows/tests.yml
CHANGED
|
@@ -10,17 +10,21 @@ jobs:
|
|
|
10
10
|
|
|
11
11
|
strategy:
|
|
12
12
|
matrix:
|
|
13
|
-
ruby: ['2.7', '2.6', '
|
|
13
|
+
ruby: ['2.7', '2.6', '3.0']
|
|
14
14
|
redmine: ['4.1-stable', '4.2-stable', 'master']
|
|
15
15
|
db: ['postgres', 'mysql']
|
|
16
16
|
exclude:
|
|
17
17
|
- ruby: '2.7'
|
|
18
18
|
redmine: 4.1-stable
|
|
19
|
+
- ruby: '3.0'
|
|
20
|
+
redmine: 4.1-stable
|
|
21
|
+
- ruby: '3.0'
|
|
22
|
+
redmine: 4.2-stable
|
|
19
23
|
fail-fast: false
|
|
20
24
|
|
|
21
25
|
services:
|
|
22
26
|
postgres:
|
|
23
|
-
image: postgres:
|
|
27
|
+
image: postgres:14
|
|
24
28
|
env:
|
|
25
29
|
POSTGRES_DB: redmine
|
|
26
30
|
POSTGRES_USER: postgres
|
|
@@ -83,6 +87,10 @@ jobs:
|
|
|
83
87
|
libpq-dev
|
|
84
88
|
libmysqlclient-dev
|
|
85
89
|
|
|
90
|
+
- name: Setup Gemfile
|
|
91
|
+
run: |
|
|
92
|
+
touch .enable_test
|
|
93
|
+
|
|
86
94
|
- name: Setup Ruby
|
|
87
95
|
uses: ruby/setup-ruby@v1
|
|
88
96
|
with:
|
|
@@ -94,6 +102,7 @@ jobs:
|
|
|
94
102
|
run: |
|
|
95
103
|
cp plugins/additional_tags/test/support/database-${{ matrix.db }}.yml config/database.yml
|
|
96
104
|
cp plugins/additional_tags/test/support/configuration.yml config/configuration.yml
|
|
105
|
+
cp plugins/additionals/test/support/additional_environment.rb config/additional_environment.rb
|
|
97
106
|
|
|
98
107
|
- name: Install Ruby dependencies
|
|
99
108
|
working-directory: redmine
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -6,7 +6,7 @@ Rails:
|
|
|
6
6
|
Enabled: true
|
|
7
7
|
|
|
8
8
|
AllCops:
|
|
9
|
-
TargetRubyVersion: 2.
|
|
9
|
+
TargetRubyVersion: 2.6
|
|
10
10
|
TargetRailsVersion: 5.2
|
|
11
11
|
NewCops: enable
|
|
12
12
|
|
|
@@ -16,6 +16,10 @@ Metrics/AbcSize:
|
|
|
16
16
|
Metrics/BlockLength:
|
|
17
17
|
Enabled: false
|
|
18
18
|
|
|
19
|
+
Metrics/ParameterLists:
|
|
20
|
+
Enabled: true
|
|
21
|
+
CountKeywordArgs: false
|
|
22
|
+
|
|
19
23
|
Metrics/ClassLength:
|
|
20
24
|
Enabled: false
|
|
21
25
|
|
|
@@ -34,9 +38,23 @@ Metrics/ModuleLength:
|
|
|
34
38
|
Metrics/PerceivedComplexity:
|
|
35
39
|
Max: 25
|
|
36
40
|
|
|
41
|
+
Style/ExpandPathArguments:
|
|
42
|
+
Enabled: true
|
|
43
|
+
Exclude:
|
|
44
|
+
- additional_tags.gemspec
|
|
45
|
+
- test/**/*
|
|
46
|
+
|
|
37
47
|
Rails/ApplicationJob:
|
|
38
48
|
Enabled: false
|
|
39
49
|
|
|
50
|
+
Lint/AmbiguousOperatorPrecedence:
|
|
51
|
+
Enabled: false
|
|
52
|
+
|
|
53
|
+
Rails/ContentTag:
|
|
54
|
+
Enabled: true
|
|
55
|
+
Exclude:
|
|
56
|
+
- app/helpers/additional_tags_issues_helper.rb
|
|
57
|
+
|
|
40
58
|
Rails/ApplicationRecord:
|
|
41
59
|
Enabled: false
|
|
42
60
|
|
|
@@ -56,14 +74,41 @@ Style/AutoResourceCleanup:
|
|
|
56
74
|
Enabled: true
|
|
57
75
|
|
|
58
76
|
Style/FrozenStringLiteralComment:
|
|
59
|
-
Enabled:
|
|
77
|
+
Enabled: true
|
|
78
|
+
Exclude:
|
|
79
|
+
- '/**/*.rsb'
|
|
60
80
|
|
|
61
81
|
Style/Documentation:
|
|
62
82
|
Enabled: false
|
|
63
83
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
84
|
+
Style/OptionHash:
|
|
85
|
+
Enabled: true
|
|
86
|
+
SuspiciousParamNames:
|
|
87
|
+
- options
|
|
88
|
+
- api_options
|
|
89
|
+
- opts
|
|
90
|
+
- args
|
|
91
|
+
- params
|
|
92
|
+
- parameters
|
|
93
|
+
- settings
|
|
94
|
+
|
|
95
|
+
# postgresql and mysql are supported
|
|
96
|
+
# autodetect does not work without database configuration
|
|
97
|
+
Rails/BulkChangeTable:
|
|
98
|
+
Enabled: true
|
|
99
|
+
Database: postgresql
|
|
100
|
+
|
|
101
|
+
Style/ReturnNil:
|
|
102
|
+
Enabled: true
|
|
103
|
+
|
|
104
|
+
Style/UnlessLogicalOperators:
|
|
105
|
+
Enabled: true
|
|
106
|
+
|
|
107
|
+
Style/MethodCallWithArgsParentheses:
|
|
108
|
+
Enabled: true
|
|
109
|
+
AllowParenthesesInMultilineCall: true
|
|
110
|
+
AllowParenthesesInChaining: true
|
|
111
|
+
EnforcedStyle: omit_parentheses
|
|
67
112
|
|
|
68
113
|
Style/HashTransformKeys:
|
|
69
114
|
Enabled: false
|
|
@@ -75,3 +120,8 @@ Naming/VariableNumber:
|
|
|
75
120
|
Enabled: true
|
|
76
121
|
Exclude:
|
|
77
122
|
- 'test/**/*'
|
|
123
|
+
|
|
124
|
+
# see https://github.com/rubocop/rubocop-rails/issues/578
|
|
125
|
+
# redmine does not use load_defaults: https://rails.rubystyle.guide/#config-defaults
|
|
126
|
+
Rails/RedundantPresenceValidationOnBelongsTo:
|
|
127
|
+
Enabled: false
|
data/.slim-lint.yml
CHANGED
|
@@ -17,10 +17,11 @@ linters:
|
|
|
17
17
|
- Layout/MultilineMethodCallIndentation
|
|
18
18
|
- Layout/MultilineMethodDefinitionBraceLayout
|
|
19
19
|
- Layout/MultilineOperationIndentation
|
|
20
|
+
- Layout/SpaceBeforeBrackets
|
|
20
21
|
- Layout/TrailingEmptyLines
|
|
21
22
|
- Lint/Void
|
|
22
23
|
- Rails/OutputSafety
|
|
24
|
+
- Style/FrozenStringLiteralComment
|
|
23
25
|
- Style/IfUnlessModifier
|
|
24
|
-
- Style/WhileUntilModifier
|
|
25
26
|
- Style/Next
|
|
26
|
-
-
|
|
27
|
+
- Style/WhileUntilModifier
|
data/README.md
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
# Additional Tags - Tags for Redmine
|
|
2
2
|
|
|
3
|
-
[](https://www.redmine.org/plugins/additional_tags) [](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3A%22Run+Linters%22) [](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)
|
|
5
4
|
|
|
6
5
|
## Features
|
|
7
6
|
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
7
|
+
- Tags for issues
|
|
8
|
+
- Tags for wiki pages
|
|
9
|
+
- Accented and non-latin characters supported for tag order
|
|
10
|
+
- View, edit and create tag permissions for issues
|
|
11
|
+
- Create permission for wiki tags
|
|
12
|
+
- Managing tags
|
|
13
|
+
- Custom tags and tagging tables (additional_tags and additional_taggings). If a other plugin
|
|
15
14
|
used tags or tagging tables for issue or wiki tagging, there tags will be migrated automatically
|
|
16
|
-
-
|
|
15
|
+
- Based on the very popular [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on)
|
|
17
16
|
|
|
18
17
|

|
|
19
18
|
|
|
20
19
|
Other plugins use additional_tags as framework in order to support tags for their entities.
|
|
21
20
|
At the moment this are:
|
|
22
21
|
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
22
|
+
- redmine_db (db entry tagging)
|
|
23
|
+
- redmine_passwords (password tagging)
|
|
24
|
+
- redmine_reporting (project tagging)
|
|
25
|
+
- redmine_hrm (holiday tagging)
|
|
26
|
+
- redmine_servicedesk (contact tagging)
|
|
28
27
|
|
|
29
28
|
Start using it, too. The example image shows the centralized tag management in the plugin configuration.
|
|
30
29
|
|
|
@@ -40,7 +39,7 @@ Start using it, too. The example image shows the centralized tag management in t
|
|
|
40
39
|
## Requirements
|
|
41
40
|
|
|
42
41
|
- Redmine `>= 4.1.0`
|
|
43
|
-
- Ruby `>= 2.
|
|
42
|
+
- Ruby `>= 2.6`
|
|
44
43
|
- Redmine plugins: [additionals](https://www.redmine.org/plugins/additionals)
|
|
45
44
|
|
|
46
45
|
## Installing
|
|
@@ -52,7 +51,7 @@ To install stable version of additional_tags, use
|
|
|
52
51
|
```shell
|
|
53
52
|
cd $REDMINE_ROOT
|
|
54
53
|
git clone -b stable https://www.github.com/alphanodes/additionals.git plugins/additionals
|
|
55
|
-
git clone -b
|
|
54
|
+
git clone -b stable https://www.github.com/alphanodes/additional_tags.git plugins/additional_tags
|
|
56
55
|
```
|
|
57
56
|
|
|
58
57
|
It is also possible to use stable version as a gem package as an alternative. If you want it, add this to your $REDMINE_ROOT/Gemfile.local:
|
data/Rakefile
CHANGED
data/additional_tags.gemspec
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
lib = File.expand_path '../lib', __FILE__
|
|
2
|
-
$LOAD_PATH.unshift
|
|
3
|
-
require 'additional_tags/
|
|
4
|
+
$LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib
|
|
5
|
+
require 'additional_tags/plugin_version'
|
|
4
6
|
|
|
5
7
|
Gem::Specification.new do |spec|
|
|
6
8
|
spec.name = 'additional_tags'
|
|
7
|
-
spec.version = AdditionalTags::VERSION
|
|
9
|
+
spec.version = AdditionalTags::PluginVersion::VERSION
|
|
8
10
|
spec.authors = ['AlphaNodes']
|
|
9
11
|
spec.email = ['alex@alphanodes.com']
|
|
12
|
+
spec.metadata = { 'rubygems_mfa_required' => 'true' }
|
|
10
13
|
|
|
11
14
|
spec.summary = 'Redmine plugin for adding tag functionality'
|
|
12
15
|
spec.description = 'Redmine plugin for adding tag functionality'
|
|
@@ -14,14 +17,15 @@ Gem::Specification.new do |spec|
|
|
|
14
17
|
spec.license = 'GPL-2.0'
|
|
15
18
|
|
|
16
19
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
17
|
-
f.match
|
|
20
|
+
f.match %r{^((test|spec|features)/|Gemfile)}
|
|
18
21
|
end
|
|
19
22
|
spec.bindir = 'exe'
|
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename
|
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename f }
|
|
21
24
|
spec.require_paths = ['lib']
|
|
22
|
-
spec.required_ruby_version = '>= 2.
|
|
25
|
+
spec.required_ruby_version = '>= 2.6'
|
|
23
26
|
|
|
24
27
|
spec.add_runtime_dependency 'acts-as-taggable-on', '~> 7.0'
|
|
28
|
+
spec.add_runtime_dependency 'redmine_plugin_kit'
|
|
25
29
|
|
|
26
30
|
spec.add_development_dependency 'bundler'
|
|
27
31
|
spec.add_development_dependency 'rake'
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class AdditionalTagsController < ApplicationController
|
|
2
4
|
before_action :require_admin
|
|
3
5
|
before_action :find_tag, only: %i[edit update]
|
|
@@ -56,7 +58,7 @@ class AdditionalTagsController < ApplicationController
|
|
|
56
58
|
end
|
|
57
59
|
|
|
58
60
|
def bulk_find_tags
|
|
59
|
-
@tags = ActsAsTaggableOn::Tag.joins("JOIN #{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.taggings_table}" \
|
|
61
|
+
@tags = ActsAsTaggableOn::Tag.joins("LEFT JOIN #{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.taggings_table}" \
|
|
60
62
|
" ON #{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.taggings_table}.tag_id =" \
|
|
61
63
|
" #{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.tags_table}.id ")
|
|
62
64
|
.select("#{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.tags_table}.id," \
|
|
@@ -67,6 +69,7 @@ class AdditionalTagsController < ApplicationController
|
|
|
67
69
|
.group("#{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.tags_table}.id" \
|
|
68
70
|
", #{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.tags_table}.name" \
|
|
69
71
|
", #{ActiveRecord::Base.connection.quote_table_name ActsAsTaggableOn.tags_table}.taggings_count")
|
|
72
|
+
|
|
70
73
|
raise ActiveRecord::RecordNotFound if @tags.empty?
|
|
71
74
|
end
|
|
72
75
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class IssueTagsController < ApplicationController
|
|
2
4
|
before_action :find_issues, only: %i[edit update]
|
|
3
5
|
|
|
@@ -25,7 +27,7 @@ class IssueTagsController < ApplicationController
|
|
|
25
27
|
tags = params[:issue] && params[:issue][:tag_list] ? params[:issue][:tag_list].reject(&:empty?) : []
|
|
26
28
|
|
|
27
29
|
unless User.current.allowed_to?(:create_issue_tags, @projects.first) || Issue.allowed_tags?(tags)
|
|
28
|
-
flash[:error] = t
|
|
30
|
+
flash[:error] = t :notice_failed_to_add_tags
|
|
29
31
|
return
|
|
30
32
|
end
|
|
31
33
|
|
|
@@ -35,13 +37,13 @@ class IssueTagsController < ApplicationController
|
|
|
35
37
|
issue.save!
|
|
36
38
|
end
|
|
37
39
|
end
|
|
38
|
-
flash[:notice] = t
|
|
40
|
+
flash[:notice] = t :notice_tags_added
|
|
39
41
|
else
|
|
40
|
-
flash[:error] = t
|
|
42
|
+
flash[:error] = t :notice_failed_to_add_tags
|
|
41
43
|
end
|
|
42
44
|
rescue StandardError => e
|
|
43
45
|
Rails.logger.warn "Failed to add tags: #{e.inspect}"
|
|
44
|
-
flash[:error] = t
|
|
46
|
+
flash[:error] = t :notice_failed_to_add_tags
|
|
45
47
|
ensure
|
|
46
48
|
redirect_to_referer_or { render text: 'Tags updated.', layout: true }
|
|
47
49
|
end
|