Skip to content

A small example showing how to add a custom context menu entry to the catalog entity page in Red Hat Developer Hub

Notifications You must be signed in to change notification settings

gashcrumb/dynamic-plugins-entity-context-menu

Repository files navigation

Dynamic Plugins Custom Entity Context Menu

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:

Screenshot of Red Hat Developer Hub with the entity context menu open

Clicking on the context menu entry brings up a simple example dialog:

Screenshot of Red Hat Developepr Hub with example dialog displayed

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.

About

A small example showing how to add a custom context menu entry to the catalog entity page in Red Hat Developer Hub

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published