Permalink
Browse files

Release openproject-ce v5.0.5

  • Loading branch information...
2 parents d34b941 + c3fc3ae commit 9b53ca90de31cce2b1187302145aec55f742d7f0 @oliverguenther oliverguenther committed Dec 2, 2015
Showing with 1,141 additions and 964 deletions.
  1. +0 −1 .codeclimate.yml
  2. +2 −2 Gemfile
  3. +5 −5 Gemfile.lock
  4. +5 −1 app/assets/stylesheets/_misc_legacy.sass
  5. +19 −31 app/controllers/attachments_controller.rb
  6. +21 −75 app/controllers/repositories_controller.rb
  7. +15 −31 app/controllers/users_controller.rb
  8. +0 −4 app/controllers/watchers_controller.rb
  9. +26 −62 app/helpers/application_helper.rb
  10. +0 −70 app/helpers/issues_helper.rb
  11. +14 −1 app/models/attachment.rb
  12. +39 −32 app/models/permitted_params.rb
  13. +12 −12 app/models/project.rb
  14. +9 −0 app/models/work_package.rb
  15. +18 −46 app/models/work_package/pdf_exporter.rb
  16. +2 −2 app/seeders/basic_data/builtin_roles_seeder.rb
  17. +2 −2 app/seeders/demo_data/project_seeder.rb
  18. +4 −0 app/uploaders/file_uploader.rb
  19. +13 −0 app/uploaders/fog_file_uploader.rb
  20. +0 −39 app/views/attachments/diff.html.erb
  21. +0 −46 app/views/attachments/file.html.erb
  22. +4 −3 app/views/timelog/edit.html.erb
  23. +14 −14 config/locales/en.seeders.yml
  24. +2 −2 config/locales/js-en.yml
  25. +4 −4 config/routes.rb
  26. +1 −1 db/migrate/migration_utils/legacy_journal_migrator.rb
  27. +0 −1 extra/Apache/OpenProjectRepoman.pm
  28. +3 −1 features/support/paths.rb
  29. +2 −2 features/work_packages/editable_fields.feature
  30. +1 −1 features/work_packages/error_on_update.feature
  31. +2 −2 features/work_packages/switch_type.feature
  32. +2 −2 features/work_packages/update.feature
  33. +45 −0 frontend/app/components/common/services/loading-indicator.service.js
  34. +31 −46 frontend/app/components/routes/controllers/work-packages-list.controller.js
  35. +2 −14 frontend/app/components/routes/partials/work-packages.list.html
  36. +1 −12 frontend/app/components/routes/partials/work-packages.show.html
  37. 0 frontend/app/components/{work-packages/activity → wp-activity}/activity-entry.directive.html
  38. +1 −1 frontend/app/components/{work-packages/activity → wp-activity}/activity-entry.directive.js
  39. +1 −1 ...e-button/wp-create-button.directive.html → wp-buttons/create-button/create-button.directive.html}
  40. +10 −4 ...reate-button/wp-create-button.directive.js → wp-buttons/create-button/create-button.directive.js}
  41. +39 −0 frontend/app/components/wp-buttons/create-button/types-drop-down-menu.service.js
  42. +2 −4 ...asks_dropdown_menu.html → components/wp-buttons/create-button/types-drop-down-menu.template.html}
  43. +13 −0 frontend/app/components/wp-buttons/view-button/view-button.directive.html
  44. +69 −0 frontend/app/components/wp-buttons/view-button/view-button.directive.js
  45. 0 ...utton/wp-watcher-button.directive.html → wp-buttons/watcher-button/watcher-button.directive.html}
  46. +1 −2 ...er-button/wp-watcher-button.directive.js → wp-buttons/watcher-button/watcher-button.directive.js}
  47. +1 −1 frontend/app/components/wp-panels/watchers-panel/watchers-panel.directive.js
  48. +49 −0 frontend/app/components/wp-panels/watchers-panel/watchers-panel.directive.test.js
  49. +1 −1 frontend/app/openproject-app.js
  50. +1 −1 frontend/app/templates/work_packages/activities/_link.html
  51. +0 −9 frontend/app/work_packages/controllers/menus/index.js
  52. +1 −5 frontend/app/work_packages/controllers/work-packages-controller.js
  53. +76 −9 frontend/npm-shrinkwrap.json
  54. +1 −0 frontend/package.json
  55. +2 −2 frontend/scripts/clean-shrinkwrap.js
  56. +2 −1 frontend/webpack.config.js
  57. +1 −1 lib/api/v3/attachments/attachment_representer.rb
  58. +2 −2 lib/api/v3/utilities/path_helper.rb
  59. +0 −15 lib/open_project/a_r_object_cache.rb
  60. +1 −2 lib/open_project/object_linking.rb
  61. +3 −2 lib/open_project/version.rb
  62. +4 −0 lib/tabular_form_builder.rb
  63. +8 −4 spec/controllers/attachments_controller_spec.rb
  64. +62 −0 spec/features/watching/toggle_watching_spec.rb
  65. +1 −1 spec/features/work_packages/details/activity_comments_spec.rb
  66. +1 −1 spec/features/work_packages/details/inplace_editor/version_editor_spec.rb
  67. +1 −1 spec/features/work_packages/new_work_package_spec.rb
  68. +173 −0 spec/features/work_packages/tabs/activity_tab_spec.rb
  69. +8 −2 spec/lib/api/v3/utilities/path_helper_spec.rb
  70. +44 −44 spec/models/permitted_params_spec.rb
  71. +219 −205 spec/models/work_package/work_package_nested_set_spec.rb
  72. +6 −2 spec/support/pages/full_work_package.rb
  73. +6 −2 spec/support/pages/split_work_package.rb
  74. +2 −53 spec_legacy/functional/attachments_controller_spec.rb
  75. +3 −3 spec_legacy/functional/user_mailer_spec.rb
  76. +3 −13 spec_legacy/integration/routing_spec.rb
  77. +3 −3 spec_legacy/unit/helpers/application_helper_spec.rb
