[Create] Utilize filtering during clone
This commit is contained in:
@@ -106,6 +106,14 @@ define(
|
|||||||
return fetchObject(object.getModel().location);
|
return fetchObject(object.getModel().location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isOriginal(domainObject) {
|
||||||
|
return domainObject.getCapability('location').isOriginal();
|
||||||
|
}
|
||||||
|
|
||||||
|
function cloneIntoParent(parent) {
|
||||||
|
return copyService.perform(domainObject, parent, isOriginal);
|
||||||
|
}
|
||||||
|
|
||||||
function cancelEditingAfterClone(clonedObject) {
|
function cancelEditingAfterClone(clonedObject) {
|
||||||
return domainObject.getCapability("editor").cancel()
|
return domainObject.getCapability("editor").cancel()
|
||||||
.then(resolveWith(clonedObject));
|
.then(resolveWith(clonedObject));
|
||||||
@@ -122,7 +130,7 @@ define(
|
|||||||
return getParent(domainObject)
|
return getParent(domainObject)
|
||||||
.then(doWizardSave)
|
.then(doWizardSave)
|
||||||
.then(getParent)
|
.then(getParent)
|
||||||
.then(copyService.perform.bind(copyService, domainObject))
|
.then(cloneIntoParent)
|
||||||
.then(cancelEditingAfterClone)
|
.then(cancelEditingAfterClone)
|
||||||
.catch(resolveWith(false));
|
.catch(resolveWith(false));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user