mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 08:25:31 +00:00
Don't allow recursive Preview actions #2775
This commit is contained in:
parent
ea90d02d66
commit
5563cbea3a
@ -75,9 +75,11 @@ class ContextMenuAPI {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_showContextMenuForObjectPath(objectPath, x, y, actionsToBeIncluded) {
|
||||
|
||||
let applicableActions = this._allActions.filter((action) => {
|
||||
_showContextMenuForObjectPath(objectPath, x, y, actionsToBeIncluded, actionsToBeSkipped = []) {
|
||||
let applicableActions = this._allActions.filter(action => {
|
||||
if (actionsToBeSkipped.includes(action.key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (actionsToBeIncluded) {
|
||||
if (action.appliesTo === undefined && actionsToBeIncluded.includes(action.key)) {
|
||||
|
@ -11,6 +11,12 @@ import contextMenu from '../mixins/context-menu-gesture'
|
||||
export default {
|
||||
mixins: [contextMenu],
|
||||
props: {
|
||||
actionsToBeSkipped: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
objectPath: {
|
||||
type: Array,
|
||||
required: true
|
||||
|
@ -1,6 +1,12 @@
|
||||
export default {
|
||||
inject: ['openmct'],
|
||||
props: {
|
||||
'actionsToBeSkipped': {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
'objectPath': {
|
||||
type: Array,
|
||||
default() {
|
||||
@ -30,7 +36,7 @@ export default {
|
||||
showContextMenu(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.openmct.contextMenu._showContextMenuForObjectPath(this.objectPath, event.clientX, event.clientY);
|
||||
this.openmct.contextMenu._showContextMenuForObjectPath(this.objectPath, event.clientX, event.clientY, null, this.actionsToBeSkipped);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -30,7 +30,10 @@
|
||||
<span class="l-browse-bar__object-name">
|
||||
{{ domainObject.name }}
|
||||
</span>
|
||||
<context-menu-drop-down :object-path="objectPath" />
|
||||
<context-menu-drop-down
|
||||
:actions-to-be-skipped="actionsToBeSkipped"
|
||||
:object-path="objectPath"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="l-browse-bar__end">
|
||||
@ -67,6 +70,7 @@ export default {
|
||||
let type = this.openmct.types.get(domainObject.type);
|
||||
|
||||
return {
|
||||
actionsToBeSkipped: ['preview'],
|
||||
domainObject: domainObject,
|
||||
type: type,
|
||||
notebookEnabled: false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user