Sponsor Reports: contained forms display and sponsor booth fallback - #1014
Conversation
…back Consumes two additive sponsor-reports-api fields shipped for the summit-73 ops fixes (backend PRs #33/#34 in that repo): - OrdersTable Type column renders the order's full contained form set ("CL - Cleaning, EL - Electrical") when `forms` is present. The backend form_code filter matches by containment, so showing only the first line's label made filtered rows look wrong. Falls back to the legacy form.display until the API ships, and shows the bare code for pre-backfill rows whose form name is null. - Destination in BOTH lines views (LinesManifestView and the By Item drill-down) falls back from the line's add_on_name to the new sponsor_booth (the sponsor's Booth-type add-on name(s)), using || to match the backend CSV's `or` precedence so an empty-string add-on falls through. The muted "Booth" placeholder now appears only for sponsors with no booth add-on on file. No new files; reducers pass rows through verbatim so no action/reducer/ i18n changes. Both renders degrade gracefully against the pre-deploy API shape. Tests pin the join format, || precedence (empty-string case), absent/empty forms fallback, and the By Item contributor mapping. Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughSponsor report destination displays now fall back from empty add-on names to sponsor booth values. OrdersTable renders contained forms with formatted names and preserves legacy fallback behavior. ChangesDestination booth rendering
Contained form display
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Pull request overview
Updates Sponsor Reports UI to better reflect backend filtering/CSV semantics by (1) rendering an order’s full set of contained forms in the Orders table and (2) aligning “Destination” display with the backend’s booth fallback logic in both the Lines manifest and By Item drill-down views, while remaining compatible with the pre-deploy API shape.
Changes:
- OrdersTable “Type” column now renders
formsas a joined list (CODE - Name) with fallbacks to legacyform.displayand bare-code behavior for null names. - LinesManifestView and ByItemView drill-down now use
add_on_name || sponsor_boothto match backend CSVorprecedence (including empty-string add-on fallthrough). - Adds/updates tests to pin the new display and fallback behavior across both views.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/sponsors/reports/OrdersTable.js | Renders full contained form set from forms with backwards-compatible fallbacks. |
| src/components/sponsors/reports/LinesManifestView.js | Destination now falls back from add-on to sponsor_booth using ` |
| src/components/sponsors/reports/ByItemView.js | Carries sponsor_booth through grouping and applies the same destination fallback in drill-down. |
| src/components/sponsors/reports/tests/OrdersTable.test.js | Adds coverage for forms join formatting and fallbacks. |
| src/components/sponsors/reports/tests/LinesManifestView.test.js | Adds coverage for destination booth fallback and empty-string precedence. |
| src/components/sponsors/reports/tests/ByItemView.test.js | Adds coverage for sponsor_booth contributor mapping and drill-down fallback behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Destination now owns the add_on || booth precedence (and its why-comment) instead of both call sites repeating the expression. Also pins the empty-string form-name case in the OrdersTable Type column. Co-Authored-By: Claude <noreply@anthropic.com>
| <TableCell>{line.item_code}</TableCell> | ||
| <TableCell>{line.description}</TableCell> | ||
| <TableCell> | ||
| <Destination name={line.add_on_name} /> |
There was a problem hiding this comment.
why not just name={line.add_on_name || line.sponsor_booth} instead of adding a new prop to destination
There was a problem hiding this comment.
@santipalenque you're right that it renders the same, I checked the empty string and null cases.
I kept two props because the rule applies at two call sites with different field shapes: LinesManifestView passes the raw API fields, ByItemView the camelCase ones off the pivot builder. Collapsing means writing the precedence twice. FWIW an earlier self review round pushed the other way. The call site literally read name={line.add_on_name || line.sponsor_booth} and I moved it into Destination so the precedence and its why-comment lived with the owner instead of being repeated. So this is a revert of that, not just an extra prop for its own sake.
Also the empty state renders "Booth" as the placeholder, so the component is booth aware either way, and the || instead of ?? is deliberate so an empty add_on_name falls through to the booth like the backend CSV does.
Can collapse it if you still prefer.
There was a problem hiding this comment.
ok thats fine, thanks for the explanation
…1014) * feat(sponsor-reports): contained forms display and sponsor booth fallback Consumes two additive sponsor-reports-api fields shipped for the summit-73 ops fixes (backend PRs #33/#34 in that repo): - OrdersTable Type column renders the order's full contained form set ("CL - Cleaning, EL - Electrical") when `forms` is present. The backend form_code filter matches by containment, so showing only the first line's label made filtered rows look wrong. Falls back to the legacy form.display until the API ships, and shows the bare code for pre-backfill rows whose form name is null. - Destination in BOTH lines views (LinesManifestView and the By Item drill-down) falls back from the line's add_on_name to the new sponsor_booth (the sponsor's Booth-type add-on name(s)), using || to match the backend CSV's `or` precedence so an empty-string add-on falls through. The muted "Booth" placeholder now appears only for sponsors with no booth add-on on file. No new files; reducers pass rows through verbatim so no action/reducer/ i18n changes. Both renders degrade gracefully against the pre-deploy API shape. Tests pin the join format, || precedence (empty-string case), absent/empty forms fallback, and the By Item contributor mapping. Co-Authored-By: Claude <noreply@anthropic.com> * refactor(sponsor-reports): fold booth fallback into Destination Destination now owns the add_on || booth precedence (and its why-comment) instead of both call sites repeating the expression. Also pins the empty-string form-name case in the OrdersTable Type column. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
ref: https://app.clickup.com/t/86bazmggh
Frontend half of the summit-73 Purchase Details ops fixes. Consumes two additive fields the sponsor-reports-api backend now ships (fntechgit/sponsor-reports-api#33 and #34); both renders degrade gracefully against the pre-deploy API shape, so merge order does not matter.
Changes
formsfield. The backendform_codefilter matches by containment, so showing only the first line's label made filtered rows look wrong. Falls back to the legacyform.displayuntil the API shipsforms, and shows the bare code for pre-backfill rows whose form name is null.add_on_name || sponsor_booth—||deliberately, matching the backend CSV'sorprecedence so an empty-string add-on falls through to the booth. The muted "Booth" placeholder now appears only for sponsors with no Booth add-on on file.Scope
6 files (3 components + their 3 test files), +131/−5. No new files; reducers pass API rows through verbatim, so no action/reducer/i18n changes.
Destinationand all existing helpers reused.Testing
TDD (each behavior red first). New tests pin: the join format, null-name and absent/empty
formsfallbacks,||precedence including the empty-string case, the muted-placeholder path, and the By Item contributor mapping. Full suite: 1394/1395 — the one failure issponsor-users-actions.test.js, which fails identically on a clean master checkout (pre-existing, unrelated).Summary by CodeRabbit
Bug Fixes
Tests