[Code Style] Run gulp fixstyle
...to apply code style settings from #142.
This commit is contained in:
@@ -82,7 +82,7 @@ define(
|
||||
parentContext =
|
||||
parentObject && parentObject.getCapability('context'),
|
||||
parentPath = parentContext ?
|
||||
parentContext.getPath() : [ this.parentObject ];
|
||||
parentContext.getPath() : [this.parentObject];
|
||||
|
||||
return parentPath.concat([this.domainObject]);
|
||||
};
|
||||
|
||||
@@ -69,18 +69,18 @@ define(
|
||||
* Checks if the value returned is falsey, and if so returns a
|
||||
* rejected promise
|
||||
*/
|
||||
function rejectIfFalsey(value, $q){
|
||||
if (!value){
|
||||
function rejectIfFalsey(value, $q) {
|
||||
if (!value) {
|
||||
return $q.reject("Error persisting object");
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
function formatError(error){
|
||||
function formatError(error) {
|
||||
if (error && error.message) {
|
||||
return error.message;
|
||||
} else if (error && typeof error === "string"){
|
||||
} else if (error && typeof error === "string") {
|
||||
return error;
|
||||
} else {
|
||||
return "unknown error";
|
||||
@@ -91,7 +91,7 @@ define(
|
||||
* Display a notification message if an error has occurred during
|
||||
* persistence.
|
||||
*/
|
||||
function notifyOnError(error, domainObject, notificationService, $q){
|
||||
function notifyOnError(error, domainObject, notificationService, $q) {
|
||||
var errorMessage = "Unable to persist " + domainObject.getModel().name;
|
||||
if (error) {
|
||||
errorMessage += ": " + formatError(error);
|
||||
@@ -133,9 +133,9 @@ define(
|
||||
this.getSpace(),
|
||||
getKey(domainObject.getId()),
|
||||
domainObject.getModel()
|
||||
]).then(function(result){
|
||||
]).then(function (result) {
|
||||
return rejectIfFalsey(result, self.$q);
|
||||
}).catch(function(error){
|
||||
}).catch(function (error) {
|
||||
return notifyOnError(error, domainObject, self.notificationService, self.$q);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -46,7 +46,9 @@ define(
|
||||
*/
|
||||
function RootModelProvider(roots, $q, $log) {
|
||||
// Pull out identifiers to used as ROOT's
|
||||
var ids = roots.map(function (root) { return root.id; });
|
||||
var ids = roots.map(function (root) {
|
||||
return root.id;
|
||||
});
|
||||
|
||||
// Assign an initial location to root models
|
||||
roots.forEach(function (root) {
|
||||
|
||||
@@ -33,8 +33,12 @@ define(
|
||||
}
|
||||
},
|
||||
identity: {
|
||||
toModelValue: function (v) { return v; },
|
||||
toFormValue: function (v) { return v; }
|
||||
toModelValue: function (v) {
|
||||
return v;
|
||||
},
|
||||
toFormValue: function (v) {
|
||||
return v;
|
||||
}
|
||||
}
|
||||
},
|
||||
ARRAY_SUFFIX = '[]';
|
||||
|
||||
@@ -179,7 +179,7 @@ define(
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
|
||||
return (self.typeMap[typeKey] =
|
||||
self.typeMap[typeKey] || buildTypeDef(typeKey));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user