dradis-csv 4.9.0 → 4.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73b72a29b3c7c57b0b65426b584d3a88f7557089b26c0c1da43fc897e7b17d30
4
- data.tar.gz: 67eb6934d1b164e7e97925d6c38cfa3149ce580c59453f20c9759bfea94fb089
3
+ metadata.gz: f2048ab1a638af0a7433589192ed553885f34417c367f06e1ec6a6cb717d5ba8
4
+ data.tar.gz: 7c93f77f09ecfe99d4a8129b9ebd349adca55aa8105d03c373243ac871b47ac3
5
5
  SHA512:
6
- metadata.gz: e7a721f5ab932bf17efb2f39debfb42145374504ecfb2b1cd7147197284e3ca943678be2ce49f16b990873a3e40dbb0c5f9956d35fd9967714e5136819841033
7
- data.tar.gz: 651af8822ababb6b238d6b31fe30ea6f979b8ed4e89e1401c9ae9afbeb7827f9d61a83cd7f1d0610c283b776f42c281ad519ca018d10e2b601d05f18dfb50834
6
+ metadata.gz: 509a35b195cadbd852370f3b4c732e9a7aeb57987bd19479f59633b8cec07f7ae23268d4eda7c4808ca58dd8dc4c0e19becbbc070c4c60ba3e61d27291741a04
7
+ data.tar.gz: ffb2d555a7965fe0aa04e4eb1600cc06db803ed30c84ee557fb643502d042528eb74453da726362aca7541eeb966f37e22626a0ee82b76a2207a9f40869f7d6e
@@ -0,0 +1,45 @@
1
+ Please review [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/develop/CONTRIBUTING.md) and remove this line.
2
+
3
+ ### Summary
4
+
5
+ Provide a general description of the code changes in your pull
6
+ request... were there any bugs you had fixed? If so, mention them. If
7
+ these bugs have open GitHub issues, be sure to tag them here as well,
8
+ to keep the conversation linked together.
9
+
10
+
11
+ ### Testing Steps
12
+
13
+ Provide steps to test functionality, described in detail for someone not familiar with this part of the application / code base
14
+
15
+
16
+ ### Other Information
17
+
18
+ If there's anything else that's important and relevant to your pull
19
+ request, mention that information here. This could include
20
+ benchmarks, or other information.
21
+
22
+ Thanks for contributing to Dradis!
23
+
24
+
25
+ ### Copyright assignment
26
+
27
+ Collaboration is difficult with commercial closed source but we want
28
+ to keep as much of the OSS ethos as possible available to users
29
+ who want to fix it themselves.
30
+
31
+ In order to unambiguously own and sell Dradis Framework commercial
32
+ products, we must have the copyright associated with the entire
33
+ codebase. Any code you create which is merged must be owned by us.
34
+ That's not us trying to be a jerks, that's just the way it works.
35
+
36
+ You can delete this section, but the following sentence needs to
37
+ remain in the PR's description:
38
+
39
+ > I assign all rights, including copyright, to any future Dradis
40
+ > work by myself to Security Roots.
41
+
42
+ ### Check List
43
+
44
+ - [ ] Added a CHANGELOG entry
45
+ - [ ] Added specs
data/.gitignore CHANGED
@@ -1 +1,3 @@
1
1
  .DS_Store
2
+
3
+ pkg/
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ v4.11.0 (January 2024)
2
+ - Disable Dradis field selects with `N/A` value
3
+
4
+ v4.10.0 (September 2023)
5
+ - Update gemspec links
6
+
1
7
  v4.9.0 (June 2023)
2
8
  - Fix CSV upload for files with special characters
3
9
  - Update views for compatibility with Bootstrap 5
