mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 21:58:13 +00:00
Resolved merge conflicts
This commit is contained in:
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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) {
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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.
|
||||||
|
@ -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)
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user