diff --git a/.github/workflows/redmine_plugin.yml b/.github/workflows/redmine_plugin.yml index c43d5c9..221b5aa 100644 --- a/.github/workflows/redmine_plugin.yml +++ b/.github/workflows/redmine_plugin.yml @@ -11,21 +11,22 @@ jobs: fail-fast: false matrix: mat_env: + - '3.3 redmica/redmica@v3.1.0' + - '3.3 redmica/redmica@v3.0.4' + - '3.2 redmica/redmica@v2.4.2' - '3.2 redmica/redmica@v2.3.2' - '3.1 redmica/redmica@v2.2.3' - '3.0 redmica/redmica@v2.2.3' - '2.7 redmica/redmica@v2.2.3' - - '3.2 redmine/redmine@5.1.0' - - '3.1 redmine/redmine@5.0.6' - - '3.0 redmine/redmine@5.0.6' + - '3.3 redmine/redmine@6.0.1' + - '3.2 redmine/redmine@5.1.4' + - '3.1 redmine/redmine@5.0.10' + - '3.0 redmine/redmine@5.0.10' - '2.7 redmine/redmine@4.2.11' - '2.6 redmine/redmine@4.2.11' - - '2.6 redmine/redmine@4.1.7' - - '2.6 redmine/redmine@4.0.9' - - '2.5 redmine/redmine@4.0.9' experimental: [false] include: - - mat_env: '3.2 redmica/redmica@master' + - mat_env: '3.3 redmica/redmica@master' experimental: true steps: - run: | @@ -43,11 +44,11 @@ jobs: ruby-version: ${{ env.RUBY_VERSION }} - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: ./${{ env.PLUGIN_NAME }} - name: Set up Redmine - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ env.REDMINE_REPOSITORY }} ref: ${{ env.REDMINE_REF }} @@ -56,7 +57,7 @@ jobs: - name: Copy the plugin files to plugin directory run: cp -pr ./${{ env.PLUGIN_NAME }} ./redmine/plugins/${{ env.PLUGIN_NAME }} - name: Create redmine/config/database.yml - uses: DamianReeves/write-file-action@v1.2 + uses: DamianReeves/write-file-action@v1.3 with: path: ./redmine/config/database.yml contents: | @@ -64,20 +65,20 @@ jobs: adapter: sqlite3 database: db/redmine_test.db - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ./redmine/vendor/bundle key: ${{ runner.os }}-gems-${{ hashFiles('./redmine/**/Gemfile.lock') }} restore-keys: | ${{ runner.os }}-gems- - - name: uninitialized constant Nokogiri::HTML4 Issue HACK ref. https://qiita.com/Mattani/items/c4bcc95a72b69d1c0489 - uses: DamianReeves/write-file-action@v1.2 + - name: "'LoadError: cannot load such file -- blankslate' Issue HACK ref. https://www.redmine.org/issues/40802#note-11" + uses: DamianReeves/write-file-action@v1.3 with: path: ./redmine/Gemfile.local contents: | - gem 'loofah', '~> 2.20.0' - if: contains(fromJSON('["2.6 redmine/redmine@4.1.7", "2.6 redmine/redmine@4.0.9", "2.5 redmine/redmine@4.0.9"]'), matrix.mat_env) + gem 'builder', '~> 3.2.4' + if: contains(fromJSON('["3.2 redmica/redmica@v2.4.2", "3.2 redmica/redmica@v2.3.2", "3.1 redmica/redmica@v2.2.3", "3.0 redmica/redmica@v2.2.3", "2.7 redmica/redmica@v2.2.3", "2.6 redmine/redmine@4.1.7", "2.6 redmine/redmine@4.0.9", "2.5 redmine/redmine@4.0.9", "2.6 redmine/redmine@4.2.11", "2.7 redmine/redmine@4.2.11"]'), matrix.mat_env) - name: Before script run: | diff --git a/README.rdoc b/README.rdoc index 64279eb..5b6d9a6 100644 --- a/README.rdoc +++ b/README.rdoc @@ -24,6 +24,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/cat-in == License -MIT License. -See the 'LICENSE.md' file. +* Codes: MIT License. +* Legacy Icons: famfamfam-silk: {CC-By-2.5}[https://creativecommons.org/licenses/by/2.5/] by Mark James http://www.famfamfam.com/lab/icons/silk/ +* Vector Icons: {Tabler Icons}[https://tabler.io/]: MIT License diff --git a/app/controllers/scheduling_polls_controller.rb b/app/controllers/scheduling_polls_controller.rb index 246f95c..ac0c3bc 100644 --- a/app/controllers/scheduling_polls_controller.rb +++ b/app/controllers/scheduling_polls_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true class SchedulingPollsController < ApplicationController - unloadable + unloadable if respond_to?(:unloadable) before_action :set_scheduling_poll, :only => [:edit, :update, :show, :vote] before_action :set_scheduling_poll_by_issue_id, :only => [:show_by_issue] diff --git a/app/helpers/scheduling_polls_helper.rb b/app/helpers/scheduling_polls_helper.rb index 151b617..f580d36 100644 --- a/app/helpers/scheduling_polls_helper.rb +++ b/app/helpers/scheduling_polls_helper.rb @@ -46,4 +46,14 @@ def render_date_related_parameter_of_issue(issue) s.html_safe end + if defined? IconsHelper # redmine >= 6.0 + include IconsHelper + def scheduling_icon_with_label(icon_name, label_text, icon_only: false, size: 18, css_class: nil) + label_classes = ["icon-label"] + label_classes << "hidden" if icon_only + plugin = 'redmine_scheduling_poll' + sprite_icon(icon_name, size: size, css_class: css_class, plugin: plugin) + content_tag(:span, label_text, class: label_classes.join(' ')) + end + end + end diff --git a/app/models/scheduling_poll.rb b/app/models/scheduling_poll.rb index 48f505c..71b8b1e 100644 --- a/app/models/scheduling_poll.rb +++ b/app/models/scheduling_poll.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class SchedulingPoll < ActiveRecord::Base - unloadable +class SchedulingPoll < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) + unloadable if respond_to?(:unloadable) belongs_to :issue has_many :scheduling_poll_items, :dependent => :destroy diff --git a/app/models/scheduling_poll_item.rb b/app/models/scheduling_poll_item.rb index 0d9dc41..a493a49 100644 --- a/app/models/scheduling_poll_item.rb +++ b/app/models/scheduling_poll_item.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class SchedulingPollItem < ActiveRecord::Base - unloadable +class SchedulingPollItem < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) + unloadable if respond_to?(:unloadable) belongs_to :scheduling_poll has_many :scheduling_votes, :dependent => :destroy diff --git a/app/models/scheduling_vote.rb b/app/models/scheduling_vote.rb index aa5fe25..6a243c9 100644 --- a/app/models/scheduling_vote.rb +++ b/app/models/scheduling_vote.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class SchedulingVote < ActiveRecord::Base - unloadable +class SchedulingVote < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) + unloadable if respond_to?(:unloadable) belongs_to :user belongs_to :scheduling_poll_item diff --git a/app/views/scheduling_polls/_form.html.erb b/app/views/scheduling_polls/_form.html.erb index abac286..7d86e4d 100644 --- a/app/views/scheduling_polls/_form.html.erb +++ b/app/views/scheduling_polls/_form.html.erb @@ -22,7 +22,13 @@