Equivalent for openmct preview actions? #4067
-
Hi, Is there a way to create/open a plugin as a preview window in OpenMCT 1.7? We're trying to migrate from a pre 1.0 version, where we'd use mct-preview-action to open detail views of given components. For example, to open a preview window from a larger list of telemetry objects, we'd use:
Is there a native way to open a preview window in the latest version of OpenMCT (this would be opening a separate plugin, rather than an enlarged view of a widget on the page)? Any insight into this would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If I'm understanding the question correctly you want to open a view of an object that you've created in a plugin in a Preview window. You were able to do this using the legacy API using the code that you provided. The equivalent of the code that you've provided in our current API would be this: const objectPath = await openmct.objects.getOriginalObjectPath({namespace: `${namespace}`, key: `${key}`});
const previewAction = openmct.actions.getAction('preview');
previewAction.invoke(objectPath); The eg. the legacy object id |
Beta Was this translation helpful? Give feedback.
If I'm understanding the question correctly you want to open a view of an object that you've created in a plugin in a Preview window. You were able to do this using the legacy API using the code that you provided.
The equivalent of the code that you've provided in our current API would be this:
The
namespace
andkey
come from the object id. In legacy Open MCT object ids were strings of the form"namespace:key"
, but in our current API objects are uniquely identified by an "identifier" objec…