Skip to content

Commit

Permalink
Release OpenProject 13.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Sep 7, 2023
2 parents 512f811 + a16bc33 commit 28e6085
Show file tree
Hide file tree
Showing 1,295 changed files with 6,798 additions and 2,455 deletions.
2 changes: 1 addition & 1 deletion app/controllers/messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def show

@replies = @topic
.children
.includes(:author, :attachments, forum: :project)
.includes(:author, :attachments, :project, forum: :project)
.order(created_at: :asc)
.page(@offset)
.per_page(per_page_param)
Expand Down
8 changes: 5 additions & 3 deletions app/controllers/oauth_clients_controller.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
Expand Down Expand Up @@ -61,7 +63,7 @@ def callback
redirect_user_or_admin(@redirect_uri) do
# If the current user is an admin, we send her directly to the
# settings that she needs to edit.
redirect_to admin_settings_storage_path(@oauth_client.integration)
redirect_to edit_admin_settings_storage_path(@oauth_client.integration)
end
end
end
Expand Down Expand Up @@ -96,7 +98,7 @@ def set_code
redirect_user_or_admin(get_redirect_uri) do
# If the current user is an admin, we send her directly to the
# settings that she needs to edit/fix.
redirect_to admin_settings_storage_path(@oauth_client.integration)
redirect_to edit_admin_settings_storage_path(@oauth_client.integration)
end
end
end
Expand All @@ -118,7 +120,7 @@ def set_redirect_uri

redirect_user_or_admin(nil) do
# Guide the user to the settings that she needs to edit/fix.
redirect_to admin_settings_storage_path(@oauth_client.integration)
redirect_to edit_admin_settings_storage_path(@oauth_client.integration)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wiki_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def editable?(page = @page)
end

def default_breadcrumb
Wiki.name.humanize
Wiki.model_name.human
end

def show_local_breadcrumb
Expand Down
26 changes: 18 additions & 8 deletions app/helpers/no_results_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
Expand Down Expand Up @@ -36,26 +38,34 @@ module NoResultsHelper
# - 'action_url' The url for the link in the content.
# - 'display_action' Whether or not the link should be displayed.
# - 'custom_title' custom text for the title.
# - 'custom_action_text' custom text for the title.
# - 'custom_action_text' custom text for the action.
#
# Calling this on its on without any arguments creates the box in its simplest
# form with only the title. Providing an action_url and display_action: true
# Displays the box with the title and link to the passed in url.
# The title and action_text are found using the locales key lookup unless
# The title_text and action_text are found using the locales key lookup unless
# custom_title and custom_action_text are provided.
#
# In the case of action_text, lookup is also only performed if display_action
# is true, in order not to perform unnecessary lookups when action_text
# shouldn't even be considered.
def no_results_box(action_url: nil,
display_action: false,
custom_title: nil,
custom_action_text: nil)

title = custom_title || t('.no_results_title_text', cascade: true)
action_text = custom_action_text || t('.no_results_content_text')
title_text = custom_title || t('.no_results_title_text', cascade: true) || ''
action_text = if display_action
custom_action_text || t('.no_results_content_text')
else
''
end
action_url = action_url || ''

render partial: '/common/no_results',
locals: {
title_text: title,
action_text: display_action ? action_text : '',
action_url: action_url || ''
title_text:,
action_text:,
action_url:
}
end
end
2 changes: 1 addition & 1 deletion app/services/authentication/omniauth_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def find_existing_user
def remap_existing_user
return unless Setting.oauth_allow_remapping_of_existing_users?

User.not_builtin.find_by(login: user_attributes[:login])
User.not_builtin.find_by_login(user_attributes[:login]) # rubocop:disable Rails/DynamicFindBy
end

##
Expand Down
8 changes: 8 additions & 0 deletions app/services/users/change_password_service.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2023 the OpenProject GmbH
Expand Down Expand Up @@ -40,9 +42,11 @@ def call(params)
current_user.password = params[:new_password]
current_user.password_confirmation = params[:new_password_confirmation]
current_user.force_password_change = false
current_user.activate if current_user.invited?

if current_user.save
invalidate_recovery_tokens
invalidate_invitation_tokens

log_success
::ServiceResult.new success: true,
Expand All @@ -64,6 +68,10 @@ def invalidate_recovery_tokens
Token::Recovery.where(user: current_user).delete_all
end

