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

Add command: View page/post #66720

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

benazeer-ben
Copy link
Contributor

What?

Enhancement for the scenario mentioned in #55806

Why?

Currently view page/post command is not available.

How?

Added command for viewing page/ post from command box.

Testing Instructions

  • Open the WordPress Editor
  • Go to Posts or Pages in the WordPress admin.
  • Open a new or existing post/page to enter the block editor.
  • Confirm Command Labels for Published Content
  • Publish the post or page if it's not already published.
  • In the block editor, open the Command Palette (by pressing Cmd + K on Mac).
  • Check for the following commands:
    • View page (if editing a page).
    • View post (if editing a post).
  • Select the command and confirm it opens the published post or page in a new tab.
  • If the post/page is not already in draft, click Save as Draft or Preview to set it to a non-published state.
  • Open the Command Palette again and check for the following commands:
    • Preview page (if editing a page).
    • Preview post (if editing a post).
  • Select the command and confirm it opens the preview of the draft post or page in a new tab.

Screenshots or screencast

view-page-post.mp4

Copy link

github-actions bot commented Nov 4, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: benazeer-ben <[email protected]>
Co-authored-by: ramonjd <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 4, 2024
Copy link

github-actions bot commented Nov 4, 2024

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @benazeer-ben! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@akasunil akasunil added [Type] Enhancement A suggestion for improvement. [Package] Editor /packages/editor labels Nov 11, 2024
Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

This is working really well, thank you!

I tested posts and pages in the site editor (published and non-published), and also pages in the site editor.

The command appears as expected with the correct label, depending on the post status. ✅

I think for the first iteration it might be safer to limit the postType to page or post for now.

What do you think?

packages/editor/src/components/commands/index.js Outdated Show resolved Hide resolved
packages/editor/src/components/commands/index.js Outdated Show resolved Hide resolved
packages/editor/src/components/commands/index.js Outdated Show resolved Hide resolved
@ramonjd
Copy link
Member

ramonjd commented Nov 13, 2024

Looks like this PR needs a quick rebase too.

@benazeer-ben
Copy link
Contributor Author

Hi @ramonjd

Thanks for your review and suggestions.

I think for the first iteration it might be safer to limit the postType to page or post for now.

Yes, right. As per the ticket definition it is mentioning support for pages.

So this PR is mainly developed for pages and posts, we can consider the other postTypes later as you suggested.

@ramonjd
Copy link
Member

ramonjd commented Dec 18, 2024

I think it just needs a quick rebase and we're good to go 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants