Skip to content
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

Introduce wp:action-publish; update corresponding UI to reference #6670

Merged
merged 3 commits into from
May 10, 2018

Conversation

danielbachhuber
Copy link
Member

Description

Introduces a wp:action-publish targetSchema attribute and updates post-pending-status, post-schedule, and post-visibility to reference it.

See #6361
Previously #6529 #6630

How has this been tested?

Sign in as an Author to see the corresponding UI as editable:

image

As a Contributor, this UI is no longer accessible:

image

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@danielbachhuber danielbachhuber added this to the 2.9 milestone May 10, 2018
@danielbachhuber danielbachhuber requested a review from a team May 10, 2018 00:53
'type' => 'object',
'properties' => array(
'status' => array(
'type' => 'string',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is only for publish, then it should have an enum entry. "enum": [ "publish", "future" ]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cf894ca175f7c8826f7e55c07dc56d3a1dbbbaa7

@danielbachhuber
Copy link
Member Author

Bit by #6683

return {
hasPublishAction: get( getCurrentPost(), [ '_links', 'wp:action-publish' ], false ),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel there should be a dedicated selector or a mechanism to make this clearer. I see selectors as something that should reflect data needs. I don't have the perfect solution though:

  • Something like canDoActionOnCurrentPost( state, 'publish' ) would work but it's specific to the current post.
  • Just an utility like canDoAction( record, 'publish' ) could work too but it enforces the fact that the _links property is part of the record where ideally it shouldn't be.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is covered by, #6655.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants