fix: add constants, change payload structure, new company on input#784
fix: add constants, change payload structure, new company on input#784
Conversation
📝 WalkthroughWalkthroughAdds a new SPONSOR_USER_ASSIGNMENT_TYPE enum, refactors sponsor-type handling to use it, and enhances CompanyInputMUI with allowCreate, debounced fetching, option creation, and improved option labeling/rendering. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
7b09f66 to
443fd6f
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/mui/formik-inputs/company-input-mui.js (1)
92-110:⚠️ Potential issue | 🟡 MinorHandle create-option values in multi-select when allowCreate is enabled.
The multi-select path doesn't normalize
inputValuelike the single-select path does. When users create a new entry:
- With
plainValue: stores'Create "..."'instead of the user input text- Without
plainValue: callsparseInt(v.value)wherev.valueisnull(created at line 129), resulting inNaNidsApply the same
inputValuehandling from the single-select path (lines 106–109):
- plainValue:
v.inputValue || v.label- id:
v.inputValue ? 0 : parseInt(v.value)🔧 Proposed fix
} else if (isMulti) { theValue = plainValue - ? newValue.map((v) => v.label) - : newValue.map((v) => ({ - id: parseInt(v.value), - name: v.label - })); + ? newValue.map((v) => v.inputValue || v.label) + : newValue.map((v) => ({ + id: v.inputValue ? 0 : parseInt(v.value), + name: v.inputValue || v.label + })); } else {
ref: https://app.clickup.com/t/86b8e1vcf
Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com
Summary by CodeRabbit
Refactor
New Features