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
[41824] Ensure project export also includes description
Oliver Günthera3897c94cc0f
diff --git a/app/models/projects/exports/query_exporter.rb b/app/models/projects/exports/query_exporter.rbindex 56efc176764..a2f91cada97 100644--- a/app/models/projects/exports/query_exporter.rb+++ b/app/models/projects/exports/query_exporter.rb@@ -55,7 +55,8 @@ module Projects::Exports[{ name: :id, caption: Project.human_attribute_name(:id) },{ name: :identifier, caption: Project.human_attribute_name(:identifier) },- { name: :name, caption: Project.human_attribute_name(:name) }+ { name: :name, caption: Project.human_attribute_name(:name) },+ { name: :description, caption: Project.human_attribute_name(:description) }]enddiff --git a/modules/xls_export/spec/models/xls_export/project/exporter/xls_integration_spec.rb b/modules/xls_export/spec/models/xls_export/project/exporter/xls_integration_spec.rbindex 7a3b12e6b96..98faee44306 100644--- a/modules/xls_export/spec/models/xls_export/project/exporter/xls_integration_spec.rb+++ b/modules/xls_export/spec/models/xls_export/project/exporter/xls_integration_spec.rb@@ -27,7 +27,8 @@ describe XlsExport::Project::Exporter::XLS doit 'performs a successful export' doexpect(rows.count).to eq(1)- expect(sheet.row(1)).to eq [project.id.to_s, project.identifier, project.name, 'Off track', 'false']+ expect(sheet.row(1)).to eq [project.id.to_s, project.identifier,+ project.name, project.description, 'Off track', 'false']enddescribe 'custom field columns selected' do@@ -40,7 +41,7 @@ describe XlsExport::Project::Exporter::XLS doexpect(rows.count).to eq 1cf_names = custom_fields.map(&:name)- expect(header).to eq ['ID', 'Identifier', 'Name', 'Status', 'Public', *cf_names]+ expect(header).to eq ['ID', 'Identifier', 'Name', 'Description', 'Status', 'Public', *cf_names]custom_values = custom_fields.map do |cf|case cf@@ -54,13 +55,13 @@ describe XlsExport::Project::Exporter::XLS doendexpect(sheet.row(1))- .to eq [project.id.to_s, project.identifier, project.name, 'Off track', 'false', *custom_values]+ .to eq [project.id.to_s, project.identifier, project.name, project.description, 'Off track', 'false', *custom_values]endendcontext 'when ee not enabled' doit 'renders only the default columns' do- expect(header).to eq %w[ID Identifier Name Status Public]+ expect(header).to eq %w[ID Identifier Name Description Status Public]endendenddiff --git a/spec/models/projects/exporter/csv_integration_spec.rb b/spec/models/projects/exporter/csv_integration_spec.rbindex e2dd8f3189a..4773662121f 100644--- a/spec/models/projects/exporter/csv_integration_spec.rb+++ b/spec/models/projects/exporter/csv_integration_spec.rb@@ -43,7 +43,8 @@ describe Projects::Exports::CSV, 'integration', type: :model doit 'performs a successful export' doexpect(parsed.size).to eq(2)- expect(parsed.last).to eq [project.id.to_s, project.identifier, project.name, 'Off track', 'false']+ expect(parsed.last).to eq [project.id.to_s, project.identifier,+ project.name, project.description, 'Off track', 'false']enddescribe 'custom field columns selected' do@@ -56,7 +57,7 @@ describe Projects::Exports::CSV, 'integration', type: :model doexpect(parsed.size).to eq 2cf_names = custom_fields.map(&:name)- expect(header).to eq ['id', 'Identifier', 'Name', 'Status', 'Public', *cf_names]+ expect(header).to eq ['id', 'Identifier', 'Name', 'Description', 'Status', 'Public', *cf_names]custom_values = custom_fields.map do |cf|case cf@@ -69,13 +70,13 @@ describe Projects::Exports::CSV, 'integration', type: :model doendendexpect(rows.first)- .to eq [project.id.to_s, project.identifier, project.name, 'Off track', 'false', *custom_values]+ .to eq [project.id.to_s, project.identifier, project.name, project.description, 'Off track', 'false', *custom_values]endendcontext 'when ee not enabled' doit 'renders only the default columns' do- expect(header).to eq %w[id Identifier Name Status Public]+ expect(header).to eq %w[id Identifier Name Description Status Public]endendenddiff --git a/spec/models/projects/exporter/exportable_project_context.rb b/spec/models/projects/exporter/exportable_project_context.rbindex 5f120bfaaef..40d994174da 100644--- a/spec/models/projects/exporter/exportable_project_context.rb+++ b/spec/models/projects/exporter/exportable_project_context.rb@@ -50,6 +50,7 @@ shared_context 'with a project with an arrangement of custom fields' doshared_let(:project) docreate(:project, members: { other_user => role }).tap do |p|+ p.description = "The description of the project"p.send(:"custom_field_#{int_cf.id}=", 5)p.send(:"custom_field_#{bool_cf.id}=", true)p.send(:"custom_field_#{version_cf.id}=", system_version)