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 support for 'link' type action in DataViews #68298

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

KUMARNiru007
Copy link

What?

This PR introduces support for a new "link" type in actions within DataViews. With this feature, actions can now function as hyperlinks, allowing users to click on them and navigate to specific URLs.

Why?

Currently, DataView actions are limited to basic functionalities like buttons. There’s no way to include navigational links directly, which restricts the scope of interactive use cases. By supporting links, this update enhances the versatility of DataViews, enabling developers to provide seamless access to external or internal resources.

How?

  • Updated the action handler to recognize and process the "link" type.
  • Added support for configuring "link" actions with a URL property.
  • Implemented rendering logic to display these actions as hyperlinks in the user interface.
  • Ensured backward compatibility for existing action types like buttons.

Testing Instructions

  1. Open a DataView configuration and add an action with the type set to "link" and a valid URL.
  2. Verify that the link action renders correctly as a clickable hyperlink in the interface.
  3. Test the link by clicking it and confirming it navigates to the correct URL.
  4. Ensure other action types like buttons still function as expected without any regressions.

Testing Instructions for Keyboard

  1. Navigate to a DataView containing a "link" action using only the keyboard.
  2. Tab through to focus on the link and press Enter.
  3. Confirm the link opens the intended URL as expected.

Screenshots or screencast


Please let me know if any other changes are required

Copy link

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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @KUMARNiru007.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: KUMARNiru007.


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 Dec 25, 2024
Copy link

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

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond 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