Skip to content

Commit

Permalink
Merge pull request #136 from DigitalSlideArchive/import-export-messages
Browse files Browse the repository at this point in the history
Update import and export messages.
  • Loading branch information
manthey authored Oct 2, 2020
2 parents 7712c9f + ffa0334 commit 3438b50
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

## Version 1.2.6

### Changes
- Updated import and export status messages (#136)

## Version 1.2.5

### Improvements
Expand Down
2 changes: 2 additions & 0 deletions wsi_deid/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def ingestOneItem(importFolder, imagePath, record, ctx, user):
assetstore = Assetstore().getCurrent()
name = record['ImageID'] + os.path.splitext(record['name'])[1]
mimeType = 'image/tiff'
if Item().findOne({'folderId': parentFolder['_id'], 'name': name}):
return 'duplicate'
item = Item().createItem(name=name, creator=user, folder=parentFolder)
file = File().createFile(
name=name, creator=user, item=item, reuseExisting=False,
Expand Down
29 changes: 15 additions & 14 deletions wsi_deid/web_client/views/HierarchyWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import HierarchyWidget from '@girder/core/views/widgets/HierarchyWidget';

function performAction(action) {
const actions = {
ingest: { done: 'Import complete.', fail: 'Failed to import.' },
export: { done: 'Recent export complete.', fail: 'Failed to export recent items.' },
exportall: { done: 'Export all complete.', fail: 'Failed to export all items.' }
ingest: { done: 'Import completed.', fail: 'Failed to import.' },
export: { done: 'Recent export task completed.', fail: 'Failed to export recent items. Check export file location for disk drive space or other system issues.' },
exportall: { done: 'Export all task completed.', fail: 'Failed to export all items. Check export file location for disk drive space or other system issues.' }
};

restRequest({
Expand All @@ -22,11 +22,12 @@ function performAction(action) {
if (resp.action === 'ingest') {
[
['added', 'added'],
['replaced', 'replaced'],
['missing', 'missing from import folder'],
['unlisted', 'missing from DeID Upload files'],
['present', 'already present'],
['failed', 'failed to import']
['replaced', 'replaced'],
['duplicate', 'with duplicate ImageID. Check DeID Upload file'],
['missing', 'missing from import folder. Check DeID Upload File and WSI image filenames'],
['unlisted', 'in the import folder, but not listed in a DeID Upload Excel/CSV file'],
['failed', 'failed to import. Check if image files is in an accepted WSI format']
].forEach(([key, desc]) => {
if (resp[key]) {
text += ` ${resp[key]} image${resp[key] > 1 ? 's' : ''} ${desc}.`;
Expand All @@ -38,29 +39,29 @@ function performAction(action) {
['notexcel', 'could not be read']
].forEach(([key, desc]) => {
if (resp[key]) {
text += ` ${resp[key]} Excel file${resp[key] > 1 ? 's' : ''} ${desc}.`;
text += ` ${resp[key]} DeID Upload Excel file${resp[key] > 1 ? 's' : ''} ${desc}.`;
any = true;
}
});
if (!any) {
text += ' Nothing to import.';
text = 'Nothing to import. Import folder is empty.';
}
}
if (resp.action === 'export' || resp.action === 'exportall') {
[
['finished', 'exported'],
['different', 'already present but different'],
['present', 'already exported'],
['quarantined', 'currently quarantined'],
['rejected', 'with rejected status']
['present', 'previously exported'],
['different', 'already present but different. Remove images from the export directory and select Export again'],
['quarantined', 'currently quarantined. Only files in "Approved" workflow stage are transferred to Export folder'],
['rejected', 'with rejected status. Only files in "Approved" workflow stage are transferred to Export folder']
].forEach(([key, desc]) => {
if (resp[key]) {
text += ` ${resp[key]} image${resp[key] > 1 ? 's' : ''} ${desc}.`;
any = true;
}
});
if (!any) {
text += ' Nothing to export.';
text = 'Nothing to export.';
}
}
events.trigger('g:alert', {
Expand Down

0 comments on commit 3438b50

Please sign in to comment.