From 438274501231e46a2049054312fa67e2085385d5 Mon Sep 17 00:00:00 2001 From: Alex M Date: Tue, 13 Sep 2016 22:35:11 +0300 Subject: [PATCH] [Edit] Final two actions now use finish() --- platform/commonUI/edit/src/actions/EditAction.js | 2 +- platform/commonUI/edit/src/creation/CreateAction.js | 2 +- platform/commonUI/edit/test/actions/EditActionSpec.js | 6 +++--- platform/commonUI/edit/test/creation/CreateActionSpec.js | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/commonUI/edit/src/actions/EditAction.js b/platform/commonUI/edit/src/actions/EditAction.js index bd30968289..9c14abad2a 100644 --- a/platform/commonUI/edit/src/actions/EditAction.js +++ b/platform/commonUI/edit/src/actions/EditAction.js @@ -71,7 +71,7 @@ define( EditAction.prototype.perform = function () { var self = this; function cancelEditing() { - self.domainObject.getCapability('editor').cancel(); + self.domainObject.getCapability('editor').finish(); self.navigationService.removeListener(cancelEditing); } //If this is not the currently navigated object, then navigate diff --git a/platform/commonUI/edit/src/creation/CreateAction.js b/platform/commonUI/edit/src/creation/CreateAction.js index 14b8443462..3cfbdb0ef9 100644 --- a/platform/commonUI/edit/src/creation/CreateAction.js +++ b/platform/commonUI/edit/src/creation/CreateAction.js @@ -72,7 +72,7 @@ define( } function onCancel() { - return editorCapability.cancel(); + return editorCapability.finish(); } newModel.type = this.type.getKey(); diff --git a/platform/commonUI/edit/test/actions/EditActionSpec.js b/platform/commonUI/edit/test/actions/EditActionSpec.js index c896e83dd1..5e54b67e15 100644 --- a/platform/commonUI/edit/test/actions/EditActionSpec.js +++ b/platform/commonUI/edit/test/actions/EditActionSpec.js @@ -58,7 +58,7 @@ define( ); mockEditor = jasmine.createSpyObj( "editorCapability", - ["edit", "isEditContextRoot", "cancel"] + ["edit", "isEditContextRoot", "finish"] ); capabilities = { @@ -98,11 +98,11 @@ define( expect(EditAction.appliesTo(actionContext)).toBe(false); }); - it ("cancels editing when user navigates away", function () { + it ("finishes editing when user navigates away", function () { action.perform(); expect(mockNavigationService.addListener).toHaveBeenCalled(); mockNavigationService.addListener.mostRecentCall.args[0](); - expect(mockEditor.cancel).toHaveBeenCalled(); + expect(mockEditor.finish).toHaveBeenCalled(); }); it ("invokes the Edit capability on the object", function () { diff --git a/platform/commonUI/edit/test/creation/CreateActionSpec.js b/platform/commonUI/edit/test/creation/CreateActionSpec.js index d65621f9a8..19dc46896f 100644 --- a/platform/commonUI/edit/test/creation/CreateActionSpec.js +++ b/platform/commonUI/edit/test/creation/CreateActionSpec.js @@ -103,7 +103,7 @@ define( [ "edit", "save", - "cancel" + "finish" ] ); @@ -178,10 +178,10 @@ define( expect(capabilities.editor.save).toHaveBeenCalled(); }); - it("to cancel the edit if user cancels dialog", function () { + it("to finish the edit if user cancels dialog", function () { action.perform(); promise.then.mostRecentCall.args[1](); - expect(capabilities.editor.cancel).toHaveBeenCalled(); + expect(capabilities.editor.finish).toHaveBeenCalled(); }); }); });