mirror of
https://github.com/nasa/openmct.git
synced 2024-12-24 15:26: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) {
|
function persistNewObject(object) {
|
||||||
/*
|
return object.getCapability('persistence').persist();
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.dialogService
|
return this.dialogService
|
||||||
.getUserInput(wizard.getFormStructure(false), wizard.getInitialFormValue())
|
.getUserInput(wizard.getFormStructure(false), wizard.getInitialFormValue())
|
||||||
.then(populateObjectFromInput)
|
.then(populateObjectFromInput)
|
||||||
.then(save)
|
.then(persistNewObject)
|
||||||
.then(addToParent);
|
.then(addToParent);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user