Permalink
Browse files

Merge tag 'v5.0.14' into stable/5

  • Loading branch information...
2 parents a0fad1b + 4c74cf7 commit a1a10a863784bd3951e52f310c4e8d65f3d194af @oliverguenther oliverguenther committed Feb 5, 2016
Showing with 682 additions and 195 deletions.
  1. +21 −21 Gemfile.lock
  2. +5 −5 app/assets/stylesheets/content/_news.sass
  3. +1 −1 app/assets/stylesheets/content/work_package_details/_activities_tab.sass
  4. +29 −2 app/controllers/concerns/user_invitation.rb
  5. +15 −1 app/controllers/users_controller.rb
  6. +15 −13 app/helpers/application_helper.rb
  7. +4 −5 app/helpers/users_helper.rb
  8. +22 −10 app/models/mail_handler.rb
  9. +3 −0 app/models/token.rb
  10. +3 −3 app/views/news/_news.html.erb
  11. +1 −1 app/views/projects/_edit.html.erb
  12. +3 −3 app/views/projects/show.html.erb
  13. +1 −1 app/views/reportings/_toolbar.html.erb
  14. +3 −0 app/views/settings/_mail_handler.html.erb
  15. +12 −0 app/views/users/_toolbar.html
  16. +5 −1 config/initializers/user_invitation.rb
  17. +8 −0 config/locales/en.yml
  18. +1 −0 config/routes.rb
  19. +2 −0 config/settings.yml
  20. +6 −0 doc/operation_guides/manual/installation-guide.md
  21. +1 −1 features/projects/copy_project.feature
  22. 0 frontend/app/components/{common → api}/api-paths/api-paths.service.js
  23. 0 frontend/app/components/{common → api}/api-paths/api-paths.service.test.js
  24. +0 −1 frontend/app/components/{common → api}/hal-api-resource/hal-api-resource.service.js
  25. 0 frontend/app/components/{common → api}/hal-api-resource/hal-api-resource.service.test.js
  26. +44 −0 frontend/app/components/common/loading-indicator/loading-indicator.service.test.ts
  27. +14 −14 ...components/common/loading-indicator/{loading-indicator.service.js → loading-indicator.service.ts}
  28. +2 −5 frontend/app/components/common/path-heleper/path-helper.service.js
  29. +6 −3 ...end/app/components/inplace-edit/directives/field-display/display-user/display-user.directive.html
  30. +4 −2 ...p/components/inplace-edit/directives/field-display/display-version/display-version.directive.html
  31. +4 −11 frontend/app/components/routing/controllers/work-packages-list.controller.js
  32. +1 −1 frontend/app/components/routing/views/work-packages.list.html
  33. +3 −2 frontend/app/components/work-packages/work-package.service.js
  34. +1 −1 frontend/app/components/work-packages/wp-new.controller.js
  35. +2 −2 frontend/app/components/wp-buttons/wp-details-view-button/wp-details-view-button.directive.ts
  36. +1 −2 frontend/app/components/wp-buttons/wp-view-button/wp-view-button.directive.ts
  37. +5 −0 frontend/app/global.js
  38. +2 −1 frontend/app/templates/inplace-edit/display/fields/embedded.html
  39. +2 −1 frontend/app/templates/inplace-edit/display/fields/text.html
  40. +2 −1 frontend/bower.json
  41. +13 −0 frontend/doc/API.md
  42. +1 −1 lib/open_project/version.rb
  43. +17 −30 lib/tasks/email.rake
  44. +39 −1 lib/tasks/ldap.rake
  45. +20 −0 spec/controllers/concerns/user_invitation_spec.rb
  46. +42 −0 spec/controllers/users_controller_spec.rb
  47. +1 −0 spec/factories/token_factory.rb
  48. +4 −0 spec/factories/user_factory.rb
  49. +59 −0 spec/features/users/resend_invitation_spec.rb
  50. +18 −0 spec/models/mail_handler_spec.rb
  51. +55 −6 spec/views/users/edit.html.erb_spec.rb
  52. +1 −1 spec_legacy/unit/token_spec.rb
  53. +1 −1 vendored-plugins/openproject-announcements/lib/open_project/announcements/version.rb
  54. +1 −1 vendored-plugins/openproject-auth_plugins/lib/open_project/auth_plugins/version.rb
  55. +1 −1 vendored-plugins/openproject-backlogs/lib/open_project/backlogs/version.rb
  56. +2 −2 vendored-plugins/openproject-costs/frontend/app/work_packages/directives/cost-object-directive.js
  57. +6 −0 vendored-plugins/openproject-costs/lib/api/v3/budgets/budget_representer.rb
  58. +1 −1 vendored-plugins/openproject-costs/lib/open_project/costs/version.rb
  59. +1 −1 vendored-plugins/openproject-documents/lib/open_project/documents/version.rb
  60. +1 −1 vendored-plugins/openproject-github_integration/lib/open_project/github_integration/version.rb
  61. +1 −1 vendored-plugins/openproject-global_roles/lib/open_project/global_roles/version.rb
  62. +1 −1 vendored-plugins/openproject-help_link/lib/open_project/help_link/version.rb
  63. +111 −0 vendored-plugins/openproject-local_avatars/.travis.yml
  64. +7 −0 vendored-plugins/openproject-local_avatars/Gemfile.plugins
  65. +10 −17 ...d-plugins/openproject-local_avatars/lib/open_project/local_avatars/patches/avatar_helper_patch.rb
  66. +1 −1 vendored-plugins/openproject-local_avatars/lib/open_project/local_avatars/version.rb
  67. +3 −3 vendored-plugins/openproject-local_avatars/spec/helpers/avatar_helper_spec.rb
  68. +1 −1 vendored-plugins/openproject-local_avatars/spec/models/user_spec.rb
  69. +1 −1 vendored-plugins/openproject-meeting/lib/open_project/meeting/version.rb
  70. +1 −1 vendored-plugins/openproject-my_project_page/lib/open_project/my_project_page/version.rb
  71. +1 −1 vendored-plugins/openproject-openid_connect/lib/open_project/openid_connect/version.rb
  72. +1 −1 vendored-plugins/openproject-pdf_export/lib/open_project/pdf_export/version.rb
  73. +1 −1 vendored-plugins/openproject-reporting/lib/open_project/reporting/version.rb
  74. +1 −1 vendored-plugins/openproject-themes-dark/lib/open_project/themes/dark/version.rb
  75. +1 −1 vendored-plugins/openproject-webhooks/lib/open_project/webhooks/version.rb
  76. +1 −1 vendored-plugins/openproject-xls_export/lib/open_project/xls_export/version.rb
  77. +1 −1 vendored-plugins/reporting_engine/lib/reporting_engine/version.rb
