mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
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:
parent
192b1582f5
commit
68d8e6a3a9
|
@ -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 {
|
||||
|
|
|
@ -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!');
|
||||
|
|
Loading…
Reference in a new issue