-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Chrome: Allow adding, removing tags from posts #970
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
Conversation
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 guess we need tabs here :)
I'll take a look |
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.
The correct argument name is orderby:
https://developer.wordpress.org/rest-api/reference/tags/#list-tags
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.
Do we want to make a conscious choice between loading "lots" of tags vs. loading "all" the tags (-1)?
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.
Why don't we need to updateSelectedTags on initial mount? Wouldn't a post loaded from save already have tags assigned?
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.
but the component won't have the availableTags yet
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.
Do we ever worry the find could return undefined here and throw an error on property access?
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.
Not at this moment, because we ensure all the tagNames are loaded before calling this.
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.
Do we actually need or want to save these tags when they're added? AFAIK the post endpoint is happy to create these for us when the post is saved if they don't yet exist, and may actually be the preferred behavior.
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 tried but failed, which shape should these tags have to do this? The endpoint was giving me an error like tags should be integers (which means ids for me)
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.
Dug around a bit and it appears intentional the endpoint only accepts IDs:
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.
How do you feel about a disabled token field instead of a spinner? Is that any better or worse for perceived reactivity?
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'll try
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.
Tested and approved :)
|
@youknowriad for the slow TokenField tests I think a reasonable approach is #982 and then find a way to run these regularly outside of Travis. |
cf2da64 to
45770d4
Compare
This reverts commit d384b451149a6d971bece019591fc6c655a83572.
45770d4 to
0905da4
Compare
|
I'll be merging this shortly if no objections? |

This PR make the TagSelector part of #854.
Worth noting: