Skip to content

feat(ui): allow change request submitter to cancel their own request#5330

Merged
IgorHorta merged 1 commit intomainfrom
igor/secrets-73-approval-change-request-submitter-should-be-able-to-cancel
Jan 31, 2026
Merged

feat(ui): allow change request submitter to cancel their own request#5330
IgorHorta merged 1 commit intomainfrom
igor/secrets-73-approval-change-request-submitter-should-be-able-to-cancel

Conversation

@IgorHorta
Copy link
Contributor

@IgorHorta IgorHorta commented Jan 30, 2026

Context

Previously, the "Close request" button in the Secret Approval Request UI was only visible to:

  • Users who are approvers, OR
  • When soft enforcement is enabled

This meant that CR submitters who are not in the approvers list could not cancel their own change requests from the UI, even though the backend already supports this operation.

This PR adds the isCommitter prop to enable the Close button for the CR submitter, allowing them to cancel their own requests.

Related: SECRETS-73

Screenshots

image

Steps to verify the change

  1. Create a user who is NOT an approver for a secret approval policy
  2. Have that user create a secret change that triggers a change request
  3. Navigate to the Secret Approvals page and view the change request
  4. Verify the "Close request" button is now visible and functional
  5. Verify the "Merge" button is still disabled (as expected - user is not an approver)

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
  • Tested locally
  • Updated docs (if needed)
  • Read the contributing guide

Previously, the "Close request" button was only visible to approvers or
when soft enforcement was enabled. This change adds the ability for CR
submitters to see and use the Close button to cancel their own change
requests, even if they are not in the approvers list.

The backend already supported this operation - this change only updates
the frontend to show the appropriate UI controls.
@maidul98
Copy link
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

This PR adds UI support for change request submitters to cancel their own requests. The backend already authorizes committers to close/reopen their requests (verified in secret-approval-request-service.ts:539-545), so this change simply exposes that capability in the frontend.

Changes:

  • Added isCommitter prop to SecretApprovalRequestAction component
  • Modified the Close button visibility condition from canApprove || isSoftEnforcement to canApprove || isSoftEnforcement || isCommitter
  • Computed isCommitter flag in the parent component by comparing committerUserId with current user's ID
  • Refactored shouldBlockSelfReview calculation to reuse the isCommitter variable

Impact:

  • Users who submitted a change request can now see and use the "Close request" button, even if they're not approvers
  • The Merge button remains correctly disabled for non-approvers
  • No security concerns - backend already validates this authorization

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • The changes are minimal, well-scoped, and align with existing backend authorization logic. The implementation is clean with proper variable reuse
  • No files require special attention

Important Files Changed

Filename Overview
frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestAction.tsx Added isCommitter prop to enable Close button visibility for change request submitters
frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestChanges.tsx Computed isCommitter flag and passed it to SecretApprovalRequestAction component, refactored shouldBlockSelfReview to use the new variable

@victorvhs017 victorvhs017 self-requested a review January 31, 2026 00:11
Copy link
Contributor

@victorvhs017 victorvhs017 left a comment

Choose a reason for hiding this comment

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

Tested and everything is working!

@IgorHorta IgorHorta merged commit a336d33 into main Jan 31, 2026
9 checks passed
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.

3 participants