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

Can't find info on submitting notices to Gutenberg #5927

Closed
jsmoriss opened this issue Apr 2, 2018 · 4 comments
Closed

Can't find info on submitting notices to Gutenberg #5927

jsmoriss opened this issue Apr 2, 2018 · 4 comments
Labels
[Status] Needs More Info Follow-up required in order to be actionable.

Comments

@jsmoriss
Copy link

jsmoriss commented Apr 2, 2018

I can't find any information on how to submit notices to Gutenberg. Would anyone be willing to share some insight? :) The code I'm working with so far is:

var editPost = wp.data.select( 'core/edit-post' ), lastIsSaving = false;

wp.data.subscribe( function() {
        var isSaving = editPost.isSavingMetaBoxes();
        if ( isSaving !== lastIsSaving && !isSaving ) {
                lastIsSaving = isSaving;

                // TODO: ajax call to get metabox HTML

                // TODO: refresh the metabox container

                // TODO: ajax call to get the notices array

                // TODO: submit notices to Gutenberg for display

        }
        lastIsSaving = isSaving;
} );

Thanks, :)

js.

@danielbachhuber
Copy link
Member

I can't find any information on how to submit notices to Gutenberg.

Just to clarify, can you share a bit more detail on what you're trying to do?

@danielbachhuber danielbachhuber added the [Status] Needs More Info Follow-up required in order to be actionable. label Apr 2, 2018
@jsmoriss
Copy link
Author

jsmoriss commented Apr 3, 2018

I must perform an ajax call to update a metabox after a post is updated by Gutenberg. This metabox displays status info and gathers information from a variety of locations / sources. Some info may be missing or incorrect, which generates notices (error, warning, or info types). So, after getting the metabox HTML, updating the metabox container, I need to retrieve any notices and pass them to Gutenberg for display. There is no information, that I could find, on how I might do this. :)

Thanks,

js.

@danielbachhuber
Copy link
Member

I need to retrieve any notices and pass them to Gutenberg for display. There is no information, that I could find, on how I might do this. :)

Makes sense. There isn't a formal notices API yet, so that's something we need to sort out first.

@danielbachhuber
Copy link
Member

Closing in favor of #5975

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable.
Projects
None yet
Development

No branches or pull requests

2 participants