-
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
Post fields: move date
fields from edit-site
to fields
package
#66938
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. |
import type { BasePost } from '../../types'; | ||
|
||
const getFormattedDate = ( dateToDisplay: string | null ) => | ||
dateI18n( |
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.
One interesting thing from migrating this to TypeScript is that it forces you to pass the last parameter. Despite what the docs say, there's no default value and cannot be undefined.
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 think this can be solved by slightly changing the type definition of the function and making the argument optional =something
rather than something | undefined
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.
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.
Reverted the default parameter and modified the JSDoc instead at 544bf3e
@@ -1,5 +1,5 @@ | |||
type PostStatus = | |||
| 'published' | |||
| 'publish' |
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 was the wrong value.
Size Change: +77 B (0%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
Flaky tests detected in 012a507. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11803354795
|
9cbcd77
to
9e44b6f
Compare
012a507
to
e92d04e
Compare
{ "path": "../data" }, | ||
{ "path": "../dataviews" }, | ||
{ "path": "../date" }, |
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.
Sorted alphabetically, like the package.json
, and added date
as a reference. A bit obscure to see, but, without this, npm run lint:tsconfig
would cause the lint job to fail (see):
npm run lint:tsconfig exited with code 1
Part of #61084
What?
This PR moves the
date
field definition fromedit-site
to thefields
package.Why?
In preparation for moving the whole
usePostFields
hook (conversation).Testing Instructions
Visit the Pages page and verify that the "Date" field still works as expected (visualization, edit).