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

Add xlsx support #275

Merged
merged 3 commits into from
Mar 5, 2024
Merged

Add xlsx support #275

merged 3 commits into from
Mar 5, 2024

Conversation

gulderov
Copy link
Contributor

@gulderov gulderov commented Jan 12, 2024

Description

XLSX support added

This feature aims to improve the user experience by providing dynamic and visually appealing reports. Some enhancements are applied by default to make report more friendly to users

  • Header row freeze
  • Bold and aligned header text
  • Auto filter for each column
  • Column width adjusted by content

Dependencies

This PR is part of improvements and should be merged in conjuction with opensearch-project/reporting#940

Issues Resolved

Closes #274

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Please check report example:
On_demand_report_2024-02-14T11_54_04.778Z_c073cca0-cb2f-11ee-b7b5-53678459d314.xlsx

  1. Download button added to popover:
SCR-20240214-nlyp
  1. The file format selector updated with xlsx format option:
SCR-20240214-nmnb
  1. Reports Dashboard allowing to download xlsx format:
SCR-20240214-nmig

Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

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

thanks for the PR! briefly went through looks good, i'll try to look more in detail

package.json Outdated
@@ -39,7 +39,8 @@
"react-toast-notifications": "^2.4.0",
"set-interval-async": "1.0.33",
"showdown": "^1.9.1",
"tesseract.js": "^4.0.2"
"tesseract.js": "^4.0.2",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz"
Copy link
Member

Choose a reason for hiding this comment

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

looks like sheetjs is not publishing to npm registry anymore https://git.sheetjs.com/sheetjs/sheetjs/issues/3055, i'm not sure if our vulnerability scan tools support libraries like this

Choose a reason for hiding this comment

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

Scanners scan built artifacts, and they identify some CVEs by examining package.json and subdeps. I have never heard of an npm requirement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joshuali925 @wbeckler

I have updated the pull request with transition from xlsx to ExcelJS

This change was motivated by several factors:

  • Robust API
  • Advanced styling options available out of the box
  • Availability on npm

Copy link
Member

Choose a reason for hiding this comment

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

thanks. @sumukhswamy could you help to take a look at this when you can?

gulderov added a commit to gulderov/dashboards-reporting that referenced this pull request Feb 14, 2024
gulderov added a commit to gulderov/dashboards-reporting that referenced this pull request Feb 15, 2024
Signed-off-by: Danila Gulderov <[email protected]>
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@a9c0c95). Click here to learn what that means.

❗ Current head 67ee569 differs from pull request most recent head b8f3448. Consider uploading reports for the commit b8f3448 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #275   +/-   ##
=======================================
  Coverage        ?   71.05%           
=======================================
  Files           ?       31           
  Lines           ?     2011           
  Branches        ?      430           
=======================================
  Hits            ?     1429           
  Misses          ?      579           
  Partials        ?        3           
Flag Coverage Δ
dashboards-report 71.05% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Rupal Mahajan <[email protected]>
@gulderov gulderov force-pushed the xlsx branch 2 times, most recently from 67ee569 to b8f3448 Compare March 5, 2024 15:02
Copy link
Member

@rupal-bq rupal-bq left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

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

thanks!

@joshuali925 joshuali925 merged commit a811806 into opensearch-project:main Mar 5, 2024
19 of 22 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-reporting/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-reporting/backport-2.x
# Create a new branch
git switch --create backport/backport-275-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a8118062a4f94961a9234ac9e7347750199ee23f
# Push it to GitHub
git push --set-upstream origin backport/backport-275-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-reporting/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-275-to-2.x.

joshuali925 pushed a commit to joshuali925/dashboards-reporting that referenced this pull request Mar 5, 2024
Signed-off-by: Danila Gulderov <[email protected]>
Signed-off-by: Rupal Mahajan <[email protected]>
Co-authored-by: Rupal Mahajan <[email protected]>
(cherry picked from commit a811806)
@joshuali925 joshuali925 mentioned this pull request Mar 5, 2024
6 tasks
rupal-bq pushed a commit that referenced this pull request Mar 7, 2024
Signed-off-by: Danila Gulderov <[email protected]>
Signed-off-by: Rupal Mahajan <[email protected]>
Co-authored-by: Rupal Mahajan <[email protected]>
(cherry picked from commit a811806)

Co-authored-by: Danila Gulderov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] XLSX reports
5 participants