From d00e13e4eed46ca8e231698af8a3efd97f7c9930 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 12 May 2016 16:09:53 -0700 Subject: [PATCH] Resolved merge conflicts --- platform/commonUI/edit/src/actions/SaveAsAction.js | 1 + platform/commonUI/edit/src/capabilities/EditorCapability.js | 2 +- platform/commonUI/edit/src/policies/EditActionPolicy.js | 5 ++--- platform/commonUI/edit/src/policies/EditableLinkPolicy.js | 2 +- platform/commonUI/edit/src/policies/EditableMovePolicy.js | 4 ++-- platform/commonUI/edit/src/policies/EditableViewPolicy.js | 2 +- .../src/controllers/swimlane/TimelineSwimlaneDropHandler.js | 2 +- platform/representation/src/MCTRepresentation.js | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/platform/commonUI/edit/src/actions/SaveAsAction.js b/platform/commonUI/edit/src/actions/SaveAsAction.js index 7e52a3f486..6d73b75308 100644 --- a/platform/commonUI/edit/src/actions/SaveAsAction.js +++ b/platform/commonUI/edit/src/actions/SaveAsAction.js @@ -158,6 +158,7 @@ define( var domainObject = (context || {}).domainObject; return domainObject !== undefined && domainObject.hasCapability("editor") && + domainObject.getCapability("editor").inEditContext() && domainObject.getModel().persisted === undefined; }; diff --git a/platform/commonUI/edit/src/capabilities/EditorCapability.js b/platform/commonUI/edit/src/capabilities/EditorCapability.js index 54d041aff0..2091f3b9b3 100644 --- a/platform/commonUI/edit/src/capabilities/EditorCapability.js +++ b/platform/commonUI/edit/src/capabilities/EditorCapability.js @@ -49,7 +49,7 @@ define( * currently being edited. * @returns boolean */ - EditorCapability.prototype.isEditing = function () { + EditorCapability.prototype.inEditContext = function () { return isEditing(this.domainObject); }; diff --git a/platform/commonUI/edit/src/policies/EditActionPolicy.js b/platform/commonUI/edit/src/policies/EditActionPolicy.js index 0e5af528e7..2952758840 100644 --- a/platform/commonUI/edit/src/policies/EditActionPolicy.js +++ b/platform/commonUI/edit/src/policies/EditActionPolicy.js @@ -72,9 +72,8 @@ define( */ function isEditing(context) { var domainObject = (context || {}).domainObject; - return domainObject && - domainObject.hasCapability('status') && - domainObject.getCapability('status').get('editing'); + return domainObject + && domainObject.getCapability('status').get('editing'); } EditActionPolicy.prototype.allow = function (action, context) { diff --git a/platform/commonUI/edit/src/policies/EditableLinkPolicy.js b/platform/commonUI/edit/src/policies/EditableLinkPolicy.js index 1200496d35..c6a2a36290 100644 --- a/platform/commonUI/edit/src/policies/EditableLinkPolicy.js +++ b/platform/commonUI/edit/src/policies/EditableLinkPolicy.js @@ -40,7 +40,7 @@ define([], function () { if (key === 'link') { 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. diff --git a/platform/commonUI/edit/src/policies/EditableMovePolicy.js b/platform/commonUI/edit/src/policies/EditableMovePolicy.js index cc95114206..4974e0c60d 100644 --- a/platform/commonUI/edit/src/policies/EditableMovePolicy.js +++ b/platform/commonUI/edit/src/policies/EditableMovePolicy.js @@ -37,8 +37,8 @@ define([], function () { selectedObject = context.selectedObject, key = action.getMetadata().key; - if (key === 'move' && domainObject.hasCapability('editor') && domainObject.getCapability('editor').isEditing()) { - return !!selectedObject && selectedObject.hasCapability('editor') && selectedObject.getCapability('editor').isEditing(); + if (key === 'move' && domainObject.hasCapability('editor') && domainObject.getCapability('editor').inEditContext()) { + return !!selectedObject && selectedObject.hasCapability('editor') && selectedObject.getCapability('editor').inEditContext(); } // Like all policies, allow by default. diff --git a/platform/commonUI/edit/src/policies/EditableViewPolicy.js b/platform/commonUI/edit/src/policies/EditableViewPolicy.js index b4ba951bd0..23de491def 100644 --- a/platform/commonUI/edit/src/policies/EditableViewPolicy.js +++ b/platform/commonUI/edit/src/policies/EditableViewPolicy.js @@ -37,7 +37,7 @@ define( // If a view is flagged as non-editable, only allow it // while we're not in Edit mode. 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. diff --git a/platform/features/timeline/src/controllers/swimlane/TimelineSwimlaneDropHandler.js b/platform/features/timeline/src/controllers/swimlane/TimelineSwimlaneDropHandler.js index f5d46fbaf7..620e70e3e1 100644 --- a/platform/features/timeline/src/controllers/swimlane/TimelineSwimlaneDropHandler.js +++ b/platform/features/timeline/src/controllers/swimlane/TimelineSwimlaneDropHandler.js @@ -42,7 +42,7 @@ define( // Check if we are in edit mode (also check parents) function inEditMode(swimlane) { return swimlane.domainObject.hasCapability('editor') && - swimlane.domainObject.getCapability('editor').isEditing(); + swimlane.domainObject.getCapability('editor').inEditContext(); } // Boolean and (for reduce below) diff --git a/platform/representation/src/MCTRepresentation.js b/platform/representation/src/MCTRepresentation.js index 4283a30a4a..06f7220fd9 100644 --- a/platform/representation/src/MCTRepresentation.js +++ b/platform/representation/src/MCTRepresentation.js @@ -170,7 +170,7 @@ define( representation = lookup($scope.key, domainObject), uses = ((representation || {}).uses || []), canRepresent = !!(representation && domainObject), - canEdit = !!(domainObject && domainObject.hasCapability('editor') && domainObject.getCapability('editor').isEditing()), + canEdit = !!(domainObject && domainObject.hasCapability('editor') && domainObject.getCapability('editor').inEditContext()), idPath = getIdPath(domainObject), key = $scope.key;