Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert node_id fix for boards from methodology library #830

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ gem 'dradis-plugins', '~>3.22'
gem 'dradis-api', path: 'engines/dradis-api'

# Import / export project data
gem 'dradis-projects', '~>3.22'
# gem 'dradis-projects', '~>3.22'
gem 'dradis-projects', git: '[email protected]:dradis/dradis-projects.git', branch: 'fix/assign-correct-methodology-libary-to-boards'

plugins_file = 'Gemfile.plugins'
if File.exists?(plugins_file)
Expand Down
14 changes: 10 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
GIT
remote: [email protected]:dradis/dradis-projects.git
revision: cad2540b4897470accba15e1fff980d321752cae
branch: fix/assign-correct-methodology-libary-to-boards
specs:
dradis-projects (3.22.0)
dradis-plugins (~> 3.7)
rubyzip

GIT
remote: [email protected]:paper-trail-gem/paper_trail.git
revision: 1e56afdf846b3e6c338ff4fcd13a95334810b4d8
Expand Down Expand Up @@ -124,9 +133,6 @@ GEM
diff-lcs (1.4.4)
differ (0.1.2)
dradis-plugins (3.22.0)
dradis-projects (3.22.0)
dradis-plugins (~> 3.7)
rubyzip
erubi (1.10.0)
execjs (2.7.0)
factory_bot (5.1.1)
Expand Down Expand Up @@ -477,7 +483,7 @@ DEPENDENCIES
differ (~> 0.1.2)
dradis-api!
dradis-plugins (~> 3.22)
dradis-projects (~> 3.22)
dradis-projects!
factory_bot_rails
foreman
guard-rspec
Expand Down
4 changes: 1 addition & 3 deletions app/models/board.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ def recovered_list
end

def to_xml(xml_builder, includes: [], version: 3)
xml_node_id = node == project.methodology_library ? nil : node_id

xml_builder.board(version: version) do |board_builder|
board_builder.id(id)
board_builder.name(name)
board_builder.node_id(xml_node_id)
board_builder.node_id(node_id)

ordered_items.each do |list|
list.to_xml(xml_builder, includes: includes)
Expand Down
5 changes: 3 additions & 2 deletions spec/features/export/v3/template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
end

it 'creates the project board xml' do
project_board_xml = "<board version=\"3\"><id>#{@project_board.id}</id>"\
"<name>#{@project_board.name}</name><node_id/></board>"
project_board_xml = "<board version=\"3\">\<id>#{@project_board.id}</id>"\
"<name>#{@project_board.name}</name><node_id>#{@project.methodology_library.id}</node_id></board>"

expect(@result).to include(project_board_xml)
end
Expand All @@ -40,3 +40,4 @@
end
end
end