Automattic / gutenberg-ramp

Control conditions under which Gutenberg loads - either from your theme code or from a UI
https://wordpress.org/plugins/gutenberg-ramp/
76 stars 15 forks source link

In settings, improve checkbox UI for enabling custom post types #56

Closed klasharr closed 5 years ago

klasharr commented 6 years ago

I have enabled Gutenberg Ramp but don't see checkboxes for all the custom post types on the site:

image

As a user, it isn't immediately clear to me why the checkboxes are missing and it looks like Ramp doesn't fully work. Looking for an explanation leads me to: https://wordpress.org/plugins/gutenberg-ramp/#screenshots where we have:

Some post types are not showing up on the settings screen Post types that are not compatible with Gutenberg will not show up. If you think you have found a false negative (posts in that post type DO work with Gutenberg, when Ramp plugin is deactivated) please report it as an issue on GitHub here.

If custom post types are incompatible with Gutenberg, it would be a better user experience to say which don't work with a link to more information, perhaps including them in the list but with checkboxes greyed out and inactive.

lukecav commented 6 years ago

Any custom post types created by using Pods, do not show up in the Gutenberg Ramp settings.

maevelander commented 6 years ago

Thanks for raising this @klasharr

A quick and easy fix would be to add some explanatory text:

Post types that are not compatible with Gutenberg do not appear here. Learn more.

A more advanced solution would be to actually check for post types that are incompatible and display a list of them. I'd propose a simple text based list, something like this:

The following post types were found but are not compatible with Gutenberg: [list of post types] Learn more.

@klasharr and @rogertheriault both suggested displaying the incompatible post types as greyed out... my concern with that is that we're already using that style to indicate a post type which IS compatible but which is controlled by the function gutenberg_ramp_load_gutenberg() in code (overriding the UI).

@justnorris Thoughts?

maevelander commented 6 years ago

Any custom post types created by using Pods, do not show up in the Gutenberg Ramp settings.

@lukecav Are you reporting that as a false negative? ie post types created by Pods ARE compatible but not showing? Or is it just illustrating the confusion?

pyronaur commented 6 years ago

@lukecav I installed Pods and created a custom post type called "Super Post" and Ramp does show that post type to me if the REST option is enabled in Pods as well.

To test this out further, I disabled Ramp completely and activated Gutenberg. If a post type in Pods doesn't have REST enabled - it doesn't support Gutenberg and falls back to TinyMCE (at least for now in WordPress 4.9.6) - so I don't think the issue you saw is Ramp related. If it is - please create a new issue with steps to reproduce so that I can debug it.

@maevelander I'm working on listing out the unsupported post types to avoid confusion.

lukecav commented 6 years ago

@justnorris

My mistake, custom post types created by Pods, do show in the Gutenberg Ramp settings when the REST API is indeed enabled for that Pods.

maevelander commented 6 years ago

@justnorris How about this?

gutenberg-ramp-ui

Moved the sentence about the function up so we don't have little bits and pieces floating everywhere.

Used admin notice style to draw attention