fix(crm): show retired stage names in list cells - #6041
Conversation
List Stage cells resolve labels from soupPropertyToProperty options. Qualified, Trial, and Negotiation are retired from that catalog and currently render as the option UUID. Co-authored-by: teo <synoet@users.noreply.github.com>
formatOptionValueById now uses getPropertyOptionLabel when the attached option catalog omits a known system id. Group headers already did this. Negotiation, Qualified, and Trial keep their names in Stage cells after the default set was trimmed. Co-authored-by: teo <synoet@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughSummary by CodeRabbit
WalkthroughUpdated property option formatting to resolve labels through the shared property-option lookup when option data is unavailable. The formatter still formats matching options and falls back to the raw option ID. Added parameterized tests for all supported stage option IDs through Merge Risk: ⚪ Minimal · up to The change restores readable labels for retired CRM stages without re-enabling those stages in the picker or changing stored data, APIs, permissions, or deployment behavior; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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 |
Why
PR #4822 trimmed Qualified, Trial, and Negotiation out of the default stage picker. Group headers still resolve those ids through
getPropertyOptionLabel, so a Negotiation group still says Negotiation. List cells go throughsoupPropertyToProperty→formatPropertyValue→formatOptionValueById, and that last step used onlyproperty.options. After the trim,SYSTEM_PROPERTY_OPTIONSfor Stage isCOMPANY_STAGE_OPTIONS(Lead, Demo, Customer, Churned). A stored Negotiation id therefore printed as00000001-0000-0000-0010-000000000005.The picker should stay trimmed. The Set-stage modal reads
property.options. PuttingALL_COMPANY_STAGE_OPTIONSback onSYSTEM_PROPERTY_OPTIONSwould offer retired stages again.Scope
formatOptionValueByIdinapps/web/src/features/property/utils/formatting.tsstill prefers a match inproperty.options. If that list has no match, it asksgetPropertyOptionLabelbefore it falls back to the raw id.apps/web/src/features/entity/extractors-property/property-helpers.test.tsformats Lead, Demo, Customer, Churned, Qualified, Trial, and Negotiation throughsoupPropertyToProperty+formatPropertyValue.Out of scope: the Set-stage modal, backend option lists, and group-header labeling.
Tradeoffs
Display labels and picker options stay on two catalogs.
ALL_COMPANY_STAGE_OPTIONSis the label table.COMPANY_STAGE_OPTIONSis the picker set. A one-list change would be smaller and would put retired stages back in the modal.The import is
@entity/utils/task-properties, not the@entitybarrel, so the extractors →@property/utilscycle does not close.Blast Radius
Any select cell that formats through
formatPropertyValuenow can show a catalog label for an id missing fromproperty.options. Unknown ids still print as ids. Current picker stages are unchanged.CRM users who still have Negotiation, Qualified, or Trial on a company see the name in the list cell, matching the group header.
Verification
Isolated vitest on
property-helpers.test.ts: 7 passed, including the three retired stage ids.Customers list on the local stack, List mode, Group by Stage. gloxco Stage cell shows Negotiation, not the option id. OSC still shows Customer. Qualco and Trialco show Qualified and Trial.
gloxco Stage cell shows Negotiation
customers_list_retired_stage_cells_show_names.mp4
To show artifacts inline, enable in settings.