mirror of
https://github.com/nasa/openmct.git
synced 2025-04-15 23:16:46 +00:00
Resolved merge conflicts
This commit is contained in:
parent
4b786d3536
commit
d00e13e4ee
@ -158,6 +158,7 @@ define(
|
||||
var domainObject = (context || {}).domainObject;
|
||||
return domainObject !== undefined &&
|
||||
domainObject.hasCapability("editor") &&
|
||||
domainObject.getCapability("editor").inEditContext() &&
|
||||
domainObject.getModel().persisted === undefined;
|
||||
};
|
||||
|
||||
|
@ -49,7 +49,7 @@ define(
|
||||
* currently being edited.
|
||||
* @returns boolean
|
||||
*/
|
||||
EditorCapability.prototype.isEditing = function () {
|
||||
EditorCapability.prototype.inEditContext = function () {
|
||||
return isEditing(this.domainObject);
|
||||
};
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user