Skip to content

Redmine 4.x support #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.history
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ gemfile:
- $REDMINE_PATH/Gemfile

env:
- REDMINE_VER=3.1.6 DB=mysql
- REDMINE_VER=3.2.3 DB=mysql
- REDMINE_VER=3.3.0 DB=mysql
- REDMINE_VER=4.0.9 DB=mysql
- REDMINE_VER=4.1.3 DB=mysql
- REDMINE_VER=4.2.1 DB=mysql

- REDMINE_VER=3.1.6 DB=postgresql
- REDMINE_VER=3.2.3 DB=postgresql
- REDMINE_VER=3.3.0 DB=postgresql
- REDMINE_VER=4.0.9 DB=postgresql
- REDMINE_VER=4.1.3 DB=postgresql
- REDMINE_VER=4.2.1 DB=postgresql

before_install:
- export PLUGIN_NAME=redmine_custom_reports
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog for Redmine Custom Reports

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.0.0 - 2021-06-01

### Added

* Redmine 4.x support (no backward compatability!)
* german translations

### Fixed

* controller tests
10 changes: 5 additions & 5 deletions app/controllers/custom_reports_controller.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class CustomReportsController < ApplicationController
unloadable

before_filter :find_project_by_project_id
before_filter :authorize
before_filter :find_custom_reports, only: [:index, :show, :new, :edit]
before_filter :find_custom_report, only: [:show, :edit, :update, :destroy]
before_filter :authorize_to_manage, only: [:edit, :update, :destroy]
before_action :find_project_by_project_id
before_action :authorize
before_action :find_custom_reports, only: [:index, :show, :new, :edit]
before_action :find_custom_report, only: [:show, :edit, :update, :destroy]
before_action :authorize_to_manage, only: [:edit, :update, :destroy]

helper :queries
include QueriesHelper
Expand Down
26 changes: 26 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
de:
label_custom_report_plural: Eigene Auswertungen
label_custom_report_view_all: Alle Auswertungen
label_custom_report_new: Neue Auswertung
label_custom_report_public_list: Öffentliche Auswertungen
label_custom_report_own_list: Meine Auswertungen
label_custom_report_edit: Bearbeiten
label_series_filters: Ansicht

label_chart_type_undev_pie: "Undev Pie"
label_chart_type_pie: Kreis
label_chart_type_donut: Donut
label_chart_type_bar: Säulen
label_chart_type_horizontal_bar: Balken
label_chart_type_stacked_bar: Stapelbalken

field_chart_type: Diagrammtyp
field_null_text: Text für Nullwerte
field_series_name: Name der Ansicht

message_custom_reports_created: Auswertung erstellt
message_custom_reports_updated: Auswertung aktualisiert
message_custom_reports_destroyed: Auswertung gelöscht
message_cant_delete_last_series: Eine Auswertung muss mindestens eine Ansicht haben
message_add_custom_report_series: Ansicht hinzufügen
message_remove_custom_report_series: Ansicht löschen
2 changes: 1 addition & 1 deletion db/migrate/20121212125001_create_custom_reports.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateCustomReports < ActiveRecord::Migration
class CreateCustomReports < ActiveRecord::Migration[5.2]
def self.up
unless table_exists? :custom_reports
create_table :custom_reports do |t|
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20121212125002_create_custom_report_series.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateCustomReportSeries < ActiveRecord::Migration
class CreateCustomReportSeries < ActiveRecord::Migration[5.2]
def self.up
unless table_exists? :custom_report_series
create_table :custom_report_series do |t|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class RemoveFiltersFromCustomReports < ActiveRecord::Migration
class RemoveFiltersFromCustomReports < ActiveRecord::Migration[5.2]
def self.up
if column_exists? :custom_reports, :filters
remove_column :custom_reports, :filters
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name 'Redmine Custom Reports (with charts) plugin'
author 'Restream'
description 'Redmine plugin for custom reports with charts'
version '0.1.5'
version '1.0.0'
url 'https://github.com/Restream/redmine_custom_reports'
author_url 'https://github.com/Restream'

Expand Down
4 changes: 2 additions & 2 deletions lib/redmine_custom_reports.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ActionDispatch::Callbacks.to_prepare do
ActiveSupport::Reloader.to_prepare do

# Requiring plugin's controller and model
require_dependency 'custom_report'
Expand All @@ -11,4 +11,4 @@
load 'redmine_custom_reports/project_patch.rb'
load 'redmine_custom_reports/user_patch.rb'

end
end
15 changes: 7 additions & 8 deletions test/functional/custom_reports_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def setup
@user = User.find(1)
User.current = @user

@request = ActionController::TestRequest.new
@request.session[:user_id] = @user.id

@custom_report = @project.custom_reports.create!(
Expand All @@ -34,17 +33,17 @@ def setup
end

def test_show_all_custom_reports
get :index, project_id: @project.identifier
get :index, params: { project_id: @project.identifier }
assert_response :success
end

def test_show_custom_report
get :new, project_id: @project.identifier, id: @custom_report.id
get :new, params: { project_id: @project.identifier, id: @custom_report.id }
assert_response :success
end

def test_show_new_custom_report
get :new, project_id: @project.identifier
get :new, params: { project_id: @project.identifier }
assert_response :success
end

Expand All @@ -69,7 +68,7 @@ def test_create_custom_report
}
}
}
post :create, project_id: @project.identifier, custom_report: attrs
post :create, params: { project_id: @project.identifier, custom_report: attrs }
assert_response :redirect
custom_report = @project.custom_reports.find_by_name(attrs[:name])
assert custom_report
Expand All @@ -86,7 +85,7 @@ def test_create_custom_report
end

def test_show_edit_custom_report
get :edit, project_id: @project.identifier, id: @custom_report.id
get :edit, params: { project_id: @project.identifier, id: @custom_report.id }
assert_response :success
end

Expand Down Expand Up @@ -116,7 +115,7 @@ def test_update_custom_report
}
}
}
put :update, project_id: @project.identifier, id: @custom_report.id, custom_report: attrs
put :update, params: { project_id: @project.identifier, id: @custom_report.id, custom_report: attrs }
assert_response :redirect
@custom_report.reload
assert_equal attrs[:description], @custom_report.description
Expand All @@ -132,7 +131,7 @@ def test_update_custom_report
end

def test_destroy_custom_report
delete :destroy, project_id: @project.identifier, id: @custom_report.id
delete :destroy, params: { project_id: @project.identifier, id: @custom_report.id }
assert_response :redirect
custom_report = CustomReport.find_by_id @custom_report.id
assert_nil custom_report
Expand Down