-
-
Notifications
You must be signed in to change notification settings - Fork 5
SF-3651 Allow serval admins to download training data #3614
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3614 +/- ##
=======================================
Coverage 82.82% 82.82%
=======================================
Files 610 610
Lines 37414 37432 +18
Branches 6152 6156 +4
=======================================
+ Hits 30987 31003 +16
+ Misses 5494 5482 -12
- Partials 933 947 +14 ☔ View full report in Codecov by Sentry. |
0816c20 to
046415e
Compare
pmachapman
left a comment
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 - just one comment when a training data file was originally uploaded from an Excel file
@pmachapman reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @RaymondLuong3)
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-project.component.ts line 338 at r1 (raw file):
if (trainingData == null) return this.noticeService.show('File not found'); this.fileService.onlineDownloadFile(FileType.TrainingData, trainingData.fileUrl, trainingData.title);
title is the original filename that was uploaded and wont end in .csv. All data is stored as CSV on our server (we do not store the original XLS or XLSX files if the user uploads an Excel file). Can you please have this set the file extension to ".csv" if the mimeType is text/csv?
Code quote:
this.fileService.onlineDownloadFile(FileType.TrainingData, trainingData.fileUrl, trainingData.title);51aa2e7 to
d653b70
Compare
RaymondLuong3
left a comment
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.
@RaymondLuong3 made 1 comment.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @pmachapman).
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-project.component.ts line 338 at r1 (raw file):
Previously, pmachapman (Peter Chapman) wrote…
titleis the original filename that was uploaded and wont end in .csv. All data is stored as CSV on our server (we do not store the original XLS or XLSX files if the user uploads an Excel file). Can you please have this set the file extension to ".csv" if themimeTypeistext/csv?
Thanks for the suggestion. I put the logic into fileService.ts since it might be useful for the auto-detection of the mime type. Let me know if that makes sense?
d653b70 to
94e1822
Compare
pmachapman
left a comment
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.
@pmachapman reviewed 2 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @RaymondLuong3).
src/SIL.XForge.Scripture/ClientApp/src/xforge-common/file.service.ts line 230 at r2 (raw file):
// use the .csv extension explicitly if the MIME type is csv filename = filename.split('.')[0] + '.csv'; }
This will return incorrect filenames for filenames like "test.data.xlsx". Something like this might be better?
if (blob.type === 'text/csv') {
const extensionIndex: number = filename.lastIndexOf('.');
filename = (extensionIndex !== -1 ? filename.substring(0, extensionIndex) : filename) + '.csv';
}Code quote:
if (blob.type === 'text/csv') {
// use the .csv extension explicitly if the MIME type is csv
filename = filename.split('.')[0] + '.csv';
}94e1822 to
9cf3b55
Compare
RaymondLuong3
left a comment
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.
@RaymondLuong3 made 1 comment.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @pmachapman).
src/SIL.XForge.Scripture/ClientApp/src/xforge-common/file.service.ts line 230 at r2 (raw file):
Previously, pmachapman (Peter Chapman) wrote…
This will return incorrect filenames for filenames like "test.data.xlsx". Something like this might be better?
if (blob.type === 'text/csv') { const extensionIndex: number = filename.lastIndexOf('.'); filename = (extensionIndex !== -1 ? filename.substring(0, extensionIndex) : filename) + '.csv'; }
You are right. How does this look?
pmachapman
left a comment
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.
@pmachapman reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @RaymondLuong3).
Serval admins can look at the training data files that have been uploaded for a specific project and can download those files. This will help serval admins more quickly identify issues using training data.
This change is