From 90c13a3959c695fd30e43c6a69a848fee692c2a7 Mon Sep 17 00:00:00 2001 From: Alex M Date: Thu, 1 Sep 2016 23:16:31 +0300 Subject: [PATCH] [Edit] EditorCapability continues edit on save --- .../commonUI/edit/src/capabilities/EditorCapability.js | 10 +++++----- .../edit/test/capabilities/EditorCapabilitySpec.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/platform/commonUI/edit/src/capabilities/EditorCapability.js b/platform/commonUI/edit/src/capabilities/EditorCapability.js index aa7670d8aa..a997eb3033 100644 --- a/platform/commonUI/edit/src/capabilities/EditorCapability.js +++ b/platform/commonUI/edit/src/capabilities/EditorCapability.js @@ -81,14 +81,14 @@ define( }; /** - * Save any changes from this editing session. This will flush all - * pending persists and end the current transaction + * Save any unsaved changes from this editing session. This will + * end the current transaction and continue with a new one. * @returns {*} */ EditorCapability.prototype.save = function () { - var domainObject = this.domainObject; - return this.transactionService.commit().then(function () { - domainObject.getCapability('status').set('editing', false); + var transactionService = this.transactionService; + return transactionService.commit().then(function () { + transactionService.startTransaction(); }); }; diff --git a/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js b/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js index 3ffb81921d..e72793be53 100644 --- a/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js +++ b/platform/commonUI/edit/test/capabilities/EditorCapabilitySpec.js @@ -134,8 +134,8 @@ define( it("commits the transaction", function () { expect(mockTransactionService.commit).toHaveBeenCalled(); }); - it("resets the edit state", function () { - expect(mockStatusCapability.set).toHaveBeenCalledWith('editing', false); + it("begins a new transaction", function () { + expect(mockTransactionService.startTransaction).toHaveBeenCalled(); }); });