Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PluginPostPublishPanel uses icon and inherits from registerPlugin #16383

Conversation

@ryanwelcher
Copy link
Contributor

commented Jul 2, 2019

Description

This PR updates the PluginPostPublishPanel SlotFill to accept an icon or inherit from registerPlugin()

Screenshots

post-publish-panel

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
@ryanwelcher ryanwelcher force-pushed the ryanwelcher:try/plugin-post-publish-panel-inherit-icon branch from bea9ce1 to e872a87 Sep 6, 2019
@ryanwelcher

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2019

Confirm that custom SVGs are rendered in greyscale

Edit_Post_‹gutenberg-dev_test—_WordPress

@ryanwelcher ryanwelcher requested a review from gziolo Sep 6, 2019
@ryanwelcher

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2019

@mapk wondering if you can sign off on this PR as well?

@mapk

This comment has been minimized.

Copy link
Contributor

commented Sep 6, 2019

@ryanwelcher Can you guide me through some steps to test this? How do I get a custom panel to show in the post-publish slideout?

@ryanwelcher

This comment has been minimized.

Copy link
Contributor Author

commented Sep 8, 2019

@mapk it might be easiest to install this plugin I wrote for a talk I gave on SlotFill - https://github.com/ryanwelcher/the-gutenberg-slotfill-system. It demos all of the slots and if you have this branch active and built, you'll see the icons.

@gziolo
gziolo approved these changes Sep 9, 2019
Copy link
Member

left a comment

Nice work. Thanks for sorting it out 👍

I tested with:

( function() {
	var el = wp.element.createElement;
	var Fragment = wp.element.Fragment;
	var __ = wp.i18n.__;
	var registerPlugin = wp.plugins.registerPlugin;
	var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel;
	var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;

	function PanelContent() {
		return el(
			'p',
			{},
			__( 'Here is the panel content!' )
		);
	}

	function MyPublishPanelPlugin() {
		return el(
			Fragment,
			{},
			el(
				PluginPrePublishPanel,
				{
					className: 'my-publish-panel-plugin__pre',
					title: __( 'My pre publish panel' )
				},
				el(
					PanelContent,
					{}
				)
			),
			el(
				PluginPostPublishPanel,
				{
					className: 'my-publish-panel-plugin__post',
					title: __( 'My post publish panel' )
				},
				el(
					PanelContent,
					{}
				)
			)
		);
	}

	registerPlugin( 'my-publish-panel-plugin', {
		icon: 'palmtree',
		render: MyPublishPanelPlugin
	} );
} )();

@mapk - I copied it over from the existing plugin which we use for e2e tests and can be activated in the plugins section for the default Gutenberg env:

Screen Shot 2019-09-09 at 11 57 25

However, I had to add the icon property. We might want to update the e2e test as well to have it covered.

@gziolo gziolo merged commit 7547215 into WordPress:master Sep 9, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@gziolo gziolo added this to the Gutenberg 6.5 milestone Sep 9, 2019
@ryanwelcher ryanwelcher deleted the ryanwelcher:try/plugin-post-publish-panel-inherit-icon branch Sep 9, 2019
dd32 pushed a commit to dd32/gutenberg that referenced this pull request Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.