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

DataViews: fix action visibility logic #67197

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

oandregal
Copy link
Member

Follow-up to #67020 (comment)

What?

This fixes a bug that hid the action menu, even when there was seconday actions.

How?

Fix the visibility logic so that it hides the action menu only when there's a single action and is primary, as it was originally intended.

Testing Instructions

npm install && npm run storybook:dev

Go to the storybook and visit the default story for dataviews. It should display both the primary action (delete) and the action menu with two actions. In trunk it only displays the primary action.

Screenshot 2024-11-21 at 11 37 19

Then, go to this line and remove the secondary action so the actions array only contains the id: delete action. The expected behaviour is that the action menu is hidden in this case:

Screenshot 2024-11-21 at 11 39 36

Copy link

github-actions bot commented Nov 21, 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: oandregal <[email protected]>
Co-authored-by: ntsekouras <[email protected]>

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

@oandregal oandregal self-assigned this Nov 21, 2024
@oandregal oandregal added [Type] Bug An existing feature does not function as intended [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Nov 21, 2024
@oandregal oandregal added this to the Gutenberg 19.8 milestone Nov 21, 2024
@oandregal oandregal enabled auto-merge (squash) November 21, 2024 10:46
@oandregal oandregal disabled auto-merge November 21, 2024 10:46
@oandregal oandregal enabled auto-merge (squash) November 21, 2024 10:46
@oandregal oandregal merged commit b5732a5 into trunk Nov 21, 2024
69 of 73 checks passed
@oandregal oandregal deleted the fix/primary-action-visibility branch November 21, 2024 11:15
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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants