8000 Bug fix 3.4/issue 10470 by hkernbach · Pull Request #10498 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Bug fix 3.4/issue 10470 #10498

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

Merged
merged 4 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
v3.4.9 (XXXX-XX-XX)
-------------------

* Fixed issue #10470: The WebUI now shows potential errors and details which
occured using _api/import (e.g. unique constraint violated).

* Updated arangosync to 0.7.0.

* Make the timeouts for replication requests (for active failover and master-slave
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,28 +371,30 @@
},

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,
processData: false,
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -249,6 +249,7 @@
if (error) {
arangoHelper.arangoError('Upload', msg);
} else {
arangoHelper.arangoMessage('Upload', msg);
this.hideImportModal();
this.resetView();
}
Expand Down
0