additional_tags 3.0.9 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c412788c20ba3626ad2707dea2a34a96b9d2e0378c70b55bd5b8f116d92dc8cf
4
- data.tar.gz: 6b2dd7625fe8b4e4249631bee75ad0e2a0f1be4a481382e1f346026683059246
3
+ metadata.gz: d8ed778f6643bfc7ef2e38f292fa92d0dab319705968e9791bb820b0e284124b
4
+ data.tar.gz: 29db0db1b7c774c387fe46b7294d5be48dc71ab0857cd8fca9eebea610e17e6b
5
5
  SHA512:
6
- metadata.gz: 9293e12799c232dca72262bf3af55c84a23481e0fd1b0c6a38199f145ce3f7dca95ee218bb661f764eb49251de602abaefef41dc4da1463f4e97714097d0aa93
7
- data.tar.gz: 57377f76241c07b63651ddece4ee6a14f983dd1faea0544b2d7ca5e3453a302142b19442252b6d71c1884c54fed4083eb84f818dc72e0b0f91927de39b381b8f
6
+ metadata.gz: c76cb8da0ffab5ef74651cc450150fc1c057e4bfff58633cc4a8aa17fdd0ff91134537bf5cacb9f85783a624b628e21d0705b30b656819583ccc7d62f4fd2f5d
7
+ data.tar.gz: b12dc1e15cf91fc1514ecda011fd3e7f8186b64be0046fe7df894853b52db7045f2713aa00ae67101e1a42d7b44947256a129c21553021a3892bea0612eab34c
data/README.md CHANGED
@@ -1,6 +1,6 @@
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 Tests](https://github.com/AlphaNodes/additional_tags/workflows/Tests/badge.svg)](https://github.com/AlphaNodes/additional_tags/actions?query=workflow%3ATests)
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)
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
- ![screenshot](https://raw.githubusercontent.com/AlphaNodes/additional_tags/master/doc/images/tag-overview.png)
32
+ ![screenshot](https://raw.githubusercontent.com/alphanodes/additional_tags/master/doc/images/tag-overview.png)
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
- ![screenshot](https://raw.githubusercontent.com/AlphaNodes/additional_tags/master/doc/images/additional-tags.gif)
36
+ ![screenshot](https://raw.githubusercontent.com/alphanodes/additional_tags/master/doc/images/additional-tags.gif)
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 tagging)
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
- ![screenshot](https://raw.githubusercontent.com/AlphaNodes/additional_tags/master/doc/images/additional-tags-framework.png)
50
+ ![screenshot](https://raw.githubusercontent.com/alphanodes/additional_tags/master/doc/images/additional-tags-framework.png)
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 `>= 2.7`
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 right plugin version
67
+ ### 1. Get correct plugin version
67
68
 
68
69
  To install stable version of additional_tags, use
69
70
 
@@ -3,6 +3,15 @@
3
3
  module AdditionalTagsHelper
4
4
  include ActsAsTaggableOn::TagsHelper
5
5
 
6
+ def format_tags_json(tags)
7
+ tags.map do |tag|
8
+ {
9
+ 'id' => tag.name,
10
+ 'text' => tag.name
11
+ }
12
+ end
13
+ end
14
+
6
15
  def manageable_tags
7
16
  AdditionalTags::Tags.sort_tag_list ActsAsTaggableOn::Tag.where({})
8
17
  end
@@ -30,7 +39,7 @@ module AdditionalTagsHelper
30
39
 
31
40
  def manageable_tag_column_values(tag)
32
41
  columns = []
33
- manageable_tag_columns.each do |_column, column_values|
42
+ manageable_tag_columns.each_value do |column_values|
34
43
  cnt = column_values[:counts][tag.id]
35
44
  cnt = 0 if cnt.blank?
36
45
 
@@ -43,6 +52,10 @@ module AdditionalTagsHelper
43
52
  columns
44
53
  end
45
54
 
55
+ def values_for_sort_direction
56
+ [[l(:label_ascending), 'asc'], [l(:label_descending), 'desc']]
57
+ end
58
+
46
59
  def sort_tags_for_list(tags, sort_by: nil, sort_order: nil)
47
60
  return tags if tags.size < 2
48
61
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class MigrateTag < ActiveRecord::Base
3
+ class MigrateTag < Rails.version < '7.1' ? ActiveRecord::Base : ApplicationRecord
4
4
  self.table_name = 'tags'
5
5
  has_many :migrate_taggings, dependent: :destroy, foreign_key: :tag_id, inverse_of: :migrate_tag
6
6
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class MigrateTagging < ActiveRecord::Base
3
+ class MigrateTagging < Rails.version < '7.1' ? ActiveRecord::Base : ApplicationRecord
4
4
  self.table_name = 'taggings'
5
5
  belongs_to :migrate_tag, foreign_key: :tag_id, inverse_of: :migrate_taggings
6
6
  belongs_to :taggable, polymorphic: true
@@ -15,8 +15,7 @@ fieldset.settings
15
15
  @settings[:tags_sort_by])
16
16
  '
17
17
  = select_tag 'settings[tags_sort_order]',
18
- options_for_select([[l(:label_ascending), 'asc'], [l(:label_descending), 'desc']],
19
- @settings[:tags_sort_order])
18
+ options_for_select(values_for_sort_direction, @settings[:tags_sort_order])
20
19
 
21
20
  p
22
21
  = additionals_settings_select :tags_suggestion_order,
@@ -37,6 +36,9 @@ fieldset.settings
37
36
  p
38
37
  = additionals_settings_checkbox :active_issue_tags
39
38
 
39
+ p
40
+ = additionals_settings_checkbox :show_tags_after_queries
41
+
40
42
  p
41
43
  = additionals_settings_checkbox :open_issues_only
42
44
 
@@ -6,10 +6,10 @@
6
6
  tr
7
7
  th.checkbox.hide-when-print
8
8
  = check_box_tag 'ids[]', '', false, class: 'toggle-selection',
9
- title: "#{l :button_check_all}/#{l :button_uncheck_all}"
9
+ title: "#{l :button_check_all} / #{l :button_uncheck_all}"
10
10
 
11
11
  th = l :field_name
12
- - manageable_tag_columns.each do |_column, column_values|
12
+ - manageable_tag_columns.each_value do |column_values|
13
13
  th = column_values[:label]
14
14
  th
15
15
  tbody
@@ -35,7 +35,7 @@
35
35
  p.nodata = l :label_no_data
36
36
 
37
37
  javascript:
38
- $(document).ready(function(){
38
+ $(function() {
39
39
  $('#settings form').data('cmUrl', "#{context_menu_additional_tags_path}")
40
40
  })
41
41
 
@@ -0,0 +1,2 @@
1
+ - if AdditionalTags.setting? :show_tags_after_queries
2
+ = render 'issues/tags_sidebar'
@@ -0,0 +1,2 @@
1
+ - unless AdditionalTags.setting? :show_tags_after_queries
2
+ = render 'issues/tags_sidebar'
@@ -15,6 +15,7 @@ bg:
15
15
  label_manage_tags: "Управление на маркерите"
16
16
  label_merge_selected_tags: "Обединение на избраните маркери"
17
17
  label_open_issues_only: "Показване само на отворените задачи"
18
+ label_show_tags_after_queries: "Показване на етикети след заявки"
18
19
  label_show_with_count: "Показване на брой маркирани обекти"
19
20
  label_tag_color_theme: "Тема на цвета %{value}"
20
21
  label_tags_color_theme: "Цвят"
@@ -15,6 +15,7 @@ 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_show_tags_after_queries: "Zobrazit TAGy po dotazech"
18
19
  label_show_with_count: "Zobrazit částku na značce"
19
20
  label_tag_color_theme: "Barevné téma %{value}"
20
21
  label_tags_color_theme: "Barva"
@@ -15,6 +15,7 @@ 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_show_tags_after_queries: "Zeige TAGs nach Abfragen"
18
19
  label_show_with_count: Zeige Anzahl zu TAG
19
20
  label_tag_color_theme: Farbschema %{value}
20
21
  label_tags_color_theme: Farbe
@@ -15,6 +15,7 @@ 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_show_tags_after_queries: "Show tags after queries"
18
19
  label_show_with_count: "Display amount on tag"
19
20
  label_tag_color_theme: Color theme %{value}
20
21
  label_tags_color_theme: Color
@@ -15,6 +15,7 @@ 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_show_tags_after_queries: "Mostrar TAGs tras las consultas"
18
19
  label_show_with_count: "Mostrar la cantidad en la tags"
19
20
  label_tag_color_theme: "Tema del color %{value}"
20
21
  label_tags_colors: "Color"
@@ -0,0 +1,45 @@
1
+ fa:
2
+ activerecord:
3
+ errors:
4
+ messages:
5
+ invalid_mutually_exclusive_tags: از تگ های منحصر به فرد متقابل استفاده شده است
6
+ field_issue_tags: تگ‌های مسئله
7
+ field_tag_list: تگ‌ها
8
+ field_tags: تگ‌ها
9
+ label_active_issue_tags: "تگ‌های فعال مسئله"
10
+ label_active_wiki_tags: "تگ‌های فعال ویکی"
11
+ label_add_tags: "افزودن تگ"
12
+ label_amount_entities_with_tags: "مقدار %{name} با تگ‌ها"
13
+ label_amount_tags: "تگ‌های مقدار"
14
+ label_edit_tags: "ویرایش تگ‌ها"
15
+ label_manage_tags: "مدیریت تگ‌ها"
16
+ label_merge_selected_tags: "ادغام تگ‌های انتخابی"
17
+ label_open_issues_only: "مشاهده مسائل باز"
18
+ label_show_tags_after_queries: "Show tags after queries"
19
+ label_show_with_count: "نمایش مقدار روی تگ"
20
+ label_tag_color_theme: تم رنگی %{value}
21
+ label_tags_color_theme: رنگ
22
+ label_tags_sidebar: "نمایش تگ‌ها در حاشیه به عنوان"
23
+ label_tags_sort_by: "مرتب سازی تگ‌ها بر اساس"
24
+ label_tags_suggestion_order: "سفارش پیشنهاد"
25
+ label_tags_tag: "تگ"
26
+ label_tags_without_color: بدون رنگ
27
+ label_use_colors: استفاده از رنگ‌ها
28
+ label_wiki_index_for_tag: "صفحه‌های ویکی با تگ"
29
+ label_with_chart: "با نمودار"
30
+ label_with_table_of_values: "با جدول مقادیر"
31
+ notice_failed_to_add_tags: "ناتوانی در افزودن تگ‌ها"
32
+ notice_tags_added: "تگ‌ها افزوده شدند"
33
+ permission_add_wiki_tags: "افزودن تگ‌های ویکی"
34
+ permission_create_issue_tags: "افزودن تگ‌های مسئله"
35
+ permission_edit_issue_tags: "ویرایش تگ‌های مسئله"
36
+ permission_view_issue_tags: "مشاهده تگ‌های مسئله"
37
+ tags_order_by_count: "بیشتر استفاده‌شده"
38
+ tags_order_by_last_created: "آخرین ساخته‌شده"
39
+ tags_order_by_name: "نام"
40
+ tags_sidebar_cloud: "ابر"
41
+ tags_sidebar_list: "لیست"
42
+ tags_sidebar_none: "هیچکدام"
43
+ tags_sidebar_simple_cloud: "ابر ساده"
44
+ tags_sort_by_count: "تعداد"
45
+ tags_sort_by_name: "نام"
@@ -15,6 +15,7 @@ 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_show_tags_after_queries: "Afficher les TAG après les requêtes"
18
19
  label_show_with_count: "Afficher le montant sur l'tags"
19
20
  label_tag_color_theme: "Thème de la couleur %{value}"
20
21
  label_tags_colors: "Couleur"
@@ -15,6 +15,7 @@ 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_show_tags_after_queries: "Mostra i TAG dopo le query"
18
19
  label_show_with_count: "Visualizzare l'importo sul tag"
19
20
  label_tag_color_theme: "Tema colore %{value}"
20
21
  label_tags_colors: Colore
@@ -15,6 +15,7 @@ ja:
15
15
  label_manage_tags: "タグの管理"
16
16
  label_merge_selected_tags: "選択したタグをマージ"
17
17
  label_open_issues_only: "開いている問題のみを表示"
18
+ label_show_tags_after_queries: "クエリーの後にTAGを表示する"
18
19
  label_show_with_count: "タグに金額を表示"
19
20
  label_tag_color_theme: "カラーテーマ%{value}"
20
21
  label_tags_colors: "カラー"
@@ -15,6 +15,7 @@ ko:
15
15
  label_manage_tags: "태그 관리"
16
16
  label_merge_selected_tags: "선택한 태그 병합"
17
17
  label_open_issues_only: "미해결 문제 만 표시"
18
+ label_show_tags_after_queries: "쿼리 뒤에 태그 표시"
18
19
  label_show_with_count: "태그에 금액 표시"
19
20
  label_tag_color_theme: "색상 테마 %{value}"
20
21
  label_tags_colors: "색깔"
@@ -15,6 +15,7 @@ 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_show_tags_after_queries: "Pokaż TAGi po zapytaniach"
18
19
  label_show_with_count: "Wyświetlanie ilości na etykiecie"
19
20
  label_tag_color_theme: "Kolorowy motyw %{value}"
20
21
  label_tags_colors: Kolor
@@ -15,6 +15,7 @@ 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_show_tags_after_queries: "Mostrar TAGs após consultas"
18
19
  label_show_with_count: "Mostrar quantidade na etiqueta"
19
20
  label_tag_color_theme: "Tema da cor %{value}"
20
21
  label_tags_colors: "Cor"
@@ -15,6 +15,7 @@ ru:
15
15
  label_manage_tags: "Управление метками"
16
16
  label_merge_selected_tags: "Объединить выбранные метки"
17
17
  label_open_issues_only: "Отображать только открытые задачи"
18
+ label_show_tags_after_queries: "Показывать теги после запросов"
18
19
  label_show_with_count: "Отображать количество на метке"
19
20
  label_tag_color_theme: "Цветовая тема %{value}"
20
21
  label_tags_colors: "Цвет"
data/config/settings.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  active_issue_tags: '0'
2
2
  active_wiki_tags: '0'
3
3
  open_issues_only: '0'
4
+ show_tags_after_queries: '0'
4
5
  show_with_count: '0'
5
6
  tags_color_theme: '1'
6
7
  tags_sidebar: 'none'
@@ -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.all.each do |old_tag|
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
data/init.rb CHANGED
@@ -5,13 +5,13 @@ require 'additional_tags/plugin_version'
5
5
  loader = RedminePluginKit::Loader.new plugin_id: 'additional_tags'
6
6
 
7
7
  Redmine::Plugin.register :additional_tags do
8
- name 'Additional Tags'
9
- author 'AlphaNodes GmbH'
8
+ name 'Additional Tags'
9
+ author 'AlphaNodes GmbH'
10
10
  description 'Redmine tagging support'
11
- version AdditionalTags::PluginVersion::VERSION
12
- url 'https://github.com/alphanodes/additional_tags/'
13
- author_url 'https://alphanodes.com/'
14
- directory __dir__
11
+ version AdditionalTags::PluginVersion::VERSION
12
+ url 'https://github.com/alphanodes/additional_tags/'
13
+ author_url 'https://alphanodes.com/'
14
+ directory File.dirname(__FILE__)
15
15
 
16
16
  requires_redmine version_or_higher: '5.0'
17
17
 
@@ -11,7 +11,8 @@ module AdditionalTags
11
11
  partial: 'issues/tags_form_details',
12
12
  locals: { tags_form: 'issues/tags_form' }
13
13
  render_on :view_issues_show_details_bottom, partial: 'issues/tags'
14
- render_on :view_issues_sidebar_planning_bottom, partial: 'issues/tags_sidebar'
14
+ render_on :view_issues_sidebar_planning_bottom, partial: 'issues/tags_sidebar_before'
15
+ render_on :view_issues_sidebar_queries_bottom, partial: 'issues/tags_sidebar_after'
15
16
  render_on :view_layouts_base_html_head, partial: 'additional_tags/html_head'
16
17
  render_on :view_layouts_base_body_bottom, partial: 'additional_tags/body_bottom'
17
18
  render_on :view_wiki_form_bottom, partial: 'tags_form_bottom'
@@ -19,10 +20,14 @@ module AdditionalTags
19
20
  render_on :view_wiki_show_sidebar_bottom, partial: 'wiki/tags_sidebar'
20
21
 
21
22
  def controller_issues_edit_before_save(context = {})
23
+ return unless AdditionalTags.setting? :active_issue_tags
24
+
22
25
  tags_journal context[:issue], context[:params]
23
26
  end
24
27
 
25
28
  def controller_issues_bulk_edit_before_save(context = {})
29
+ return unless AdditionalTags.setting? :active_issue_tags
30
+
26
31
  issue = context[:issue]
27
32
  params = context[:params]
28
33
 
@@ -54,7 +59,7 @@ module AdditionalTags
54
59
 
55
60
  pdf.ln
56
61
  pdf.SetFontStyle '', 8
57
- pdf.RDMCell 190, 5, page.tag_list.to_list
62
+ pdf.RDMCell 190, 5, page.tag_list.to_comma_list
58
63
  pdf.ln
59
64
  end
60
65
 
@@ -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
- @tags = Issue.available_tags name_like: build_search_query_term(params),
16
- sort_by: suggestion_order,
17
- order: (suggestion_order == 'name' ? 'ASC' : 'DESC')
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
- @tags = AdditionalTags::Tags.sort_tag_list @tags if suggestion_order == 'name'
20
+ tags = AdditionalTags::Tags.sort_tag_list tags if suggestion_order == 'name'
20
21
 
21
- render layout: false, partial: 'additional_tag_list', locals: { unsorted: true }
22
+ render json: format_tags_json(tags)
22
23
  end
23
24
 
24
25
  def wiki_tags
25
- @tags = WikiPage.available_tags project: nil,
26
- name_like: build_search_query_term(params)
27
- render layout: false, partial: 'additional_tag_list', locals: { unsorted: true }
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
- @tags = ActsAsTaggableOn::Tag.where(sql_for_where, "%#{q.downcase}%")
36
- .order(name: :asc)
37
+ tags = ActsAsTaggableOn::Tag.where(sql_for_where, "%#{q.downcase}%")
38
+ .order(name: :asc)
37
39
 
38
- render layout: false, partial: 'additional_tag_list', locals: { unsorted: true }
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
 
@@ -42,7 +42,8 @@ module AdditionalTags
42
42
  end
43
43
 
44
44
  module InstanceMethods
45
- def issues_with_tags(**options)
45
+ def issues_with_tags(options = nil)
46
+ options ||= {}
46
47
  issues = issues_without_tags(**options)
47
48
  return issues unless has_column? :tags
48
49
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AdditionalTags
4
4
  module PluginVersion
5
- VERSION = '3.0.9' unless defined? AdditionalTags::PluginVersion::VERSION
5
+ VERSION = '3.2.0' unless defined? AdditionalTags::PluginVersion::VERSION
6
6
  end
7
7
  end
@@ -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.all
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.to_list
157
+ columns.to_comma_list
150
158
  end
151
159
 
152
160
  def status_for_tag_value(scope:, tag_id:, group_id: nil, group_id_is_bool: false)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: additional_tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.9
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AlphaNodes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-18 00:00:00.000000000 Z
11
+ date: 2024-04-27 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: '9.0'
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: '9.0'
26
+ version: '10.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redmine_plugin_kit
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -68,7 +68,6 @@ files:
68
68
  - app/views/additional_tags/settings/_general.html.slim
69
69
  - app/views/additional_tags/settings/_manage_tags.html.slim
70
70
  - app/views/additional_tags/settings/_settings.html.slim
71
- - app/views/auto_completes/_additional_tag_list.slim
72
71
  - app/views/common/_tag_summary_block.html.slim
73
72
  - app/views/context_menus/_issues_tags.html.slim
74
73
  - app/views/dashboards/blocks/_issue_tags.html.slim
@@ -80,6 +79,8 @@ files:
80
79
  - app/views/issues/_tags_form.html.slim
81
80
  - app/views/issues/_tags_form_details.html.slim
82
81
  - app/views/issues/_tags_sidebar.html.slim
82
+ - app/views/issues/_tags_sidebar_after.html.slim
83
+ - app/views/issues/_tags_sidebar_before.html.slim
83
84
  - app/views/wiki/_tags_form.html.slim
84
85
  - app/views/wiki/_tags_form_bottom.html.slim
85
86
  - app/views/wiki/_tags_show.html.slim
@@ -93,6 +94,7 @@ files:
93
94
  - config/locales/de.yml
94
95
  - config/locales/en.yml
95
96
  - config/locales/es.yml
97
+ - config/locales/fa.yml
96
98
  - config/locales/fr.yml
97
99
  - config/locales/it.yml
98
100
  - config/locales/ja.yml
@@ -149,14 +151,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
151
  requirements:
150
152
  - - ">="
151
153
  - !ruby/object:Gem::Version
152
- version: '2.7'
154
+ version: '3.0'
153
155
  required_rubygems_version: !ruby/object:Gem::Requirement
154
156
  requirements:
155
157
  - - ">="
156
158
  - !ruby/object:Gem::Version
157
159
  version: '0'
158
160
  requirements: []
159
- rubygems_version: 3.1.6
161
+ rubygems_version: 3.4.19
160
162
  signing_key:
161
163
  specification_version: 4
162
164
  summary: Redmine plugin for adding tag functionality
@@ -1 +0,0 @@
1
- == @tags.collect { |tag| { 'id' => tag.name, 'text' => tag.name } }.to_json