View
@@ -63,10 +63,10 @@ GIT
GIT
remote: https://github.com/opf/openproject-translations.git
- revision: 46bfcac8b31a745586c35e3feca3dccec4838842
+ revision: 7d1810e56cbf8b9476e4fa018d7b94fc8dab6026
branch: stable/5
specs:
- openproject-translations (5.0.13)
+ openproject-translations (5.0.14)
crowdin-api (~> 0.4.0)
mixlib-shellout (~> 2.1.0)
rails (~> 4.2.3)
@@ -98,78 +98,78 @@ GIT
PATH
remote: vendored-plugins/openproject-announcements
specs:
- openproject-announcements (5.0.13)
+ openproject-announcements (5.0.14)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-auth_plugins
specs:
- openproject-auth_plugins (5.0.13)
+ openproject-auth_plugins (5.0.14)
omniauth (~> 1.0)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-backlogs
specs:
- openproject-backlogs (5.0.13)
+ openproject-backlogs (5.0.14)
acts_as_silent_list (~> 2.0.0)
openproject-pdf_export
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-costs
specs:
- openproject-costs (5.0.13)
+ openproject-costs (5.0.14)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-documents
specs:
- openproject-documents (5.0.13)
+ openproject-documents (5.0.14)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-github_integration
specs:
- openproject-github_integration (5.0.13)
+ openproject-github_integration (5.0.14)
openproject-webhooks (~> 5.0.1)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-global_roles
specs:
- openproject-global_roles (5.0.13)
+ openproject-global_roles (5.0.14)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-help_link
specs:
- openproject-help_link (5.0.13)
+ openproject-help_link (5.0.14)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-local_avatars
specs:
- openproject-local_avatars (5.0.13)
+ openproject-local_avatars (5.0.14)
rails (~> 4.2.4)
rmagick (~> 2.15.4)
PATH
remote: vendored-plugins/openproject-meeting
specs:
- openproject-meeting (5.0.13)
+ openproject-meeting (5.0.14)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-my_project_page
specs:
- openproject-my_project_page (5.0.13)
+ openproject-my_project_page (5.0.14)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-openid_connect
specs:
- openproject-openid_connect (5.0.13)
+ openproject-openid_connect (5.0.14)
lobby_boy (~> 0.1)
omniauth-openid_connect-providers (~> 0.1)
openproject-auth_plugins (~> 5.0.1)
@@ -178,41 +178,41 @@ PATH
PATH
remote: vendored-plugins/openproject-pdf_export
specs:
- openproject-pdf_export (5.0.13)
+ openproject-pdf_export (5.0.14)
prawn (~> 0.14.0)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-reporting
specs:
- openproject-reporting (5.0.13)
+ openproject-reporting (5.0.14)
openproject-costs (>= 5.0.1)
rails (~> 4.2.4)
reporting_engine (>= 1.1.0)
PATH
remote: vendored-plugins/openproject-themes-dark
specs:
- openproject-themes-dark (5.0.13)
+ openproject-themes-dark (5.0.14)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-webhooks
specs:
- openproject-webhooks (5.0.13)
+ openproject-webhooks (5.0.14)
rails (~> 4.2.4)
PATH
remote: vendored-plugins/openproject-xls_export
specs:
- openproject-xls_export (5.0.13)
+ openproject-xls_export (5.0.14)
rails (~> 4.2.4)
spreadsheet (~> 0.8.9)
PATH
remote: vendored-plugins/reporting_engine
specs:
- reporting_engine (5.0.13)
+ reporting_engine (5.0.14)
json
rails (~> 4.2.4)
@@ -719,7 +719,7 @@ GEM
uber (0.0.13)
unf (0.1.4)
unf_ext
- unf_ext (0.0.7.1)
+ unf_ext (0.0.7.2)
unicorn (4.9.0)
kgio (~> 2.6)
rack
@@ -27,6 +27,8 @@
//++
.news
+ margin-bottom: 3rem
+
&.box > p
margin-top: -15px
@@ -37,14 +39,12 @@
.additional-information
font-size: 11px
-h4.overview
- margin-bottom: 0
- border: 0
+ .news--comment
+ font-size: 11px
.summary
font-style: italic
+ font-size: 1rem
p.author
font-style: italic
- /* to accomodate the .profile-wrap class
- height: 42px
@@ -114,7 +114,7 @@
a:hover
text-decoration: none
.action-icon
- color: $main-menu-font-color
+ color: $content-icon-link-color
&::before
padding: 0 0 0 0.3em
@@ -27,7 +27,17 @@
#++
module UserInvitation
- EVENT_NAME = 'user_invited'
+ module Events
+ class << self
+ def user_invited
+ 'user_invited'
+ end
+
+ def user_reinvited
+ 'user_reinvited'
+ end
+ end
+ end
module_function
@@ -62,6 +72,23 @@ def invite_new_user(email:, login: nil, first_name: nil, last_name: nil)
end
##
+ # Sends a new invitation to the user with a new token.
+ #
+ # @param user_id [Integer] ID of the user to be re-invited.
+ # @return [Token] The new token used for the invitation.
+ def reinvite_user(user_id)
+ clear_tokens user_id
+
+ Token.create(user_id: user_id, action: token_action).tap do |token|
+ OpenProject::Notifications.send Events.user_reinvited, token
+ end
+ end
+
+ def clear_tokens(user_id)
+ Token.where(user_id: user_id, action: token_action).destroy_all
+ end
+
+ ##
# Creates a placeholder name for the user based on their email address.
# For the unlikely case that the local or domain part of the email address
# are longer than 30 characters they will be trimmed to 27 characters and an
@@ -91,7 +118,7 @@ def invite_user!(user)
user, token = user_invitation user
if token
- OpenProject::Notifications.send(EVENT_NAME, token)
+ OpenProject::Notifications.send(Events.user_invited, token)
user
end
@@ -39,7 +39,8 @@ class UsersController < ApplicationController
:edit_membership,
:destroy_membership,
:destroy,
- :deletion_info]
+ :deletion_info,
+ :resend_invitation]
before_filter :require_login, only: [:deletion_info] # should also contain destroy but post data can not be redirected
before_filter :authorize_for_user, only: [:destroy]
before_filter :check_if_deletion_allowed, only: [:deletion_info,
@@ -267,6 +268,19 @@ def edit_membership
end
end
+ def resend_invitation
+ token = UserInvitation.reinvite_user @user.id
+
+ if token.persisted?
+ flash[:notice] = I18n.t(:notice_user_invitation_resent, email: @user.mail)
+ else
+ logger.error "could not re-invite #{@user.mail}: #{token.errors.full_messages.join(' ')}"
+ flash[:error] = I18n.t(:notice_internal_server_error, app_title: Setting.app_title)
+ end
+
+ redirect_to edit_user_path(@user)
+ end
+
def destroy
# true if the user deletes him/herself
self_delete = (@user == User.current)
@@ -222,27 +222,29 @@ def render_tabs(tabs)
end
end
- def project_tree_options_for_select(projects, options = {}, &_block)
- Project.project_level_list(projects).map { |element|
+ def project_tree_options_for_select(projects, selected: nil, disabled: {}, &_block)
+ options = ''.html_safe
+ Project.project_level_list(projects).each do |element|
+ identifier = element[:project].id
tag_options = {
- value: h(element[:project].id),
+ value: h(identifier),
title: h(element[:project].name),
}
- if options[:selected] == element[:project] ||
- (options[:selected].respond_to?(:include?) &&
- options[:selected].include?(element[:project]))
-
- tag_options[:selected] = 'selected'
+ if !selected.nil? && selected.id == identifier
+ tag_options[:selected] = true
end
- level_prefix = ''
- level_prefix = ('&nbsp;' * 3 * element[:level] + '&#187; ').html_safe if element[:level] > 0
+ tag_options[:disabled] = true if disabled.include? identifier
+
+ content = ''.html_safe
+ content << ('&nbsp;' * 3 * element[:level] + '&#187; ').html_safe if element[:level] > 0
+ content << element[:project].name
- tag_options.merge!(yield(element[:project])) if block_given?
+ options << content_tag('option', content, tag_options)
+ end
- content_tag('option', level_prefix + h(element[:project].name), tag_options)
- }.join('').html_safe
+ options
end
# Yields the given block for each project with its level in the tree
@@ -126,12 +126,11 @@ def change_user_status_links(user)
end
# Options for the new membership projects combo-box
+ #
+ # Disables projects the user is already member in
def options_for_membership_project_select(user, projects)
- options = content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---")
- options << project_tree_options_for_select(projects) { |p|
- { disabled: (user.projects.include?(p)) }
- }
- options
+ options = project_tree_options_for_select(projects, disabled: user.projects.ids.to_set)
+ content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---") + options
end
def user_mail_notification_options(user)
Oops, something went wrong.

0 comments on commit a1a10a8

Please sign in to comment.