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

✨ Enhance ImportApplicationsForm: support for XLS, XLSX, ODS file formats #2104

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Shevijacobson
Copy link
Contributor

@Shevijacobson Shevijacobson commented Sep 22, 2024

adds support for uploading Excel (.xlsx, .xls) and OpenDocument Spreadsheet (.ods) formats in addition to CSV. It extends the file import functionality to support more common spreadsheet formats.

Before the Changes

Successful Upload of Supported File:
This screenshot shows a successful upload of a CSV file, which was the only supported format in the original version.

Screenshot from 2024-10-30 12-39-03

Selecting an Unsupported File:
Attempting to upload a file that is not in CSV format results in an error.

Screenshot from 2024-10-30 13-53-31

Error Message for Unsupported File:
An error message is shown, as only CSV files were supported prior to this update.

Screenshot from 2024-10-30 12-58-25

After the Changes

Successful Upload of Supported File:
The interface now accepts and processes files with .xlsx, .xls, and .ods extensions.

Screenshot from 2024-10-30 12-40-18

Selecting an Unsupported File:
Attempting to upload a file that is still unsupported, triggering an error.

Screenshot from 2024-10-30 12-38-52

Error Message for Unsupported File:
The system accurately displays an error when an unsupported file is chosen.

Screenshot from 2024-10-30 12-36-18

List of Uploaded Files with Supported Extensions:
Successfully uploaded files, including .xlsx and .ods, now appear in the upload list.

Screenshot from 2024-10-30 12-40-48

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.98%. Comparing base (b654645) to head (e3b1f6f).
Report is 244 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2104      +/-   ##
==========================================
+ Coverage   39.20%   41.98%   +2.78%     
==========================================
  Files         146      175      +29     
  Lines        4857     5630     +773     
  Branches     1164     1415     +251     
==========================================
+ Hits         1904     2364     +460     
- Misses       2939     3145     +206     
- Partials       14      121     +107     
Flag Coverage Δ
client 41.98% <ø> (+2.78%) ⬆️
server ?

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.

@Shevijacobson Shevijacobson force-pushed the miri_shevi_enhance-import-format branch from c0c3c0b to 312405d Compare October 6, 2024 12:32
@Shevijacobson Shevijacobson changed the title ✨ Extend file upload to support Excel and ODS ✨ Enhance ImportApplicationsForm: support for XLS, XLSX, ODS file formats Oct 9, 2024
@Shevijacobson Shevijacobson marked this pull request as ready for review October 9, 2024 06:41
Copy link
Collaborator

@rszwajko rszwajko left a comment

Choose a reason for hiding this comment

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

Looks good! Please attach some screenshots presenting the change and error message.

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

Does the hub support file uploads of those types?

What issue or ticket is this PR fixing? Is it #2112?

@Shevijacobson
Copy link
Contributor Author

Looks good! Please attach some screenshots presenting the change and error message.

I have added screenshots that present the changes and the error message as requested.

@Shevijacobson
Copy link
Contributor Author

Does the hub support file uploads of those types?
What issue or ticket is this PR fixing? Is it #2112?

The hub currently only supports CSV files, so I handle the file format conversion in the UI. Now, supported file types (like Excel and OpenDocument) are converted to CSV in the UI before being uploaded to the server. This approach avoids needing to add additional format support on the server.
Done in 9114f1e

The issue related is: konveyor/enhancements#121
Regarding issue #2112 - we could not reproduce it.

Copy link
Collaborator

@rszwajko rszwajko left a comment

Choose a reason for hiding this comment

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

IMHO we should search for an approach that doesn't require parsing and in-browser conversion to CSV or look for a different library.
The xlsx lib is a heavy one (claimed unpacked size of 7.5 MB) and has confusing browser/os support matrix (https://www.npmjs.com/package/xlsx)

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.

3 participants