-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Editable: Display a posts list suggestion in the link modal #1985
Conversation
7b8d01d
to
788f300
Compare
I think you're correct about this. Maybe worth flagging as "Needs API Endpoint" or otherwise some API conveniences? Two separate requests seems undesirable 😞 |
@jasmussen I suspect the same problems you encounter when performing API calls. Any JS error? |
No JS errors, no. First time I tried, a little dialog did pop out though, and the spinner stopped. But nothing populated the dialog. |
@nylen maybe you have some thoughts on the API issue here. @jasmussen Unfortunately, I couldn't reproduce :( |
@youknowriad works great for me on text nodes, but breaks the button on images: |
@mtias Good catch, it should be better now (same for the button block) |
@youknowriad cool, but it should open over the whole toolbar area :) |
1eadc5d
to
d749721
Compare
I force-pushed the last commit. I was missing a className change. |
@@ -0,0 +1,187 @@ | |||
/** |
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.
It is a bit weird that link-input is under format-toolbar
, considering the link input can be used inline or block level, what about placing it together with url-input
? The current url-input/index.js could be renamed button.js
maybe.
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.
👍 I like this proposal, it's there because it was extracted from the format-toolbar
at first.
this.suggestionsRequest.abort(); | ||
} | ||
|
||
if ( value.length < 2 ) { |
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.
A comment could help here.
Just a comment on the component structure, but this looks good to me. |
f1199bf
to
b0422cf
Compare
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 looks good to me. 🚢
The API issue here is tracked at https://core.trac.wordpress.org/ticket/39965. |
The current functionality in WP searches also pages and also CPTs. See Worth also considering the REST API returns by default all the post fields including the content, and the response could be huge in size. Even several hundreds KB or more than 1MB with very long posts. See related considerations on: I think these concerns should definitely go in a new issue. |
closes #1040
This is not ready but I'd appreciate some eyes to help me polish it.
The idea is to provide a dropdown of suggested posts when adding a link.
Some notes: