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

Shows persistent info alert when processing file, and at end of processing #304

Merged
merged 1 commit into from
Feb 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/components/Menu/MenuContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class MenuContainer extends Component {
if (file.zip_name) {
msg += " from {}".format(file.zip_name);
}
this.props.alert.info(
msg
this.alert = this.props.alert.info(
msg, { timeout: 0 }
);
this.getFileMeta(file.path, callback);
},
Expand All @@ -62,6 +62,7 @@ class MenuContainer extends Component {
unlinkSync(file.path);
}
});
this.props.alert.info('Finished processing all files', { timeout: 0 });
}
);
});
Expand Down Expand Up @@ -127,8 +128,8 @@ class MenuContainer extends Component {
if (file.zip_name) {
msg += " from {}".format(file.zip_name);
}
this.props.alert.info(
msg
this.alert = this.props.alert.info(
msg, { timeout: 0 }
);
this.getFileMeta(file.path, callback);
},
Expand All @@ -142,6 +143,7 @@ class MenuContainer extends Component {
unlinkSync(file.path);
}
});
this.props.alert.info('Finished processing all files', { timeout: 0 });
}
);

Expand Down Expand Up @@ -185,11 +187,11 @@ class MenuContainer extends Component {
var path = files[index].path;
var name = files[index].name;

this.props.alert.info(
'Unzipping file {}'.format(name)
);

if (isZipSync(path)) {
var alert = this.props.alert.info(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix mistake in #302 where the message was shown even for non-zip files

'Unzipping file {}'.format(name)
);

await createReadStream(path)
.pipe(Parse())
.on('error', function(error) {
Expand Down Expand Up @@ -217,6 +219,7 @@ class MenuContainer extends Component {
});
})
.promise();
alert.close();
} else {
processed.push({ path: path, name: name, delete: false });
}
Expand Down Expand Up @@ -329,6 +332,9 @@ class MenuContainer extends Component {
this.setState({ progress: 100 });
emitter.emit('refreshDBData');
console.timeEnd('IngestTime');
if (this.alert) { // close currently shown info alert
this.alert.close();
}
callback();
}.bind(this)
);
Expand Down