mirror of
https://github.com/nasa/openmct.git
synced 2025-01-11 23:42: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
|
* Save any unsaved changes from this editing session. This will
|
||||||
* pending persists and end the current transaction
|
* end the current transaction and continue with a new one.
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
EditorCapability.prototype.save = function () {
|
EditorCapability.prototype.save = function () {
|
||||||
var domainObject = this.domainObject;
|
var transactionService = this.transactionService;
|
||||||
return this.transactionService.commit().then(function () {
|
return transactionService.commit().then(function () {
|
||||||
domainObject.getCapability('status').set('editing', false);
|
transactionService.startTransaction();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -134,8 +134,8 @@ define(
|
|||||||
it("commits the transaction", function () {
|
it("commits the transaction", function () {
|
||||||
expect(mockTransactionService.commit).toHaveBeenCalled();
|
expect(mockTransactionService.commit).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
it("resets the edit state", function () {
|
it("begins a new transaction", function () {
|
||||||
expect(mockStatusCapability.set).toHaveBeenCalledWith('editing', false);
|
expect(mockTransactionService.startTransaction).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user