additional_tags 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/brakeman.yml +38 -0
  3. data/.github/workflows/linters.yml +41 -0
  4. data/.github/workflows/tests.yml +139 -0
  5. data/.gitignore +8 -0
  6. data/.rubocop.yml +75 -0
  7. data/.slim-lint.yml +25 -0
  8. data/.stylelintrc.json +163 -0
  9. data/LICENSE +339 -0
  10. data/README.md +126 -0
  11. data/Rakefile +11 -0
  12. data/additional_tags.gemspec +28 -0
  13. data/app/controllers/additional_tags_controller.rb +80 -0
  14. data/app/controllers/issue_tags_controller.rb +48 -0
  15. data/app/helpers/additional_tags_helper.rb +197 -0
  16. data/app/helpers/additional_tags_issues_helper.rb +43 -0
  17. data/app/helpers/additional_tags_wiki_helper.rb +17 -0
  18. data/app/jobs/additional_tags_job.rb +3 -0
  19. data/app/jobs/additional_tags_remove_unused_tag_job.rb +5 -0
  20. data/app/models/migrate_tag.rb +4 -0
  21. data/app/models/migrate_tagging.rb +5 -0
  22. data/app/views/additional_tags/_html_head.html.slim +6 -0
  23. data/app/views/additional_tags/_tag_list.html.slim +35 -0
  24. data/app/views/additional_tags/context_menu.html.slim +16 -0
  25. data/app/views/additional_tags/edit.html.slim +14 -0
  26. data/app/views/additional_tags/merge.html.slim +17 -0
  27. data/app/views/additional_tags/settings/_general.html.slim +45 -0
  28. data/app/views/additional_tags/settings/_manage_tags.html.slim +35 -0
  29. data/app/views/additional_tags/settings/_settings.html.slim +9 -0
  30. data/app/views/auto_completes/_additional_tag_list.slim +1 -0
  31. data/app/views/context_menus/_issues_tags.html.slim +10 -0
  32. data/app/views/issue_tags/_edit_modal.html.slim +30 -0
  33. data/app/views/issue_tags/edit.js.erb +2 -0
  34. data/app/views/issues/_tags.html.slim +8 -0
  35. data/app/views/issues/_tags_bulk_edit.html.slim +7 -0
  36. data/app/views/issues/_tags_form.html.slim +11 -0
  37. data/app/views/issues/_tags_form_details.html.slim +7 -0
  38. data/app/views/issues/_tags_sidebar.html.slim +5 -0
  39. data/app/views/reports/_tags_simple.html.slim +11 -0
  40. data/app/views/wiki/_tags_form.html.slim +7 -0
  41. data/app/views/wiki/_tags_form_bottom.html.slim +5 -0
  42. data/app/views/wiki/_tags_show.html.slim +9 -0
  43. data/app/views/wiki/_tags_sidebar.html.slim +4 -0
  44. data/app/views/wiki/tag_index.html.slim +21 -0
  45. data/assets/javascripts/tags.js +19 -0
  46. data/assets/stylesheets/tags.css +119 -0
  47. data/config/locales/bg.yml +33 -0
  48. data/config/locales/cs.yml +33 -0
  49. data/config/locales/de.yml +33 -0
  50. data/config/locales/en.yml +33 -0
  51. data/config/locales/es.yml +33 -0
  52. data/config/locales/fr.yml +33 -0
  53. data/config/locales/it.yml +33 -0
  54. data/config/locales/ja.yml +33 -0
  55. data/config/locales/ko.yml +33 -0
  56. data/config/locales/pl.yml +33 -0
  57. data/config/locales/pt-BR.yml +33 -0
  58. data/config/locales/ru.yml +33 -0
  59. data/config/routes.rb +31 -0
  60. data/config/settings.yml +9 -0
  61. data/db/migrate/20201116145429_acts_as_taggable_migration.rb +40 -0
  62. data/db/migrate/20201123093214_migrate_existing_tags.rb +39 -0
  63. data/doc/images/additional-tags-framework.png +0 -0
  64. data/doc/images/additional-tags.gif +0 -0
  65. data/init.rb +31 -0
  66. data/lib/additional_tags.rb +107 -0
  67. data/lib/additional_tags/hooks.rb +63 -0
  68. data/lib/additional_tags/patches/agile_boards_controller_patch.rb +14 -0
  69. data/lib/additional_tags/patches/agile_query_patch.rb +41 -0
  70. data/lib/additional_tags/patches/agile_versions_controller_patch.rb +14 -0
  71. data/lib/additional_tags/patches/agile_versions_query_patch.rb +11 -0
  72. data/lib/additional_tags/patches/auto_completes_controller_patch.rb +42 -0
  73. data/lib/additional_tags/patches/calendars_controller_patch.rb +14 -0
  74. data/lib/additional_tags/patches/dashboard_async_blocks_controller_patch.rb +11 -0
  75. data/lib/additional_tags/patches/dashboards_controller_patch.rb +11 -0
  76. data/lib/additional_tags/patches/gantts_controller_patch.rb +14 -0
  77. data/lib/additional_tags/patches/imports_controller_patch.rb +12 -0
  78. data/lib/additional_tags/patches/issue_patch.rb +95 -0
  79. data/lib/additional_tags/patches/issue_query_patch.rb +55 -0
  80. data/lib/additional_tags/patches/issues_controller_patch.rb +14 -0
  81. data/lib/additional_tags/patches/journal_patch.rb +18 -0
  82. data/lib/additional_tags/patches/my_controller_patch.rb +14 -0
  83. data/lib/additional_tags/patches/queries_helper_patch.rb +40 -0
  84. data/lib/additional_tags/patches/reports_controller_patch.rb +32 -0
  85. data/lib/additional_tags/patches/settings_controller_patch.rb +12 -0
  86. data/lib/additional_tags/patches/time_entry_patch.rb +19 -0
  87. data/lib/additional_tags/patches/time_entry_query_patch.rb +53 -0
  88. data/lib/additional_tags/patches/time_report_patch.rb +46 -0
  89. data/lib/additional_tags/patches/timelog_controller_patch.rb +14 -0
  90. data/lib/additional_tags/patches/wiki_controller_patch.rb +63 -0
  91. data/lib/additional_tags/patches/wiki_page_patch.rb +39 -0
  92. data/lib/additional_tags/tags.rb +134 -0
  93. data/lib/additional_tags/version.rb +3 -0
  94. metadata +177 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 743d2eba1f678392ca6d7197ef8ac31cc7b6ee05c183f7b74eba826510ecaf72
