Skip to content

Commit

Permalink
Merge branch 'feature/redmine_6' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
haru committed Nov 17, 2024
2 parents b69b2c2 + c6a3742 commit 873f5e0
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ services:
# Update 'VARIANT' to pick a version of Ruby: 3, 3.0, 2, 2.7, 2.6
# Append -bullseye or -buster to pin to an OS version.
# Use -bullseye variants on local arm64/Apple Silicon.
RUBY_VERSION: "3.1"
RUBY_VERSION: "3.2"
# Optional Node.js version to install
NODE_VERSION: "lts/*"
REDMINE_VERSION: "5.1-stable"
REDMINE_VERSION: "6.0-stable"

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,27 @@ env:
jobs:
build:
runs-on: ubuntu-latest
# Supported Matrix:
# Redmine 5.0-stable: Ruby 2.7, 3.0, 3.1
# Redmine 5.1-stable: Ruby 2.7, 3.0, 3.1, 3.2
# Redmine 6.0-stable: Ruby 3.1, 3.2, 3.3
# Redmine master: Ruby 3.1, 3.2, 3.3
strategy:
matrix:
db: [sqlite3, mysql, postgres]
ruby_version: ["2.7", "3.0", "3.1", "3.2"]
redmine_version: [5.0-stable, 5.1-stable, master]
ruby_version: ["3.0", "3.1", "3.2", "3.3"]
redmine_version: [5.0-stable, 5.1-stable, 6.0-stable, master]
exclude:
- ruby_version: "3.2"
redmine_version: 5.0-stable
- ruby_version: "3.3"
redmine_version: 5.0-stable
- ruby_version: "3.3"
redmine_version: 5.1-stable
- ruby_version: "3.0"
redmine_version: 6.0-stable
- ruby_version: "3.0"
redmine_version: master
services:
mysql:
image: mysql:5.7
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/code_review_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class CodeReviewController < ApplicationController
class CodeReviewController < ApplicationController
before_action :find_project, :authorize, :find_user, :find_setting, :find_repository, :find_priorities

helper :sort
Expand Down Expand Up @@ -251,7 +251,7 @@ def show
if action_name == 'attachment'
attachment = target.attachment
url = url_for(controller: 'attachments', action: 'show',
id: attachment.id) + '/' + URI.encode(attachment.filename)
id: attachment.id) + '/' + URI.encode_www_form_component(attachment.filename)
url << '?review_id=' + @review.id.to_s if @review
else
path = nil if target.diff_all
Expand Down
2 changes: 1 addition & 1 deletion app/models/code_review_assignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def self.create_with_changeset(changeset)
assignment = CodeReviewAssignment.new
issue = Issue.new
issue.subject = auto_assign.subject
issue.subject = l(:code_review_requrest) if issue.subject.blank?
issue.subject = I18n.t(:code_review_requrest) if issue.subject.blank?
issue.subject = issue.subject.sub("$REV", changeset.revision)
issue.subject = issue.subject.sub("$COMMENTS", changeset.comments.split(//u)[0..60].join) unless changeset.comments.blank?
issue.tracker_id = setting.assignment_tracker_id
Expand Down
13 changes: 7 additions & 6 deletions app/views/code_review/_html_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
baseurl = Redmine::Utils.relative_url_root

-%>
<%= javascript_include_tag(baseurl + "/plugin_assets/redmine_code_review/javascripts/code_review.js") %>
<%= javascript_include_tag(baseurl + '/javascripts/jstoolbar/jstoolbar.js') %>
<%= javascript_include_tag(baseurl + '/javascripts/jstoolbar/textile.js') %>
<%= javascript_include_tag(baseurl + "/javascripts/jstoolbar/lang/jstoolbar-#{@project.current_language.to_s.downcase}.js") %>
<%= javascript_include_tag("code_review.js", plugin: "redmine_code_review") %>
<%= javascript_include_tag('jstoolbar/jstoolbar') %>
<%= javascript_include_tag("jstoolbar/lang/jstoolbar-#{@project.current_language.to_s.downcase}.js") %>
<%= include_calendar_headers_tags %>
<%= stylesheet_link_tag(baseurl + "/plugin_assets/redmine_code_review/stylesheets/code_review.css") %>
<%= stylesheet_link_tag(baseurl + "/stylesheets/jstoolbar.css") %>
<%= stylesheet_link_tag("code_review.css", plugin: "redmine_code_review") %>
<%= stylesheet_link_tag("jstoolbar.css") %>
<% end %>
10 changes: 5 additions & 5 deletions app/views/code_review_settings/_show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%
# Code Review plugin for Redmine
# Copyright (C) 2010-2012 Haruyuki Iida
# Copyright (C) 2010- Haruyuki Iida
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -89,16 +89,16 @@
<%= error_messages_for 'code_review_setting' %>
<div class="box">
<%= f.hidden_field :lock_version %>
<p><%= f.check_box :tracker_in_review_dialog %></p>
<p><%= f.check_box :tracker_in_review_dialog, label: t(:field_tracker_in_review_dialog) %></p>

<b><%=h l(:select_tracker_for_code_reviews)%>:</b>
<p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %></p>
<p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true, label: t(:field_tracker) %></p>

<b><%=h l(:select_tracker_for_code_review_assignment)%>:</b>
<p><%= f.select :assignment_tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %></p>
<p><%= f.select :assignment_tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true, label: t(:field_assignment_tracker) %></p>

<p>
<%= f.check_box :hide_code_review_tab %>
<%= f.check_box :hide_code_review_tab, label: t(:field_hide_code_review_tab) %>
</p>

<p>
Expand Down
8 changes: 7 additions & 1 deletion assets/javascripts/code_review.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
# Code Review plugin for Redmine
# Copyright (C) 2009-2023 Haruyuki Iida
# Copyright (C) 2009- Haruyuki Iida
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -139,6 +139,12 @@ function setAddReviewButton(url, change_id, image_tag, is_readonly, is_diff, att
}

var line = $(th).data('txt');
if (line == null || line == "") {
var a = $(th).find('a');
if (a.length > 0) {
line = $(a).data('txt');
}
}
if (line == null || line == "") {
continue;
}
Expand Down

0 comments on commit 873f5e0

Please sign in to comment.