Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/14.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed May 14, 2024
2 parents 509bdba + 5c9212c commit da5c8a4
Show file tree
Hide file tree
Showing 29 changed files with 412 additions and 150 deletions.
2 changes: 1 addition & 1 deletion app/components/queries/sort_by_field_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% flex.with_column(flex: 1) do %>
<%#- We are just using the classes of the primer component here, because when using the primer component, we cannot detach the input element from the form %>
<%#- The form="none" adds the input to a nonexistant form (as we do not have one with the ID="none" and thus the fields to not get appended to the query string %>
<%= select_tag 'sort_field', select_options, include_blank: true, form: "none", class: "FormControl-select FormControl-medium FormControl--fullWidth", data: { action: "change->sort-by-config#fieldChanged"} %>
<%= select_tag 'sort_field', select_options, prompt: "-", form: "none", class: "FormControl-select FormControl-medium FormControl--fullWidth", data: { action: "change->sort-by-config#fieldChanged"} %>
<% end %>
<% flex.with_column do %>
<%= render(Primer::Alpha::SegmentedControl.new("aria-label": "Sort order", hide_labels: true, ml: 3)) do |sort_buttons| %>
Expand Down
1 change: 1 addition & 0 deletions app/controllers/work_packages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class WorkPackagesController < ApplicationController
before_action :authorize_on_work_package,
:project, only: :show
before_action :find_optional_project,
:check_allowed_export,
:protect_from_unauthorized_export, only: :index

before_action :load_and_validate_query, only: :index, unless: -> { request.format.html? }
Expand Down
6 changes: 6 additions & 0 deletions app/helpers/work_packages_controller_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ def protect_from_unauthorized_export
end
end

def check_allowed_export
return unless params[:format] == "pdf" && params[:gantt] == "true"

render_403 unless EnterpriseToken.allows_to?(:gantt_pdf_export)
end

def user_allowed_to_export?
User.current.allowed_in_any_work_package?(:export_work_packages, in_project: @project)
end
Expand Down
2 changes: 2 additions & 0 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def default_formats_for_setting(format)

##
# Overwrite mailer method to prevent sending mails to locked users.
# Usually this would accept a string for the `to:` argument, but
# we always require an actual user object since fed95796.
def mail(headers = {}, &block)
block ||= method(:default_formats_for_setting)
to = headers[:to]
Expand Down
16 changes: 13 additions & 3 deletions app/models/queries/projects/orders/custom_field_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,27 @@
class Queries::Projects::Orders::CustomFieldOrder < Queries::Orders::Base
self.model = Project.all

EXCLUDED_CUSTOM_FIELD_TYPES = %w(text)
KEY_FORMAT = /cf_(\d+)/

validates :custom_field, presence: { message: I18n.t(:"activerecord.errors.messages.does_not_exist") }

def self.key
/cf_(\d+)/
valid_ids = RequestStore.fetch(:custom_sortable_project_custom_fields) do
ProjectCustomField.where.not(field_format: EXCLUDED_CUSTOM_FIELD_TYPES).visible.pluck(:id).join("|")
end

/cf_(#{valid_ids})/
end

def custom_field
@custom_field ||= begin
id = self.class.key.match(attribute)[1]
id = KEY_FORMAT.match(attribute)[1]

ProjectCustomField.visible.find_by_id(id)
ProjectCustomField
.where.not(field_format: EXCLUDED_CUSTOM_FIELD_TYPES)
.visible
.find_by(id:)
end
end

Expand Down
39 changes: 31 additions & 8 deletions app/models/work_package/pdf_export/gantt/gantt_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -511,20 +511,45 @@ def build_multi_page_dep_line_forward_end(source, target)
)
end

# Builds the dependency line between two work packages on different horizontal and vertical pages
# Builds the dependency line between two work packages on different vertical (and maybe horizontal) pages
# @param [GanttDataLineInfo] source
# @param [GanttDataLineInfo] target
# @param [Array<GanttDataPageGroup>] page_groups
def build_multi_group_dep_line(source, target, page_groups)
start_page_index = source.page_group.pages.index(source.finish_row.page)
finish_page_index = target.page_group.pages.index(target.start_row.page)
if start_page_index > finish_page_index
if start_page_index == finish_page_index
build_multi_group_same_page_dep_line(source, target, start_page_index, page_groups)
elsif start_page_index > finish_page_index
build_multi_group_dep_line_backward(source, target, start_page_index, finish_page_index, page_groups)
else
build_multi_group_dep_line_forward(source, target, start_page_index, finish_page_index, page_groups)
end
end

