dradis-csv 4.10.0 → 4.12.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: 1a00bf938af0360a152258883523f2f42c1470d344b7b40cba521b8434c0fbbf
4
- data.tar.gz: 006ef91ae2b25a1a3e2bd6b59cd15a24788a30485389cf184aea4c8e588a8f1c
3
+ metadata.gz: e3d701f812e267a36a66703478149615652edcba33010028fceebbb4f3c40d1d
4
+ data.tar.gz: 151acfaf569d8e889c9cb8d1f3d3f468ec02b694e9262f9f4bec91a66b9a3cdc
5
5
  SHA512:
6
- metadata.gz: 2f0e5fe23895620b12225300aa54183bc5aea4b30229760814574c5c05519f99412e122edf12c811de78c4766d2d1c790283d4b29b1147ac2248a56c9707ec7b
7
- data.tar.gz: ce46b280fb17f6b79d91f9448014d59fd516e2d140742a0aa980339ba43ac04d8c7ed68dc1ed04ea252b935467fc8a6358e78e840cb0b570640ad501b6434d49
6
+ metadata.gz: bf1761a649d5ac269deeafb6ef09d93cb4c847c4cf153f09c37cb753753af8f88947195619245ec3acc9d7800ea4962a62d7b2367868021c4a84634e0499b254
7
+ data.tar.gz: 17be352857c262461c97e2f383cc3e08da98e1e73f9453d3938413d347deca01d63d7463a26f80c525114293500245d922b82c3ed74c87f2792a9c215abfeeb4
@@ -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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ v4.12.0 (May 2024)
2
+ - Update Dradis links in README
3
+
4
+ v4.11.0 (January 2024)
5
+ - Disable Dradis field selects with `N/A` value
6
+
1
7
  v4.10.0 (September 2023)
2
8
  - Update gemspec links
3
9
 
data/README.md CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  Upload CSV files into Dradis.
4
4
 
5
- The add-on requires [Dradis CE](https://dradisframework.org/) > 4.5, or [Dradis Pro](https://dradisframework.com/pro/) > 4.5.
5
+ The add-on requires [Dradis CE](https://dradis.com/ce/) > 4.5, or [Dradis Pro](https://dradis.com/).
6
6
 
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>
@@ -8,7 +8,7 @@ module Dradis
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 4
11
- MINOR = 10
11
+ MINOR = 12
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.10.0
4
+ version: 4.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-07 00:00:00.000000000 Z
11
+ date: 2024-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dradis-plugins
@@ -58,6 +58,7 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
+ - ".github/pull_request_template.md"
61
62
  - ".gitignore"
62
63
  - CHANGELOG.md
63
64
  - CHANGELOG.template