Skip to content

feat: allow customizing the button texts of a row action confirmation - #24

Open
paodb wants to merge 2 commits into
masterfrom
confirmation-button-texts
Open

paodb wants to merge 2 commits into
masterfrom
confirmation-button-texts

Conversation

@paodb

@paodb paodb commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Add withConfirmation overloads to EasyRowAction that take the confirm and cancel button texts, both with a static message and with a message provider. The existing overloads keep using "Ok" / "Cancel". The row actions demo now shows custom button texts.

Close #22

Summary by CodeRabbit

  • New Features
    • Confirmation dialogs for row actions can now use custom confirm and cancel button labels, alongside a fixed or item-specific message.
    • The deactivate action now displays “Deactivate” and “Keep active” as its confirmation and cancel options. Default button labels remain “Ok” and “Cancel.”

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

EasyRowAction now exposes confirmation overloads that accept custom confirm and cancel button text. Tests cover default and custom labels, static and row-dependent messages, and null-label exceptions. The demo supplies custom labels, and the project version changes to 1.2.0-SNAPSHOT.

Changes

Confirmation button labels

Layer / File(s) Summary
Expose custom confirmation labels
src/main/java/com/flowingcode/vaadin/addons/easygrid/actions/EasyRowAction.java, src/test/java/com/flowingcode/vaadin/addons/easygrid/actions/EasyRowActionTest.java, src/test/java/com/flowingcode/vaadin/addons/easygrid/RowActionsDemo.java, pom.xml
EasyRowAction exposes custom-button-text overloads for static messages and row-dependent message providers. Tests cover default and custom text, null titles, provider-generated messages, and null-label exceptions. The demo action supplies “Deactivate” and “Keep active.” The project version changes to 1.2.0-SNAPSHOT.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature · Severity of issue fixed: Low

Suggested reviewers: javier-godoy

Merge Risk: Minimal · up to 60971

This change adds custom confirm and cancel button texts to row-action confirmation dialogs, and the existing default labels are unchanged. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: row action confirmation dialogs can now use custom confirm and cancel button texts. The changeset adds public withConfirmation overloads to EasyRowAction that accept …
Linked Issues check Passed [#22] The issue asks that the confirm and cancel button texts of a row action confirmation be customizable. The issue proposes making the private overload `withConfirmation(String title, ValueProvider…
Out of Scope Changes check Passed All functional changes map to #22:
- EasyRowAction.java: public overloads for custom button texts, plus the static-message variant.
- EasyRowActionTest.java: tests for the new overloads and null h…
Full details: Title check

Explanation

The title states the main change: row action confirmation dialogs can now use custom confirm and cancel button texts. The changeset adds public withConfirmation overloads to EasyRowAction that accept these texts, and the demo and tests cover them. The title is concise, specific, and matches the linked issue #22 objective.

Full details: Linked Issues check

Explanation

[#22] The issue asks that the confirm and cancel button texts of a row action confirmation be customizable. The issue proposes making the private overload withConfirmation(String title, ValueProvider<T, String> messageProvider, String confirmText, String cancelText) public, and optionally adding a static-message variant.

At the reviewed head, EasyRowAction.java implements both requirements:

  • The message-provider overload with confirmText and cancelText is public. It builds a ConfirmDialog with setConfirmText and setCancelText.
  • A static-message overload withConfirmation(String title, String message, String confirmText, String cancelText) is public. It delegates to the message-provider overload through Constant.of(message).
  • The existing overloads keep the defaults "Ok" and "Cancel".
  • @NonNull on the text parameters causes a NullPointerException for null button texts. A null title remains allowed.

The test file adds coverage for default texts, custom texts with a null title, item-specific messages from a provider, and null button texts. The demo uses the new texts. The Easy CRUD integration described in the issue is context only and is not required here.

The current head contents were checked for the overload signatures and their delegation. The test assertions were taken from the change summary and were not independently run.

Full details: Out of Scope Changes check

Explanation

All functional changes map to #22:

  • EasyRowAction.java: public overloads for custom button texts, plus the static-message variant.
  • EasyRowActionTest.java: tests for the new overloads and null handling.
  • RowActionsDemo.java: the deactivate action shows the custom button texts. This is demonstration support for the new API.

The pom.xml change bumps the project version from 1.1.1-SNAPSHOT to 1.2.0-SNAPSHOT. It is a release-level metadata change, not a behavior change. It is consistent with adding a public API in a minor release. It is not tied to #22 in the PR description, so it is noted here but does not constitute unrelated functional scope.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 38716dab-e0ca-431a-9a1b-64d845b07e33
Commits

Reviewing files that changed from the base of the PR and between 79fd696 and 609713f.

Files selected for processing: 4

  • pom.xml
  • src/main/java/com/flowingcode/vaadin/addons/easygrid/actions/EasyRowAction.java
  • src/test/java/com/flowingcode/vaadin/addons/easygrid/RowActionsDemo.java
  • src/test/java/com/flowingcode/vaadin/addons/easygrid/actions/EasyRowActionTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@paodb
paodb marked this pull request as ready for review November 13, 2026 17:51
@paodb
paodb requested a review from scardanzan November 13, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

Allow customizing the button texts of a row action confirmation

1 participant