data/README.md CHANGED
@@ -7,12 +7,12 @@ The add-on requires [Dradis CE](https://dradisframework.org/) > 4.5, or [Dradis
7
7
 
8
8
  ## More information
9
9
 
10
- See the Dradis Framework's [README.md](https://github.com/dradis/dradisframework/blob/master/README.md)
10
+ See the Dradis Framework's [README.md](https://github.com/dradis/dradis-ce/blob/develop/README.md)
11
11
 
12
12
 
13
13
  ## Contributing
14
14
 
15
- See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradisframework/blob/master/CONTRIBUTING.md)
15
+ See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/develop/CONTRIBUTING.md)
16
16
 
17
17
 
18
18
  ## License
@@ -1,4 +1,4 @@
1
- window.addEventListener('job-done', function(){
1
+ window.addEventListener('job-done', function () {
2
2
  if ($('body.upload.index').length) {
3
3
  var uploader = document.getElementById('uploader');
4
4
 
@@ -7,31 +7,41 @@ window.addEventListener('job-done', function(){
7
7
  var project_path = path.split('/').slice(0, -1).join('/');
8
8
  var attachment = $('#attachment').val();
9
9
 
10
- var redirectPath = project_path + '/addons/csv/upload/new?attachment=' + attachment;
10
+ var redirectPath =
11
+ project_path + '/addons/csv/upload/new?attachment=' + attachment;
11
12
  Turbolinks.visit(redirectPath);
12
13
  }
13
14
  }
14
15
  });
15
16
 
16
- document.addEventListener('turbolinks:load', function() {
17
+ document.addEventListener('turbolinks:load', function () {
17
18
  if ($('body.upload.new').length) {
18
- $('[data-behavior=type-select]').on('change', function() {
19
+ $('[data-behavior=type-select]').on('change', function () {
19
20
  var $nodeSelect = $('select option[value="node"]:selected').parent();
20
21
 
21
22
  // Disable Node Label option
22
23
  if ($nodeSelect.length) {
23
- $('[data-behavior=type-select]').not($nodeSelect).find('option[value="node"]').attr('disabled', 'disabled');
24
+ $('[data-behavior=type-select]')
25
+ .not($nodeSelect)
26
+ .find('option[value="node"]')
27
+ .attr('disabled', 'disabled');
24
28
  } else {
25
- $('[data-behavior=type-select]').find('option[value="node"]').removeAttr('disabled');
29
+ $('[data-behavior=type-select]')
30
+ .find('option[value="node"]')
31
+ .removeAttr('disabled');
26
32
  }
27
33
 
28
- $(this).parents('tr').toggleClass('issue-type', $(this).val() == 'issue');
34
+ $(this)
35
+ .parents('tr')
36
+ .toggleClass('issue-type', $(this).val() == 'issue');
29
37
 
30
38
  // Update fields column labels
31
- var $fieldLabel = $(this).closest('tr').find('[data-behavior=field-label]');
39
+ var $fieldLabel = $(this)
40
+ .closest('tr')
41
+ .find('[data-behavior=field-label]');
32
42
 
33
- switch($(this).val()) {
34
- case 'identifier':
43
+ switch ($(this).val()) {
44
+ case 'identifier':
35
45
  $fieldLabel.text('plugin_id');
36
46
  break;
37
47
  case 'node':
@@ -40,7 +50,7 @@ document.addEventListener('turbolinks:load', function() {
40
50
  case 'skip':
41
51
  $fieldLabel.text('N/A');
42
52
  break;
43
- default:
53
+ default:
44
54
  var header = $fieldLabel.data('header');
45
55
  $fieldLabel.text(header);
46
56
  }
@@ -48,11 +58,14 @@ document.addEventListener('turbolinks:load', function() {
48
58
  _setDradisFieldSelect($(this));
49
59
  });
50
60
 
51
- $('[data-behavior~=mapping-form]').submit(function() {
61
+ $('[data-behavior~=mapping-form]').submit(function () {
52
62
  var valid = _validateIdentifierSelected() && _validateNodeSelected();
53
63
 
54
64
  if (!valid) {
55
- $(this).find('input[type="submit"]').attr('disabled', false).val('Import CSV');
65
+ $(this)
66
+ .find('input[type="submit"]')
67
+ .attr('disabled', false)
68
+ .val('Import CSV');
56
69
 
57
70
  $('[data-behavior~=view-content]').animate({
58
71
  scrollTop: $('[data-behavior~=validation-messages]').scrollTop()
@@ -67,27 +80,43 @@ document.addEventListener('turbolinks:load', function() {
67
80
  function _setDradisFieldSelect($select) {
68
81
  var $row = $select.closest('tr');
69
82
 
70
- $row.find('.field-select').attr('disabled', 'disabled').addClass('d-none');
83
+ $row
84
+ .find('[data-behavior~=dradis-field-select]')
85
+ .attr('disabled', 'disabled')
86
+ .addClass('d-none');
87
+
71
88
  if ($select.val() == 'issue') {
72
- $row.find('[data-behavior=issue-field-select]').removeAttr('disabled', 'disabled').removeClass('d-none');
73
- }
74
- else if ($select.val() == 'evidence') {
75
- $row.find('[data-behavior=evidence-field-select]').removeAttr('disabled').removeClass('d-none');
76
- }
77
- else {
78
- $row.find('[data-behavior=empty-field-select]').removeAttr('disabled').removeClass('d-none');
89
+ $row
90
+ .find('[data-behavior~=issue-field-select]')
91
+ .removeAttr('disabled')
92
+ .removeClass('d-none');
93
+ } else if ($select.val() == 'evidence') {
94
+ $row
95
+ .find('[data-behavior~=evidence-field-select]')
96
+ .removeAttr('disabled')
97
+ .removeClass('d-none');
98
+ } else {
99
+ $row
100
+ .find('[data-behavior~=empty-field-select]')
101
+ .attr('disabled', 'disabled')
102
+ .removeClass('d-none');
79
103
  }
80
104
  }
81
105
 
82
106
  function _validateNodeSelected() {
83
- var $validationMessage = $('[data-behavior~=node-type-validation-message]');
107
+ var $validationMessage = $(
108
+ '[data-behavior~=node-type-validation-message]'
109
+ );
84
110
  $validationMessage.addClass('d-none');
85
111
 
86
- var selectedEvidenceCount = $('select option[value="evidence"]:selected').length;
112
+ var selectedEvidenceCount = $(
113
+ 'select option[value="evidence"]:selected'
114
+ ).length;
87
115
  var selectedNodeCount = $('select option[value="node"]:selected').length;
88
116
 
89
- var valid = selectedEvidenceCount == 0 ||
90
- (selectedEvidenceCount > 0 && selectedNodeCount > 0);
117
+ var valid =
118
+ selectedEvidenceCount == 0 ||
119
+ (selectedEvidenceCount > 0 && selectedNodeCount > 0);
91
120
 
92
121
  if (!valid) {
93
122
  $validationMessage.removeClass('d-none');
@@ -97,10 +126,14 @@ document.addEventListener('turbolinks:load', function() {
97
126
  }
98
127
 
99
128
  function _validateIdentifierSelected() {
100
- var $validationMessage = $('[data-behavior~=issue-id-validation-message]');
129
+ var $validationMessage = $(
130
+ '[data-behavior~=issue-id-validation-message]'
131
+ );
101
132
  $validationMessage.addClass('d-none');
102
133
 
103
- var selectedIdentifierCount = $('select option[value="identifier"]:selected').length;
134
+ var selectedIdentifierCount = $(
135
+ 'select option[value="identifier"]:selected'
136
+ ).length;
104
137
 
105
138
  var valid = selectedIdentifierCount == 1;
106
139
 
@@ -48,12 +48,12 @@
48
48
  <% if @rtp_fields %>
49
49
  <div>
50
50
  <% issue_options = @rtp_fields[:issue].any? ? options_for_select(@rtp_fields[:issue]) : options_for_select([[header, header]], disabled: header, selected: header) %>
51
- <%= f.select "mappings[field_attributes][#{index}][field]", issue_options, {}, class: 'form-select w-75 field-select', data: { behavior: 'issue-field-select', header: header } %>
51
+ <%= f.select "mappings[field_attributes][#{index}][field]", issue_options, {}, class: 'form-select w-75 field-select', data: { behavior: 'dradis-field-select issue-field-select', header: header } %>
52
52
 
53
53
  <% evidence_options = @rtp_fields[:evidence].any? ? options_for_select(@rtp_fields[:evidence]) : options_for_select([[header, header]], disabled: header, selected: header) %>
54
- <%= f.select "mappings[field_attributes][#{index}][field]", evidence_options, {}, disabled: true, class: 'form-select w-75 field-select d-none', data: { behavior: 'evidence-field-select', header: header } %>
54
+ <%= f.select "mappings[field_attributes][#{index}][field]", evidence_options, {}, disabled: true, class: 'form-select w-75 field-select d-none', data: { behavior: 'dradis-field-select evidence-field-select', header: header } %>
55
55
 
56
- <%= f.select "mappings[field_attributes][#{index}][field]", [['N/A', '']], {}, disabled: true, class: 'form-select w-75 field-select d-none', data: { behavior: 'empty-field-select', header: header } %>
56
+ <%= f.select "mappings[field_attributes][#{index}][field]", [['N/A', '']], {}, disabled: true, class: 'form-select w-75 field-select d-none', data: { behavior: 'dradis-field-select empty-field-select', header: header } %>
57
57
  </div>
58
58
  <% else %>
59
59
  <span data-behavior="field-label" data-header="<%= header.delete(" \t\r\n") %>" ><%= header.delete(" \t\r\n") %></span>
data/dradis-csv.gemspec CHANGED
@@ -13,8 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.license = 'GPL-2'
14
14
 
15
15
  spec.authors = ['Daniel Martin']
16
- spec.email = ['etd@nomejortu.com']
17
- spec.homepage = 'http://dradisframework.org'
16
+ spec.homepage = 'http://dradis.com'
18
17
 
19
18
  spec.files = `git ls-files`.split("\n")
20
19
  spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
@@ -8,7 +8,7 @@ module Dradis
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 4
11
- MINOR = 9
11
+ MINOR = 11
12
12
  TINY = 0
13
13
  PRE = nil
14
14
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dradis-csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.9.0
4
+ version: 4.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Martin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-31 00:00:00.000000000 Z
11
+ date: 2024-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dradis-plugins
@@ -54,11 +54,11 @@ dependencies:
54
54
  version: '0'
55
55
  description: This add-on allows you to upload and parse CSV output into Dradis.
56
56
  email:
57
- - etd@nomejortu.com
58
57
  executables: []
59
58
  extensions: []
60
59
  extra_rdoc_files: []
61
60
  files:
61
+ - ".github/pull_request_template.md"
62
62
  - ".gitignore"
63
63
  - CHANGELOG.md
64
64
  - CHANGELOG.template
@@ -90,11 +90,11 @@ files:
90
90
  - spec/fixtures/files/simple_malformed.csv
91
91
  - spec/jobs/dradis/plugins/csv/mapping_import_job_spec.rb
92
92
  - spec/lib/dradis/plugins/csv/importer_spec.rb
93
- homepage: http://dradisframework.org
93
+ homepage: http://dradis.com
94
94
  licenses:
95
95
  - GPL-2
96
96
  metadata: {}
97
- post_install_message:
97
+ post_install_message:
98
98
  rdoc_options: []
99
99
  require_paths:
100
100
  - lib
@@ -109,8 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubygems_version: 3.1.4
113
- signing_key:
112
+ rubygems_version: 3.3.7
113
+ signing_key:
114
114
  specification_version: 4
115
115
  summary: CSV add-on for the Dradis Framework.
116
116
  test_files: