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
add duration column to wp journals - hide in activity
ulferts2d3457388ac1
diff --git a/db/migrate/20220505154549_add_duration_to_work_packages.rb b/db/migrate/20220525154549_add_duration_to_work_packages.rbsimilarity index 69%rename from db/migrate/20220505154549_add_duration_to_work_packages.rbrename to db/migrate/20220525154549_add_duration_to_work_packages.rbindex 845599feacf..2fc2660686f 100644--- a/db/migrate/20220505154549_add_duration_to_work_packages.rb+++ b/db/migrate/20220525154549_add_duration_to_work_packages.rb@@ -1,5 +1,7 @@class AddDurationToWorkPackages < ActiveRecord::Migration[6.1]def changeadd_column :work_packages, :duration, :integer++ add_column :work_package_journals, :duration, :integerendenddiff --git a/lib/api/v3/activities/activity_property_formatters.rb b/lib/api/v3/activities/activity_property_formatters.rbindex f48232a6dfc..effac9e441a 100644--- a/lib/api/v3/activities/activity_property_formatters.rb+++ b/lib/api/v3/activities/activity_property_formatters.rb@@ -39,15 +39,19 @@ module APIdef formatted_details(journal)details = render_details(journal, no_html: true)html_details = render_details(journal)- formattables = details.zip(html_details)- formattables.map { |d| { format: 'custom', raw: d[0], html: d[1] } }+ details+ .zip(html_details)+ .map { |d| { format: 'custom', raw: d[0], html: d[1] } }endprivatedef render_details(journal, no_html: false)- journal.details.map { |d| journal.render_detail(d, no_html: no_html) }+ journal+ .details+ .map { |d| journal.render_detail(d, no_html:) }+ .compactenddef journal_note(journal)diff --git a/lib/api/v3/activities/activity_representer.rb b/lib/api/v3/activities/activity_representer.rbindex d89cb815eac..c92d84c6f3c 100644--- a/lib/api/v3/activities/activity_representer.rb+++ b/lib/api/v3/activities/activity_representer.rb@@ -26,8 +26,6 @@# See COPYRIGHT and LICENSE files for more details.#++-API::V3::Utilities::DateTimeFormatter-module APImodule V3module Activities@@ -38,7 +36,7 @@ module APIinclude ActivityPropertyFormattersself_link path: :activity,- title_getter: ->(*) { nil }+ title_getter: ->(*) {}link :workPackage do{@@ -91,10 +89,6 @@ module APIdef current_user_allowed_to_edit?represented.editable_by?(current_user)end-- def render_details(journal, no_html: false)- journal.details.map { |d| journal.render_detail(d, no_html: no_html) }- endendendenddiff --git a/spec/models/mail_handler_spec.rb b/spec/models/mail_handler_spec.rbindex 6671e33c4f4..38ad4113e2a 100644--- a/spec/models/mail_handler_spec.rb+++ b/spec/models/mail_handler_spec.rb@@ -603,6 +603,7 @@ describe MailHandler, type: :model do"status_id" => [original_status.id, resolved_status.id],"assigned_to_id" => [nil, other_user.id],"start_date" => [nil, Date.parse("Fri, 01 Jan 2010")],+ "duration" => [1, 365],"custom_fields_#{float_cf.id}" => [nil, "52.6"])end