-
Notifications
You must be signed in to change notification settings - Fork 20
Feature: Native Block Editor Interface #94
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
base: feature/rest-api-endpoint
Are you sure you want to change the base?
Conversation
4608980
to
621e135
Compare
… Classic Editor usage
Hi @fabiankaegy I went ahead and updated the UI to use the new ContentPicker, along with some fixes and improvements for post-to-user relationship support and bi-directional panels in post-to-post relationships. Ready for your review when you can. |
I've created a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking pretty good already! Thanks for the try/block-editor-ui branch. Two things I noticed while doing some basic testing:
- If
sortable
is enabled sorting is a bit laggy. Sometimes the item positions are not changed.I think this happens because the sorting is directly saved via a POST request and directly followed by a GET request. There seems to be a race-condition where the second runs to early? Should saving maybe delayed until the post is saved? - The second one is related to
enable_ui
which is simply ignored in the block editor, meaning the UI is always there.
Thanks for testing this @ocean90. I'll review the issues you pointed out ASAP. |
@ocean90 this was resolved in the latest commit. |
Hi @ocean90, I haven't been able to replicate this same issue on my end, but I did notice that was missing an Can you try again when you have a chance to see if the problem still persists? If so, it would be really helpful to get a bit more context about your setup:
Once again, thank you! |
@fabiankaegy Is there a way to improve this experience? Maybe by using an internal state and syncing changes to the REST API afterward? Screen.Recording.2025-04-30.at.11.23.10.AM.mp4 |
@s3rgiosan yeah we really should improve that. I though that the way we handle the rest API communication in the custom Data store would have already taken care of this but apparently not. I will try and see if I can find some time at the end of this week for this. Feel free to explore either adjusting the logic in the datastore to not persist on change directly but rather only queueing up the changes in the datastore as local changes that are in memory only and then only persist the relationships when we actually save the post 🤔 Alternatively, we could look at using something like |
I'll explore some options and take a look into |
Warning
This PR is based on top of #91
Description of the Change
Adds a WordPress Data store to more easily interface with the Content Connect REST API from within the Block Editor.
Closes #45
How to test the Change
wp.data.select('wp-content-connect').getRelationships(xxx)
where xxx is the current post iduseSelect
will smooth this experience)wp.data.select('wp-content-connect').getRelatedPosts(xxx, 'university_city_university_to_city')
wp.data.dispatch('wp-content-connect').updateRelatedPosts( xxx, 'university_city_university_to_city', [ yyy, zzz ] )
Note
This PR is still very much in progress and subject to change :)
Changelog Entry
Credits
Props @fabiankaegy @s3rgiosan