Skip to content

fix: presentation material form reset - #1019

Merged
smarcet merged 3 commits into
masterfrom
fix/presentation-material-form-reset
Aug 13, 2026
Merged

fix: presentation material form reset#1019
smarcet merged 3 commits into
masterfrom
fix/presentation-material-form-reset

Conversation

@santipalenque

@santipalenque santipalenque commented Jul 22, 2026

Copy link
Copy Markdown

https://app.clickup.com/t/9014802374/86bb18pbh

Summary by CodeRabbit

  • Bug Fixes
    • Improved event material form behavior when existing data or validation errors change.
    • Fixed stale form values when switching from an existing material to a new one.
    • Improved file and media upload handling, including clearing removed files and updating uploaded file details.
    • Improved validation error display and automatic scrolling to errors.
    • Refined conditional fields and input states based on the selected material type.
    • Preserved user-entered changes while displaying newly received validation feedback.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e2ade909-1411-4817-93da-a039e56e9478

📥 Commits

Reviewing files that changed from the base of the PR and between 2d1ac8e and 67f2977.

📒 Files selected for processing (1)
  • src/components/forms/__tests__/event-material-form.test.js

📝 Walkthrough

Walkthrough

EventMaterialForm was converted to a functional React component using hooks. State synchronization, form handlers, submission, conditional rendering, media uploads, and regression tests were updated.

Changes

Event material form

Layer / File(s) Summary
Hook state and prop synchronization
src/components/forms/event-material-form.js
React hooks replace class state wiring. Effects synchronize entity and validation errors. The form derives optional media configuration.
Form behavior and media rendering
src/components/forms/event-material-form.js, src/components/forms/__tests__/event-material-form.test.js
Handlers update fields and upload metadata. File removal clears metadata. Submission passes entityState. Tests verify stale values, default entities, event prefilling, and validation-error handling.

Estimated code review effort: 4 (Complex) | ~45 minutes

Mergeability Score: ⚪ Minimal · up to 67f29

The PR updates presentation material form reset behavior and adds focused tests. One localized assertion should be confirmed to verify the control value correctly, but no actionable merge-blocking risk remains.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: fixing the presentation material form reset behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/presentation-material-form-reset

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/event-material-form.js`:
- Around line 56-59: Update the mediaUploadsOpts mapping in the event material
form to safely handle an undefined event.type during initial render and
handleChangeMUType. Use the existing event data when available and fall back to
an empty list before calling map.
🪄 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: e7020f9e-94a8-4f9a-a171-d874adb218dc

📥 Commits

Reviewing files that changed from the base of the PR and between 53b15bf and 6520aa5.

📒 Files selected for processing (1)
  • src/components/forms/event-material-form.js

Comment thread src/components/forms/event-material-form.js Outdated
Comment thread src/components/forms/event-material-form.js

@smarcet smarcet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@santipalenque please review

@smarcet smarcet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@smarcet
smarcet merged commit c5c20cb into master Aug 13, 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.

2 participants