Skip to content

Sponsor Reports: contained forms display and sponsor booth fallback - #1014

Merged
smarcet merged 2 commits into
masterfrom
feature/sponsor-reports-forms-booth-display
Jul 21, 2026
Merged

Sponsor Reports: contained forms display and sponsor booth fallback#1014
smarcet merged 2 commits into
masterfrom
feature/sponsor-reports-forms-booth-display

Conversation

@caseylocker

@caseylocker caseylocker commented Jul 18, 2026

Copy link
Copy Markdown

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

  • OrdersTable Type column renders the order's full contained form set ("CL - Cleaning, EL - Electrical") from the new forms field. 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 forms, and shows the bare code for pre-backfill rows whose form name is null.
  • Destination fallback in both lines views (LinesManifestView and the By Item drill-down): add_on_name || sponsor_booth|| deliberately, matching the backend CSV's or precedence 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. Destination and all existing helpers reused.

Testing

TDD (each behavior red first). New tests pin: the join format, null-name and absent/empty forms fallbacks, || precedence including the empty-string case, the muted-placeholder path, and the By Item contributor mapping. Full suite: 1394/1395 — the one failure is sponsor-users-actions.test.js, which fails identically on a clean master checkout (pre-existing, unrelated).

Summary by CodeRabbit

  • Bug Fixes

    • Destination booth displays now correctly fall back to the sponsor’s booth when add-on information is missing or blank.
    • Orders tables now show all contained forms, including form codes and names, while preserving compatibility with older records.
    • Form entries without names now display their codes without extra formatting.
  • Tests

    • Added coverage for destination booth fallbacks and contained-form display scenarios.

…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>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@caseylocker, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 780a9316-188d-4b3c-be4c-1b21b33eb82c

📥 Commits

Reviewing files that changed from the base of the PR and between 8e949f9 and 66837ca.

📒 Files selected for processing (3)
  • src/components/sponsors/reports/ByItemView.js
  • src/components/sponsors/reports/LinesManifestView.js
  • src/components/sponsors/reports/__tests__/OrdersTable.test.js
📝 Walkthrough

Walkthrough

Sponsor 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.

Changes

Destination booth rendering

Layer / File(s) Summary
Booth data propagation and fallback rendering
src/components/sponsors/reports/ByItemView.js, src/components/sponsors/reports/LinesManifestView.js, src/components/sponsors/reports/__tests__/*
Contributor records include sponsorBooth; destination rendering uses addOnName or sponsorBooth, with tests covering null and empty values.

Contained form display

Layer / File(s) Summary
Contained forms column rendering
src/components/sponsors/reports/OrdersTable.js, src/components/sponsors/reports/__tests__/OrdersTable.test.js
The Type column formats all contained forms as code - name, joins them with commas, and falls back to the legacy display when needed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: smarcet

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: contained forms display and sponsor booth fallback in sponsor reports.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/sponsor-reports-forms-booth-display

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 forms as a joined list (CODE - Name) with fallbacks to legacy form.display and bare-code behavior for null names.
  • LinesManifestView and ByItemView drill-down now use add_on_name || sponsor_booth to match backend CSV or precedence (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.

@caseylocker
caseylocker requested a review from smarcet July 18, 2026 01:32
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>
@smarcet
smarcet requested a review from santipalenque July 20, 2026 13:39
<TableCell>{line.item_code}</TableCell>
<TableCell>{line.description}</TableCell>
<TableCell>
<Destination name={line.add_on_name} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just name={line.add_on_name || line.sponsor_booth} instead of adding a new prop to destination

@caseylocker caseylocker Jul 20, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thats fine, thanks for the explanation

@smarcet smarcet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smarcet
smarcet merged commit 53b15bf into master Jul 21, 2026
9 checks passed
smarcet pushed a commit that referenced this pull request Jul 21, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants