From 8cc0ac7f46cd7b06518b9665f1c0ea7cb89a3800 Mon Sep 17 00:00:00 2001 From: Sean Date: Thu, 22 Apr 2021 17:18:18 +0800 Subject: [PATCH 1/2] Revert node_id fix for boards from methodology library --- Gemfile | 3 ++- Gemfile.lock | 14 ++++++++++---- app/models/board.rb | 4 +--- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index a92d5d38b..58ac0d05d 100644 --- a/Gemfile +++ b/Gemfile @@ -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: 'git@github.com:dradis/dradis-projects.git', branch: 'fix/assign-correct-methodology-libary-to-boards' plugins_file = 'Gemfile.plugins' if File.exists?(plugins_file) diff --git a/Gemfile.lock b/Gemfile.lock index d33cf65c0..368bd44bc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,12 @@ +GIT + remote: git@github.com: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: git@github.com:paper-trail-gem/paper_trail.git revision: 1e56afdf846b3e6c338ff4fcd13a95334810b4d8 @@ -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) @@ -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 diff --git a/app/models/board.rb b/app/models/board.rb index 215bbd07c..ee6032be8 100644 --- a/app/models/board.rb +++ b/app/models/board.rb @@ -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) From 62ed51628b0b5b1a2efd7220aa59261281043603 Mon Sep 17 00:00:00 2001 From: Sean Date: Thu, 22 Apr 2021 17:47:10 +0800 Subject: [PATCH 2/2] Fix board template specs --- spec/features/export/v3/template_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/features/export/v3/template_spec.rb b/spec/features/export/v3/template_spec.rb index ff27bd021..dfd9ec296 100644 --- a/spec/features/export/v3/template_spec.rb +++ b/spec/features/export/v3/template_spec.rb @@ -25,8 +25,8 @@ end it 'creates the project board xml' do - project_board_xml = "#{@project_board.id}"\ - "#{@project_board.name}" + project_board_xml = "\#{@project_board.id}"\ + "#{@project_board.name}#{@project.methodology_library.id}" expect(@result).to include(project_board_xml) end @@ -40,3 +40,4 @@ end end end +