Resolved merge conflicts

This commit is contained in:
Henry
2016-05-12 16:09:53 -07:00
parent 4b786d3536
commit d00e13e4ee
8 changed files with 10 additions and 10 deletions

View File

@ -158,6 +158,7 @@ define(
var domainObject = (context || {}).domainObject; var domainObject = (context || {}).domainObject;
return domainObject !== undefined && return domainObject !== undefined &&
domainObject.hasCapability("editor") && domainObject.hasCapability("editor") &&
domainObject.getCapability("editor").inEditContext() &&
domainObject.getModel().persisted === undefined; domainObject.getModel().persisted === undefined;
}; };

View File

@ -49,7 +49,7 @@ define(
* currently being edited. * currently being edited.
* @returns boolean * @returns boolean
*/ */
EditorCapability.prototype.isEditing = function () { EditorCapability.prototype.inEditContext = function () {
return isEditing(this.domainObject); return isEditing(this.domainObject);
}; };

View File

@ -72,9 +72,8 @@ define(
*/ */
function isEditing(context) { function isEditing(context) {
var domainObject = (context || {}).domainObject; var domainObject = (context || {}).domainObject;
return domainObject && return domainObject
domainObject.hasCapability('status') && && domainObject.getCapability('status').get('editing');
domainObject.getCapability('status').get('editing');
} }
EditActionPolicy.prototype.allow = function (action, context) { EditActionPolicy.prototype.allow = function (action, context) {

View File

@ -40,7 +40,7 @@ define([], function () {
if (key === 'link') { if (key === 'link') {
object = context.selectedObject || context.domainObject; object = context.selectedObject || context.domainObject;
return !(object.hasCapability("editor") && object.getCapability("editor").isEditing()); return !(object.hasCapability("editor") && object.getCapability("editor").inEditContext());
} }
// Like all policies, allow by default. // Like all policies, allow by default.

View File

@ -37,8 +37,8 @@ define([], function () {
selectedObject = context.selectedObject, selectedObject = context.selectedObject,
key = action.getMetadata().key; key = action.getMetadata().key;
if (key === 'move' && domainObject.hasCapability('editor') && domainObject.getCapability('editor').isEditing()) { if (key === 'move' && domainObject.hasCapability('editor') && domainObject.getCapability('editor').inEditContext()) {
return !!selectedObject && selectedObject.hasCapability('editor') && selectedObject.getCapability('editor').isEditing(); return !!selectedObject && selectedObject.hasCapability('editor') && selectedObject.getCapability('editor').inEditContext();
} }
// Like all policies, allow by default. // Like all policies, allow by default.

View File

@ -37,7 +37,7 @@ define(
// If a view is flagged as non-editable, only allow it // If a view is flagged as non-editable, only allow it
// while we're not in Edit mode. // while we're not in Edit mode.
if ((view || {}).editable === false) { if ((view || {}).editable === false) {
return !(domainObject.hasCapability('editor') && domainObject.getCapability('editor').isEditing()); return !(domainObject.hasCapability('editor') && domainObject.getCapability('status').get('editing'));
} }
// Like all policies, allow by default. // Like all policies, allow by default.

View File

@ -42,7 +42,7 @@ define(
// Check if we are in edit mode (also check parents) // Check if we are in edit mode (also check parents)
function inEditMode(swimlane) { function inEditMode(swimlane) {
return swimlane.domainObject.hasCapability('editor') && return swimlane.domainObject.hasCapability('editor') &&
swimlane.domainObject.getCapability('editor').isEditing(); swimlane.domainObject.getCapability('editor').inEditContext();
} }
// Boolean and (for reduce below) // Boolean and (for reduce below)

View File

@ -170,7 +170,7 @@ define(
representation = lookup($scope.key, domainObject), representation = lookup($scope.key, domainObject),
uses = ((representation || {}).uses || []), uses = ((representation || {}).uses || []),
canRepresent = !!(representation && domainObject), canRepresent = !!(representation && domainObject),
canEdit = !!(domainObject && domainObject.hasCapability('editor') && domainObject.getCapability('editor').isEditing()), canEdit = !!(domainObject && domainObject.hasCapability('editor') && domainObject.getCapability('editor').inEditContext()),
idPath = getIdPath(domainObject), idPath = getIdPath(domainObject),
key = $scope.key; key = $scope.key;