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 Modal: Allow customizable modal size through props #69302

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 prop, which the internal Modal component supports. Currently, the size prop is hardcoded.

How?

The type declarations for ActionModal have been updated, allowing action.modalSize to be used as the 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

github-actions bot commented Feb 25, 2025

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: Mayank-Tripathi32 <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[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
@yogeshbhutkar yogeshbhutkar changed the title DataView Actions: Allow customizable modal size through props DataView Actions: Allow customizable modal size and focusOnMount through props Mar 3, 2025
@yogeshbhutkar yogeshbhutkar force-pushed the enhance-69294/enable-size-prop-dataviews branch from 8964fd6 to 65d7170 Compare March 3, 2025 04:37
@yogeshbhutkar
Copy link
Contributor Author

The failing test case is unrelated to the changes made in this PR and passes locally.

@yogeshbhutkar
Copy link
Contributor Author

Hi @ciampo, I've updated this PR based on your feedback here. When you have a moment, could you please review the latest changes?

Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

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

This seems to work well in principle. It would be great to also get a 👍 from @ntsekouras, @jorgefilipecosta and/or @oandregal (although we don't have much time to work on Gutenberg, these days).

Also cc @t-hamano and @Mamaduka for visibility.

@yogeshbhutkar yogeshbhutkar changed the title DataView Actions: Allow customizable modal size and focusOnMount through props DataView Actions Modal: Allow customizable modal size through props Mar 4, 2025
@yogeshbhutkar yogeshbhutkar force-pushed the enhance-69294/enable-size-prop-dataviews branch from 8b09376 to 78ad11a Compare March 4, 2025 04:13
@yogeshbhutkar yogeshbhutkar requested a review from t-hamano March 4, 2025 11:18
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.

LGTM 👍There are currently some e2e test failures on trunk, but we'll merge once those are resolved.

@Mamaduka
Copy link
Member

Mamaduka commented Mar 5, 2025

Rebasing should resolve e2e testing failures.

@yogeshbhutkar yogeshbhutkar force-pushed the enhance-69294/enable-size-prop-dataviews branch from a6ec7b8 to dc3ff35 Compare March 5, 2025 09:37
@Mamaduka Mamaduka merged commit 4e16551 into WordPress:trunk Mar 5, 2025
58 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.5 milestone Mar 5, 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
5 participants