mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 07:16:39 +00:00
[Persistence] Handle refresh after edit
Correctly handle Discard changes after leaving Edit mode when conflicts are detected; WTD-1033.
This commit is contained in:
parent
6b43256afd
commit
0090732f71
@ -29,6 +29,13 @@ define(
|
|||||||
cache.markDirty(editableObject);
|
cache.markDirty(editableObject);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Delegate refresh to the original object; this avoids refreshing
|
||||||
|
// the editable instance of the object, and ensures that refresh
|
||||||
|
// correctly targets the "real" version of the object.
|
||||||
|
persistence.refresh = function () {
|
||||||
|
return domainObject.getCapability('persistence').refresh();
|
||||||
|
};
|
||||||
|
|
||||||
return persistence;
|
return persistence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ define(
|
|||||||
|
|
||||||
// Persist the underlying domain object
|
// Persist the underlying domain object
|
||||||
function doPersist() {
|
function doPersist() {
|
||||||
return persistenceCapability.persist();
|
return domainObject.getCapability('persistence').persist();
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -62,7 +62,9 @@ define(
|
|||||||
|
|
||||||
// Discard changes for a failed refresh
|
// Discard changes for a failed refresh
|
||||||
function discard(failure) {
|
function discard(failure) {
|
||||||
return failure.persistence.refresh(true);
|
var persistence =
|
||||||
|
failure.domainObject.getCapability('persistence');
|
||||||
|
return persistence.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discard changes associated with a failed save
|
// Discard changes associated with a failed save
|
||||||
|
Loading…
Reference in New Issue
Block a user