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

DataView Actions: Allow customizable modal size through props #69302

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

Conversation

yogeshbhutkar
Copy link
Contributor

@yogeshbhutkar yogeshbhutkar commented Feb 25, 2025

What?

Closes #69294

This PR would allow the consumers to set up the modal size within DataView actions.

Why?

The consumer implementation supports various modal behaviors but does not specify the size parameter, which the internal Modal component supports. Currently, the size is hardcoded to medium.

How?

The type declarations for ActionModal have been updated, allowing action.size to be used as a prop for customization.

Testing Instructions

  1. Start the storybook development server (npm run storybook:dev).
  2. Add/modify the modalSize prop here in the action with id delete:
    export const actions: Action< SpaceObject >[] = [
  3. Confirm that the modal size changes.

Screencast

dataviews.mov

@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review February 25, 2025 09:42
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: @VanshDagar27.

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: VanshDagar27.

Co-authored-by: yogeshbhutkar <[email protected]>
Co-authored-by: oandregal <[email protected]>

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

Copy link
Contributor

@Mayank-Tripathi32 Mayank-Tripathi32 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Feb 26, 2025
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] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataViews: allow setting the size for action modals
3 participants