Resolved merge conflicts
This commit is contained in:
@@ -73,7 +73,8 @@ define(
|
||||
function isEditing(context) {
|
||||
var domainObject = (context || {}).domainObject;
|
||||
return domainObject
|
||||
&& domainObject.getCapability('status').get('editing');
|
||||
&& domainObject.hasCapability('editor')
|
||||
&& domainObject.getCapability('editor').isEditContextRoot();
|
||||
}
|
||||
|
||||
EditActionPolicy.prototype.allow = function (action, context) {
|
||||
|
||||
@@ -34,6 +34,11 @@ define(
|
||||
* from context menu of non-editable objects, when navigated object
|
||||
* is being edited
|
||||
* @constructor
|
||||
* @param navigationService
|
||||
* @param editModeBlacklist A blacklist of actions disallowed from
|
||||
* context menu when navigated object is being edited
|
||||
* @param nonEditContextBlacklist A blacklist of actions disallowed
|
||||
* from context menu of non-editable objects, when navigated object
|
||||
* @implements {Policy.<Action, ActionContext>}
|
||||
*/
|
||||
function EditContextualActionPolicy(navigationService, editModeBlacklist, nonEditContextBlacklist) {
|
||||
@@ -51,7 +56,7 @@ define(
|
||||
navigatedObject = this.navigationService.getNavigation(),
|
||||
actionMetadata = action.getMetadata ? action.getMetadata() : {};
|
||||
|
||||
if (navigatedObject.getCapability("status").get("editing")) {
|
||||
if (navigatedObject.hasCapability("editor") && navigatedObject.getCapability("editor").isEditContextRoot()) {
|
||||
if (selectedObject.hasCapability("editor") && selectedObject.getCapability("editor").inEditContext()){
|
||||
//Target is within the editing context
|
||||
return this.editBlacklist.indexOf(actionMetadata.key) === -1;
|
||||
|
||||
@@ -41,12 +41,11 @@ define(
|
||||
EditNavigationPolicy.prototype.isDirty = function(domainObject) {
|
||||
var navigatedObject = domainObject,
|
||||
editorCapability = navigatedObject &&
|
||||
navigatedObject.getCapability("editor"),
|
||||
statusCapability = navigatedObject &&
|
||||
navigatedObject.getCapability("status");
|
||||
navigatedObject.getCapability("editor");
|
||||
|
||||
return statusCapability && statusCapability.get('editing') &&
|
||||
editorCapability && editorCapability.dirty();
|
||||
return editorCapability &&
|
||||
editorCapability.isEditContextRoot() &&
|
||||
editorCapability.dirty();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,10 +35,13 @@ define([], function () {
|
||||
EditableMovePolicy.prototype.allow = function (action, context) {
|
||||
var domainObject = context.domainObject,
|
||||
selectedObject = context.selectedObject,
|
||||
key = action.getMetadata().key;
|
||||
key = action.getMetadata().key,
|
||||
isDomainObjectEditing = domainObject.hasCapability('editor') &&
|
||||
domainObject.getCapability('editor').inEditContext();
|
||||
|
||||
if (key === 'move' && domainObject.hasCapability('editor') && domainObject.getCapability('editor').inEditContext()) {
|
||||
return !!selectedObject && selectedObject.hasCapability('editor') && selectedObject.getCapability('editor').inEditContext();
|
||||
if (key === 'move' && isDomainObjectEditing) {
|
||||
return !!selectedObject && selectedObject.hasCapability('editor') &&
|
||||
selectedObject.getCapability('editor').inEditContext();
|
||||
}
|
||||
|
||||
// Like all policies, allow by default.
|
||||
|
||||
Reference in New Issue
Block a user