1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-21 05:31:42 +00:00

Fix tests, add logs for #117

This commit is contained in:
jendib
2016-11-20 18:52:47 +01:00
parent b36d08db8e
commit 1d78551f4c
2 changed files with 17 additions and 12 deletions

View File

@@ -94,6 +94,7 @@ angular.module('docs').controller('DocumentEdit', function($rootScope, $scope, $
// Upload files after edition
promise.then(function(data) {
console.log('document created, adding file', $scope.newFiles);
$scope.fileProgress = 0;
// When all files upload are over, attach orphan files and move on
@@ -133,6 +134,7 @@ angular.module('docs').controller('DocumentEdit', function($rootScope, $scope, $
};
// Build the payload
console.log('sending file', key, $scope.newFiles[key], data);
var file = $scope.newFiles[key];
var formData = new FormData();
formData.append('id', data.id);
@@ -147,6 +149,7 @@ angular.module('docs').controller('DocumentEdit', function($rootScope, $scope, $
contentType: false,
processData: false,
success: function(response) {
console.log('file uploaded successfully', formData);
deferred.resolve(response);
},
error: function(jqXHR) {
@@ -192,11 +195,13 @@ angular.module('docs').controller('DocumentEdit', function($rootScope, $scope, $
var then = function() {
key++;
if ($scope.newFiles[key]) {
console.log('sending new file');
sendFile(key).then(then);
} else {
$scope.fileIsUploading = false;
$scope.fileProgress = 0;
$rootScope.pageTitle = 'Sismics Docs';
console.log('finished sending files, bye');
navigateNext();
}
};