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

Replace "Add new post" link text with more meaningful Label (v2) #62277

Merged

Conversation

carstingaxion
Copy link
Contributor

I messed up my first PR on the same thing, this is my 2nd try in which I followed all suggestions from the review by @t-hamano review. 🙏 Thank you for your kindness!


What?

This PR replaces the static "Add new post" link text inside the the query block, with a more meaningful label from the currently selected post type.

Why?

This PR is polishing the existing UI with data, that is already available, without introducing any new elements.

How?

Removes a static text string, with the add_new_item label from the currently selected post type.

Testing Instructions

  1. Open a post or page.
  2. Insert a query block.
  3. Open the inspector controls
  4. Switch the queried post type
  5. And see the link text change, depending on the selected post type, within the CreateNewPostLink element.

Testing Instructions for Keyboard

Test can be done by keyboard as well, without any additions to my Testing Instruction.

Screenshots or screencast

Before

Bildschirmaufzeichnung.vom.11.03.2024.03.51.53.mp4

After

Bildschirmaufzeichnung.vom.11.03.2024.03.56.18.mp4

@carstingaxion carstingaxion requested a review from ajitbohra as a code owner June 4, 2024 11:39
Copy link

github-actions bot commented Jun 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: carstingaxion <carstenbach@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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 Jun 4, 2024
Copy link

github-actions bot commented Jun 4, 2024

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @carstingaxion! 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.

@carstingaxion
Copy link
Contributor Author

Dear @t-hamano , please could you take a look, once more?

@t-hamano t-hamano added [Block] Query Loop Affects the Query Loop Block [Type] Enhancement A suggestion for improvement. labels Jun 6, 2024
@t-hamano t-hamano self-requested a review June 6, 2024 14:01
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This PR seems to work as expected.

Post:

image

Page:

image

In order to ship this PR, we need to merge the latest trunk into it (See this Slack comment). Would you be willing to try this?

The following steps should do the trick:

  1. Check out the trunk branch: git checkout trunk
  2. Fetch the latest changes from upstream: git fetch upstream
  3. Incorporate the upstream changes into the trunk branch of your local repo: git merge upstream/trunk
  4. Check out the branch this PR was submitted in: git checkout feature/better-create-new-post-link-v2
  5. Merge trunk branch: git merge trunk
  6. Push to the remote branch: git push origin feature/better-create-new-post-link-v2

@carstingaxion
Copy link
Contributor Author

In order to ship this PR, we need to merge the latest trunk into it (See this Slack comment). Would you be willing to try this?

I tried. And with your detailed & friendly explanation, things went surprisingly well on my side. Thank you very much @t-hamano !!!

Now, let's see what happens over here.

@t-hamano t-hamano self-requested a review June 8, 2024 10:02
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the update! The merge is done correctly 👍

@t-hamano t-hamano merged commit acbfacf into WordPress:trunk Jun 8, 2024
62 checks passed
@github-actions github-actions bot added this to the Gutenberg 18.6 milestone Jun 8, 2024
@carstingaxion
Copy link
Contributor Author

Thank you for not giving up and helping me to reach the finish line! Thank you very much @t-hamano .

patil-vipul pushed a commit to patil-vipul/gutenberg that referenced this pull request Jun 17, 2024
…dPress#62277)

* Replace "Add new post" link text with more meaningful 'add_new_item' label of current post type.

* Avoid rendering the CreateNewPostLink component itself if postType is falsy

* Follow recommendation to use useSelect hook, instead of using select() directly in React components

Co-authored-by: carstingaxion <carstenbach@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants