mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 23:36:41 +00:00
[Edit] EditorCapability continues edit on save
This commit is contained in:
parent
9847c40e34
commit
90c13a3959
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user