From 79b16ddda643239e555a8807300bc0650e3b795e Mon Sep 17 00:00:00 2001 From: Alex M Date: Tue, 13 Sep 2016 21:24:20 +0300 Subject: [PATCH] [Edit] SaveAs now calls finish() --- platform/commonUI/edit/src/actions/SaveAsAction.js | 10 ++++++++-- .../commonUI/edit/test/actions/SaveAsActionSpec.js | 3 +-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/platform/commonUI/edit/src/actions/SaveAsAction.js b/platform/commonUI/edit/src/actions/SaveAsAction.js index 57a055429a..402fccb86c 100644 --- a/platform/commonUI/edit/src/actions/SaveAsAction.js +++ b/platform/commonUI/edit/src/actions/SaveAsAction.js @@ -166,11 +166,16 @@ define([ .then(resolveWith(object)); } - function commitEditingAfterClone(clonedObject) { + function saveAfterClone(clonedObject) { return domainObject.getCapability("editor").save() .then(resolveWith(clonedObject)); } + function finishEditing(clonedObject) { + return domainObject.getCapability("editor").finish() + .then(resolveWith(clonedObject)); + } + function onFailure() { hideBlockingDialog(); return false; @@ -182,7 +187,8 @@ define([ .then(getParent) .then(cloneIntoParent) .then(undirtyOriginals) - .then(commitEditingAfterClone) + .then(saveAfterClone) + .then(finishEditing) .then(hideBlockingDialog) .catch(onFailure); }; diff --git a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js index fd8ce18c07..6bf631feed 100644 --- a/platform/commonUI/edit/test/actions/SaveAsActionSpec.js +++ b/platform/commonUI/edit/test/actions/SaveAsActionSpec.js @@ -78,9 +78,8 @@ define( mockEditorCapability = jasmine.createSpyObj( "editor", - ["save", "cancel", "isEditContextRoot"] + ["save", "isEditContextRoot"] ); - mockEditorCapability.cancel.andReturn(mockPromise(undefined)); mockEditorCapability.save.andReturn(mockPromise(true)); mockEditorCapability.isEditContextRoot.andReturn(true); capabilities.editor = mockEditorCapability;