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

Export lists #1992

Merged
merged 18 commits into from
Aug 24, 2024
Merged

Export lists #1992

merged 18 commits into from
Aug 24, 2024

Conversation

caiosba
Copy link
Contributor

@caiosba caiosba commented Aug 16, 2024

Description

Allow lists (core, custom, search results, articles, filtered or not) to be exported to a CSV file that is sent to e-mail.

  • Add an exportList GraphQL mutation
  • Implement a generic export class that supports media, articles and feeds
  • Validate maximum number of results (which is a global configuration key)
  • Validate permission
  • Create Sidekiq job to export results
  • Create a CSV for the export
  • Save CSV in S3 using a pre-signed URL that expires after X days ("X" is a global configuration key)
  • Add support to MailCatcher
  • Send CSV by e-mail
  • Automated tests
  • Make sure it works for articles as well
  • Make sure it works for shared feeds as well

References: CV2-5067 and CV2-4979.

How has this been tested?

Automated tests implemented for 100% coverage.

Checklist

  • I have performed a self-review of my own code
  • I have added unit and feature tests, if the PR implements a new feature or otherwise would benefit from additional testing
  • I have added regression tests, if the PR fixes a bug
  • I have added logging, exception reporting, and custom tracing with any additional information required for debugging
  • I considered secure coding practices when writing this code. Any security concerns are noted above.
  • I have commented my code in hard-to-understand areas, if any
  • I have made needed changes to the README
  • My changes generate no new warnings
  • If I added a third party module, I included a rationale for doing so and followed our current guidelines

lib/check_search.rb Fixed Show fixed Hide fixed
@caiosba caiosba marked this pull request as ready for review August 23, 2024 23:51
Comment on lines +33 to +37
csv_string = CSV.generate do |csv|
self.export_data.each do |row|
csv << row
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need more details for myself to user csv for do and then use csv << row so what's the expected value for csv_string it will be csv array

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It generates a CSV string, really.

Copy link
Contributor

@melsawy melsawy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work Dr Caio

@caiosba caiosba merged commit f1f3b6c into develop Aug 24, 2024
10 checks passed
@caiosba caiosba deleted the feature/CV2-5067-CV2-4979-export-list branch August 24, 2024 11:44
DGaffney pushed a commit that referenced this pull request Aug 27, 2024
Allow lists (core, custom, search results, articles, filtered or not) to be exported to a CSV file that is sent to e-mail.

- [x] Add an `exportList` GraphQL mutation
- [x] Implement a generic export class that supports media, articles and feeds
- [x] Validate maximum number of results (which is a global configuration key)
- [x] Validate permission
- [x] Create Sidekiq job to export results
- [x] Create a CSV for the export
- [x] Save CSV in S3 using a pre-signed URL that expires after X days ("X" is a global configuration key)
- [x] Add support to MailCatcher
- [x] Send CSV by e-mail
- [x] Automated tests
- [x] Make sure it works for articles as well
- [x] Make sure it works for shared feeds as well

References: CV2-5067 and CV2-4979.
DGaffney pushed a commit that referenced this pull request Aug 27, 2024
Allow lists (core, custom, search results, articles, filtered or not) to be exported to a CSV file that is sent to e-mail.

- [x] Add an `exportList` GraphQL mutation
- [x] Implement a generic export class that supports media, articles and feeds
- [x] Validate maximum number of results (which is a global configuration key)
- [x] Validate permission
- [x] Create Sidekiq job to export results
- [x] Create a CSV for the export
- [x] Save CSV in S3 using a pre-signed URL that expires after X days ("X" is a global configuration key)
- [x] Add support to MailCatcher
- [x] Send CSV by e-mail
- [x] Automated tests
- [x] Make sure it works for articles as well
- [x] Make sure it works for shared feeds as well

References: CV2-5067 and CV2-4979.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants