Skip to content

Commit b454433

Browse files
author
Guillaume DUPE
committed
Backlog upgrade for redmine 4.0.5
- task directory deleted - Add sidekiq dependancy to GemFile - Change deprecated method *_filter by *_action, it is the equivalent since Rails5.2 - Change css z-index to prevent search menu to pass under backlog menu - hash attribute to prevent internal error when drag and drop task - Error Block Message in impediment
1 parent b2424fe commit b454433

105 files changed

Lines changed: 89 additions & 18394 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
1+
gem "sidekiq"
2+
gem 'erubis', '~> 2.7'
23
gem "holidays", "~>1.0.3"
34
gem "icalendar"
45
gem "open-uri-cached"

app/controllers/rb_all_projects_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class RbAllProjectsController < ApplicationController
22
unloadable
33

4-
before_filter :authorize_global
4+
before_action :authorize_global
55

66
def statistics
77
backlogs_projects = RbCommonHelper.find_backlogs_enabled_active_projects

app/controllers/rb_application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
class RbApplicationController < ApplicationController
33
unloadable
44

5-
before_filter :load_project, :authorize, :check_if_plugin_is_configured
5+
before_action :load_project, :authorize, :check_if_plugin_is_configured
66

77
#provide list of javascript_include_tags which must be rendered before common.js
88
def rb_jquery_plugins

app/controllers/rb_calendars_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class RbCalendarsController < RbApplicationController
55

66
case Backlogs.platform
77
when :redmine
8-
before_filter :require_admin_or_api_request, :only => :ical
8+
before_action :require_admin_or_api_request, :only => :ical
99
accept_api_auth :ical
1010
when :chiliproject
1111
accept_key_auth :ical

app/controllers/rb_impediments_controller.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ class RbImpedimentsController < RbApplicationController
44
unloadable
55

66
def create
7-
@settings = Backlogs.settings
7+
params.permit!
8+
@settings = Backlogs.setting
89
begin
910
@impediment = RbTask.create_with_relationships(params, User.current.id, @project.id, true)
1011
rescue => e
11-
render :text => e.message.blank? ? e.to_s : e.message, :status => 400
12+
Rails.logger.error(e.message.blank? ? e.to_s : e.message)
13+
render :partial => "backlogs/model_errors", :object => { "base" => e.message.blank? ? e.to_s : e.message }, :status => 400
1214
return
1315
end
1416

@@ -22,8 +24,9 @@ def create
2224
end
2325

2426
def update
27+
params.permit!
2528
@impediment = RbTask.find_by_id(params[:id])
26-
@settings = Backlogs.settings
29+
@settings = Backlogs.setting
2730
begin
2831
result = @impediment.update_with_relationships(params)
2932
rescue => e

app/controllers/rb_project_settings_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ def project_settings
2323
:tab => 'backlogs'
2424
end
2525

26+
def project_settings_params
27+
params.require(:rb_project_settings).permit(:project_id);
28+
end
2629
end

app/controllers/rb_releases_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def edit
4949
def update
5050
except = ['id', 'project_id']
5151
attribs = params.select{|k,v| (!except.include? k) and (RbRelease.column_names.include? k) }
52-
attribs = Hash[*attribs.flatten]
52+
attribs = attribs.to_enum.to_h
5353
begin
5454
result = @release.update_attributes attribs
5555
rescue => e

app/controllers/rb_server_variables_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class RbServerVariablesController < RbApplicationController
77

88
# for index there's no @project
99
# (eliminates the need of RbAllProjectsController)
10-
skip_before_filter :load_project, :authorize, :only => [:index]
10+
skip_before_action :load_project, :authorize, :only => [:index]
1111

1212
def index
1313
@context = params[:context]

app/controllers/rb_sprints_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class RbSprintsController < RbApplicationController
1212

1313
def create
1414
attribs = params.select{|k,v| k != 'id' and RbSprint.column_names.include? k }
15-
attribs = Hash[*attribs.flatten]
15+
attribs = attribs.to_enum.to_h
1616
@sprint = RbSprint.new(attribs)
1717

1818
#share the sprint according to the global setting
@@ -43,7 +43,7 @@ def create
4343
def update
4444
except = ['id', 'project_id']
4545
attribs = params.select{|k,v| (!except.include? k) and (RbSprint.column_names.include? k) }
46-
attribs = Hash[*attribs.flatten]
46+
attribs = attribs.to_enum.to_h
4747
begin
4848
result = @sprint.update_attributes attribs
4949
rescue => e

app/controllers/rb_stories_controller.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def create
3232
begin
3333
story = RbStory.create_and_position(params)
3434
rescue => e
35-
render :text => e.message.blank? ? e.to_s : e.message, :status => 400
35+
Rails.logger.error(e.message.blank? ? e.to_s : e.message)
36+
render text: e.message.blank? ? e.to_s : e.message, status: 400
3637
return
3738
end
3839

@@ -48,6 +49,7 @@ def update
4849
begin
4950
result = story.update_and_position!(params)
5051
rescue => e
52+
Rails.logger.error(e.message.blank? ? e.to_s : e.message)
5153
render :text => e.message.blank? ? e.to_s : e.message, :status => 400
5254
return
5355
end

0 commit comments

Comments
 (0)