Skip to content

Commit

Permalink
Sorted excel output and misc bug fixes (#537)
Browse files Browse the repository at this point in the history
* sorted excel output and misc bug fixes

* line limit fix
  • Loading branch information
rlakey authored Feb 14, 2023
1 parent faa8f0f commit 25adb69
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/helpers/export_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ module ExportHelper # rubocop:todo Metrics/ModuleLength
'fix_text' => 'The requirement is NA. No fix is required.'
},
'Applicable - Inherently Meets' => {
'check_text' => 'The technology supports this requirement and cannot be configured to be out of compliance.
The technology inherently meets this requirement.',
'check_text' => 'The technology supports this requirement and cannot be configured to be out of compliance. ' \
'The technology inherently meets this requirement.',
'fix_text' => 'This technology inherently meets this requirement. No fix is required.'
},
'Applicable - Does Not Meet' => {
'check_text' => 'The technology does not support this requirement. This is an applicable-does not meet finding.',
'fix_text' => 'This requirement is a permanent finding and cannot be fixed.
An appropriate mitigation for the system must be implemented, but this finding cannot be considered fixed.'
'fix_text' => 'This requirement is a permanent finding and cannot be fixed. ' \
'An appropriate mitigation for the system must be implemented, ' \
'but this finding cannot be considered fixed.'
}
}.freeze

Expand Down Expand Up @@ -48,7 +49,7 @@ def export_excel(project, components_type, is_disa_export)
worksheet.auto_width = true
worksheet.append_row(ExportConstants::DISA_EXPORT_HEADERS)
last_row_num = 0
component.rules.each do |rule|
component.rules.order(:version, :rule_id).each do |rule|
# fast_excel unfortunately does not provide a method to modify the @last_row_number class variable
# so it needs to be manually kept track of
csv_attributes = rule.csv_attributes
Expand All @@ -71,7 +72,7 @@ def export_excel(project, components_type, is_disa_export)
csv_attributes[CSV_ATTRIBUTE_MAP[:mitigation]] = nil
when 'Not Applicable'
csv_attributes[CSV_ATTRIBUTE_MAP[:mitigation]] = nil
csv_attributes[CSV_ATTRIBUTE_MAP[:status_justification]] = nil
csv_attributes[CSV_ATTRIBUTE_MAP[:artifact_description]] = nil
end
end

Expand Down

0 comments on commit 25adb69

Please sign in to comment.