4
+ data.tar.gz: '09edc2c9f4990f6437b299e3495cb925f1eaefa47011ea49289d3e509273a72f'
5
+ SHA512:
6
+ metadata.gz: edc36542d6caedfb732258d6431363954c44704f9ccafbb69d308ebd372e86824b90975f82fdbfb441f8b4c3c17833e020477dce1dd33a687054e527fbf9b5de
7
+ data.tar.gz: fd341693f9dbe550a2587aa60220a95c20c1b1b2a2e0ecd34226abcabf15d084ca044063e93d8ac7280d9546d6c0b1626f7cd02954c83b8c415e2b779f65b78c
@@ -0,0 +1,38 @@
1
+ name: Run Brakeman
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+
13
+ - name: Install package dependencies
14
+ run: >
15
+ sudo apt-get install --yes --quiet
16
+ pandoc
17
+
18
+ - name: Set up Ruby 2.6
19
+ uses: actions/setup-ruby@v1
20
+ with:
21
+ ruby-version: 2.6.x
22
+
23
+ - name: Set Gemfile
24
+ run: |
25
+ echo "source 'https://rubygems.org'" > Gemfile
26
+ echo "group :test do" >> Gemfile
27
+ echo " gem 'brakeman', require: false" >> Gemfile
28
+ echo " gem 'pandoc-ruby', require: false" >> Gemfile
29
+ echo "end">> Gemfile
30
+
31
+ - name: Setup gems
32
+ run: |
33
+ gem install bundler
34
+ bundle install --jobs 4 --retry 3
35
+
36
+ - name: Run Brakeman
37
+ run: |
38
+ bundle exec brakeman -5
@@ -0,0 +1,41 @@
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@v1
12
+
13
+ - name: Set up Ruby 2.6
14
+ uses: actions/setup-ruby@v1
15
+ with:
16
+ ruby-version: 2.6.x
17
+
18
+ - name: Set Gemfile
19
+ run: |
20
+ echo "source 'https://rubygems.org'" > Gemfile
21
+ echo "group :test do" >> Gemfile
22
+ echo " gem 'pandoc-ruby', require: false" >> Gemfile
23
+ echo " gem 'rubocop', require: false" >> Gemfile
24
+ echo " gem 'rubocop-performance', require: false" >> Gemfile
25
+ echo " gem 'rubocop-rails', require: false" >> Gemfile
26
+ echo " gem 'slim_lint', require: false" >> Gemfile
27
+ echo "end" >> Gemfile
28
+
29
+ - name: Setup gems
30
+ run: |
31
+ gem install bundler
32
+ bundle install --jobs 4 --retry 3
33
+
34
+ - name: Run RuboCop
35
+ run: |
36
+ bundle exec rubocop -S
37
+
38
+ - name: Run Slim-Lint
39
+ run: |
40
+ bundle exec slim-lint app/views
41
+ if: always()
@@ -0,0 +1,139 @@
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.6', '2.4']
14
+ redmine: ['4.1-stable', 'master']
15
+ db: ['postgres', 'mysql']
16
+ fail-fast: false
17
+
18
+ services:
19
+ postgres:
20
+ image: postgres:13
21
+ env:
22
+ POSTGRES_DB: redmine
23
+ POSTGRES_USER: postgres
24
+ POSTGRES_PASSWORD: postgres
25
+ ports:
26
+ - 5432:5432
27
+
28
+ options: >-
29
+ --health-cmd pg_isready
30
+ --health-interval 10s
31
+ --health-timeout 5s
32
+ --health-retries 5
33
+
34
+ mysql:
35
+ image: mysql:5.7
36
+ env:
37
+ MYSQL_USER: root
38
+ MYSQL_PASSWORD: ''
39
+ MYSQL_ALLOW_EMPTY_PASSWORD: yes
40
+ ports:
41
+ - 3306:3306
42
+ options: >-
43
+ --health-cmd="mysqladmin ping"
44
+ --health-interval=10s
45
+ --health-timeout=5s
46
+ --health-retries=3
47
+
48
+ steps:
49
+ - name: Verify MySQL connection from host
50
+ run: |
51
+ mysql --host 127.0.0.1 --port 3306 -uroot -e "SHOW DATABASES"
52
+ if: matrix.db == 'mysql'
53
+
54
+ - name: Checkout Redmine
55
+ uses: actions/checkout@v2
56
+ with:
57
+ repository: redmine/redmine
58
+ ref: ${{ matrix.redmine }}
59
+ path: redmine
60
+
61
+ - name: Checkout additionals
62
+ uses: actions/checkout@v2
63
+ with:
64
+ repository: AlphaNodes/additionals
65
+ path: redmine/plugins/additionals
66
+
67
+ - name: Checkout additional_tags
68
+ uses: actions/checkout@v2
69
+ with:
70
+ path: redmine/plugins/additional_tags
71
+
72
+ - name: Update package archives
73
+ run: sudo apt-get update --yes --quiet
74
+
75
+ - name: Install package dependencies
76
+ run: >
77
+ sudo apt-get install --yes --quiet
78
+ build-essential
79
+ cmake
80
+ libicu-dev
81
+ libpq-dev
82
+ libmysqlclient-dev
83
+
84
+ - name: Setup Ruby
85
+ uses: actions/setup-ruby@v1
86
+ with:
87
+ ruby-version: ${{ matrix.ruby }}
88
+
89
+ - name: Setup Cache
90
+ uses: actions/cache@v1
91
+ with:
92
+ path: vendor
93
+ key: v1-ruby-${{ matrix.ruby }}-redmine-${{ matrix.redmine }}
94
+
95
+ - name: Setup Bundler
96
+ run: |
97
+ gem install bundler -v '~> 1.0'
98
+ bundle config path "$(pwd)/vendor/bundle"
99
+
100
+ - name: Prepare Redmine source
101
+ working-directory: redmine
102
+ run: |
103
+ sed -i '/rubocop/d' Gemfile
104
+ rm -f .rubocop*
105
+ cp plugins/additional_tags/test/support/database-${{ matrix.db }}.yml config/database.yml
106
+ cp plugins/additional_tags/test/support/configuration.yml config/configuration.yml
107
+
108
+ - name: Install Ruby dependencies
109
+ working-directory: redmine
110
+ run: |
111
+ bundle install --jobs=4 --retry=3 --without development
112
+
113
+ - name: Generate session store secret
114
+ env:
115
+ RAILS_ENV: test
116
+ working-directory: redmine
117
+ run: |
118
+ bundle exec rake generate_secret_token
119
+
120
+ - name: Run Redmine DB and migration tasks
121
+ env:
122
+ RAILS_ENV: test
123
+ working-directory: redmine
124
+ run: |
125
+ bundle exec rake db:create db:migrate redmine:plugins:migrate
126
+
127
+ - name: Run tests
128
+ env:
129
+ RAILS_ENV: test
130
+ REDMINE_VERSION: ${{ matrix.redmine }}
131
+ working-directory: redmine
132
+ run: bundle exec rake redmine:plugins:test NAME=additional_tags RUBYOPT="-W0"
133
+
134
+ - name: Run uninstall test
135
+ env:
136
+ RAILS_ENV: test
137
+ REDMINE_VERSION: ${{ matrix.redmine }}
138
+ working-directory: redmine
139
+ run: bundle exec rake redmine:plugins:migrate NAME=additional_tags VERSION=0
@@ -0,0 +1,8 @@
1
+ .DS_Store
2
+ .buildpath
3
+ coverage/
4
+ tmp/
5
+ Gemfile.lock
6
+ .project
7
+ .settings/
8
+ ._*
@@ -0,0 +1,75 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rails
4
+
5
+ Rails:
6
+ Enabled: true
7
+
8
+ AllCops:
9
+ TargetRubyVersion: 2.4
10
+ TargetRailsVersion: 5.2
11
+ NewCops: enable
12
+
13
+ Metrics/AbcSize:
14
+ Enabled: false
15
+
16
+ Metrics/BlockLength:
17
+ Enabled: false
18
+
19
+ Metrics/ClassLength:
20
+ Enabled: false
21
+
22
+ Metrics/CyclomaticComplexity:
23
+ Max: 25
24
+
25
+ Layout/LineLength:
26
+ Max: 140
27
+
28
+ Metrics/MethodLength:
29
+ Max: 60
30
+
31
+ Metrics/ModuleLength:
32
+ Enabled: false
33
+
34
+ Metrics/PerceivedComplexity:
35
+ Max: 25
36
+
37
+ Rails/ApplicationJob:
38
+ Enabled: false
39
+
40
+ Rails/ApplicationRecord:
41
+ Enabled: false
42
+
43
+ Rails/CreateTableWithTimestamps:
44
+ Enabled: false
45
+
46
+ Rails/HelperInstanceVariable:
47
+ Enabled: false
48
+
49
+ Rails/SkipsModelValidations:
50
+ Enabled: false
51
+
52
+ Performance/ChainArrayAllocation:
53
+ Enabled: true
54
+
55
+ Style/AutoResourceCleanup:
56
+ Enabled: true
57
+
58
+ Style/FrozenStringLiteralComment:
59
+ Enabled: false
60
+
61
+ Style/Documentation:
62
+ Enabled: false
63
+
64
+ # required for travis/ci (symbolic links problem)
65
+ Style/ExpandPathArguments:
66
+ Enabled: false
67
+
68
+ Style/HashTransformKeys:
69
+ Enabled: false
70
+
71
+ Style/HashTransformValues:
72
+ Enabled: false
73
+
74
+ Naming/VariableNumber:
75
+ Enabled: false
@@ -0,0 +1,25 @@
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/TrailingEmptyLines
21
+ - Lint/Void
22
+ - Rails/OutputSafety
23
+ - Style/IfUnlessModifier
24
+ - Style/WhileUntilModifier
25
+ - Style/Next
@@ -0,0 +1,163 @@
1
+ {
2
+ "rules": {
3
+ "at-rule-no-unknown": true,
4
+ "block-no-empty": true,
5
+ "color-no-invalid-hex": true,
6
+ "comment-no-empty": true,
7
+ "declaration-block-no-duplicate-properties": [
8
+ true,
9
+ {
10
+ "ignore": [
11
+ "consecutive-duplicates-with-different-values"
12
+ ]
13
+ }
14
+ ],
15
+ "declaration-block-no-redundant-longhand-properties": true,
16
+ "declaration-block-no-shorthand-property-overrides": true,
17
+ "font-family-no-duplicate-names": true,
18
+ "font-family-no-missing-generic-family-keyword": true,
19
+ "function-calc-no-unspaced-operator": true,
20
+ "function-linear-gradient-no-nonstandard-direction": true,
21
+ "keyframe-declaration-no-important": true,
22
+ "media-feature-name-no-unknown": true,
23
+ "no-descending-specificity": true,
24
+ "no-duplicate-at-import-rules": true,
25
+ "no-duplicate-selectors": true,
26
+ "no-empty-source": true,
27
+ "no-extra-semicolons": true,
28
+ "no-invalid-double-slash-comments": true,
29
+ "property-no-unknown": true,
30
+ "selector-pseudo-class-no-unknown": true,
31
+ "selector-pseudo-element-no-unknown": true,
32
+ "selector-type-no-unknown": true,
33
+ "string-no-newline": true,
34
+ "unit-no-unknown": true,
35
+ "at-rule-empty-line-before": [
36
+ "always",
37
+ {
38
+ "except": [
39
+ "blockless-after-same-name-blockless",
40
+ "first-nested"
41
+ ],
42
+ "ignore": [
43
+ "after-comment"
44
+ ]
45
+ }
46
+ ],
47
+ "at-rule-name-case": "lower",
48
+ "at-rule-name-space-after": "always-single-line",
49
+ "at-rule-semicolon-newline-after": "always",
50
+ "block-closing-brace-empty-line-before": "never",
51
+ "block-closing-brace-newline-after": "always",
52
+ "block-closing-brace-newline-before": "always-multi-line",
53
+ "block-closing-brace-space-before": "always-single-line",
54
+ "block-opening-brace-newline-after": "always-multi-line",
55
+ "block-opening-brace-space-after": "always-single-line",
56
+ "block-opening-brace-space-before": "always",
57
+ "color-hex-case": "lower",
58
+ "color-hex-length": "short",
59
+ "comment-empty-line-before": [
60
+ "always",
61
+ {
62
+ "except": [
63
+ "first-nested"
64
+ ],
65
+ "ignore": [
66
+ "stylelint-commands"
67
+ ]
68
+ }
69
+ ],
70
+ "comment-whitespace-inside": "always",
71
+ "custom-property-empty-line-before": [
72
+ "always",
73
+ {
74
+ "except": [
75
+ "after-custom-property",
76
+ "first-nested"
77
+ ],
78
+ "ignore": [
79
+ "after-comment",
80
+ "inside-single-line-block"
81
+ ]
82
+ }
83
+ ],
84
+ "declaration-bang-space-after": "never",
85
+ "declaration-bang-space-before": "always",
86
+ "declaration-block-semicolon-newline-after": "always-multi-line",
87
+ "declaration-block-semicolon-space-after": "always-single-line",
88
+ "declaration-block-semicolon-space-before": "never",
89
+ "declaration-block-single-line-max-declarations": 1,
90
+ "declaration-block-trailing-semicolon": "always",
91
+ "declaration-colon-newline-after": "always-multi-line",
92
+ "declaration-colon-space-after": "always-single-line",
93
+ "declaration-colon-space-before": "never",
94
+ "declaration-empty-line-before": [
95
+ "always",
96
+ {
97
+ "except": [
98
+ "after-declaration",
99
+ "first-nested"
100
+ ],
101
+ "ignore": [
102
+ "after-comment",
103
+ "inside-single-line-block"
104
+ ]
105
+ }
106
+ ],
107
+ "function-comma-newline-after": "always-multi-line",
108
+ "function-comma-space-after": "always-single-line",
109
+ "function-comma-space-before": "never",
110
+ "function-max-empty-lines": 0,
111
+ "function-name-case": "lower",
112
+ "function-parentheses-newline-inside": "always-multi-line",
113
+ "function-parentheses-space-inside": "never-single-line",
114
+ "function-whitespace-after": "always",
115
+ "indentation": 2,
116
+ "length-zero-no-unit": true,
117
+ "max-empty-lines": 1,
118
+ "media-feature-colon-space-after": "always",
119
+ "media-feature-colon-space-before": "never",
120
+ "media-feature-name-case": "lower",
121
+ "media-feature-parentheses-space-inside": "never",
122
+ "media-feature-range-operator-space-after": "always",
123
+ "media-feature-range-operator-space-before": "always",
124
+ "media-query-list-comma-newline-after": "always-multi-line",
125
+ "media-query-list-comma-space-after": "always-single-line",
126
+ "media-query-list-comma-space-before": "never",
127
+ "no-eol-whitespace": true,
128
+ "no-missing-end-of-source-newline": true,
129
+ "number-leading-zero": "always",
130
+ "number-no-trailing-zeros": true,
131
+ "property-case": "lower",
132
+ "rule-empty-line-before": [
133
+ "always-multi-line",
134
+ {
135
+ "except": [
136
+ "first-nested"
137
+ ],
138
+ "ignore": [
139
+ "after-comment"
140
+ ]
141
+ }
142
+ ],
143
+ "selector-attribute-brackets-space-inside": "never",
144
+ "selector-attribute-operator-space-after": "never",
145
+ "selector-attribute-operator-space-before": "never",
146
+ "selector-combinator-space-after": "always",
147
+ "selector-combinator-space-before": "always",
148
+ "selector-descendant-combinator-no-non-space": true,
149
+ "selector-list-comma-newline-after": "always",
150
+ "selector-list-comma-space-before": "never",
151
+ "selector-max-empty-lines": 0,
152
+ "selector-pseudo-class-case": "lower",
153
+ "selector-pseudo-class-parentheses-space-inside": "never",
154
+ "selector-pseudo-element-case": "lower",
155
+ "selector-pseudo-element-colon-notation": "double",
156
+ "selector-type-case": "lower",
157
+ "unit-case": "lower",
158
+ "value-list-comma-newline-after": "always-multi-line",
159
+ "value-list-comma-space-after": "always-single-line",
160
+ "value-list-comma-space-before": "never",
161
+ "value-list-max-empty-lines": 0
162
+ }
163
+ }