Allow editing disabled redirects#4200
Open
Gilmoursa wants to merge 1 commit into
Open
Conversation
Remove the `enabled` guard from the Edit row action so users can edit redirects without needing to re-enable them first. Fixes johngodley#4106
Contributor
There was a problem hiding this comment.
Pull request overview
Enables editing redirects even when they are disabled, removing an unnecessary workflow step for users managing temporary or staged redirects (Fixes #4106).
Changes:
- Show the Edit row action regardless of redirect
enabledstate (capability-gated byCAP_REDIRECT_ADD). - Keep Check Redirect action gated by
enabled(and existing non-regex/url match constraints). - Leave the Enable/Disable toggle logic unchanged.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #4106.
Currently the Edit action in the redirect row menu is only shown when a redirect is enabled. This forces users to re-enable a redirect, make their edits, then disable it again — an unnecessary extra step.
The fix removes the
enabled &&guard from the Edit action condition inrow-actions.tsx, so the Edit button appears for both enabled and disabled redirects. The capability check (CAP_REDIRECT_ADD) is preserved, and the Enable/Disable toggle is unaffected.The "Check Redirect" action intentionally keeps its
enabledguard since checking a live redirect doesn't make sense when it's disabled.Changes
src/page/redirects/row-actions.tsx: removeenabled &&from the Edit row action conditionTest plan