Resolved merge conflicts
This commit is contained in:
@@ -24,11 +24,8 @@
|
||||
* Module defining CreateAction. Created by vwoeltje on 11/10/14.
|
||||
*/
|
||||
define(
|
||||
[
|
||||
'./CreateWizard',
|
||||
'../../../edit/src/objects/EditableDomainObject'
|
||||
],
|
||||
function (CreateWizard, EditableDomainObject) {
|
||||
[],
|
||||
function () {
|
||||
|
||||
/**
|
||||
* The Create Action is performed to create new instances of
|
||||
@@ -86,22 +83,19 @@ define(
|
||||
CreateAction.prototype.perform = function () {
|
||||
var newModel = this.type.getInitialModel(),
|
||||
parentObject = this.navigationService.getNavigation(),
|
||||
newObject,
|
||||
editableObject;
|
||||
newObject;
|
||||
|
||||
newModel.type = this.type.getKey();
|
||||
newObject = parentObject.useCapability('instantiation', newModel);
|
||||
editableObject = new EditableDomainObject(newObject, this.$q);
|
||||
editableObject.setOriginalObject(parentObject);
|
||||
editableObject.getCapability('status').set('editing', true);
|
||||
editableObject.useCapability('mutation', function(model){
|
||||
newObject.useCapability('mutation', function(model){
|
||||
model.location = parentObject.getId();
|
||||
});
|
||||
|
||||
if (countEditableViews(editableObject) > 0 && editableObject.hasCapability('composition')) {
|
||||
this.navigationService.setNavigation(editableObject);
|
||||
if (countEditableViews(newObject) > 0 && newObject.hasCapability('composition')) {
|
||||
this.navigationService.setNavigation(newObject);
|
||||
newObject.getCapability("action").perform("edit");
|
||||
} else {
|
||||
return editableObject.getCapability('action').perform('save');
|
||||
return newObject.getCapability('action').perform('save');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user