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

Sorted excel output and misc bug fixes #537

Merged
merged 2 commits into from
Feb 14, 2023
Merged
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
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