Resolved merge conflicts

This commit is contained in:
Henry
2016-05-12 16:03:19 -07:00
parent e5ef7c0c22
commit bd686790dc
11 changed files with 53 additions and 91 deletions

View File

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