diff --git a/platform/entanglement/src/actions/CopyAction.js b/platform/entanglement/src/actions/CopyAction.js index 1fb8a29229..a8dbf95d4c 100644 --- a/platform/entanglement/src/actions/CopyAction.js +++ b/platform/entanglement/src/actions/CopyAction.js @@ -66,15 +66,12 @@ define( } notificationModel.progress = (processed / totalObjects) * 100; notificationModel.title = ["Copied ", processed, "of ", totalObjects, "objects"].join(" "); - if (processed === totalObjects){ - notification.dismiss(); - self.notificationService.info(["Successfully copied ", totalObjects, " items."].join("")); - } } } AbstractComposeAction.prototype.perform.call(this, progress) .then(function(){ + notification.dismiss(); self.notificationService.info("Copying complete."); }) .catch(function (error){ diff --git a/platform/entanglement/src/services/CopyService.js b/platform/entanglement/src/services/CopyService.js index ee22f592c1..aaa3227f8c 100644 --- a/platform/entanglement/src/services/CopyService.js +++ b/platform/entanglement/src/services/CopyService.js @@ -114,7 +114,6 @@ define( return modelClone; }); }); - }; return copy(domainObject, parent).then(function(){ return clones; @@ -137,7 +136,7 @@ define( return self.$q.all(objectClones.map(function(clone, index){ return self.persistenceService.createObject(clone.persistenceSpace, clone.model.id, clone.model) .then(function(){ - progress("copying", objectClones.length, ++persisted); + progress && progress("copying", objectClones.length, ++persisted); }); })).then(function(){ return objectClones}); } @@ -177,7 +176,7 @@ define( var $q = this.$q, self = this; if (this.validate(domainObject, parent)) { - progress("preparing"); + progress && progress("preparing"); return this.buildCopyPlan(domainObject, parent) .then(self.persistObjects(progress)) .then(self.addClonesToParent(parent, progress)); diff --git a/platform/entanglement/test/actions/AbstractComposeActionSpec.js b/platform/entanglement/test/actions/AbstractComposeActionSpec.js index 5be0604ec3..b65e0569ff 100644 --- a/platform/entanglement/test/actions/AbstractComposeActionSpec.js +++ b/platform/entanglement/test/actions/AbstractComposeActionSpec.js @@ -140,7 +140,7 @@ define( .args[0](newParent); expect(composeService.perform) - .toHaveBeenCalledWith(selectedObject, newParent); + .toHaveBeenCalledWith(selectedObject, newParent, undefined); }); }); });