# Builds the dependency line between two work packages on different vertical but not horizontal pages
# @param [GanttDataLineInfo] source
# @param [GanttDataLineInfo] target
# @param [Integer] page_index
# @param [Array<GanttDataPageGroup>] page_groups
def build_multi_group_same_page_dep_line(source, target, page_index, page_groups)
build_multi_group_same_page_dep_lines_forward_start(source, target)
build_multi_group_dep_line_middle(source, target, page_index, page_groups)
build_multi_group_dep_line_group_end_end(target, target.start_left - LINE_STEP)
end

# Builds the dependency line between two work packages on different vertical but not horizontal pages (start)
# @param [GanttDataLineInfo] source
# @param [GanttDataLineInfo] target
def build_multi_group_same_page_dep_lines_forward_start(source, target)
source_top = source.finish_top
target_left = target.start_left - LINE_STEP
source.finish_row.page.add_lines([
[source.finish_left, target_left, source_top, source_top],
[target_left, target_left, source_top, source.finish_row.page.height]
])
end

# Builds the dependency line between two work packages on different horizontal and vertical pages
# and the source work package page is before the target work package page
# @param [GanttDataLineInfo] source
Expand Down Expand Up @@ -596,13 +621,13 @@ def build_multi_group_dep_line_group_end_end(target, target_left)
# draw line between the source and target work package pages
# @param [GanttDataLineInfo] source
# @param [GanttDataLineInfo] target
def build_multi_group_dep_line_middle(source, target, finish_page_index, page_groups)
def build_multi_group_dep_line_middle(source, target, page_index, page_groups)
start_group_index = page_groups.index(source.finish_row.page.group)
finish_group_index = page_groups.index(target.start_row.page.group)
start = [start_group_index, finish_group_index].min
finish = [start_group_index, finish_group_index].max
((start + 1)..(finish - 1)).each do |index|
build_multi_group_dep_line_middle_for_group(page_groups[index], target, finish_page_index)
build_multi_group_dep_line_middle_for_group(page_groups[index], target, page_index)
end
end

Expand Down Expand Up @@ -702,9 +727,7 @@ def build_row_text_lines_wp_info(entry, left, right, top)
# @param [WorkPackage] work_package
# @return [String]
def work_package_info_line(work_package)
level_path = @id_wp_meta_map[work_package.id][:level_path]
level_string = "#{level_path.join('.')}."
"#{level_string} #{work_package.type} ##{work_package.id}"
"#{work_package.type} ##{work_package.id}"
end

# Builds the shape for the given work package
Expand Down Expand Up @@ -822,7 +845,7 @@ def collect_rows_by_work_package(work_package, page_groups)
# @param [WorkPackage] work_package
# @return [String] hexcode_in_prawn_format
def wp_type_color(work_package)
work_package.type.color.hexcode.sub("#", "")
work_package.type&.color&.hexcode&.sub("#", "") || "000000"
end

# get the dates of the work package with safety checks
Expand Down
2 changes: 1 addition & 1 deletion app/models/work_package/pdf_export/standard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
page:
page_size: "EXECUTIVE"
page_size: "A4"
margin_top: 60
margin_bottom: 60
margin_left: 36
Expand Down
2 changes: 1 addition & 1 deletion app/models/work_package/pdf_export/style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def initialize(yml)
end

def page_size
@styles[:page_size] || "EXECUTIVE"
@styles[:page_size] || "A4"
end

def page_header_offset
Expand Down
1 change: 1 addition & 0 deletions app/services/authorization/enterprise_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Authorization::EnterpriseService
work_package_sharing
one_drive_sharepoint_file_storage
virus_scanning
gantt_pdf_export
).freeze

def initialize(token)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="warning-bar--item">
<p>
<strong><%= t('work_packages.sharing.missing_workflow_waring.title') %></strong><br>
<strong><%= t('work_packages.sharing.missing_workflow_warning.title') %></strong><br>

<%= t('work_packages.sharing.missing_workflow_waring.message') %>
<%= link_to t('work_packages.sharing.missing_workflow_waring.link_message'),
<%= t('work_packages.sharing.missing_workflow_warning.message') %>
<%= link_to t('work_packages.sharing.missing_workflow_warning.link_message'),
copy_workflows_path %>
</p>
</div>
28 changes: 3 additions & 25 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
project_roles: "Project roles"
wp_shares: "Work package shares"
groups: "Groups"
no_modify_on_shared: "You currently cannot modify or remove shared memberships through the member page. Use the sharing modal instead."
delete_member_dialog:
title: "Remove member"
will_remove_the_users_role: "This will remove the user’s role from this project."
Expand Down Expand Up @@ -555,7 +556,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
unsupported_for_multiple_projects: "Bulk move/copy is not supported for work packages from multiple projects"

