Feature: add OVERRIDE action on sponsor forms#1017
Conversation
📝 WalkthroughWalkthroughChangesSponsor managed-form override
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant SponsorFormsTab
participant ReduxThunk
participant ManagedFormsAPI
SponsorFormsTab->>ReduxThunk: confirm and submit form.id
ReduxThunk->>ManagedFormsAPI: POST /managed-forms/{formId}/override
ManagedFormsAPI-->>ReduxThunk: override result
ReduxThunk->>SponsorFormsTab: refresh managed and customized forms
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8)src/i18n/en.jsonTraceback (most recent call last): Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/actions/sponsor-forms-actions.js`:
- Around line 649-651: Update the refresh success handler containing
getSponsorManagedForms and getSponsorCustomizedForms to dispatch both actions
with the current managed and customized table parameters, matching the parameter
construction used by the UI handlers. Preserve each table’s page, sorting,
search, and showArchived state instead of invoking the default-argument forms.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a56f5fa7-e68b-448d-af26-cf1c836b557d
📒 Files selected for processing (3)
src/actions/sponsor-forms-actions.jssrc/i18n/en.jsonsrc/pages/sponsors/sponsor-page/tabs/sponsor-forms-tab/index.js
| .then(() => { | ||
| dispatch(getSponsorManagedForms()); | ||
| dispatch(getSponsorCustomizedForms()); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve the active table queries during refresh.
These default-argument calls reset both tables to page 1, default sorting, an empty search, and showArchived=false after an override. Refresh using the current managed/customized table parameters, as the UI handlers do, so an override does not move users out of their current view.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/actions/sponsor-forms-actions.js` around lines 649 - 651, Update the
refresh success handler containing getSponsorManagedForms and
getSponsorCustomizedForms to dispatch both actions with the current managed and
customized table parameters, matching the parameter construction used by the UI
handlers. Preserve each table’s page, sorting, search, and showArchived state
instead of invoking the default-argument forms.
https://app.clickup.com/t/9014802374/86bb1557g
Summary by CodeRabbit