Add root object to object path for legacy context menu actions (#2369)

This commit is contained in:
Andrew Henry 2019-04-10 11:42:49 -07:00 committed by Deep Tailor
parent 570aa2c02a
commit 3219a64d09

View File

@ -33,9 +33,13 @@ export default class LegacyContextMenuAction {
} }
invoke(objectPath) { invoke(objectPath) {
this.openmct.objects.getRoot().then((root) => {
let pathWithRoot = objectPath.slice();
pathWithRoot.push(root);
let context = { let context = {
category: 'contextual', category: 'contextual',
domainObject: this.openmct.legacyObject(objectPath) domainObject: this.openmct.legacyObject(pathWithRoot)
} }
let legacyAction = new this.LegacyAction(context); let legacyAction = new this.LegacyAction(context);
@ -47,6 +51,7 @@ export default class LegacyContextMenuAction {
}.bind(legacyAction); }.bind(legacyAction);
} }
legacyAction.perform(); legacyAction.perform();
});
} }
appliesTo(objectPath) { appliesTo(objectPath) {