[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:
Victor Woeltjen 2016-03-21 10:22:25 -07:00
parent 17faf000b0
commit 8fa030437e

View File

@ -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);
}; };