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

Confirmdialog: add custom button text #38994

Merged

Conversation

chad1008
Copy link
Contributor

Description

Follow up to #37602 (comment), this PR adds the ability to set custom label text for the confirm and cancel buttons in the experimental ConfirmDialog component.

cc @fullofcaffeine @ciampo

Testing Instructions

  • Launch Storybook locally
  • locate the ConfirmDialog component and select the new 'With Custom Button Labels" Story
  • manipulate the new "cancel button" and "confirm button" knobs to test different text strings
  • make sure all components tests pass, as this PR also adds a new test to confirm the specified button text is being rendered

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

@ciampo ciampo requested review from mirka and ciampo February 22, 2022 16:49
@ciampo ciampo added [Feature] Component System WordPress component system [Package] Components /packages/components [Type] Enhancement A suggestion for improvement. labels Feb 22, 2022
Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Nice enhancement! If you could update the component readme and add a changelog entry that would be great.

Comments are mostly code health stuff — I thought you'd might want some context around the general components work that's going on, given your interest in the squad 🙌

packages/components/src/confirm-dialog/test/index.js Outdated Show resolved Hide resolved
packages/components/src/confirm-dialog/test/index.js Outdated Show resolved Hide resolved
packages/components/src/confirm-dialog/component.tsx Outdated Show resolved Hide resolved
@chad1008 chad1008 force-pushed the enhance/confirmdialog-add-custom-button-text branch from 9215b53 to 750e4d3 Compare February 28, 2022 15:19
Co-authored-by: Lena Morita <lena@jaguchi.com>
@chad1008
Copy link
Contributor Author

chad1008 commented Feb 28, 2022

Component readme and changelog updated (7c46610) ✅

Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Looks like we're in good shape!

packages/components/src/confirm-dialog/README.md Outdated Show resolved Hide resolved
@ciampo ciampo merged commit aca7e6e into WordPress:trunk Mar 2, 2022
@github-actions github-actions bot added this to the Gutenberg 12.8 milestone Mar 2, 2022
@chad1008 chad1008 deleted the enhance/confirmdialog-add-custom-button-text branch March 2, 2022 11:14
@priethor priethor changed the title Enhance/confirmdialog add custom button text Confirmdialog: add custom button text Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Component System WordPress component system [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants