Skip to content

Add a button to the "Activity Bar Panel"Β #110

@josephfusco

Description

@josephfusco

Acceptance Criteria

  • registerActivityBarPanel() exists and is callable by 3rd party plugins
  • Function handles edge cases & invalid input
  • Tests:
    • Help Panel tests should work
    • Explorer Panel tests should work (rename to Query Composer)

Technical Details

const { registerActivityBarPanel } = window.WPGRAPHQL_IDE;

registerActivityBarPanel( 'my-button', {
  title: 'My Button',
  label: 'My Button does x, y and z',
  icon: () => {}, // name of icon from supported icon library or custom Icon component
  content: () => {} // The content that will render in the activity panel when this activity bar plugin is active
} );

The smart cache collections feature will most certainly make use of this API.

An example of the help screen as a plugin might look like this:

const { registerActivityBarPanel } = window.WPGRAPHQL_IDE;

registerActivityBarPanel( 'help', {
  title: 'Help',
  label: 'Help',
  icon: () => <HelpIcon />,
  content: () => <HelpPluginList /> // In the screenshot below, this component represents the list of articles visible in the activity panel when the help button is active
} );

Image

The list of panels should be maintained in the Redux store, so registering a panel should modify the list of panels in the Redux store. Similar when you call registerBlockType in Gutenberg.

Reference

Metadata

Metadata

Assignees

Labels

type: enhancementImprovements to existing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions