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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#47058] Remove unsupported export option & rename entries (#12812)
Andrej Sandorfe0c23612d30e
diff --git a/app/models/work_package/pdf_export/common.rb b/app/models/work_package/pdf_export/common.rbindex 3ef3876eaf8..306fac9b7ce 100644--- a/app/models/work_package/pdf_export/common.rb+++ b/app/models/work_package/pdf_export/common.rb@@ -188,11 +188,11 @@ module WorkPackage::PDFExport::Commonenddef with_descriptions?- options[:show_descriptions]+ options[:show_report]enddef with_attachments?- options[:show_attachments]+ options[:show_images]enddef current_page_nrdiff --git a/app/models/work_package/pdf_export/work_package_to_pdf.rb b/app/models/work_package/pdf_export/work_package_to_pdf.rbindex dc7bb492f8d..1b5caaf1994 100644--- a/app/models/work_package/pdf_export/work_package_to_pdf.rb+++ b/app/models/work_package/pdf_export/work_package_to_pdf.rb@@ -69,8 +69,8 @@ class WorkPackage::PDFExport::WorkPackageToPdf < Exports::Exporterdef render_work_packagewrite_title!write_work_package_detail_content!(work_package)- write_history!- write_changesets! if show_changesets?+ # write_history!+ # write_changesets! if show_changesets?write_headers!write_footers!enddiff --git a/config/locales/en.yml b/config/locales/en.ymlindex ccbc1bb0272..761ecce3e8a 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -1404,9 +1404,9 @@ en:atom: "Atom"csv: "CSV"pdf: "PDF"- pdf_with_descriptions: "PDF with descriptions"- pdf_with_descriptions_and_attachments: "PDF with descriptions and attachments"- pdf_with_attachments: "PDF with attachments"+ pdf_overview_table: "PDF Table"+ pdf_report_with_images: "PDF Report with images"+ pdf_report: "PDF Report"image:omitted: "Image not exported."@@ -1859,7 +1859,6 @@ en:label_password_rule_special: "Special Characters"label_password_rule_uppercase: "Uppercase"label_path_encoding: "Path encoding"- label_pdf_with_descriptions: "PDF with Descriptions"label_per_page: "Per page"label_people: "People"label_permissions: "Permissions"diff --git a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.htmlindex 10279e7529f..4a3856e2e3f 100644--- a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html+++ b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html@@ -9,7 +9,7 @@<div class="spot-divider"></div><div class="spot-modal--body spot-container">- <ul *ngIf="exportOptions" class="op-export-options" [ngClass]="{'-hidden': isLoading}">+ <ul *ngIf="exportOptions" class="op-export-options op-export-options-grid" [ngClass]="{'-hidden': isLoading}"><li*ngFor="let option of exportOptions"class="op-export-options--option"diff --git a/frontend/src/global_styles/common/export-options/export-options.sass b/frontend/src/global_styles/common/export-options/export-options.sassindex ae212558e6a..65735aa59e5 100644--- a/frontend/src/global_styles/common/export-options/export-options.sass+++ b/frontend/src/global_styles/common/export-options/export-options.sass@@ -24,3 +24,14 @@&-labeldisplay: blockpadding: 10px 0 0 0++ &.op-export-options-grid+ display: grid+ grid-template-columns: 1fr 1fr 1fr++ @media screen and (max-width: 480px)+ grid-template-columns: 1fr 1fr++ @media screen and (max-width: 320px)+ grid-template-columns: 1fr+diff --git a/lib/api/v3/work_packages/work_package_collection_representer.rb b/lib/api/v3/work_packages/work_package_collection_representer.rbindex a400a5521db..f46c02bbfae 100644--- a/lib/api/v3/work_packages/work_package_collection_representer.rb+++ b/lib/api/v3/work_packages/work_package_collection_representer.rb@@ -228,9 +228,8 @@ module APIdef representation_formatsformats = [representation_format_pdf,- representation_format_pdf_attachments,- representation_format_pdf_description,- representation_format_pdf_description_attachments,+ representation_format_pdf_report_with_images,+ representation_format_pdf_report,representation_format_xls,representation_format_xls_descriptions,representation_format_xls_relations,@@ -263,30 +262,24 @@ module APIdef representation_format_pdfrepresentation_format 'pdf',+ i18n_key: 'pdf_overview_table',mime_type: 'application/pdf'end- def representation_format_pdf_attachments- representation_format 'pdf',- i18n_key: 'pdf_with_attachments',- mime_type: 'application/pdf',- url_query_extras: 'show_attachments=true'- end-- def representation_format_pdf_description+ def representation_format_pdf_report_with_imagesrepresentation_format 'pdf-with-descriptions',format: 'pdf',- i18n_key: 'pdf_with_descriptions',+ i18n_key: 'pdf_report_with_images',mime_type: 'application/pdf',- url_query_extras: 'show_descriptions=true'+ url_query_extras: 'show_images=true&show_report=true'end- def representation_format_pdf_description_attachments- representation_format 'pdf-with-descriptions',+ def representation_format_pdf_report+ representation_format 'pdf-descr',format: 'pdf',- i18n_key: 'pdf_with_descriptions_and_attachments',+ i18n_key: 'pdf_report',mime_type: 'application/pdf',- url_query_extras: 'show_descriptions=true&show_attachments=true'+ url_query_extras: 'show_report=true'enddef representation_format_xlsdiff --git a/spec/features/work_packages/export_spec.rb b/spec/features/work_packages/export_spec.rbindex 2de6cd8c110..cba70638b8a 100644--- a/spec/features/work_packages/export_spec.rb+++ b/spec/features/work_packages/export_spec.rb@@ -210,7 +210,7 @@ RSpec.describe 'work package export' doendcontext 'PDF export', js: true do- let(:export_type) { 'PDF' }+ let(:export_type) { I18n.t('export.format.pdf_overview_table') }let(:query) docreate(:query,user: current_user,diff --git a/spec/lib/api/v3/work_packages/work_package_collection_representer_spec.rb b/spec/lib/api/v3/work_packages/work_package_collection_representer_spec.rbindex 7cdab28949b..0cdc51b9964 100644--- a/spec/lib/api/v3/work_packages/work_package_collection_representer_spec.rb+++ b/spec/lib/api/v3/work_packages/work_package_collection_representer_spec.rb@@ -121,13 +121,20 @@ RSpec.describe API::V3::WorkPackages::WorkPackageCollectionRepresenter dohref: work_packages_path({ format: 'pdf' }.merge(expected_query_params)),type: 'application/pdf',identifier: 'pdf',- title: I18n.t('export.format.pdf')+ title: I18n.t('export.format.pdf_overview_table')},{- href: work_packages_path({ format: 'pdf', show_descriptions: true }.merge(expected_query_params)),+ href: work_packages_path({ format: 'pdf', show_images: true, show_report: true }+ .merge(expected_query_params)),identifier: 'pdf-with-descriptions',type: 'application/pdf',- title: I18n.t('export.format.pdf_with_descriptions')+ title: I18n.t('export.format.pdf_report_with_images')+ },+ {+ href: work_packages_path({ format: 'pdf', show_report: true }.merge(expected_query_params)),+ identifier: 'pdf-descr',+ type: 'application/pdf',+ title: I18n.t('export.format.pdf_report')},{href: work_packages_path({ format: 'csv' }.merge(expected_query_params)),@@ -164,13 +171,20 @@ RSpec.describe API::V3::WorkPackages::WorkPackageCollectionRepresenter dohref: project_work_packages_path(project, { format: 'pdf' }.merge(expected_query_params)),type: 'application/pdf',identifier: 'pdf',- title: I18n.t('export.format.pdf')+ title: I18n.t('export.format.pdf_overview_table')},{- href: project_work_packages_path(project, { format: 'pdf', show_descriptions: true }.merge(expected_query_params)),+ href: project_work_packages_path(project, { format: 'pdf', show_images: true, show_report: true }+ .merge(expected_query_params)),type: 'application/pdf',identifier: 'pdf-with-descriptions',- title: I18n.t('export.format.pdf_with_descriptions')+ title: I18n.t('export.format.pdf_report_with_images')+ },+ {+ href: project_work_packages_path(project, { format: 'pdf', show_report: true }.merge(expected_query_params)),+ type: 'application/pdf',+ identifier: 'pdf-descr',+ title: I18n.t('export.format.pdf_report')},{href: project_work_packages_path(project, { format: 'csv' }.merge(expected_query_params)),