fix: add isSaving to state, guard submit and catch errors - #1010
fix: add isSaving to state, guard submit and catch errors#1010tomrndom wants to merge 5 commits into
Conversation
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesBadge settings save flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant BadgeSettingsForm
participant saveBadgeSettings
participant Swal.fire
BadgeSettingsForm->>BadgeSettingsForm: Set isSaving to true
BadgeSettingsForm->>saveBadgeSettings: Submit badge settings
saveBadgeSettings-->>BadgeSettingsForm: Settle operations and return or reject
BadgeSettingsForm->>Swal.fire: Show success message on resolve
BadgeSettingsForm->>BadgeSettingsForm: Reset isSaving when mounted
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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/components/forms/badge-settings-form.js`:
- Around line 172-188: Update handleSubmit’s onSubmit flow to create a Promise
boundary with Promise.resolve().then(() => this.props.onSubmit(settingsToSave)),
preserving the existing success, catch, and finally handlers so synchronous
throws or non-Promise returns always reset isSaving.
🪄 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: bd39d0f8-2444-4382-9089-0b940b4d0b5f
📒 Files selected for processing (2)
src/components/forms/__tests__/badge-settings-form.test.jssrc/components/forms/badge-settings-form.js
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
…nted, add test for success path Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
…tled Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
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/__tests__/badge-actions.test.js`:
- Around line 72-83: Update the saveBadgeSettings test around
saveMarketingSetting to mock distinct fulfilled results for settings a and b,
then assert the dispatch promise resolves to an array containing those results
in a-then-b input order instead of only checking that the value is defined.
🪄 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: 94afd55a-d78a-43ce-b0a9-7a540b4f59f8
📒 Files selected for processing (1)
src/actions/__tests__/badge-actions.test.js
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
ref: https://app.clickup.com/t/9014802374/86batpx0h
Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com
Summary by CodeRabbit