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

Fix reader optional view_setup_hints in seed

Oliver Güntherbc97432f1bb4
diff --git a/modules/bcf/lib/open_project/bcf/bcf_json/viewpoint_reader.rb b/modules/bcf/lib/open_project/bcf/bcf_json/viewpoint_reader.rb
index 4603b61277b..79b087102b2 100644
--- a/modules/bcf/lib/open_project/bcf/bcf_json/viewpoint_reader.rb
+++ b/modules/bcf/lib/open_project/bcf/bcf_json/viewpoint_reader.rb
@@ -135,8 +135,7 @@ module OpenProject::Bcf
##
# Move selections up the tree from the nested XML node
def transform_selections(hash)
- selections = hash.dig('components', 'selection', 'component')
- return unless selections
+ return unless (selections = hash.dig('components', 'selection', 'component'))
# Ensure selections are an array
selections = Array.wrap(selections)
@@ -150,8 +149,7 @@ module OpenProject::Bcf
##
# Move coloring up the tree from the nested XML node
def transform_coloring(hash)
- colors = hash.dig('components', 'coloring', 'color')
- return unless colors
+ return unless (colors = hash.dig('components', 'coloring', 'color'))
# avoid Array(colors) since that deconstructs the array
colors = Array.wrap(colors)
@@ -167,8 +165,7 @@ module OpenProject::Bcf
end
def transform_visibility(hash)
- visibility = hash.dig('components', 'visibility')
- return unless visibility
+ return unless (visibility = hash.dig('components', 'visibility'))
visibility['default_visibility'] = visibility['default_visibility'] == 'true'
@@ -178,7 +175,7 @@ module OpenProject::Bcf
# Move view_setup_hints
view_setup_hints = hash.dig('components', 'view_setup_hints')
- visibility['view_setup_hints'] = view_setup_hints.transform_values { |val| val == 'true' }
+ visibility['view_setup_hints'] = view_setup_hints.transform_values { |val| val == 'true' } if view_setup_hints
# Remove the old node
hash['components'].delete('view_setup_hints')
diff --git a/modules/bim_seeder/lib/open_project/bim_seeder/patches/work_package_seeder_patch.rb b/modules/bim_seeder/lib/open_project/bim_seeder/patches/work_package_seeder_patch.rb
index 7847e6d47b0..e8551667966 100644
--- a/modules/bim_seeder/lib/open_project/bim_seeder/patches/work_package_seeder_patch.rb
+++ b/modules/bim_seeder/lib/open_project/bim_seeder/patches/work_package_seeder_patch.rb
@@ -7,7 +7,6 @@ module OpenProject::BimSeeder::Patches::WorkPackageSeederPatch
def create_or_update_work_package(attributes)
uuid = attributes[:bcf_issue_uuid]
if uuid
- puts "Would do something with #{attributes[:bcf_issue_id]}"
start_date = calculate_start_date(attributes[:start])
due_date = calculate_due_date(start_date, attributes[:duration])