Skip to content

Give the Cancel Request confirmation an OK button that does not say Cancel - #161

Open
SushilAmbekar wants to merge 2 commits into
jenkinsci:mainfrom
SushilAmbekar:fix/151-withdraw-request-ok-text
Open

SushilAmbekar wants to merge 2 commits into
jenkinsci:mainfrom
SushilAmbekar:fix/151-withdraw-request-ok-text

Conversation

@SushilAmbekar

@SushilAmbekar SushilAmbekar commented Nov 22, 2026 •

Copy link
Copy Markdown

What this changes

On the detail page of a pending run request, permission window request or activation request, Cancel Request opens core's confirmation dialog. Its two buttons read Cancel request (ours, which cancels the request) and Cancel (core's, which only closes the dialog). Two buttons with opposite effects and almost the same label make it easy to click the wrong one. This change sets okText="Withdraw request" on the three l:confirmationLinks, as the issue suggests. The button on the page and the dialog title stay as they are, and core's own Cancel cannot be changed from here.

Anchor

Testing done

  • T-UI-317 (PolishMarkupTest#t_ui_317_cancelConfirmationOkTextIsWithdrawRequest). bob files a pending run request, a permission window request and an activation request, then opens each detail page. The control is found by its endpoint (/cancel), as in T-UI-52b, and is asserted to be core's confirmation-link. Its data-ok-text must be exactly Withdraw request. Guard: Revoke on the active grants list is the same core tag and must keep Revoke, so a change that rewrote every confirmation link would fail the row.
  • Committed failing first (e84589e, f5b28b7 after the rebase), run on its own commit with mvn -ntp test -Dtest=PolishMarkupTest:
    Cancel on the pending run request: the dialog's OK text must be 'Withdraw request', was 'Cancel request'
    Cancel on the pending permission window request: the dialog's OK text must be 'Withdraw request', was 'Cancel request'
    Cancel on the pending activation request: the dialog's OK text must be 'Withdraw request', was 'Cancel request'
    Tests run: 5, Failures: 1, Errors: 0, Skipped: 0
    
    With the fix (c0df699): Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, and the same again on the rebased fix commit (5cdcb08, on main 06cfe2f). Both runs used Windows 11 and JDK 21.0.7.
  • e2e: e2e/ci/selftest_h1.py (the _destructive fixture) and the description of e2e/r21/reject_color.py named the old OK text and now name the new one. The driver finds the OK button by its data-id, so its code needs no change. python3 e2e/ci/selftest_h1.py passes locally.
  • Fork CI (on the commits before the rebase; the rebase changed only the note number, in docs/TEST-MATRIX.md and the test class Javadoc): Build passed, 26 of 26 jobs (the whole test suite and SpotBugs). One group, "run approval and mail", failed on the first attempt before any test ran: Maven could not download surefire-junit-platform on the runner. It passed on a rerun with no change. E2E passed, 12 of 12 jobs.

Checks

  • The pull request title represents the desired changelog entry.
  • Opened from a topic branch, not from the main branch of my fork.
  • The build and e2e workflows passed on my fork (links above).
  • mvn clean verify passed locally. Not ticked, and here is why: the full suite took about 105 s per class on my Windows machine (359 classes, about 2.5 h), so I ran PolishMarkupTest locally (red and green, above) and the whole suite in the fork's build workflow instead.
  • New behaviour has a row in docs/TEST-MATRIX.md (T-UI-317, note 374, changelog line), the row ID is in the test's name, and the test was committed failing first.
  • Touched src/main/resources/**: only the okText attribute of three existing l:confirmationLinks changed, so the dialog's layout is core's and is unchanged. T-UI-317 checks the rendered attribute on all three pages, and the E2E workflow, which drives these pages in a real browser, passed.
  • This PR does not disclose a security vulnerability.

Suggested label: enhancement (a usability fix to a confirmation dialog).

AI assistance: I made this change with the help of Claude Code. I reviewed the diff and the test, and I ran the red and green runs above myself.

🤖 Generated with Claude Code

@SushilAmbekar
SushilAmbekar requested a review from a team as a code owner November 22, 2026 15:25
SushilAmbekar and others added 2 commits November 22, 2026 20:59
The requester's Cancel Request on the pending run, permission window and
activation request pages opens core's confirmation dialog, whose own
dismiss button reads "Cancel". T-UI-317 requires the dialog's OK text
(data-ok-text on core's confirmation-link) to read "Withdraw request" on
all three pages, with Revoke on the grants list as the guard that keeps
its own OK text. Red on 059e1ed.

Refs jenkinsci#151 (SPEC 5, 6a, 8; note 374)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…say Cancel

Core's confirmation dialog for Cancel Request has its own dismiss button,
"Cancel", and the plugin's OK button read "Cancel request": two buttons
with opposite effects and almost the same label. The OK button of the
pending run, permission window and activation request pages now reads
"Withdraw request". The page button and the dialog title are unchanged.

The e2e self-test fixture and the description of r21/reject_color.py
name the new OK text; the driver finds the OK button by its data-id.

Fixes jenkinsci#151 (SPEC 5, 6a, 8; T-UI-317, note 374)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SushilAmbekar
SushilAmbekar force-pushed the fix/151-withdraw-request-ok-text branch from c0df699 to 5cdcb08 Compare November 22, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Give the cancel confirmation an OK button that does not say Cancel

1 participant