additional_tags 1.0.5 → 1.0.6
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/linters.yml +2 -2
- data/.gitignore +1 -0
- data/.rubocop.yml +4 -6
- data/README.md +2 -2
- data/app/controllers/additional_tags_controller.rb +3 -3
- data/app/helpers/additional_tags_wiki_helper.rb +11 -6
- data/app/jobs/additional_tags_remove_unused_tag_job.rb +11 -6
- data/app/views/additional_tags/_tag_list.html.slim +2 -2
- data/app/views/dashboards/blocks/_issue_tags.html.slim +6 -6
- data/app/views/issue_tags/edit.js.erb +1 -1
- data/app/views/issues/_tags.html.slim +7 -7
- data/app/views/issues/_tags_form_details.html.slim +1 -2
- data/app/views/wiki/_tags_form_bottom.html.slim +1 -2
- data/app/views/wiki/_tags_show.html.slim +7 -7
- data/app/views/wiki/tag_index.html.slim +2 -2
- data/lib/additional_tags/patches/query_patch.rb +1 -1
- data/lib/additional_tags/patches/wiki_page_patch.rb +2 -1
- data/lib/additional_tags/plugin_version.rb +1 -1
- data/lib/additional_tags/tags.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05656ef90d3c7c796b1bd3d510f6a349fc77c8b1adbf43ca6135af8e48ca705e
|
4
|
+
data.tar.gz: a22552cd9d096d6963dd9349c207da4755b1e3ba1d8dec560d404b3207ee1458
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eb18bdccf79be5d1f1b4327c11c3c838e434c8737edcfa096d62d61925170e53be4a6ae45fb486e0c5b3a008933dc30e3bd2c36de9db929fe1fb1e71225adf2
|
7
|
+
data.tar.gz: 97fd974a51bcdf337c0246cd95c0313639d43aa73f19ac9a81f0f9efa87da0e3c02736970b5c8148566ded5bb3e670a2fb332a03f99d85f59caed219d12410be
|
@@ -8,7 +8,7 @@ jobs:
|
|
8
8
|
runs-on: ubuntu-latest
|
9
9
|
|
10
10
|
steps:
|
11
|
-
- uses: actions/checkout@
|
11
|
+
- uses: actions/checkout@v2
|
12
12
|
|
13
13
|
- name: Install package dependencies
|
14
14
|
run: >
|
@@ -22,7 +22,7 @@ jobs:
|
|
22
22
|
- name: Setup Ruby
|
23
23
|
uses: ruby/setup-ruby@v1
|
24
24
|
with:
|
25
|
-
ruby-version: 3.
|
25
|
+
ruby-version: 3.1
|
26
26
|
bundler-cache: true
|
27
27
|
|
28
28
|
- name: Setup gems
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -7,6 +7,7 @@ AllCops:
|
|
7
7
|
TargetRubyVersion: 2.7
|
8
8
|
TargetRailsVersion: 6.1
|
9
9
|
NewCops: enable
|
10
|
+
ActiveSupportExtensionsEnabled: true
|
10
11
|
|
11
12
|
Rails:
|
12
13
|
Enabled: true
|
@@ -118,17 +119,14 @@ Style/MethodCallWithArgsParentheses:
|
|
118
119
|
AllowParenthesesInChaining: true
|
119
120
|
EnforcedStyle: omit_parentheses
|
120
121
|
|
121
|
-
Style/HashTransformKeys:
|
122
|
-
Enabled: false
|
123
|
-
|
124
|
-
Style/HashTransformValues:
|
125
|
-
Enabled: false
|
126
|
-
|
127
122
|
Naming/VariableNumber:
|
128
123
|
Enabled: true
|
129
124
|
Exclude:
|
130
125
|
- 'test/**/*'
|
131
126
|
|
127
|
+
Layout/LineContinuationLeadingSpace:
|
128
|
+
Enabled: false
|
129
|
+
|
132
130
|
# see https://github.com/rubocop/rubocop-rails/issues/578
|
133
131
|
# redmine does not use load_defaults: https://rails.rubystyle.guide/#config-defaults
|
134
132
|
Rails/RedundantPresenceValidationOnBelongsTo:
|
data/README.md
CHANGED
@@ -71,14 +71,14 @@ git clone https://github.com/alphanodes/additionals.git plugins/additionals
|
|
71
71
|
git clone https://github.com/alphanodes/additional_tags.git plugins/additional_tags
|
72
72
|
```
|
73
73
|
|
74
|
-
### 2. Install dependencies and migrate database
|
74
|
+
### 2. Install dependencies and migrate database
|
75
75
|
|
76
76
|
```shell
|
77
77
|
bundle install
|
78
78
|
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
|
79
79
|
```
|
80
80
|
|
81
|
-
### 3. Restart your Redmine web server
|
81
|
+
### 3. Restart your Redmine web server
|
82
82
|
|
83
83
|
## Running tests
|
84
84
|
|
@@ -35,8 +35,8 @@ class AdditionalTagsController < ApplicationController
|
|
35
35
|
|
36
36
|
def destroy
|
37
37
|
@tags.each do |tag|
|
38
|
-
tag.reload.destroy
|
39
|
-
rescue ::ActiveRecord::RecordNotFound
|
38
|
+
tag.reload.destroy!
|
39
|
+
rescue ::ActiveRecord::RecordNotFound, ::ActiveRecord::RecordNotDestroyed
|
40
40
|
Rails.logger.warn "Tag #{tag} could not be deleted"
|
41
41
|
end
|
42
42
|
redirect_back_or_default @tag_list_path
|
@@ -54,7 +54,7 @@ class AdditionalTagsController < ApplicationController
|
|
54
54
|
end
|
55
55
|
else
|
56
56
|
respond_to do |format|
|
57
|
-
format.html { render
|
57
|
+
format.html { render :edit }
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -18,18 +18,23 @@ module AdditionalTagsWikiHelper
|
|
18
18
|
render_tags_list sidebar_tags, **options
|
19
19
|
end
|
20
20
|
|
21
|
-
def render_wiki_index_title(project, tag
|
21
|
+
def render_wiki_index_title(project: nil, name: nil, tag: nil, title: :label_wiki)
|
22
22
|
if tag.present?
|
23
|
-
if project
|
24
|
-
|
23
|
+
if project
|
24
|
+
t :label_wiki_index_for_tag_html, tag: tag
|
25
|
+
else
|
26
|
+
title = [link_to(l(title), wiki_index_path)]
|
25
27
|
title << Additionals::LIST_SEPARATOR
|
26
28
|
title << t(:label_wiki_index_for_tag_html, tag: tag)
|
27
29
|
safe_join title, ' '
|
28
|
-
else
|
29
|
-
t :label_wiki_index_for_tag_html, tag: tag
|
30
30
|
end
|
31
|
+
elsif name.present?
|
32
|
+
title = [link_to(l(title), wiki_index_path)]
|
33
|
+
title << Additionals::LIST_SEPARATOR
|
34
|
+
title << name
|
35
|
+
safe_join title, ' '
|
31
36
|
else
|
32
|
-
l
|
37
|
+
l title
|
33
38
|
end
|
34
39
|
end
|
35
40
|
end
|
@@ -2,11 +2,16 @@
|
|
2
2
|
|
3
3
|
class AdditionalTagsRemoveUnusedTagJob < AdditionalTagsJob
|
4
4
|
def perform
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
if Rails.env.test?
|
6
|
+
# no cache for testing
|
7
|
+
AdditionalTags::Tags.remove_unused_tags
|
8
|
+
else
|
9
|
+
# only once a minute to reduce load
|
10
|
+
cache = ActiveSupport::Cache::MemoryStore.new expires_in: 1.minute
|
11
|
+
cache.fetch self.class.to_s do
|
12
|
+
AdditionalTags::Tags.remove_unused_tags
|
13
|
+
true
|
14
|
+
end
|
15
|
+
end
|
11
16
|
end
|
12
17
|
end
|
@@ -20,8 +20,8 @@
|
|
20
20
|
|
21
21
|
#edit_tags_form.hidden
|
22
22
|
= form_tag update_url, method: :put do
|
23
|
-
= render
|
24
|
-
|
23
|
+
= render defined?(tags_form) ? tags_form : 'tags_form',
|
24
|
+
css_id: defined?(css_id) ? css_id : nil
|
25
25
|
'
|
26
26
|
= submit_tag l(:button_save), class: 'button-small'
|
27
27
|
'
|
@@ -7,12 +7,12 @@ h3 = block_definition[:label]
|
|
7
7
|
statuses: { true => :closed, false => :open },
|
8
8
|
group_id_is_bool: true
|
9
9
|
|
10
|
-
= render
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
= render 'common/tag_summary_block',
|
11
|
+
tags: tags,
|
12
|
+
entities_label: l(:label_issue_plural),
|
13
|
+
totals_link: link_to_issue_tags_totals(entries: counts,
|
14
|
+
project: @project,
|
15
|
+
open_issues_only: open_issues_only)
|
16
16
|
|
17
17
|
- if RedminePluginKit.true? settings[:with_table_of_values]
|
18
18
|
- if tags.present?
|
@@ -1,2 +1,2 @@
|
|
1
|
-
$('#ajax-modal').html(
|
1
|
+
$('#ajax-modal').html("<%= escape_javascript(render 'issue_tags/edit_modal') %>");
|
2
2
|
showModal('ajax-modal', '600px');
|
@@ -1,8 +1,8 @@
|
|
1
1
|
- if AdditionalTags.setting?(:active_issue_tags) && User.current.allowed_to?(:view_issue_tags, issue.project)
|
2
|
-
= render
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
= render 'additional_tags/tag_list',
|
3
|
+
entry: issue,
|
4
|
+
show_always: true,
|
5
|
+
editable: issue.editable?(User.current),
|
6
|
+
css_id: 'issue_tag_list_show',
|
7
|
+
update_url: issue_path(issue),
|
8
|
+
use_colors: AdditionalTags.setting?(:use_colors)
|
@@ -1,5 +1,4 @@
|
|
1
1
|
- if AdditionalTags.setting?(:active_wiki_tags) && User.current.allowed_to?(:add_wiki_tags, @project)
|
2
2
|
p#wiki_tags
|
3
3
|
= label_tag l(:field_tag_list)
|
4
|
-
= render
|
5
|
-
locals: { project: project, page: page }
|
4
|
+
= render 'wiki/tags_form', project: project, page: page
|
@@ -1,9 +1,9 @@
|
|
1
1
|
- if AdditionalTags.setting? :active_wiki_tags
|
2
2
|
.wiki-attributes
|
3
|
-
= render
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
= render 'additional_tags/tag_list',
|
4
|
+
entry: page,
|
5
|
+
show_always: true,
|
6
|
+
link_wiki_tag: true,
|
7
|
+
editable: User.current.allowed_to?(:add_wiki_tags, @project),
|
8
|
+
update_url: update_tags_project_wiki_page_path(@project, page.title),
|
9
|
+
use_colors: AdditionalTags.setting?(:use_colors)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
- if User.current.allowed_to? :edit_wiki_pages, @project
|
3
3
|
= link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), remote: true, class: 'icon icon-add'
|
4
4
|
|
5
|
-
h2 = render_wiki_index_title @project, @tag
|
5
|
+
h2 = render_wiki_index_title project: @project, tag: @tag
|
6
6
|
|
7
7
|
- if @pages.empty?
|
8
8
|
p.nodata = l :label_no_data
|
@@ -18,4 +18,4 @@ h2 = render_wiki_index_title @project, @tag
|
|
18
18
|
= link_to page.parent.pretty_title, project_wiki_page_path(@project, page.parent.title)
|
19
19
|
|
20
20
|
- content_for :sidebar do
|
21
|
-
= render
|
21
|
+
= render 'sidebar'
|
@@ -44,7 +44,7 @@ module AdditionalTags
|
|
44
44
|
subsql = ActsAsTaggableOn::Tagging.joins("INNER JOIN #{quoted_joined_table}" \
|
45
45
|
" ON additional_taggings.taggable_id = #{quoted_joined_table}.#{quoted_target_field}")
|
46
46
|
.where(taggable_type: klass.name)
|
47
|
-
.where("#{self.class.connection.quote_table_name queried_table_name}.#{quoted_source_field} ="\
|
47
|
+
.where("#{self.class.connection.quote_table_name queried_table_name}.#{quoted_source_field} =" \
|
48
48
|
" #{quoted_joined_table}.#{quoted_joined_field}")
|
49
49
|
.select(1)
|
50
50
|
|
@@ -41,10 +41,11 @@ module AdditionalTags
|
|
41
41
|
scope
|
42
42
|
end
|
43
43
|
|
44
|
-
def with_tags(tag, project: nil, order: 'title_asc', max_entries: nil)
|
44
|
+
def with_tags(tag, project: nil, order: 'title_asc', max_entries: nil, exclude_page: nil)
|
45
45
|
wiki = project&.wiki
|
46
46
|
|
47
47
|
scope = with_tags_scope wiki: wiki, project: project
|
48
|
+
scope = scope.where.not id: exclude_page.id if exclude_page
|
48
49
|
scope = scope.limit max_entries if max_entries
|
49
50
|
|
50
51
|
tags = Array tag
|
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: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AlphaNodes
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acts-as-taggable-on
|