-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Quick edit: add Date as field and datetime
as field type
#64267
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Looking at the video, I feel like we're missing a label here. I think in the default "form" renderer (the default one we're using until now), all the fields should look like we're in regular form and have some consistency. |
Size Change: +352 B (+0.02%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Set it to draft, as this is still in progress: fixing some types, adding tests, date format, form design, etc. |
e40a0ea
to
e841c71
Compare
}; | ||
const [ edits, setEdits ] = useState( {} ); | ||
const [ edits, setEdits ] = useState( initialEdits ); |
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 makes sure that the dataform has access to the previous item. It was always an empty object for the onChange
event handler. The setEdits( {} )
below also triggered a re-render of the DataForm on submit.
date
as field and field typedatetime
as field type
@jameskoster I've pushed the "datetime" type field as two separate inputs ( Note that I used the HTML input components directly:
Using the browser components directly has its disadvantages, as we'd need to make sure every style provided by |
There's a related conversation about this at #64299 (comment) |
I think using |
Based on this feedback and the fact that we are going to have two form layouts as per #64299 I've pushed the following changes:
Gravacao.do.ecra.2024-08-07.as.08.38.13.mov |
This is ready for a new round of feedback/approval. |
This reverts commit 27ffe45.
02f1e35
to
69946cc
Compare
Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Part of #59745 #63624
What?
Adds the "Date" field in quick edit as a
datetime
type.Gravacao.do.ecra.2024-08-07.as.08.38.13.mov
How?
This PR introduces a
datetime
field type definition to be used by the "Date" field.Testing Instructions