This example shows how to add an additional entry into the context menu of the catalog entity page in Red Hat Developer Hub from a dynamic plugin.
The context menu is the 3-dot icon in the top-right of the catalog entity page, once the plugin is loaded properly it should appear as the first entry:
Clicking on the context menu entry brings up a simple example dialog:
To build this example run the following:
yarn install
yarn tsc
yarn build
To deploy this example to RHDH local you can use the following command, substituting the correct path to RHDH local's local-plugins
directory:
npx -y @red-hat-developer-hub/cli plugin package \
--export-to /path/to/rhdh-local/local-plugins
The command will output the correct configuration snippet to add to RHDH local's dynamic-plugins.override.yaml
file:
- package: ./local-plugins/red-hat-developer-hub-plugin-entity-context-menu-item
disabled: false
pluginConfig:
dynamicPlugins:
frontend:
red-hat-developer-hub.plugin-entity-context-menu-item:
appIcons:
- name: dialogIcon
importName: DialogIcon
mountPoints:
- mountPoint: entity.context.menu
importName: SimpleDialog
config:
props:
title: Open Simple Dialog
icon: dialogIcon
After adding this configuration, either start up RHDH local or re-run install-dynamic-plugins
as mentioned in this section of the RHDH local docs.