View
@@ -27,4 +27,3 @@ exclude_paths:
- .bundle/**/*
- lib/plugins/rfpdf/**/*
- spec_legacy/**/*
- - lib/redcloth3.rb
View
@@ -193,7 +193,7 @@ group :development, :test do
gem 'pry-rescue'
gem 'pry-byebug', platforms: [:mri]
gem 'pry-doc'
- gem 'parallel_tests'
+ gem 'parallel_tests', '~> 2.1.2'
gem 'rubocop', '~> 0.32'
end
@@ -230,7 +230,7 @@ platforms :jruby do
end
group :opf_plugins do
- gem 'openproject-translations', git:'https://github.com/opf/openproject-translations.git', tag: 'v5.0.4'
+ gem 'openproject-translations', git:'https://github.com/opf/openproject-translations.git', tag: 'v5.0.5'
end
# Load Gemfile.local, Gemfile.plugins and plugins' Gemfiles
View
@@ -220,10 +220,10 @@ GIT
GIT
remote: https://github.com/opf/openproject-translations.git
- revision: 9c87aec9d0cd956a1cfaea2a4d7bbdbadd2997bf
- tag: v5.0.4
+ revision: 98a560e6eb533bbaacb0146f12fccf61f0452d60
+ branch: release/5.0
specs:
- openproject-translations (5.0.4)
+ openproject-translations (5.0.5)
crowdin-api (~> 0.4.0)
mixlib-shellout (~> 2.1.0)
rails (~> 4.2.3)
@@ -530,7 +530,7 @@ GEM
validate_url
webfinger (>= 0.0.2)
parallel (1.6.1)
- parallel_tests (1.6.1)
+ parallel_tests (2.1.2)
parallel
parser (2.2.2.5)
ast (>= 1.1, < 3.0)
@@ -858,8 +858,8 @@ DEPENDENCIES
openproject-translations!
openproject-webhooks!
openproject-xls_export!
- parallel_tests
pdf-inspector (~> 1.0.0)
+ parallel_tests (~> 2.1.2)
pg (~> 0.18.3)
poltergeist
prototype-rails!
@@ -33,6 +33,8 @@
// placed elsewhere. Pleade DO NOT add to this file. Instead MOVE, refactor or
// REMOVE with ruthlessness.
+$version-summary-width: 380px
+
#watchers
ul
margin: 0
@@ -192,9 +194,11 @@ div
font-size: 120%
h2
font-size: 110%
+ .generic-table--no-results-container
+ max-width: calc(100% - #{$version-summary-width})
&#version-summary
float: right
- width: 380px
+ width: $version-summary-width
margin-left: 16px
margin-bottom: 16px
background-color: #fff
@@ -32,29 +32,14 @@ class AttachmentsController < ApplicationController
before_filter :file_readable, :read_authorize, except: :destroy
before_filter :delete_authorize, only: :destroy
- def show
- if @attachment.is_diff?
- @diff = File.new(@attachment.diskfile, 'rb').read
- render action: 'diff'
- elsif @attachment.is_text? && @attachment.filesize <= Setting.file_max_size_displayed.to_i.kilobyte
- @content = File.new(@attachment.diskfile, 'rb').read
- render action: 'file'
- else
- redirect_to link_to_attachment(@attachment)
- end
- end
-
def download
- if @attachment.container.is_a?(Version) || @attachment.container.is_a?(Project)
- @attachment.increment_download
- end
+ url = @attachment.external_url
- # browsers should not try to guess the content-type
- response.headers['X-Content-Type-Options'] = 'nosniff'
-
- send_file @attachment.diskfile, filename: filename_for_content_disposition(@attachment.filename),
- type: @attachment.content_type,
- disposition: @attachment.content_disposition
+ if url
+ redirect_to url.to_s
+ else
+ serve_attachment @attachment
+ end
end
def destroy
@@ -69,16 +54,6 @@ def destroy
private
- def link_to_attachment(attachment)
- url = URI.parse attachment.file.download_url
-
- if url.host # check if URL or file path
- url.to_s
- else
- download_attachment_url filename: attachment.filename, id: attachment.id
- end
- end
-
def find_project
@attachment = Attachment.find(params[:id])
# Show 404 if the filename in the url is wrong
@@ -104,4 +79,17 @@ def delete_authorize
def destroy_response_url(container)
url_for(container.is_a?(WikiPage) ? [@project, container.wiki] : container)
end
+
+ def serve_attachment(attachment)
+ if attachment.container.is_a?(Version) || attachment.container.is_a?(Project)
+ attachment.increment_download
+ end
+
+ # browsers should not try to guess the content-type
+ response.headers['X-Content-Type-Options'] = 'nosniff'
+
+ send_file attachment.diskfile, filename: filename_for_content_disposition(attachment.filename),
+ type: attachment.content_type,
+ disposition: attachment.content_disposition
+ end
end
@@ -98,11 +98,7 @@ def committers
@users.sort!
if request.post? && params[:committers].is_a?(Hash)
# Build a hash with repository usernames as keys and corresponding user ids as values
- @repository.committer_ids = params[:committers].values
- .inject({}) { |h, c|
- h[c.first] = c.last
- h
- }
+ @repository.committer_ids = params[:committers].values.inject({}) { |h, c| h[c.first] = c.last; h }
flash[:notice] = l(:notice_successful_update)
redirect_to action: 'committers', project_id: @project
end
@@ -150,17 +146,10 @@ def show
def changes
@entry = @repository.entry(@path, @rev)
-
- unless @entry
- show_error_not_found
- return
- end
-
- @changesets = @repository.latest_changesets(@path,
- @rev,
- Setting.repository_log_display_limit.to_i)
+ (show_error_not_found; return) unless @entry
+ @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i)
@properties = @repository.properties(@path, @rev)
- @changeset = @repository.find_changeset_by_name(@rev)
+ @changeset = @repository.find_changeset_by_name(@rev)
end
def revisions
@@ -170,21 +159,14 @@ def revisions
.per_page(per_page_param)
respond_to do |format|
- format.html do
- render layout: false if request.xhr?
- end
- format.atom do
- render_feed(@changesets, title: "#{@project.name}: #{l(:label_revision_plural)}")
- end
+ format.html do render layout: false if request.xhr? end
+ format.atom do render_feed(@changesets, title: "#{@project.name}: #{l(:label_revision_plural)}") end
end
end
def entry
@entry = @repository.entry(@path, @rev)
- unless @entry
- show_error_not_found
- return
- end
+ (show_error_not_found; return) unless @entry
# If the entry is a dir, show the browser
if @entry.dir?
@@ -193,12 +175,7 @@ def entry
end
@content = @repository.cat(@path, @rev)
-
- unless @content
- show_error_not_found
- return
- end
-
+ (show_error_not_found; return) unless @content
if 'raw' == params[:format] ||
(@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) ||
!is_entry_text_data?(@content, @path)
@@ -226,8 +203,7 @@ def is_entry_text_data?(ent, path)
# http://apidock.com/ruby/v1_8_6_287/String/is_binary_data%3F
if ent.respond_to?('is_binary_data?') && ent.is_binary_data? # Ruby 1.8.x and <1.9.2
return false
- elsif ent.respond_to?(:force_encoding) &&
- (ent.dup.force_encoding('UTF-8') != ent.dup.force_encoding('BINARY')) # Ruby 1.9.2
+ elsif ent.respond_to?(:force_encoding) && (ent.dup.force_encoding('UTF-8') != ent.dup.force_encoding('BINARY')) # Ruby 1.9.2
# TODO: need to handle edge cases of non-binary content that isn't UTF-8
return false
end
@@ -238,13 +214,9 @@ def is_entry_text_data?(ent, path)
def annotate
@entry = @repository.entry(@path, @rev)
+ (show_error_not_found; return) unless @entry
- unless @entry
- show_error_not_found
- return
- end
-
- @annotate = @repository.scm.annotate(@path, @rev)
+ @annotate = @repository.scm.annotate(@path, @rev)
@changeset = @repository.find_changeset_by_name(@rev)
end
@@ -264,12 +236,7 @@ def revision
def diff
if params[:format] == 'diff'
@diff = @repository.diff(@path, @rev, @rev_to)
-
- unless @diff
- show_error_not_found
- return
- end
-
+ (show_error_not_found; return) unless @diff
filename = "changeset_r#{@rev}"
filename << "_r#{@rev_to}" if @rev_to
send_data @diff.join,
@@ -286,9 +253,7 @@ def diff
User.current.preference.save
end
- @cache_key = "repositories/diff/#{@repository.id}/" +
- Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
-
+ @cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
unless read_fragment(@cache_key)
@diff = @repository.diff(@path, @rev, @rev_to)
show_error_not_found unless @diff
@@ -341,11 +306,7 @@ def update_repository(repo_params)
def find_repository
@repository = @project.repository
-
- unless @repository
- render_404
- return false
- end
+ (render_404; return false) unless @repository
# Prepare checkout instructions
# available on all pages (even empty!)
@@ -383,30 +344,20 @@ def graph_commits_per_month(repository)
@date_to = Date.today
@date_from = @date_to << 11
@date_from = Date.civil(@date_from.year, @date_from.month, 1)
- commits_by_day = Changeset.where(
- ['repository_id = ? AND commit_date BETWEEN ? AND ?', repository.id, @date_from, @date_to]
- ).group(:commit_date).size
+ commits_by_day = Changeset.where(['repository_id = ? AND commit_date BETWEEN ? AND ?', repository.id, @date_from, @date_to]).group(:commit_date).size
commits_by_month = [0] * 12
- commits_by_day.each do |c|
- commits_by_month[(@date_to.month - c.first.to_date.month) % 12] += c.last
- end
+ commits_by_day.each do |c| commits_by_month[(@date_to.month - c.first.to_date.month) % 12] += c.last end
changes_by_day = Change.includes(:changeset)
- .where(["#{Changeset.table_name}.repository_id = ? "\
- "AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?",
- repository.id, @date_from, @date_to])
+ .where(["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
.references(:changesets)
.group(:commit_date)
.size
changes_by_month = [0] * 12
- changes_by_day.each do |c|
- changes_by_month[(@date_to.month - c.first.to_date.month) % 12] += c.last
- end
+ changes_by_day.each do |c| changes_by_month[(@date_to.month - c.first.to_date.month) % 12] += c.last end
fields = []
- 12.times do |m|
- fields << month_name(((Date.today.month - 1 - m) % 12) + 1)
- end
+ 12.times do |m| fields << month_name(((Date.today.month - 1 - m) % 12) + 1) end
graph = SVG::Graph::Bar.new(
height: 300,
@@ -435,19 +386,14 @@ def graph_commits_per_month(repository)
def graph_commits_per_author(repository)
commits_by_author = Changeset.where(['repository_id = ?', repository.id]).group(:committer).size
- commits_by_author.to_a.sort! do |x, y|
- x.last <=> y.last
- end
+ commits_by_author.to_a.sort! do |x, y| x.last <=> y.last end
changes_by_author = Change.includes(:changeset)
.where(["#{Changeset.table_name}.repository_id = ?", repository.id])
.references(:changesets)
.group(:committer)
.size
- h = changes_by_author.inject({}) { |o, i|
- o[i.first] = i.last
- o
- }
+ h = changes_by_author.inject({}) { |o, i| o[i.first] = i.last; o }
fields = commits_by_author.map(&:first)
commits_data = commits_by_author.map(&:last)
Oops, something went wrong.

0 comments on commit 9b53ca9

Please sign in to comment.