Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

split export dialog pdf settings to enable independent values

as-opd9ba709df99c
diff --git a/app/components/work_packages/exports/base_export_settings_component.rb b/app/components/work_packages/exports/base_export_settings_component.rb
index 5c6bafd12b1..16fdbc293dd 100644
--- a/app/components/work_packages/exports/base_export_settings_component.rb
+++ b/app/components/work_packages/exports/base_export_settings_component.rb
@@ -2,7 +2,7 @@
# -- copyright
# OpenProject is an open source project management software.
-# Copyright (C) 2010-2024 the OpenProject GmbH
+# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
@@ -42,12 +42,6 @@ module WorkPackages
@query = query
end
-
- def selected_columns
- query
- .columns
- .map { |s| { id: s.name, name: s.caption } }
- end
end
end
end
diff --git a/app/components/work_packages/exports/column_selection_component.html.erb b/app/components/work_packages/exports/column_selection_component.html.erb
new file mode 100644
index 00000000000..0df57ba154f
--- /dev/null
+++ b/app/components/work_packages/exports/column_selection_component.html.erb
@@ -0,0 +1,15 @@
+<%= helpers.angular_component_tag "opce-draggable-autocompleter",
+ inputs: {
+ options: available_columns,
+ selected: selected_columns,
+ protected: protected_work_packages_columns_options,
+ name: 'columns',
+ id:,
+ dragAreaName: id,
+ inputCaption: caption,
+ 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"),
+ appendToComponent: true
+ }
+%>
diff --git a/app/components/work_packages/exports/column_selection_component.rb b/app/components/work_packages/exports/column_selection_component.rb
new file mode 100644
index 00000000000..c70fa45b699
--- /dev/null
+++ b/app/components/work_packages/exports/column_selection_component.rb
@@ -0,0 +1,57 @@
+# frozen_string_literal: true
+
+# -- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+# ++
+
+module WorkPackages
+ module Exports
+ class ColumnSelectionComponent < ApplicationComponent
+ include WorkPackagesHelper
+
+ attr_reader :query, :id, :caption
+
+ def initialize(query, id, caption)
+ super()
+
+ @query = query
+ @id = id
+ @caption = caption
+ end
+
+ def available_columns
+ work_packages_columns_options
+ end
+
+ def selected_columns
+ query
+ .columns
+ .map { |s| { id: s.name, name: s.caption } }
+ end
+ end
+ end
+end
diff --git a/app/components/work_packages/exports/csv/export_settings_component.html.erb b/app/components/work_packages/exports/csv/export_settings_component.html.erb
index 1646d40d2e5..4cc6a176a26 100644
--- a/app/components/work_packages/exports/csv/export_settings_component.html.erb
+++ b/app/components/work_packages/exports/csv/export_settings_component.html.erb
@@ -1,19 +1,5 @@
-<%=
- flex_layout do |container|
- container.with_row do |_columns|
- helpers.angular_component_tag "opce-draggable-autocompleter",
- inputs: {
- options: work_packages_columns_options,
- selected: selected_columns,
- protected: protected_work_packages_columns_options,
- name: 'columns',
- id: 'columns-select-export-csv',
- dragAreaName: 'columns-select-export-csv',
- 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"),
- appendToComponent: true
- }
- end
- end
-%>
+<%= render WorkPackages::Exports::ColumnSelectionComponent.new(
+ query,
+ "columns-select-export-csv",
+ I18n.t("export.dialog.columns.input_caption_table")
+) %>
diff --git a/app/components/work_packages/exports/csv/export_settings_component.rb b/app/components/work_packages/exports/csv/export_settings_component.rb
index f4474454039..1ca563e7dc1 100644
--- a/app/components/work_packages/exports/csv/export_settings_component.rb
+++ b/app/components/work_packages/exports/csv/export_settings_component.rb
@@ -2,7 +2,7 @@
# -- copyright
# OpenProject is an open source project management software.
-# Copyright (C) 2010-2024 the OpenProject GmbH
+# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
diff --git a/app/components/work_packages/exports/modal_dialog_component.rb b/app/components/work_packages/exports/modal_dialog_component.rb
index f696a7151a7..45255b25993 100644
--- a/app/components/work_packages/exports/modal_dialog_component.rb
+++ b/app/components/work_packages/exports/modal_dialog_component.rb
@@ -2,7 +2,7 @@
# -- copyright
# OpenProject is an open source project management software.
-# Copyright (C) 2010-2024 the OpenProject GmbH
+# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
diff --git a/app/components/work_packages/exports/pdf/export_settings_component.html.erb b/app/components/work_packages/exports/pdf/export_settings_component.html.erb
index f40d1895f34..3606adc76aa 100644
--- a/app/components/work_packages/exports/pdf/export_settings_component.html.erb
+++ b/app/components/work_packages/exports/pdf/export_settings_component.html.erb
@@ -3,7 +3,6 @@
"application-target": "dynamic",
controller: "work-packages--export--pdf--settings"
}) do |container| %>
-
<%= container.with_row do %>
<%= render(Primer::Alpha::RadioButtonGroup.new(
mb: 3,
@@ -28,71 +27,14 @@
end %>
<hr class="mt-4 mb-4"/>
<% end %>
-
- <% container.with_row(
- classes: %w[table report].include?(current_pdf_export_type) ? nil : "d-none",
- data: {
- table: true,
- report: true,
- "work-packages--export--pdf--settings-target": "fields"
- }) do |_columns|
- helpers.angular_component_tag "opce-draggable-autocompleter",
- inputs: {
- options: work_packages_columns_options,
- selected: selected_columns,
- protected: protected_work_packages_columns_options,
- name: 'columns',
- id: 'columns-select-export-pdf',
- inputLabel: I18n.t(:"queries.configure_view.columns.input_label"),
- inputPlaceholder: I18n.t(:"queries.configure_view.columns.input_placeholder"),
- dragAreaName: 'columns-select-export-pdf',
- dragAreaLabel: I18n.t(:"queries.configure_view.columns.drag_area_label"),
- appendToComponent: true
- }
- end %>
-
- <%= container.with_row(
- classes: current_pdf_export_type == "report" ? nil : "d-none",
- data: {
- report: true,
- "work-packages--export--pdf--settings-target": "fields"
- }) do |_pdf_report_images| %>
- <hr class="mt-2 mb-4"/>
- <%= render(Primer::Alpha::CheckBox.new(name: 'show_images',
- checked: true,
- value: "true",
- unchecked_value: "false",
- label: I18n.t("export.dialog.pdf.include_images.label"),
- caption: I18n.t("export.dialog.pdf.include_images.caption"),
- disabled: current_pdf_export_type != "report",
- visually_hide_label: false)) %>
- <% end %>
- <% if gantt_chart_allowed? %>
- <%= container.with_row(classes: current_pdf_export_type == "gantt" ? nil : "d-none",
- data: {
- gantt: true,
- "work-packages--export--pdf--settings-target": "fields"
- }) do |_pdf_gantt_paper_size| %>
-
- <% flex_layout do |flex| %>
- <% gantt_selects.each_with_index do |entry, index| %>
- <% flex.with_row(mt: index == 0 ? 0 : 3) do %>
- <%= render(Primer::Alpha::Select.new(
- name: entry[:name],
- label: entry[:label],
- caption: entry[:caption],
- size: :medium,
- input_width: :small,
- disabled: current_pdf_export_type != "gantt",
- value: entry[:options].find { |e| e[:default] }[:value])
- ) do |component|
- entry[:options].each do |entry|
- component.option(label: entry[:label], value: entry[:value])
- end
- end %>
- <% end %>
- <% end %>
- <% end %>
+ <% pdf_export_types.reject { |entry| entry[:disabled] }.each do |entry| %>
+ <%= container.with_row(
+ classes: current_pdf_export_type == entry[:value] ? nil : "d-none",
+ data: {
+ "pdf-export-type": entry[:value],
+ "work-packages--export--pdf--settings-target": "fields"
+ }) do |_pdf_export_type| %>
+ <%= render(entry[:component].new(query)) %>
<% end %>
<% end %>
<% end %>
diff --git a/app/components/work_packages/exports/pdf/export_settings_component.rb b/app/components/work_packages/exports/pdf/export_settings_component.rb
index 093c3967135..daa4f6afaf3 100644
--- a/app/components/work_packages/exports/pdf/export_settings_component.rb
+++ b/app/components/work_packages/exports/pdf/export_settings_component.rb
@@ -2,7 +2,7 @@
# -- copyright
# OpenProject is an open source project management software.
-# Copyright (C) 2010-2024 the OpenProject GmbH
+# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
@@ -44,74 +44,17 @@ module WorkPackages
[
{ value: "table",
label: I18n.t("export.dialog.pdf.export_type.options.table.label"),
- caption: I18n.t("export.dialog.pdf.export_type.options.table.caption") },
+ caption: I18n.t("export.dialog.pdf.export_type.options.table.caption"),
+ component: WorkPackages::Exports::PDF::Table::ExportSettingsComponent },
{ value: "report",
label: I18n.t("export.dialog.pdf.export_type.options.report.label"),
- caption: I18n.t("export.dialog.pdf.export_type.options.report.caption") },
+ caption: I18n.t("export.dialog.pdf.export_type.options.report.caption"),
+ component: WorkPackages::Exports::PDF::Report::ExportSettingsComponent },
{ value: "gantt",
label: I18n.t("export.dialog.pdf.export_type.options.gantt.label"),
caption: I18n.t("export.dialog.pdf.export_type.options.gantt.caption"),
- disabled: !gantt_chart_allowed? }
- ]
- end
-
- def selected_columns
- query
- .columns
- .map { |s| { id: s.name, name: s.caption } }
- end
-
- def gantt_selects
- [
- {
- name: "gantt_mode",
- label: I18n.t("export.dialog.pdf.gantt_zoom_levels.label"),
- caption: I18n.t("export.dialog.pdf.gantt_zoom_levels.caption"),
- options: gantt_zoom_levels
- },
- {
- name: "gantt_width",
- label: I18n.t("export.dialog.pdf.column_width.label"),
- options: gantt_column_widths
- },
- {
- name: "paper_size",
- label: I18n.t("export.dialog.pdf.paper_size.label"),
- caption: I18n.t("export.dialog.pdf.paper_size.caption"),
- options: pdf_paper_sizes
- }
- ]
- end
-
- def gantt_zoom_levels
- [
- { label: t("export.dialog.pdf.gantt_zoom_levels.options.days"), value: "day", default: true },
- { label: t("export.dialog.pdf.gantt_zoom_levels.options.weeks"), value: "week" },
- { label: t("export.dialog.pdf.gantt_zoom_levels.options.months"), value: "month" },
- { label: t("export.dialog.pdf.gantt_zoom_levels.options.quarters"), value: "quarter" }
- ]
- end
-
- def gantt_column_widths
- [
- { label: t("export.dialog.pdf.column_width.options.narrow"), value: "narrow" },
- { label: t("export.dialog.pdf.column_width.options.medium"), value: "medium", default: true },
- { label: t("export.dialog.pdf.column_width.options.wide"), value: "wide" },
- { label: t("export.dialog.pdf.column_width.options.very_wide"), value: "very_wide" }
- ]
- end
-
- def pdf_paper_sizes
- [
- { label: "A4", value: "A4", default: true },
- { label: "A3", value: "A3" },
- { label: "A2", value: "A2" },
- { label: "A1", value: "A1" },
- { label: "A0", value: "A0" },
- { label: "Executive", value: "EXECUTIVE" },
- { label: "Folio", value: "FOLIO" },
- { label: "Letter", value: "LETTER" },
- { label: "Tabloid", value: "TABLOID" }
+ disabled: !gantt_chart_allowed?,
+ component: WorkPackages::Exports::PDF::Gantt::ExportSettingsComponent }
]
end
end
diff --git a/app/components/work_packages/exports/pdf/gantt/export_settings_component.html.erb b/app/components/work_packages/exports/pdf/gantt/export_settings_component.html.erb
new file mode 100644
index 00000000000..3f281ca3bb5
--- /dev/null
+++ b/app/components/work_packages/exports/pdf/gantt/export_settings_component.html.erb
@@ -0,0 +1,18 @@
+<%= flex_layout do |container| %>
+ <% gantt_selects.each_with_index do |entry, index| %>
+ <% container.with_row(mt: index == 0 ? 0 : 3) do %>
+ <%= render(Primer::Alpha::Select.new(
+ name: entry[:name],
+ label: entry[:label],
+ caption: entry[:caption],
+ size: :medium,
+ input_width: :small,
+ value: entry[:options].find { |e| e[:default] }[:value])
+ ) do |component|
+ entry[:options].each do |entry|
+ component.option(label: entry[:label], value: entry[:value])
+ end
+ end %>
+ <% end %>
+ <% end %>
+<% end %>
diff --git a/app/components/work_packages/exports/pdf/gantt/export_settings_component.rb b/app/components/work_packages/exports/pdf/gantt/export_settings_component.rb
new file mode 100644
index 00000000000..3f1a2497d10
--- /dev/null
+++ b/app/components/work_packages/exports/pdf/gantt/export_settings_component.rb
@@ -0,0 +1,93 @@
+# frozen_string_literal: true
+
+# -- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+# ++
+
+module WorkPackages
+ module Exports
+ module PDF
+ module Gantt
+ class ExportSettingsComponent < BaseExportSettingsComponent
+ def gantt_selects
+ [
+ {
+ name: "gantt_mode",
+ label: I18n.t("export.dialog.pdf.gantt_zoom_levels.label"),
+ caption: I18n.t("export.dialog.pdf.gantt_zoom_levels.caption"),
+ options: gantt_zoom_levels
+ },
+ {
+ name: "gantt_width",
+ label: I18n.t("export.dialog.pdf.column_width.label"),
+ options: gantt_column_widths
+ },
+ {
+ name: "paper_size",
+ label: I18n.t("export.dialog.pdf.paper_size.label"),
+ caption: I18n.t("export.dialog.pdf.paper_size.caption"),
+ options: pdf_paper_sizes
+ }
+ ]
+ end
+
+ def gantt_zoom_levels
+ [
+ { label: t("export.dialog.pdf.gantt_zoom_levels.options.days"), value: "day", default: true },
+ { label: t("export.dialog.pdf.gantt_zoom_levels.options.weeks"), value: "week" },
+ { label: t("export.dialog.pdf.gantt_zoom_levels.options.months"), value: "month" },
+ { label: t("export.dialog.pdf.gantt_zoom_levels.options.quarters"), value: "quarter" }
+ ]
+ end
+
+ def gantt_column_widths
+ [
+ { label: t("export.dialog.pdf.column_width.options.narrow"), value: "narrow" },
+ { label: t("export.dialog.pdf.column_width.options.medium"), value: "medium", default: true },
+ { label: t("export.dialog.pdf.column_width.options.wide"), value: "wide" },
+ { label: t("export.dialog.pdf.column_width.options.very_wide"), value: "very_wide" }
+ ]
+ end
+
+ def pdf_paper_sizes
+ [
+ { label: "A4", value: "A4", default: true },
+ { label: "A3", value: "A3" },
+ { label: "A2", value: "A2" },
+ { label: "A1", value: "A1" },
+ { label: "A0", value: "A0" },
+ { label: "Executive", value: "EXECUTIVE" },
+ { label: "Folio", value: "FOLIO" },
+ { label: "Letter", value: "LETTER" },
+ { label: "Tabloid", value: "TABLOID" }
+ ]
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb b/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb
new file mode 100644
index 00000000000..73aac3ac166
--- /dev/null
+++ b/app/components/work_packages/exports/pdf/report/export_settings_component.html.erb
@@ -0,0 +1,19 @@
+<%= flex_layout do |container| %>
+ <% container.with_row do |_columns| %>
+ <%= render WorkPackages::Exports::ColumnSelectionComponent.new(
+ query,
+ "columns-select-export-pdf-report",
+ I18n.t("export.dialog.columns.input_caption_report")
+ ) %>
+ <% end %>
+ <%= container.with_row do |_pdf_report_images| %>
+ <hr class="mt-2 mb-4"/>
+ <%= render(Primer::Alpha::CheckBox.new(name: 'show_images',
+ checked: true,
+ value: "true",
+ unchecked_value: "false",
+ label: I18n.t("export.dialog.pdf.include_images.label"),
+ caption: I18n.t("export.dialog.pdf.include_images.caption"),
+ visually_hide_label: false)) %>
+ <% end %>
+<% end %>
diff --git a/app/components/work_packages/exports/pdf/report/export_settings_component.rb b/app/components/work_packages/exports/pdf/report/export_settings_component.rb
new file mode 100644
index 00000000000..e3b4a5fe17c
--- /dev/null
+++ b/app/components/work_packages/exports/pdf/report/export_settings_component.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+# -- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+# ++
+
+module WorkPackages
+ module Exports
+ module PDF
+ module Report
+ class ExportSettingsComponent < BaseExportSettingsComponent
+ end
+ end
+ end
+ end
+end
diff --git a/app/components/work_packages/exports/pdf/table/export_settings_component.html.erb b/app/components/work_packages/exports/pdf/table/export_settings_component.html.erb
new file mode 100644
index 00000000000..40cd43cd9ee
--- /dev/null
+++ b/app/components/work_packages/exports/pdf/table/export_settings_component.html.erb
@@ -0,0 +1,5 @@
+<%= render WorkPackages::Exports::ColumnSelectionComponent.new(
+ query,
+ "columns-select-export-pdf-table",
+ I18n.t("export.dialog.columns.input_caption_table")
+) %>
diff --git a/app/components/work_packages/exports/pdf/table/export_settings_component.rb b/app/components/work_packages/exports/pdf/table/export_settings_component.rb
new file mode 100644
index 00000000000..b8020bebacd
--- /dev/null
+++ b/app/components/work_packages/exports/pdf/table/export_settings_component.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+# -- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+# ++
+
+module WorkPackages
+ module Exports
+ module PDF
+ module Table
+ class ExportSettingsComponent < BaseExportSettingsComponent
+ end
+ end
+ end
+ end
+end
diff --git a/app/components/work_packages/exports/xls/export_settings_component.html.erb b/app/components/work_packages/exports/xls/export_settings_component.html.erb
index 6e0470b7ddb..32985b78ce5 100644
--- a/app/components/work_packages/exports/xls/export_settings_component.html.erb
+++ b/app/components/work_packages/exports/xls/export_settings_component.html.erb
@@ -1,22 +1,14 @@
<%= flex_layout do |container| %>
<%= container.with_row do |_columns| %>
- <% helpers.angular_component_tag "opce-draggable-autocompleter",
- inputs: {
- options: work_packages_columns_options,
- selected: selected_columns,
- protected: protected_work_packages_columns_options,
- name: 'columns',
- id: 'columns-select-export-xls',
- inputLabel: I18n.t(:"queries.configure_view.columns.input_label"),
- inputPlaceholder: I18n.t(:"queries.configure_view.columns.input_placeholder"),
- dragAreaName: 'columns-select-export-xls',
- dragAreaLabel: I18n.t(:"queries.configure_view.columns.drag_area_label"),
- appendToComponent: true
- } %>
+ <%= render WorkPackages::Exports::ColumnSelectionComponent.new(
+ query,
+ "columns-select-export-xls",
+ I18n.t("export.dialog.columns.input_caption_table")
+ ) %>
<% end %>
<%= container.with_row do |_xls_include_relations| %>
<hr class="mt-2 mb-4"/>
- <%= render(Primer::Alpha::CheckBox.new(name: 'show_relations',
+ <%= render(Primer::Alpha::CheckBox.new(name: "show_relations",
value: "true",
unchecked_value: "false",
label: I18n.t("export.dialog.xls.include_relations.label"),
diff --git a/app/components/work_packages/exports/xls/export_settings_component.rb b/app/components/work_packages/exports/xls/export_settings_component.rb
index 130c2b7a239..eb42c268054 100644
--- a/app/components/work_packages/exports/xls/export_settings_component.rb
+++ b/app/components/work_packages/exports/xls/export_settings_component.rb
@@ -2,7 +2,7 @@
# -- copyright
# OpenProject is an open source project management software.
-# Copyright (C) 2010-2024 the OpenProject GmbH
+# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 1ed81d2445a..cbc0bf24158 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1760,6 +1760,9 @@ en:
label: "PDF"
xls:
label: "XLS"
+ columns:
+ input_caption_report: "By default all attributes added as columns in the work package list are selected. Long text field will be displayed at the end of the attributes list."
+ input_caption_table: "By default all attributes added as columns in the work package list are selected. Long text fields are not available in table based exports."
pdf:
export_type:
label: "PDF export type"
diff --git a/frontend/src/app/shared/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts b/frontend/src/app/shared/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts
index aff9cc93f65..d4be4c7d21a 100644
--- a/frontend/src/app/shared/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts
+++ b/frontend/src/app/shared/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts
@@ -334,7 +334,6 @@ export class OpSettingsMenuDirective extends OpContextMenuTrigger {
icon: 'icon-export',
onClick: ($event:JQuery.TriggeredEvent) => {
if (this.allowWorkPackageAction($event, 'representations')) {
- // old angular export form: this.opModalService.show(WpTableExportModalComponent, this.injector);
const query = this.querySpace.query.value;
if (query) {
const href = this.buildExportDialogHref(query);
diff --git a/frontend/src/stimulus/controllers/dynamic/work-packages/export/pdf/settings.controller.ts b/frontend/src/stimulus/controllers/dynamic/work-packages/export/pdf/settings.controller.ts
index fb22852b458..d9abaa74aa2 100644
--- a/frontend/src/stimulus/controllers/dynamic/work-packages/export/pdf/settings.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/work-packages/export/pdf/settings.controller.ts
@@ -13,9 +13,17 @@ export default class PDFExportSettingsController extends Controller {
});
}
+ connect() {
+ this.fieldsTargets.forEach((element:HTMLElement) => {
+ if (element.classList.contains('d-none')) {
+ this.silenceFormFields(element, true);
+ }
+ });
+ }
+
typeChanged({ params: { name } }:{ params:{ name:string } }) {
this.fieldsTargets.forEach((element:HTMLElement) => {
- if (element.getAttribute(`data-${name}`) === 'true') {
+ if (element.getAttribute(`data-pdf-export-type`) === name) {
element.classList.remove('d-none');
this.silenceFormFields(element, false);
} else {