-
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
DataForm: add author to quick edit page/post list #63983
Merged
+76
−7
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
271dac7
Add validation to quick edit form
oandregal 23d3904
Add author to quick-edit form
oandregal 16cda97
Display select control for users
oandregal d88059f
Allow for undefined author
oandregal 216234e
Bring back getValue for author
oandregal f3053ac
If elements are provided, the value needs to be one of them
oandregal 1dff635
Update storybook
oandregal 9bfa200
Remove unnecessary getValue from author field
oandregal 70e6966
Convert to number before validating
oandregal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add author to quick-edit form
commit 23d3904261bc14831c7409236f1da2cc1f6492a9
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
As far as I'm aware, we didn't really use this function. The implementation is also wrong, because the
getValue
should return an integer (whatitem.author
is) instead of a string (the display name is arender
concern).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.
Don't we have a filter that uses 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.
It's not necessary for filters, using the integer would be enough. However! Your comment makes me realize this is actually necessary for sorting: we should sort authors by name not by the id assigned by WordPress.
I'm going to bring back this, but sorting is not working on
trunk
. We need to look at that separately. There's a few issues (author & dates not sorting properly, the sort config in the table headers is not cleared properly):Gravacao.do.ecra.2024-07-26.as.13.23.26.mov
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 actually raises an interesting question: if we have types but sorting depends on getValue, we can end up with the following (like in this case for
author
):integer
getValue
returns a stringHow do we make the sort utility work based on types in this scenario?
It seems we shouldn't use
getValue
for sorting and actually provide a custom sort utility if the field needs it. In that case, the filterSort utility would use the custom sort if it exists, otherwise would default to the sort defined by the field type. Thoughts?(nothing to do in this PR, as I brought back the
getValue
function 216234e but wanted to share for consideration when looking at fixing sorting and formalizing types)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've looked a bit more into this and it turns out
getValue
is not used for sorting either: we delegate on the REST API for filter/sort/rest in this page.The issues I've seen with sorting in
trunk
are:I removed the
getValue
to proceed with this PR.