mirror of
https://github.com/nasa/openmct.git
synced 2025-05-03 01:02:52 +00:00
Add root object to object path for legacy context menu actions (#2369)
This commit is contained in:
parent
570aa2c02a
commit
3219a64d09
@ -33,20 +33,25 @@ export default class LegacyContextMenuAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
invoke(objectPath) {
|
invoke(objectPath) {
|
||||||
let context = {
|
this.openmct.objects.getRoot().then((root) => {
|
||||||
category: 'contextual',
|
let pathWithRoot = objectPath.slice();
|
||||||
domainObject: this.openmct.legacyObject(objectPath)
|
pathWithRoot.push(root);
|
||||||
}
|
|
||||||
let legacyAction = new this.LegacyAction(context);
|
|
||||||
|
|
||||||
if (!legacyAction.getMetadata) {
|
let context = {
|
||||||
let metadata = Object.create(this.LegacyAction.definition);
|
category: 'contextual',
|
||||||
metadata.context = context;
|
domainObject: this.openmct.legacyObject(pathWithRoot)
|
||||||
legacyAction.getMetadata = function () {
|
}
|
||||||
return metadata;
|
let legacyAction = new this.LegacyAction(context);
|
||||||
}.bind(legacyAction);
|
|
||||||
}
|
if (!legacyAction.getMetadata) {
|
||||||
legacyAction.perform();
|
let metadata = Object.create(this.LegacyAction.definition);
|
||||||
|
metadata.context = context;
|
||||||
|
legacyAction.getMetadata = function () {
|
||||||
|
return metadata;
|
||||||
|
}.bind(legacyAction);
|
||||||
|
}
|
||||||
|
legacyAction.perform();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
appliesTo(objectPath) {
|
appliesTo(objectPath) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user