1
0
Fork 0
* fixing issue #10470

* changelog

* changelog
This commit is contained in:
Heiko 2019-11-21 11:15:42 +01:00 committed by Michael Hackstein
parent c555cba6f5
commit 6080649ac7
3 changed files with 20 additions and 14 deletions

View File

@ -1,6 +1,9 @@
devel
-----
* Fixed issue #10470: The WebUI now shows potential errors and details which occured using _api/import (e.g.
unique constraint violated).
* Added startup option `--query.optimizer-rules` to selectively enable or disable
optimizer rules by default. The option can be specified multiple times, and takes
the same input as the query option of the same name.

View File

@ -360,9 +360,21 @@
},
uploadDocuments: function (file, callback) {
var analyzeResponse = function (data) {
if (data.hasOwnProperty('error')) {
delete data.error;
}
if (data.errors > 0) {
callback(true, 'Info: ' + JSON.stringify(data));
} else {
callback(false, 'Info: ' + JSON.stringify(data));
}
};
$.ajax({
type: 'POST',
url: arangoHelper.databaseUrl('/_api/import?type=auto&collection=' +
url: arangoHelper.databaseUrl('/_api/import?type=auto&details=true&collection=' +
encodeURIComponent(this.collectionID) +
'&createCollection=false'),
data: file,
@ -370,18 +382,8 @@
contentType: 'json',
dataType: 'json',
complete: function (xhr) {
if (xhr.readyState === 4 && xhr.status === 201) {
callback(false);
} else {
try {
var data = JSON.parse(xhr.responseText);
if (data.errors > 0) {
var result = 'At least one error occurred during upload';
callback(false, result);
}
} catch (err) {
console.log(err);
}
if (xhr.responseJSON) {
analyzeResponse(xhr.responseJSON);
}
},
error: function (msg) {

View File

@ -220,7 +220,7 @@
$('#documents_first').css('visibility', 'visible');
this.addDocumentSwitch = true;
this.collection.resetFilter();
this.collection.loadTotal(callback);
this.collection.loadCollectionConfig(callback);
this.restoredFilters = [];
// for resetting json upload
@ -249,6 +249,7 @@
if (error) {
arangoHelper.arangoError('Upload', msg);
} else {
arangoHelper.arangoMessage('Upload', msg);
this.hideImportModal();
this.resetView();
}