-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: main
Are you sure you want to change the base?
✨ Enhance ImportApplicationsForm: support for XLS, XLSX, ODS file formats #2104
Conversation
Signed-off-by: Shevijacobson <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Shevijacobson <[email protected]>
Signed-off-by: shevijacobson <[email protected]>
c0c3c0b
to
312405d
Compare
There was a problem hiding this 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.
There was a problem hiding this 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?
Signed-off-by: shevijacobson <[email protected]>
I have added screenshots that present the changes and the error message as requested. |
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. The issue related is: konveyor/enhancements#121 |
There was a problem hiding this 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)
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.
Selecting an Unsupported File:
Attempting to upload a file that is not in CSV format results in an error.
Error Message for Unsupported File:
An error message is shown, as only CSV files were supported prior to this update.
After the Changes
Successful Upload of Supported File:
The interface now accepts and processes files with .xlsx, .xls, and .ods extensions.
Selecting an Unsupported File:
Attempting to upload a file that is still unsupported, triggering an error.
Error Message for Unsupported File:
The system accurately displays an error when an unsupported file is chosen.
List of Uploaded Files with Supported Extensions:
Successfully uploaded files, including .xlsx and .ods, now appear in the upload list.