Skip to content

Commit

Permalink
Merge branch 'release/14.5' into task/56638-145-documentation-enable-…
Browse files Browse the repository at this point in the history
…a-storage-for-multiple-projects-at-on
  • Loading branch information
MayaBerd authored Sep 9, 2024
2 parents 082bb38 + 81d4d25 commit 3f18267
Show file tree
Hide file tree
Showing 306 changed files with 2,480 additions and 1,810 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ GEM
minitest (5.25.1)
msgpack (1.7.2)
multi_json (1.15.0)
mustermann (3.0.2)
mustermann (3.0.3)
ruby2_keywords (~> 0.0.1)
mustermann-grape (1.1.0)
mustermann (>= 1.0.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
selected: selected_columns,
protected: helpers.protected_projects_columns_options,
name: COLUMN_HTML_NAME,
id: 'columns-select',
id: COLUMN_HTML_ID,
dragAreaName: "#{COLUMN_HTML_ID}_dragarea",
formControlId: "#{COLUMN_HTML_ID}_autocompleter",
inputLabel: I18n.t(:'queries.configure_view.columns.input_label'),
inputPlaceholder: I18n.t(:'queries.configure_view.columns.input_placeholder'),
dragAreaLabel: I18n.t(:'queries.configure_view.columns.drag_area_label'),
Expand Down
1 change: 1 addition & 0 deletions app/components/projects/configure_view_modal_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Projects::ConfigureViewModalComponent < ApplicationComponent
MODAL_ID = "op-project-list-configure-dialog"
QUERY_FORM_ID = "op-project-list-configure-query-form"
COLUMN_HTML_NAME = "columns"
COLUMN_HTML_ID = "columns-select"

options :query

Expand Down
2 changes: 1 addition & 1 deletion app/components/projects/row_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def name
end

content << " "
content << helpers.link_to_project(project, {}, {}, false)
content << helpers.link_to_project(project, {}, { data: { turbo: false } }, false)
content
end

Expand Down

This file was deleted.

39 changes: 36 additions & 3 deletions app/components/work_packages/details/tab_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
<%=
flex_layout(classes: "op-work-package-details-tab-component") do |flex|
flex_layout(classes: "op-work-package-details-tab-component", data: {
"application-target": "dynamic",
controller: "work-packages--details--tabs"
}) do |flex|
flex.with_column(classes: "op-work-package-details-tab-component--action") do
render(Primer::Beta::IconButton.new(icon: :"chevron-left",
tag: :a,
scheme: :invisible,
data: {
action: "click->work-packages--details--tabs#scrollLeft"
},
aria: { label: I18n.t(:label_scroll_left) }))
end


flex.with_column(flex: 1, classes: "op-work-package-details-tab-component--tabs", test_selector: "wp-details-tab-component--tabs") do
render(Primer::Alpha::UnderlineNav.new(align: :left, label: "Tabs", classes: "op-primer-adjustment--UnderlineNav_spaciousLeft")) do |component|
render(Primer::Alpha::UnderlineNav.new(align: :left,
label: "Tabs",
data: {
"work-packages--details--tabs-target": "underlineNav",
})) do |component|
menu_items.each do |node|
component.with_tab(selected: @tab == node.name,
href: helpers.url_for_with_params(**node.url),
test_selector: "wp-details-tab-component--tab-#{node.name}",
data: { turbo: true, turbo_stream: true, turbo_action: "replace" }
data: {
turbo: true,
turbo_stream: true,
turbo_action: "replace",
"work-packages--details--tabs-target": @tab == node.name ? "activeElement" : ""
}
) do |c|
c.with_text { t("js.work_packages.tabs.#{node.name}") }
count = node.badge(work_package:).to_i
Expand All @@ -16,6 +39,16 @@
end
end

flex.with_column(classes: "op-work-package-details-tab-component--action") do
render(Primer::Beta::IconButton.new(icon: :"chevron-right",
tag: :a,
scheme: :invisible,
data: {
action: "click->work-packages--details--tabs#scrollRight"
},
aria: { label: I18n.t(:label_scroll_right) }))
end

flex.with_column(classes: "op-work-package-details-tab-component--action") do
render(Primer::Beta::IconButton.new(icon: :"screen-full",
tag: :a,
Expand Down
3 changes: 3 additions & 0 deletions app/components/work_packages/details/tab_component.sass
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@

&:last-of-type
padding-right: 10px

&:first-of-type
padding-left: 5px
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<%= render WorkPackages::Exports::ColumnSelectionComponent.new(
query,
"columns-select-export-csv",
I18n.t("export.dialog.columns.input_caption_table")
) %>
<%= flex_layout do |container| %>
<%= container.with_row do |_columns| %>
<%= render WorkPackages::Exports::ColumnSelectionComponent.new(
query,
"columns-select-export-csv",
I18n.t("export.dialog.columns.input_caption_table")
) %>
<% end %>
<%= container.with_row do |_csv_include_description| %>
<%= render OpenProject::Common::DividerComponent.new %>
<%= render(Primer::Alpha::CheckBox.new(
id: "show_descriptions_csv",
name: "show_descriptions",
value: "true",
unchecked_value: "false",
label: I18n.t("export.dialog.xls.include_descriptions.label"),
caption: I18n.t("export.dialog.xls.include_descriptions.caption"),
visually_hide_label: false)) %>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class ModalDialogComponent < ApplicationComponent

attr_reader :query, :project, :query_params

def initialize(query:, project:)
def initialize(query:, project:, title:)
super

@query = query
@project = project
@query_params = ::API::V3::Queries::QueryParamsRepresenter.new(query).to_url_query(merge_params: { columns: [] })
@query_params = ::API::V3::Queries::QueryParamsRepresenter.new(query).to_url_query(merge_params: { columns: [], title: })
end

def export_format_url(format)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@
<% end %>
<%= container.with_row do |_xls_include_relations| %>
<%= render OpenProject::Common::DividerComponent.new(mt: 2) %>
<%= render(Primer::Alpha::CheckBox.new(name: "show_relations",
value: "true",
unchecked_value: "false",
label: I18n.t("export.dialog.xls.include_relations.label"),
caption: I18n.t("export.dialog.xls.include_relations.caption"),
visually_hide_label: false)) %>
<%= render(Primer::Alpha::CheckBox.new(
id: "show_relations_xls",
name: "show_relations",
value: "true",
unchecked_value: "false",
label: I18n.t("export.dialog.xls.include_relations.label"),
caption: I18n.t("export.dialog.xls.include_relations.caption"),
visually_hide_label: false)) %>
<% end %>
<%= container.with_row do |_xls_include_description| %>
<%= render OpenProject::Common::DividerComponent.new %>
<%= render(Primer::Alpha::CheckBox.new(name: "show_descriptions",
value: "true",
unchecked_value: "false",
label: I18n.t("export.dialog.xls.include_descriptions.label"),
caption: I18n.t("export.dialog.xls.include_descriptions.caption"),
visually_hide_label: false)) %>
<%= render(Primer::Alpha::CheckBox.new(
id: "show_descriptions_xls",
name: "show_descriptions",
value: "true",
unchecked_value: "false",
label: I18n.t("export.dialog.xls.include_descriptions.label"),
caption: I18n.t("export.dialog.xls.include_descriptions.caption"),
visually_hide_label: false)) %>
<% end %>
<% end %>
4 changes: 4 additions & 0 deletions app/components/work_packages/split_view_component.sass
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
@media screen and (max-width: $breakpoint-lg)
// Unfortunately, we have to enforce this style via !important as the resizer writes the width directly on the element as inline style
min-width: unset !important

@media screen and (max-width: $breakpoint-sm)
.work-packages--details-toolbar-container
@include hide-button-texts
2 changes: 1 addition & 1 deletion app/controllers/work_packages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def show
end

def export_dialog
respond_with_dialog WorkPackages::Exports::ModalDialogComponent.new(query: @query, project: @project)
respond_with_dialog WorkPackages::Exports::ModalDialogComponent.new(query: @query, project: @project, title: params[:title])
end

protected
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/sharing_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def shared_work_package(sharer, membership, group = nil)
@role_rights = derive_role_rights(role)
@allowed_work_package_actions = derive_allowed_work_package_actions(role)
@url = optionally_activated_url(work_package_url(@work_package.id), @invitation_token)
@notification_url = optionally_activated_url(details_notifications_url(@work_package.id), @invitation_token)
@notification_url = optionally_activated_url(details_notifications_url(@work_package.id, tab: :activity), @invitation_token)

set_open_project_headers(@work_package)
message_id(membership, sharer)
Expand Down
8 changes: 8 additions & 0 deletions app/models/work_package/exports/csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,19 @@ def title
end

def csv_headers
return super unless with_descriptions

super + [WorkPackage.human_attribute_name(:description)]
end

def with_descriptions
ActiveModel::Type::Boolean.new.cast(options[:show_descriptions])
end

# fetch all row values
def csv_row(work_package)
return super unless with_descriptions

super.tap do |row|
if row.any?
row << if work_package.description
Expand Down
5 changes: 4 additions & 1 deletion app/views/layouts/only_logo.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ See COPYRIGHT and LICENSE files for more details.
<head>
<%= render partial: 'layouts/common_head' %>
</head>
<body>
<body
class="<%= body_css_classes %>"
<%= user_theme_data_attributes %>
>
<div id="wrapper">
<header class="op-app-header<%= ' op-app-header_development' if OpenProject::Configuration.development_highlight_enabled? %>">
<div class="op-app-header--center op-logo">
Expand Down
4 changes: 2 additions & 2 deletions app/views/mailer/_notification_row.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a style="text-decoration: none;display: block;"
href="<%= local_assigns[:notification_url] || details_notifications_url(work_package.id) %>"
href="<%= local_assigns[:notification_url] || details_notifications_url(work_package.id, tab: :activity) %>"
target="_blank">
<%= render layout: 'mailer/border_table' do %>
<tr>
Expand Down Expand Up @@ -104,7 +104,7 @@
</table>

<a style="margin-left: 12px;"
href="<%= defined?(open_in_browser_path) ? open_in_browser_path : details_notifications_url(work_package.id) %>"
href="<%= defined?(open_in_browser_path) ? open_in_browser_path : details_notifications_url(work_package.id, tab: :activity) %>"
target="_blank"
rel="noopener noreferrer">
<%= I18n.t('mail.work_packages.open_in_browser') %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/work_package_mailer/mentioned.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= render partial: 'mailer/mailer_header',
locals: {
summary: I18n.t(:'mail.work_packages.mentioned_by', user: @journal.user),
button_href: details_notifications_url(@work_package.id),
button_href: details_notifications_url(@work_package.id, tab: :activity),
button_text: I18n.t(:'mail.notification.see_in_center'),
user: @user,
} %>
Expand Down
29 changes: 13 additions & 16 deletions app/workers/rake_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
require "rake"

##
# Invoke a rake task while safely loading the tasks only once
# Invoke a rake task while loading the tasks on demand
# to ensure they are only loaded once.
module RakeJob
attr_reader :task_name, :args
Expand All @@ -44,29 +44,26 @@ def perform(task_name, *args)
protected

def invoke
load_tasks!
task.invoke *args
ensure
task&.reenable
if (task = load_task)
task.reenable
task.invoke *args
else
OpenProject.logger.error { "Rake task #{task_name} not found for background job." }
end
end

##
# Load tasks if there are none. This should only be run once in an environment
def load_tasks!
Rails.application.load_rake_tasks unless tasks_loaded?
end
# Load tasks if we don't find our task
def load_task
Rails.application.load_rake_tasks unless task_loaded?

##
# Reference to the task name.
# Will raise NameError or NoMethodError depending on what of rake is (not) loaded
def task
Rake::Task[task_name]
task_loaded? && Rake::Task[task_name]
end

##
# Returns whether any task is loaded
# Will raise NameError or NoMethodError depending on what of rake is (not) loaded
def tasks_loaded?
!Rake::Task.tasks.empty?
def task_loaded?
Rake::Task.task_defined?(task_name)
end
end
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ class Application < Rails::Application
# http://stackoverflow.com/questions/4590229
config.middleware.use Rack::TempfileReaper

# Move secure_headers middleware to after the ShowExceptions
config.middleware.move_after ActionDispatch::ShowExceptions, SecureHeaders::Middleware

# Add lookbook preview paths when enabled
if OpenProject::Configuration.lookbook_enabled?
config.paths.add Primer::ViewComponents::Engine.root.join("app/components").to_s, eager_load: true
Expand Down
2 changes: 2 additions & 0 deletions config/locales/crowdin/af.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2364,6 +2364,8 @@ af:
label_role_plural: "Rolle"
label_role_search: "Assign role to new members"
label_scm: "SCM"
label_scroll_left: "Scroll left"
label_scroll_right: "Scroll right"
label_search: "Search"
label_search_by_name: "Search by name"
label_send_information: "Send new credentials to the user"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/crowdin/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2504,6 +2504,8 @@ ar:
label_role_plural: "دور"
label_role_search: "تعيين دور للأعضاء الجدد"
label_scm: "اختصاراً لِ:\"Supply Chain Management\" إدارة سلسة الإمداد"
label_scroll_left: "Scroll left"
label_scroll_right: "Scroll right"
label_search: "البحث"
label_search_by_name: "Search by name"
label_send_information: "Send new credentials to the user"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/crowdin/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2364,6 +2364,8 @@ az:
label_role_plural: "Roles"
label_role_search: "Assign role to new members"
label_scm: "SCM"
label_scroll_left: "Scroll left"
label_scroll_right: "Scroll right"
label_search: "Search"
label_search_by_name: "Search by name"
label_send_information: "Send new credentials to the user"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/crowdin/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2434,6 +2434,8 @@ be:
label_role_plural: "Roles"
label_role_search: "Assign role to new members"
label_scm: "SCM"
label_scroll_left: "Scroll left"
label_scroll_right: "Scroll right"
label_search: "Search"
label_search_by_name: "Search by name"
label_send_information: "Send new credentials to the user"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/crowdin/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2364,6 +2364,8 @@ bg:
label_role_plural: "Роли"
label_role_search: "Assign role to new members"
label_scm: "SCM"
label_scroll_left: "Scroll left"
label_scroll_right: "Scroll right"
label_search: "Търсене"
label_search_by_name: "Search by name"
label_send_information: "Send new credentials to the user"
Expand Down
Loading

0 comments on commit 3f18267

Please sign in to comment.