Importer again (#2260)

* Quote item names when displaying in error table.

* Remove the danger class as well as the warning class when uploading a file.  Fixes a display error if a file is successful after a file fails upload.
This commit is contained in:
Daniel Meltzer 2016-07-18 18:46:03 -04:00 committed by snipe
parent 192b1582f5
commit 68d8e6a3a9
2 changed files with 7 additions and 7 deletions

View file

@ -341,7 +341,7 @@ class ObjectImportCommand extends Command
$this->log('Asset Model ' . $asset_model_name . ' with model number ' . $asset_modelno . ' was created');
return $asset_model;
} else {
$this->jsonError('Asset Model ' . $asset_model_name, $asset_model->getErrors());
$this->jsonError('Asset Model "' . $asset_model_name . '"', $asset_model->getErrors());
return $asset_model;
}
} else {
@ -388,7 +388,7 @@ class ObjectImportCommand extends Command
$this->log('Category ' . $asset_category . ' was created');
return $category;
} else {
$this->jsonError('Category '. $asset_category, $category->getErrors());
$this->jsonError('Category "'. $asset_category. '"', $category->getErrors());
return $category;
}
} else {
@ -463,7 +463,7 @@ class ObjectImportCommand extends Command
$this->log('Status ' . $asset_statuslabel_name . ' was created');
return $status;
} else {
$this->jsonError('Status '. $asset_statuslabel_name, $status->getErrors());
$this->jsonError('Status "'. $asset_statuslabel_name . '"', $status->getErrors());
return $status;
}
} else {
@ -512,7 +512,7 @@ class ObjectImportCommand extends Command
$this->log('Manufacturer ' . $manufacturer->name . ' was created');
return $manufacturer;
} else {
$this->jsonError('Manufacturer '. $manufacturer->name, $manufacturer->getErrors());
$this->jsonError('Manufacturer "'. $manufacturer->name . '"', $manufacturer->getErrors());
return $manufacturer;
}
@ -696,7 +696,7 @@ class ObjectImportCommand extends Command
if ($user->save()) {
$this->log('User '.$first_name.' created');
} else {
$this->jsonError('User', $user->getErrors());
$this->jsonError('User "' . $first_name . '"', $user->getErrors());
}
} else {

View file

@ -137,13 +137,13 @@
// We use this instead of the fail option, since our API
// returns a 200 OK status which always shows as "success"
if (data && data.jqXHR.responseJSON.error && data.jqXHR.responseJSON && data.jqXHR.responseJSON.error) {
if (data && data.jqXHR.responseJSON && data.jqXHR.responseJSON.error) {
$('#progress-bar-text').html(data.jqXHR.responseJSON.error);
$('.progress-bar').removeClass('progress-bar-warning').addClass('progress-bar-danger').css('width','100%');
$('.progress-checkmark').fadeIn('fast').html('<i class="fa fa-times fa-3x icon-white" style="color: #d9534f"></i>');
//console.log(data.jqXHR.responseJSON.error);
} else {
$('.progress-bar').removeClass('progress-bar-warning').addClass('progress-bar-success').css('width','100%');
$('.progress-bar').removeClass('progress-bar-warning').removeClass('progress-bar-danger').addClass('progress-bar-success').css('width','100%');
$('.progress-checkmark').fadeIn('fast');
$('#progress-container').delay(950).css('visibility', 'visible');
$('.progress-bar-text').html('Finished!');