def invalidate_invitation_tokens
Token::Invitation.where(user: current_user).delete_all
end

def invalidate_session_result
update_message = I18n.t(:notice_account_password_updated)

Expand Down
9 changes: 4 additions & 5 deletions app/views/admin/plugins.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,21 @@ See COPYRIGHT and LICENSE files for more details.
<% @plugins.each do |plugin| %>
<tr>
<td><span class="name"><%=h plugin.name %></span>
<%= content_tag('span', h(plugin.description), class: 'description') unless plugin.description.blank? %>
<%= content_tag('span', link_to(h(plugin.url), plugin.url), class: 'url') unless plugin.url.blank? %>
<%= content_tag('span', plugin.description, class: 'description') if plugin.description.present? %>
<%= content_tag('span', link_to(plugin.url, plugin.url), class: 'url') if plugin.url.present? %>
</td>
<td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td>
<td class="author"><%= plugin.author_url.blank? ? plugin.author : link_to(plugin.author, plugin.author_url) %></td>
<td class="version">
<% if plugin.bundled %>
<%= t(:label_bundled) %>
<% else %>
<%= h plugin.version %>
<%= plugin.version %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>

</div>
</div>
<% else %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/forums/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
<%= toolbar title: Forum.name.humanize %>
<%= toolbar title: Forum.model_name.human %>

<%= labelled_tabular_form_for [@project, @forum] do |f| %>
<%= render partial: 'form', locals: { f: f } %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/forums/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ See COPYRIGHT and LICENSE files for more details.
<div class="generic-table--sort-header-outer">
<div class="generic-table--sort-header">
<span>
<%= Forum.name.humanize %>
<%= Forum.model_name.human %>
</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/messages/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
<% if !replying && !@message.new_record? && User.current.allowed_to?(:edit_messages, @project) %>
<div class="form--field">
<%= f.select :forum_id, @project.forums.collect {|b| [b.name, b.id]}, label: Forum.name.humanize, container_class: '-wide' %>
<%= f.select :forum_id, @project.forums.collect {|b| [b.name, b.id]}, label: Forum.model_name.human, container_class: '-wide' %>
</div>
<% end %>

Expand Down
6 changes: 4 additions & 2 deletions app/views/messages/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ See COPYRIGHT and LICENSE files for more details.
<div class="wiki op-uc-container">
<%= format_text message, :content, attachments: message.attachments %>
</div>
<% resource = message_attachment_representer(message) %>
<%= list_attachments(resource) %>
<% if message.attachments.any? %>
<% resource = message_attachment_representer(message) %>
<%= list_attachments(resource) %>
<% end %>
</div>
<% end %>
<%= pagination_links_full @replies, per_page_links: false %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/oauth/applications/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ See COPYRIGHT and LICENSE files for more details.
</p>

<div class="form--field -visible-overflow">
<label class="form--label"> <%= t('doorkeeper.application.client_credentials_user_id') %>
<label class="form--label"> <%= t('activerecord.attributes.doorkeeper/application.client_credentials_user_id') %>
</label>
<div class="form--field-container">
<div class="form--text-field-container -middle">
Expand Down
93 changes: 49 additions & 44 deletions app/views/repositories/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ See COPYRIGHT and LICENSE files for more details.
</div>

<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render partial: 'dir_list' %>
<%= render partial: 'dir_list' %>
<% end %>

