CC-39: Setting Player Faction Breaks Flexible Alignment#320
Conversation
Fixes CC-39 This is a temporary fix to replace the functionality lost by removing the `clearable` prop from `<Select/>`. Long term it should be replaced by creating dummy lists which later have files attached.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis change updates the tournament registration form's details fields component. The 🚥 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 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/components/TournamentRegistrationForm/components/DetailsFields/DetailsFields.tsx`:
- Around line 78-84: The alignment clear button still calls
setValue('details.alignment', null) even when editing is disabled by
declaredFaction, which can leave alignment null while the selector is
uneditable; update the Button (the X icon's onClick) to be disabled or no-op
when declaredFaction is truthy (or hide the Button) so it cannot clear the field
while declaredFaction disables the Select—target the Button component and the
setValue('details.alignment', null) invocation and guard it with the
declaredFaction condition.
- Around line 61-68: The factionRequired boolean is using the wrong registration
flag—replace tournament.registrationDetails?.alignment with the faction-specific
flag (e.g., tournament.registrationDetails?.faction === 'required' or the
correct property name used in your model) so factionRequired reflects the
faction setting; update the computation of factionRequired and ensure
factionOptions (and its disabled: factionRequired) uses this corrected variable
(check functions/props around factionOptions and getFactionOptions() to confirm
the exact property name).
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d27008fc-72ca-42cf-bd8e-25876ce9492f
📒 Files selected for processing (2)
src/components/TournamentRegistrationForm/components/DetailsFields/DetailsFields.module.scsssrc/components/TournamentRegistrationForm/components/DetailsFields/DetailsFields.tsx
Fixes CC-39
This is a temporary fix to replace the functionality lost by removing the
clearableprop from<Select/>. Long term it should be replaced by creating dummy lists which later have files attached.Summary by CodeRabbit
Release Notes
Style
New Features