Add bufferstrip checkbox column to fields table#532
Conversation
…d update the bufferstrip status of a field
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a buffer-strip checkbox column to the fields table with a new cell component that submits updates via a POST action on the field route, and a route action that persists the Changes
Sequence DiagramsequenceDiagram
actor User
participant Checkbox as BufferStripCheckbox
participant Fetcher as ReactRouterFetcher
participant Action as FieldRouteAction
participant DB as updateField(database)
User->>Checkbox: Toggle checkbox
Checkbox->>Checkbox: Render Spinner (fetcher non-idle)
Checkbox->>Fetcher: submit({ b_id, b_bufferstrip })
Fetcher->>Action: POST form data
Action->>Action: validate b_id, parse b_bufferstrip
Action->>DB: call updateField(..., b_bufferstrip)
DB-->>Action: update result
Action-->>Fetcher: success response
Fetcher-->>Checkbox: transition to idle
Checkbox->>User: render updated checkbox
Note over User,Action: success toast displayed
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@fdm-app/app/routes/farm`.$b_id_farm.$calendar.field.tsx:
- Around line 50-76: The action handler reads b_id from formData and casts it to
string without checking for presence, which can pass "null" to updateField;
update the action function to validate b_id after const b_id =
formData.get("b_id") — ensure it is non-null and a string (or matches expected
id format), and if invalid return or throw a handled error (e.g., use
handleActionError or return a dataWithSuccess/dataWithError response with a
clear message) before calling updateField so updateField never receives an
invalid b_id.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 70a5e0f7-08da-4200-9797-eed8cc7d758b
📒 Files selected for processing (4)
.changeset/khaki-suits-bow.mdfdm-app/app/components/blocks/fields/buffer-strip-checkbox.tsxfdm-app/app/components/blocks/fields/columns.tsxfdm-app/app/routes/farm.$b_id_farm.$calendar.field.tsx
BoraIneviNMI
left a comment
There was a problem hiding this comment.
Seems to work well. The graying out based on permissions also works.
Summary by CodeRabbit
Closes #531