mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 11:17:04 +00:00
Improvements to copy notifications
This commit is contained in:
parent
05722d9b11
commit
f44819a7fe
@ -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){
|
||||
|
@ -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));
|
||||
|
@ -140,7 +140,7 @@ define(
|
||||
.args[0](newParent);
|
||||
|
||||
expect(composeService.perform)
|
||||
.toHaveBeenCalledWith(selectedObject, newParent);
|
||||
.toHaveBeenCalledWith(selectedObject, newParent, undefined);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user