[32855] Export viewpoint with renmaed viewpoint in markup

https://community.openproject.com/wp/32855
pull/8239/head
Oliver Günther 5 years ago
parent 0e94e9c142
commit 41172f25d0
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 4
      modules/bim/lib/open_project/bim/bcf_xml/issue_writer.rb
  2. 7
      modules/bim/spec/bcf/bcf_xml/issue_writer_spec.rb

@ -222,8 +222,8 @@ module OpenProject::Bim::BcfXml
def viewpoints(xml)
issue.viewpoints.find_each do |vp|
xml.Viewpoints "Guid" => vp.uuid do
xml.Viewpoint vp.viewpoint_name
xml.Snapshot vp.snapshot.filename
xml.Viewpoint "#{vp.uuid}.xml"
xml.Snapshot "#{vp.uuid}#{vp.snapshot.extension}"
end
end
end

@ -177,6 +177,13 @@ describe ::OpenProject::Bim::BcfXml::IssueWriter do
expect(subject.at('/Markup/Comment[2]/Comment').content).to eql("Some note created in OP.")
expect(Bim::Bcf::Comment.count).to eql(2)
end
it 'replaces the BCF viewpoints names to use its uuid only' do
uuid = bcf_issue.viewpoints.first.uuid
viewpoint_node = subject.at("/Markup/Viewpoints[@Guid='#{uuid}']")
expect(viewpoint_node.at('Viewpoint').content).to eql("#{uuid}.xml")
expect(viewpoint_node.at('Snapshot').content).to eql("#{uuid}.jpg")
end
end
def url_helpers

Loading…
Cancel
Save