sharing:
missing_workflow_waring:
missing_workflow_warning:
title: "Workflow missing for work package sharing"
message: "No workflow is configured for the 'Work package editor' role. Without a workflow, the shared with user cannot alter the status of the work package. Workflows can be copied. Select a source type (e.g. 'Task') and source role (e.g. 'Member'). Then select the target types. To start with, you could select all the types as targets. Finally, select the 'Work package editor' role as the target and press 'Copy'. After having thus created the defaults, fine tune the workflows as you do for every other role."
link_message: "Configure the workflows in the administration."
Expand Down Expand Up @@ -1849,29 +1850,6 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
mentioned: "You have been mentioned in %{work_package}"
responsible: "You have become accountable for %{work_package}"
watched: "You are watching %{work_package}"
update_info_mail:
body: >
We are excited to announce the release of OpenProject 12.0. It's a major release that will hopefully significantly improve the way you use OpenProject.
Starting with this release, we are introducing in-app notifications. From now on, you will receive notifications for updates to work packages directly in OpenProject. You can mark these notifications as read, reply to a comment or even directly modify work package attributes without leaving the notification center.
This also means that we will no longer be using emails for notifications. We think the new notification center is a better place to view and act upon these updates. Nevertheless, if you would like continue receiving updates via email, you can choose to receive daily email reminders at particular times of your choosing.
Please make sure to verify your new default notification settings, and set your preferences for notifications and email reminders via your account settings. You can do this through the “Change email settings” button bellow.
We hope you find in-app notifications useful and that they makes you even more productive.
Sincerely,
The OpenProject team
body_header: "Version 12.0 with Notification Center"
body_subheader: "News"
subject: "Important changes to notifications with the release of 12.0"

label_accessibility: "Accessibility"
label_account: "Account"
Expand Down Expand Up @@ -2906,7 +2884,7 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
member_of_group: "Assignee's group"
name_or_identifier: "Name or identifier"
only_subproject_id: "Only subproject"
shared_with_user: "Shared with user"
shared_with_user: "Shared with users"
shared_with_me: "Shared with me"
subproject_id: "Including subproject"

Expand Down
2 changes: 1 addition & 1 deletion config/locales/js-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ en:
sharing:
share: "Share"
title: "Share work package"
show_all_users: "Show all shared users"
show_all_users: "Show all users with whom the work package has been shared with"
selected_count: "%{count} selected"
selection:
mixed: "Mixed"
Expand Down
2 changes: 0 additions & 2 deletions docs/installation-and-operations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ This page summarizes the options for getting OpenProject, some hosted and some o

* **Enterprise Enterprise cloud edition** - Hosted by OpenProject in an EU Data Center, with Enterprise add-ons and professional support . See more on the [website](https://www.openproject.org/enterprise-edition/#hosting-options), where you can apply for a free trial, or in the [documentation](../enterprise-guide/enterprise-cloud-guide/).

* **Univention App Center** - Download the free Community edition as a pre-installed virtual environment and upgrade to the Enterprise edition with Enterprise add-ons and support. See the [documentation](installation/univention/) for details.

All editions can be enhanced by adding [the BIM module](../bim-guide/), including features for construction project management, i.e. 3D model viewer, BCF management. See how to [switch to that edition](bim-edition/) in the documentation or how to start a [BIM Enterprise cloud edition](https://start.openproject.com/trial/bim).

Compare the features of these versions [on the website](https://www.openproject.org/pricing/#features).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ on different platforms which use either the docker container or the package:

There are additional methods on installing OpenProject, which we will link below for reference. Please note that we do not officially support these methods, and cannot guarantee their stability or correctness.

* [Installing OpenProject with Univention App Center](../univention)
* [Custom package for OpenSuse by Matthew Trescott](https://en.opensuse.org/User:Matthewtrescott/OpenProject)
* [Instructions for installing OpenProject on Raspian Buster using a Raspberry Pi 4 by Wolfgang Schmied](https://github.com/madewhatnow/OpenProjectRaspberryPi)
27 changes: 0 additions & 27 deletions docs/installation-and-operations/installation/univention/README.md

This file was deleted.

This file was deleted.

0 comments on commit da5c8a4

Please sign in to comment.