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

feat: Add download CSV funtionality to Reports page #286

Merged
merged 13 commits into from
Sep 3, 2022

Conversation

chadstewart
Copy link
Contributor

@chadstewart chadstewart commented Sep 1, 2022

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Description

This PR adds the feature of downloading CSVs from the reports page.

Details:

  • Added the filters to the filter options dropdown
  • Added the npm package react.csv to project and it handles generating a React component that allows you to download a csv.
  • Use a callback to get the selected filter and create the report object that will be passed to report history.
  • Currently we just use the useRepositoriesList hook to get some data to simulate. The intention in the future would be to have a function that'll use the correct endpoint and get data from there.
  • All the reports are currently stored in localstorage.
  • Made some CSS changes to fix issue with being displayed in mobile screens up to 375px. Current date being a potentially long string breaks design at 320px.

Related Tickets & Documents

Fixes #284
Fixes #288

Mobile & Desktop Screenshots/Recordings

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ““ docs.opensauced.pizza
  • πŸ• dev.to/opensauced
  • πŸ“• storybook
  • πŸ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

@netlify
Copy link

netlify bot commented Sep 1, 2022

βœ… Deploy Preview for design-insights ready!

Name Link
πŸ”¨ Latest commit f275796
πŸ” Latest deploy log https://app.netlify.com/sites/design-insights/deploys/63124987a028f2000929b657
😎 Deploy Preview https://deploy-preview-286--design-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 1, 2022

βœ… Deploy Preview for oss-insights ready!

Name Link
πŸ”¨ Latest commit f275796
πŸ” Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/63124987c3daac0009fece7b
😎 Deploy Preview https://deploy-preview-286--oss-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@chadstewart chadstewart marked this pull request as ready for review September 2, 2022 13:25
@chadstewart chadstewart added the needs review PRs that need review from core engineering team label Sep 2, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Watched Files

This pull request modifies specific files that require careful review by the maintainers.

Files Matched

  • npm-shrinkwrap.json
  • package.json

@chadstewart chadstewart removed the needs review PRs that need review from core engineering team label Sep 2, 2022
@chadstewart chadstewart marked this pull request as draft September 2, 2022 15:43
@chadstewart chadstewart marked this pull request as ready for review September 2, 2022 18:23
@chadstewart chadstewart added the needs review PRs that need review from core engineering team label Sep 2, 2022
Copy link
Contributor

@0-vortex 0-vortex left a comment

Choose a reason for hiding this comment

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

Code LGTM! πŸ‘

Regarding CSV generation, most likely that will happen on the backend with https://csv.js.org - the way that library works it's likely reusable across endpoints if you feel like doing a refactor! πŸ•

@chadstewart
Copy link
Contributor Author

Code LGTM! +1

Regarding CSV generation, most likely that will happen on the backend with https://csv.js.org - the way that library works it's likely reusable across endpoints if you feel like doing a refactor! pizza

So honestly, a lot of this work I view as a temporary solution until we can get a more back-end focused solution up and running. Really just here to at least have the functionality in some form.

Copy link
Member

@bdougie bdougie left a comment

Choose a reason for hiding this comment

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

This will definitely need to be a limited feature (paid) and may even need to limit which data is downloadable.

Functional works though

@chadstewart chadstewart merged commit ada79d3 into beta Sep 3, 2022
@chadstewart chadstewart deleted the 284-repo-list-response-to-csv branch September 3, 2022 00:58
github-actions bot pushed a commit that referenced this pull request Sep 3, 2022
## [1.4.0-beta.3](v1.4.0-beta.2...v1.4.0-beta.3) (2022-09-03)

### πŸ• Features

* Add download CSV funtionality to Reports page ([#286](#286)) ([ada79d3](ada79d3))
@github-actions
Copy link

github-actions bot commented Sep 3, 2022

πŸŽ‰ This PR is included in version 1.4.0-beta.3 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

github-actions bot pushed a commit that referenced this pull request Sep 6, 2022
## [1.4.0](v1.3.0...v1.4.0) (2022-09-06)

### πŸ§‘β€πŸ’» Code Refactoring

* Add types to useRepositoriesList hook ([#277](#277)) ([4f1a771](4f1a771))

### πŸ• Features

* Add download CSV funtionality to Reports page ([#286](#286)) ([ada79d3](ada79d3))
* **footer:** swap out footer text ([#296](#296)) ([737df5b](737df5b))
* Update Scatter Chart Legend ([#260](#260)) ([309ef62](309ef62))

### πŸ› Bug Fixes

* Add background to selectable tr table ([#252](#252)) ([7d6ae16](7d6ae16)), closes [#183](#183) [#289](#289)
* Contributor card overlap on smaller devices ([#298](#298)) ([777f6ba](777f6ba)), closes [#290](#290)
* correct netlify build supabase redirect url ([#283](#283)) ([0b2b80a](0b2b80a))
* Filter dropdown can only be closed by clicking on the filter button ([#299](#299)) ([bce1f8e](bce1f8e)), closes [#292](#292)
* Fixing issues with TopNav and Highlight Card ([#294](#294)) ([218f30d](218f30d)), closes [#287](#287) [#291](#291)
* grammar for header description ([#279](#279)) ([a019912](a019912))
ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this pull request Aug 17, 2023
## [1.4.0-beta.3](open-sauced/app@v1.4.0-beta.2...v1.4.0-beta.3) (2022-09-03)

### πŸ• Features

* Add download CSV funtionality to Reports page ([#286](open-sauced/app#286)) ([ada79d3](open-sauced/app@ada79d3))
ElpisHelle added a commit to ElpisHelle/next.js-tailwindcss that referenced this pull request Aug 17, 2023
## [1.4.0](open-sauced/app@v1.3.0...v1.4.0) (2022-09-06)

### πŸ§‘β€πŸ’» Code Refactoring

* Add types to useRepositoriesList hook ([#277](open-sauced/app#277)) ([4f1a771](open-sauced/app@4f1a771))

### πŸ• Features

* Add download CSV funtionality to Reports page ([#286](open-sauced/app#286)) ([ada79d3](open-sauced/app@ada79d3))
* **footer:** swap out footer text ([#296](open-sauced/app#296)) ([737df5b](open-sauced/app@737df5b))
* Update Scatter Chart Legend ([#260](open-sauced/app#260)) ([309ef62](open-sauced/app@309ef62))

### πŸ› Bug Fixes

* Add background to selectable tr table ([#252](open-sauced/app#252)) ([7d6ae16](open-sauced/app@7d6ae16)), closes [#183](open-sauced/app#183) [#289](open-sauced/app#289)
* Contributor card overlap on smaller devices ([#298](open-sauced/app#298)) ([777f6ba](open-sauced/app@777f6ba)), closes [#290](open-sauced/app#290)
* correct netlify build supabase redirect url ([#283](open-sauced/app#283)) ([0b2b80a](open-sauced/app@0b2b80a))
* Filter dropdown can only be closed by clicking on the filter button ([#299](open-sauced/app#299)) ([bce1f8e](open-sauced/app@bce1f8e)), closes [#292](open-sauced/app#292)
* Fixing issues with TopNav and Highlight Card ([#294](open-sauced/app#294)) ([218f30d](open-sauced/app@218f30d)), closes [#287](open-sauced/app#287) [#291](open-sauced/app#291)
* grammar for header description ([#279](open-sauced/app#279)) ([a019912](open-sauced/app@a019912))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review PRs that need review from core engineering team released on @beta
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Design breaks in mobile on Reports page. [Front-End] Download data from useRepositoriesList to a CSV
3 participants