<%= render_properties(@properties) %>
Expand All @@ -50,8 +50,11 @@ See COPYRIGHT and LICENSE files for more details.
},
method: :get,
id: 'revision_selector',
class: 'form -vertical'
) do %>
class: 'form -vertical',
data: {
'repository-navigation-target': 'form',
}
) do %>
<li class="toolbar-item toolbar-input-group hidden-for-mobile">
<div>
<%= label_tag 'rev', I18n.t('repositories.go_to_revision') %>
Expand All @@ -66,34 +69,36 @@ See COPYRIGHT and LICENSE files for more details.
} %>
</li>
<% if !@repository.branches.nil? && @repository.branches.length > 0 %>
<li class="toolbar-item toolbar-input-group hidden-for-mobile">
<div>
<%= label_tag 'branch', I18n.t(:label_branch) %>
</div>
<%= select_tag :branch,
options_for_select(@repository.branches, @rev),
include_blank: "--- #{t(:actionview_instancetag_blank_option)} ---",
id: 'revision-branch-select',
data: {
'repository-navigation-target': 'branch'
}
%>
</li>
<li class="toolbar-item toolbar-input-group hidden-for-mobile">
<div>
<%= label_tag 'branch', I18n.t(:label_branch) %>
</div>
<%= select_tag :branch,
options_for_select(@repository.branches, @rev),
include_blank: "--- #{t(:actionview_instancetag_blank_option)} ---",
id: 'revision-branch-select',
data: {
'repository-navigation-target': 'branch',
action: 'repository-navigation#applyValue'
}
%>
</li>
<% end %>
<% if !@repository.tags.nil? && @repository.tags.length > 0 %>
<li class="toolbar-item toolbar-input-group hidden-for-mobile">
<div>
<%= label_tag 'tag', I18n.t(:label_tag) %>
</div>
<%= select_tag :tag,
options_for_select(@repository.tags, @rev),
include_blank: "--- #{t(:actionview_instancetag_blank_option)} ---",
id: 'revision-tag-select',
data: {
'repository-navigation-target': 'tag'
}
%>
</li>
<li class="toolbar-item toolbar-input-group hidden-for-mobile">
<div>
<%= label_tag 'tag', I18n.t(:label_tag) %>
</div>
<%= select_tag :tag,
options_for_select(@repository.tags, @rev),
include_blank: "--- #{t(:actionview_instancetag_blank_option)} ---",
id: 'revision-tag-select',
data: {
'repository-navigation-target': 'tag',
action: 'repository-navigation#applyValue'
}
%>
</li>
<% end %>
<li class="toolbar-item -icon-only">
<%= link_to({ url: { action: 'revision#revision-identifier-inputs', project_id: @project,
Expand All @@ -106,22 +111,22 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>

<% if authorize_for('repositories', 'revisions') %>
<% if @changesets && !@changesets.empty? %>
<%= render partial: 'revisions',
locals: {project: @project, path: @path,
revisions: @changesets, entry: nil }%>
<% end %>
<p>
<%
has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
sep = ''
%>
<% if @changesets && !@changesets.empty? %>
<%= render partial: 'revisions',
locals: { project: @project, path: @path,
revisions: @changesets, entry: nil } %>
<% end %>
<p>
<%
has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
sep = ''
%>

<% if @repository.supports_all_revisions? && @path.blank? %>
<%= link_to t(:label_view_all_revisions), revisions_project_repository_path(@project) %>
<% sep = '|' %>
<% end %>
</p>
<% if @repository.supports_all_revisions? && @path.blank? %>
<%= link_to t(:label_view_all_revisions), revisions_project_repository_path(@project) %>
<% sep = '|' %>
<% end %>
</p>
<% end %>

<% html_title(t(:label_repository)) -%>
2 changes: 1 addition & 1 deletion app/views/user_mailer/wiki_page_added.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>

<p>
<%=raw t(:mail_body_wiki_content_added,
<%=raw t(:mail_body_wiki_page_added,
id: link_to(@wiki_page.title, project_wiki_url(@wiki_page.project, @wiki_page)),
author: @wiki_page.author) %><br />
<em><%= @wiki_page.journals.last.notes %></em>
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/wiki_page_updated.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>

<p>
<%=raw t(:mail_body_wiki_content_updated,
<%=raw t(:mail_body_wiki_page_updated,
id: link_to(@wiki_page.title, project_wiki_url(@wiki_page.project, @wiki_page)),
author: @wiki_page.journals.last.user) %><br />
<em><%= @wiki_page.journals.last.notes %></em>
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
config.assets.debug = false

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
config.i18n.raise_on_missing_translations = true

config.cache_store = :file_store, Rails.root.join("tmp", "cache", "paralleltests#{ENV.fetch('TEST_ENV_NUMBER', nil)}")

Expand Down
1 change: 1 addition & 0 deletions config/initializers/menus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
# Work packages
menu.push :work_packages,
{ controller: '/work_packages', action: 'index' },
caption: :label_work_package_plural,
icon: 'view-timeline',
after: :activity

Expand Down
Loading

0 comments on commit 28e6085

Please sign in to comment.