additional_tags 1.0.1 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql-analysis.yml +70 -0
  3. data/.github/workflows/linters.yml +6 -1
  4. data/.github/workflows/tests.yml +11 -2
  5. data/.gitignore +2 -0
  6. data/.rubocop.yml +55 -5
  7. data/.slim-lint.yml +3 -2
  8. data/README.md +16 -17
  9. data/Rakefile +2 -0
  10. data/additional_tags.gemspec +10 -6
  11. data/app/controllers/additional_tags_controller.rb +4 -1
  12. data/app/controllers/issue_tags_controller.rb +6 -4
  13. data/app/helpers/additional_tags_helper.rb +91 -52
  14. data/app/helpers/additional_tags_issues_helper.rb +15 -3
  15. data/app/helpers/additional_tags_wiki_helper.rb +4 -26
  16. data/app/jobs/additional_tags_job.rb +2 -0
  17. data/app/jobs/additional_tags_remove_unused_tag_job.rb +7 -0
  18. data/app/models/migrate_tag.rb +2 -0
  19. data/app/models/migrate_tagging.rb +2 -0
  20. data/app/models/query_tags_column.rb +7 -0
  21. data/app/views/additional_tags/_body_bottom.html.slim +19 -0
  22. data/app/views/additional_tags/_html_head.html.slim +1 -4
  23. data/app/views/additional_tags/_tag_list.html.slim +1 -1
  24. data/app/views/additional_tags/merge.html.slim +4 -3
  25. data/app/views/additional_tags/settings/_manage_tags.html.slim +24 -23
  26. data/app/views/common/_tag_summary_block.html.slim +11 -0
  27. data/app/views/context_menus/_issues_tags.html.slim +1 -1
  28. data/app/views/dashboards/blocks/_issue_tags.html.slim +58 -0
  29. data/app/views/dashboards/blocks/_issue_tags_settings.html.slim +20 -0
  30. data/app/views/issue_tags/_edit_modal.html.slim +6 -4
  31. data/app/views/issues/_tags_form.html.slim +1 -1
  32. data/assets/javascripts/tags.js +4 -3
  33. data/assets/stylesheets/tags.css +27 -13
  34. data/config/initializers/zeitwerk.rb +6 -0
  35. data/config/locales/bg.yml +5 -0
  36. data/config/locales/cs.yml +5 -0
  37. data/config/locales/de.yml +5 -0
  38. data/config/locales/en.yml +5 -0
  39. data/config/locales/es.yml +5 -0
  40. data/config/locales/fr.yml +5 -0
  41. data/config/locales/it.yml +5 -0
  42. data/config/locales/ja.yml +5 -0
  43. data/config/locales/ko.yml +5 -0
  44. data/config/locales/pl.yml +5 -0
  45. data/config/locales/pt-BR.yml +5 -0
  46. data/config/locales/ru.yml +28 -23
  47. data/config/routes.rb +2 -0
  48. data/db/migrate/20201116145429_acts_as_taggable_migration.rb +3 -1
  49. data/db/migrate/20201123093214_migrate_existing_tags.rb +5 -3
  50. data/init.rb +11 -6
  51. data/lib/additional_tags/hooks/model_hook.rb +13 -0
  52. data/lib/additional_tags/hooks/view_hook.rb +77 -0
  53. data/lib/additional_tags/patches/agile_boards_controller_patch.rb +2 -0
  54. data/lib/additional_tags/patches/agile_query_patch.rb +11 -9
  55. data/lib/additional_tags/patches/agile_versions_controller_patch.rb +2 -0
  56. data/lib/additional_tags/patches/agile_versions_query_patch.rb +3 -1
  57. data/lib/additional_tags/patches/auto_completes_controller_patch.rb +8 -7
  58. data/lib/additional_tags/patches/calendars_controller_patch.rb +2 -0
  59. data/lib/additional_tags/patches/dashboard_async_blocks_controller_patch.rb +2 -0
  60. data/lib/additional_tags/patches/dashboard_content_patch.rb +28 -0
  61. data/lib/additional_tags/patches/dashboards_controller_patch.rb +2 -0
  62. data/lib/additional_tags/patches/gantts_controller_patch.rb +2 -0
  63. data/lib/additional_tags/patches/imports_controller_patch.rb +2 -0
  64. data/lib/additional_tags/patches/issue_patch.rb +19 -20
  65. data/lib/additional_tags/patches/issue_query_patch.rb +17 -14
  66. data/lib/additional_tags/patches/issues_controller_patch.rb +2 -0
  67. data/lib/additional_tags/patches/journal_patch.rb +2 -0
  68. data/lib/additional_tags/patches/my_controller_patch.rb +2 -0
  69. data/lib/additional_tags/patches/queries_helper_patch.rb +3 -15
  70. data/lib/additional_tags/patches/query_patch.rb +83 -0
  71. data/lib/additional_tags/patches/settings_controller_patch.rb +2 -0
  72. data/lib/additional_tags/patches/time_entry_patch.rb +2 -0
  73. data/lib/additional_tags/patches/time_entry_query_patch.rb +5 -15
  74. data/lib/additional_tags/patches/time_report_patch.rb +2 -0
  75. data/lib/additional_tags/patches/timelog_controller_patch.rb +2 -0
  76. data/lib/additional_tags/patches/wiki_controller_patch.rb +3 -1
  77. data/lib/additional_tags/patches/wiki_page_patch.rb +54 -3
  78. data/lib/additional_tags/plugin_version.rb +7 -0
  79. data/lib/additional_tags/tags.rb +78 -18
  80. data/lib/additional_tags.rb +53 -74
  81. data/lib/tasks/additional_tags.rake +18 -0
  82. metadata +32 -9
  83. data/.github/workflows/brakeman.yml +0 -33
  84. data/app/views/reports/_tags_simple.html.slim +0 -11
  85. data/lib/additional_tags/hooks.rb +0 -73
  86. data/lib/additional_tags/patches/reports_controller_patch.rb +0 -32
  87. data/lib/additional_tags/version.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f6573f962ff7b251ce5afae13e2659985887d486d320fcb99f4c99892fa8a52
4
- data.tar.gz: a258bcf71c8c53b40a5b7bcec92e9b6ff8a7dde6070fe5cfdc3eac0adb3d2ccb
3
+ metadata.gz: d10d32f78d464486a2921a86274972ec068f3aad16c988f9037e89a433ac4efa
4
+ data.tar.gz: 50833ac552b8b3de0cba5eb5d9710cdbafdf17b3c2d53e742031ed22a52c9e86
5
5
  SHA512:
6
- metadata.gz: 46e6f62fae40af6b03d6b09a2b237f4049ab4d54ce30289e1fa7a74b9ee7f57df586feb3cf695f4268a86478365fee580db550e9b044c84281fcb464e2fde321
7
- data.tar.gz: 8b1c9a8b5873b2b993f27d80186e9c7e0a024e201aba3c0125f47331c6fda50d673cbb1f572c17b2aef1b613b687f6a66c86c17d9b325f8c20e9c2bd8e6bf103
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
- cp test/support/gemfile.rb Gemfile
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
@@ -10,17 +10,21 @@ jobs:
10
10
 
11
11
  strategy:
12
12
  matrix:
13
- ruby: ['2.7', '2.6', '2.5']
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:13
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
@@ -5,4 +5,6 @@ tmp/
5
5
  Gemfile.lock
6
6
  .project
7
7
  .settings/
8
+ .enable_*
8
9
  ._*
10
+ *.gem
data/.rubocop.yml CHANGED
@@ -6,7 +6,7 @@ Rails:
6
6
  Enabled: true
7
7
 
8
8
  AllCops:
9
- TargetRubyVersion: 2.5
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: false
77
+ Enabled: true
78
+ Exclude:
79
+ - '/**/*.rsb'
60
80
 
61
81
  Style/Documentation:
62
82
  Enabled: false
63
83
 
64
- # required for travis/ci (symbolic links problem)
65
- Style/ExpandPathArguments:
66
- Enabled: false
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
- - Layout/SpaceBeforeBrackets
27
+ - Style/WhileUntilModifier
data/README.md CHANGED
@@ -1,30 +1,29 @@
1
1
  # Additional Tags - Tags for Redmine
2
2
 
3
- [![Rate at redmine.org](https://img.shields.io/badge/rate%20at-redmine.org-blue.svg?style=flat)](https://www.redmine.org/plugins/additional_tags) [![Run Linters](https://github.com/AlphaNodes/additional_tags/workflows/Run%20Linters/badge.svg)](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3A%22Run+Linters%22) [![Run Brakeman](https://github.com/AlphaNodes/additional_tags/workflows/Run%20Brakeman/badge.svg)](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3A%22Run+Brakeman%22) [![Run Tests](https://github.com/AlphaNodes/additional_tags/workflows/Tests/badge.svg)](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3ATests)
4
-
3
+ [![Rate at redmine.org](https://img.shields.io/badge/rate%20at-redmine.org-blue.svg?style=flat)](https://www.redmine.org/plugins/additional_tags) [![Run Linters](https://github.com/AlphaNodes/additional_tags/workflows/Run%20Linters/badge.svg)](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3A%22Run+Linters%22) [![Run Tests](https://github.com/AlphaNodes/additional_tags/workflows/Tests/badge.svg)](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3ATests)
5
4
 
6
5
  ## Features
7
6
 
8
- - Tags for issues
9
- - Tags for wiki pages
10
- - Accented and non-latin characters supported for tag order
11
- - View, edit and create tag permissions for issues
12
- - Create permission for wiki tags
13
- - Managing tags
14
- - Custom tags and tagging tables (additional_tags and additional_taggings). If a other plugin
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
- - Based on the very popular [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on)
15
+ - Based on the very popular [acts-as-taggable-on](https://github.com/mbleigh/acts-as-taggable-on)
17
16
 
18
17
  ![screenshot](https://raw.githubusercontent.com/AlphaNodes/additional_tags/master/doc/images/additional-tags.gif)
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
- - redmine_db (db entry tagging)
24
- - redmine_passwords (password tagging)
25
- - redmine_reporting (project tagging)
26
- - redmine_hrm (holiday tagging)
27
- - redmine_servicedesk (contact tagging)
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.5`
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 1.0.0 https://www.github.com/alphanodes/additional_tags.git plugins/additional_tags
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rake/testtask'
3
5
 
@@ -1,12 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path '../lib', __FILE__
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'additional_tags/version'
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(%r{^((test|spec|features)/|Gemfile)})
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(f) }
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename f }
21
24
  spec.require_paths = ['lib']
22
- spec.required_ruby_version = '>= 2.5'
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(:notice_failed_to_add_tags)
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(:notice_tags_added)
40
+ flash[:notice] = t :notice_tags_added
39
41
  else
40
- flash[:error] = t(:notice_failed_to_add_tags)
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(:notice_failed_to_add_tags)
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