diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0515ad5..d4b9e42 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,16 +7,16 @@ on: push: branches: - main - - master + - next pull_request: branches: - main - - master + - next jobs: test: name: redmine:${{ matrix.redmine_version }} ruby:${{ matrix.ruby_version }} db:${{ matrix.db }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 container: image: ruby:${{ matrix.ruby_version }}-bullseye @@ -24,32 +24,28 @@ jobs: strategy: fail-fast: false matrix: - redmine_version: [4.2-stable, 5.0-stable, master] - ruby_version: ['2.6', '2.7', '3.0', '3.1', '3.2'] + redmine_version: [5.0-stable, 5.1-stable, 6.0-stable, master] + ruby_version: ['3.1', '3.2', '3.3'] db: [mysql, postgres, sqlite] # # System test takes 2~3 times longer, so limit to specific matrix combinations # # See: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations # include: # - system_test: true # redmine_version: master - # ruby_version: '3.1' + # ruby_version: '3.3' # db: mysql exclude: - - redmine_version: 4.2-stable - ruby_version: '3.0' - - redmine_version: 4.2-stable - ruby_version: '3.1' - - redmine_version: 4.2-stable - ruby_version: '3.2' - redmine_version: 5.0-stable ruby_version: '3.2' - - redmine_version: master - ruby_version: '2.6' + - redmine_version: 5.0-stable + ruby_version: '3.3' + - redmine_version: 5.1-stable + ruby_version: '3.3' services: mysql: image: mysql:5.7 # min - # image: mysql:8.0 # latest + # image: mysql:9.1 # latest env: MYSQL_ROOT_PASSWORD: password ports: @@ -57,7 +53,7 @@ jobs: options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5 postgres: image: postgres:10 # min - # image: postgres:15 # latest + # image: postgres:17 # latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -67,14 +63,14 @@ jobs: steps: - name: Checkout Redmine - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: redmine/redmine ref: ${{ matrix.redmine_version }} path: redmine - name: Checkout Plugin - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: redmine/plugins/${{ env.PLUGIN_NAME }} @@ -165,14 +161,14 @@ jobs: # For system test in plugin GOOGLE_CHROME_OPTS_ARGS: "headless,disable-gpu,no-sandbox,disable-dev-shm-usage" working-directory: redmine - run: bundle exec rake redmine:plugins:test NAME=${{ env.PLUGIN_NAME }} RUBYOPT="-W0" + run: bundle exec rails test plugins/redmine_text_blocks/test # - name: Run core tests # env: # RAILS_ENV: test # PARALLEL_WORKERS: 1 # working-directory: redmine - # run: bundle exec rake test + # run: bundle exec rails test # - name: Run core system tests # if: matrix.system_test == true @@ -180,7 +176,7 @@ jobs: # RAILS_ENV: test # GOOGLE_CHROME_OPTS_ARGS: "headless,disable-gpu,no-sandbox,disable-dev-shm-usage" # working-directory: redmine - # run: bundle exec rake test:system + # run: bundle exec rails test:system - name: Run uninstall test env: diff --git a/README.md b/README.md index a409a0a..ba55b8d 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,12 @@ This plugin adds configurable text blocks for replying to issues. ## Requirements -- Redmine >= 4.0.0 +- Redmine >= 5.0.0 ## Installation -To install Redmine text blocks plugin, download or clone this repository in your Redmine installation plugins directory! +To install Redmine text blocks plugin, download or clone this repository in your +Redmine installation plugins directory! ```sh cd path/to/plugin/directory @@ -26,9 +27,11 @@ bundle install bundle exec rake redmine:plugins:migrate ``` -After restarting Redmine, you should be able to see the Redmine Text Blocks plugin in the Plugins page. +After restarting Redmine, you should be able to see the Redmine Text Blocks +plugin in the Plugins page. -More information on installing (and uninstalling) Redmine plugins can be found in [Redmine Plugins](http://www.redmine.org/wiki/redmine/Plugins) documentation. +More information on installing (and uninstalling) Redmine plugins can be found in +[Redmine Plugins](http://www.redmine.org/wiki/redmine/Plugins) documentation. ## How to use @@ -36,16 +39,13 @@ More information on installing (and uninstalling) Redmine plugins can be found i ## Contributing and Support -The Text Blocks Project appreciates any [contributions](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md)! Feel free to contact us for [reporting problems and support](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md). +The Text Blocks Project appreciates any [contributions](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md)! +Feel free to contact us for [reporting problems and support](https://github.com/gtt-project/.github/blob/main/CONTRIBUTING.md). ## Version History -- 2.0.0 Support Redmine 5.0 -- 1.2.0 Publish on GitHub -- 1.0.2 Fixes localization -- 1.0.1 Bugfix - -See [all releases](https://github.com/gtt-project/redmine_text_blocks/releases) with release notes. +See [all releases](https://github.com/gtt-project/redmine_text_blocks/releases) +with release notes. ## Authors diff --git a/app/models/text_block.rb b/app/models/text_block.rb index f6a5b7e..0232ce0 100644 --- a/app/models/text_block.rb +++ b/app/models/text_block.rb @@ -1,4 +1,4 @@ -class TextBlock < ActiveRecord::Base +class TextBlock < (defined?(ApplicationRecord) == 'constant' ? ApplicationRecord : ActiveRecord::Base) belongs_to :project has_and_belongs_to_many :issue_statuses acts_as_positioned :scope => [:project_id] diff --git a/app/views/hooks/text_blocks/_view_issues_edit_notes_bottom.html.erb b/app/views/hooks/text_blocks/_view_issues_edit_notes_bottom.html.erb index 476fa38..c027797 100644 --- a/app/views/hooks/text_blocks/_view_issues_edit_notes_bottom.html.erb +++ b/app/views/hooks/text_blocks/_view_issues_edit_notes_bottom.html.erb @@ -1,5 +1,5 @@ <% if User.current.allowed_to?(:view_text_blocks, @project) %> - <%= select_tag :text_block, text_block_options(@issue), id: 'textblock-select', style: 'display:none; border: 1px solid #e0e2e3; background: #f6f6f6; height: 24px; color: #3d454c; vertical-align: bottom; margin-left: 6px; margin-botton: 0;' %> + <%= select_tag :text_block, text_block_options(@issue), id: 'textblock-select' %> <%= javascript_include_tag 'text_blocks', plugin: 'redmine_text_blocks' %> <%= hidden_field_tag :text_block_project_id, @project.id %> <% end %> diff --git a/app/views/text_blocks/_form.html.erb b/app/views/text_blocks/_form.html.erb index 5d7d37c..b573349 100644 --- a/app/views/text_blocks/_form.html.erb +++ b/app/views/text_blocks/_form.html.erb @@ -2,7 +2,7 @@
<%= f.text_field :name, required: true, size: 25 %>
-<%= f.text_area :text, label: l(:field_text_block_text), rows: 10 %>
+<%= f.text_area :text, label: l(:field_text_block_text), rows: 10, class: 'wiki-edit' %>
<%= content_tag :label, l(:label_issue_status_plural) %> <%= f.collection_select :issue_status_ids, diff --git a/app/views/text_blocks/_list.html.erb b/app/views/text_blocks/_list.html.erb index 0a5b8bc..f4c4f57 100644 --- a/app/views/text_blocks/_list.html.erb +++ b/app/views/text_blocks/_list.html.erb @@ -17,21 +17,7 @@ <% end %> <%= content_for :header_tags do %> - <%= javascript_include_tag 'jquery.dotdotdot', plugin: 'redmine_text_blocks' %> <%= javascript_tag do %> - $(document).ready(function() { - $("table.list.textblocks tbody td.text div").dotdotdot({ - watch: 'window', - }); - - // make sure text is shortened when it was initially hidden and just - // becomes visible due to Redmine's tabbing in project settings: - var origShowTab = window.showTab; - window.showTab = function(name, url){ - origShowTab(name, url); - $("table.list.textblocks tbody td.text div").trigger('update.dot'); - } - }); $(function() { $("table.textblocks tbody").positionedItems(); }); diff --git a/app/views/text_blocks/_text_block.html.erb b/app/views/text_blocks/_text_block.html.erb index 4d65240..ee8908e 100644 --- a/app/views/text_blocks/_text_block.html.erb +++ b/app/views/text_blocks/_text_block.html.erb @@ -1,7 +1,7 @@