feat(dashboard): hide Sponsorship until there is an enquiry - #371
feat(dashboard): hide Sponsorship until there is an enquiry#371harshtandiya wants to merge 1 commit into
Conversation
The manage sidebar showed Sponsorship to everyone, though the section only has something to say once a user has filed an enquiry. Follow the account tabs and read the same endpoint, dropping the item when it comes back empty. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
❌ UI Demo Check failedThis pull request changes the UI (2 file(s) under 🛠️ How to fix
Either one re-runs this check automatically. |
Greptile SummaryThis PR conditionally shows the manage-sidebar Sponsorship entry when the current user has at least one sponsorship enquiry and updates the manage-access browser coverage accordingly.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking test-isolation issue that can make the new sidebar assertion fail against retained data. The sidebar uses the established owner-scoped sponsorship endpoint correctly, while the new absence test assumes rather than creates an enquiry-free database state. Files Needing Attention: e2e/tests/manage-access.spec.ts
|
| Filename | Overview |
|---|---|
| dashboard/src/data/sponsorships.ts | Adds a session-scoped v2 call whose direct-array response matches the endpoint and existing dashboard data patterns. |
| dashboard/src/layouts/ManagerLayout.vue | Makes personal navigation reactive and includes Sponsorship only when the owner-scoped endpoint returns rows. |
| e2e/tests/manage-access.spec.ts | Preserves direct placeholder coverage and adds an absence assertion, but that assertion does not establish its required empty database state. |
Prompt To Fix All With AI
### Issue 1
e2e/tests/manage-access.spec.ts:26
**Test assumes empty sponsorship state**
This assertion relies on the shared Administrator account having no sponsorship enquiries, but the persistent test database has no setup or cleanup that establishes that state. A retained Administrator-owned enquiry correctly renders the link and makes this test fail despite valid product behavior.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(dashboard): hide Sponsorship until ..." | Re-trigger Greptile
| await expect(page.getByRole("link", { name: "Talk Proposals" })).toBeVisible({ | ||
| timeout: 15000, | ||
| }); | ||
| await expect(page.getByRole("link", { name: "Sponsorship" })).toHaveCount(0); |
There was a problem hiding this comment.
Test assumes empty sponsorship state
This assertion relies on the shared Administrator account having no sponsorship enquiries, but the persistent test database has no setup or cleanup that establishes that state. A retained Administrator-owned enquiry correctly renders the link and makes this test fail despite valid product behavior.
Knowledge Base Used: Browser-Level E2E Test Harness
Prompt To Fix With AI
This is a comment left during a code review.
Path: e2e/tests/manage-access.spec.ts
Line: 26
Comment:
**Test assumes empty sponsorship state**
This assertion relies on the shared Administrator account having no sponsorship enquiries, but the persistent test database has no setup or cleanup that establishes that state. A retained Administrator-owned enquiry correctly renders the link and makes this test fail despite valid product behavior.
**Knowledge Base Used:** [Browser-Level E2E Test Harness](https://app.greptile.com/bwh-tech/-/custom-context/knowledge-base/bwhtech/buzz/-/docs/e2e-test-harness.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The manage sidebar listed Sponsorship for everyone, but the section only has
anything to show once a user has filed an enquiry. The account tabs already
gate their Sponsorships tab on
get_user_sponsorship_inquiries; the sidebarnow reads the same endpoint and drops the item when it comes back empty.
dashboard/src/data/sponsorships.ts—useMySponsorships(), v2useCall,no
cacheKey(it persists to IndexedDB and would outlive the session).ManagerLayout.vue—personalItemsis a computed; the Sponsorship entryis spread in only when the call returns rows.
Gotchas:
/manage/sponsorshipstill resolves to the work-in-progress placeholder foranyone who types it. Hiding the item is the ask; a redirect can wait until
the section has a real page.
Administrator no longer sees. It now navigates directly, and a second test
asserts the item is absent.
Not changed: the account tabs, the endpoint, or the placeholder route.