Stop import spinner when import failed

This commit is contained in:
Stan Hu 2018-07-01 06:19:40 -07:00
parent 8377057364
commit 5f73bbc614

View file

@ -45,6 +45,8 @@ class ImporterStatus {
}
$btn.disable().addClass('is-loading');
this.id = id;
return axios.post(this.importUrl, {
repo_id: id,
target_namespace: targetNamespace,
@ -70,6 +72,10 @@ class ImporterStatus {
.catch((error) => {
let details = error;
const jobItem = $(`#repo_${this.id}`);
const statusField = jobItem.find('.job-status');
statusField.html(__('Failed'));
if (error.response && error.response.data && error.response.data.errors) {
details = error.response.data.errors;
}