mirror of
https://github.com/nasa/openmct.git
synced 2025-06-12 04:08:22 +00:00
[Edit] SaveAs now calls finish()
This commit is contained in:
@ -166,11 +166,16 @@ define([
|
|||||||
.then(resolveWith(object));
|
.then(resolveWith(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
function commitEditingAfterClone(clonedObject) {
|
function saveAfterClone(clonedObject) {
|
||||||
return domainObject.getCapability("editor").save()
|
return domainObject.getCapability("editor").save()
|
||||||
.then(resolveWith(clonedObject));
|
.then(resolveWith(clonedObject));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function finishEditing(clonedObject) {
|
||||||
|
return domainObject.getCapability("editor").finish()
|
||||||
|
.then(resolveWith(clonedObject));
|
||||||
|
}
|
||||||
|
|
||||||
function onFailure() {
|
function onFailure() {
|
||||||
hideBlockingDialog();
|
hideBlockingDialog();
|
||||||
return false;
|
return false;
|
||||||
@ -182,7 +187,8 @@ define([
|
|||||||
.then(getParent)
|
.then(getParent)
|
||||||
.then(cloneIntoParent)
|
.then(cloneIntoParent)
|
||||||
.then(undirtyOriginals)
|
.then(undirtyOriginals)
|
||||||
.then(commitEditingAfterClone)
|
.then(saveAfterClone)
|
||||||
|
.then(finishEditing)
|
||||||
.then(hideBlockingDialog)
|
.then(hideBlockingDialog)
|
||||||
.catch(onFailure);
|
.catch(onFailure);
|
||||||
};
|
};
|
||||||
|
@ -78,9 +78,8 @@ define(
|
|||||||
|
|
||||||
mockEditorCapability = jasmine.createSpyObj(
|
mockEditorCapability = jasmine.createSpyObj(
|
||||||
"editor",
|
"editor",
|
||||||
["save", "cancel", "isEditContextRoot"]
|
["save", "isEditContextRoot"]
|
||||||
);
|
);
|
||||||
mockEditorCapability.cancel.andReturn(mockPromise(undefined));
|
|
||||||
mockEditorCapability.save.andReturn(mockPromise(true));
|
mockEditorCapability.save.andReturn(mockPromise(true));
|
||||||
mockEditorCapability.isEditContextRoot.andReturn(true);
|
mockEditorCapability.isEditContextRoot.andReturn(true);
|
||||||
capabilities.editor = mockEditorCapability;
|
capabilities.editor = mockEditorCapability;
|
||||||
|
Reference in New Issue
Block a user