mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 07:16:39 +00:00
[Add] Remove edit awareness
Remove step where Added objects are persisted via the editor capability; instead, persist via the usual persistence capability, such that Edit mode may intervene (or not) as necessary. As instantiated models are cached at least until persisted, this workaround to allow newly-created models to be available during editing is no longer necessary (and undesired consequences such as #770 no longer occur)
This commit is contained in:
parent
17faf000b0
commit
8fa030437e
@ -100,20 +100,14 @@ define(
|
||||
});
|
||||
}
|
||||
|
||||
function save(object) {
|
||||
/*
|
||||
It's necessary to persist the new sub-object in order
|
||||
that it can be retrieved for composition in the parent.
|
||||
Future refactoring that allows temporary objects to be
|
||||
retrieved from object services will make this unnecessary.
|
||||
*/
|
||||
return object.getCapability('editor').save(true);
|
||||
function persistNewObject(object) {
|
||||
return object.getCapability('persistence').persist();
|
||||
}
|
||||
|
||||
return this.dialogService
|
||||
.getUserInput(wizard.getFormStructure(false), wizard.getInitialFormValue())
|
||||
.then(populateObjectFromInput)
|
||||
.then(save)
|
||||
.then(persistNewObject)
|
||||
.then(addToParent);
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user