Repository navigation
feat(web): campaign/organizer follows, pre-launch teasers, and donor impact summary (#315) - #323
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
…nor impact summary (#315)
4c38070 to
c6a3622
Compare
|
PO acceptance: merge at c6a3622 Independent PO flagship review (d86f4f60-0e1e-45d9-8d9c-57fcee65cd25): APPROVE (0 P0/P1/P2).
|
Refs #315
Summary
Phase 2 web application implementation for #315 (Retention & Pre-launch: campaign/organizer follows, pre-launch "Sắp ra mắt" opt-in & notify-me teaser, in-app follow notices, and donor impact summary), built against the deployed
DOS/DOS.Me#1880(20261201120000_give_follows_prelaunch_and_donor_impact.sql) schema on Supabase Beta (2559201b22c9cc1c09e60838d70acbec556994d0).Key Changes
lib/follows.ts,components/FollowButton.tsx):/campaigns/[slug]via user-JWT RLS ongive.campaign_followsand public aggregategive.campaign_follower_count./u/[handle]strictly via handle-based RPCs (organizer_follower_count_by_handle,is_following_organizer_by_handle,follow_organizer_by_handle,unfollow_organizer_by_handle,list_my_followed_organizers) — zero direct table queries and zeroorganizer_idexposure to browsers.<a href="/auth/login?return_path=...">; keyed inneruseActionStateform so server refreshes stay in sync while preserving inline errors./me/campaigns/[id](PrelaunchSection.tsx+setCampaignPrelaunchPublic) with TOC entry and live teaser link./campaigns/[slug]forapproved+prelaunch_public = true+ futurestarts_atshowing"Nhận thông báo khi mở"CTA and strictly suppressing all payment accounts, VietQR, donate/pledge/monthly forms, statements, poster QR, report form, and view/share analytics beacons.status === "live"pre-checks ondonate,startMonthlyPlan, andsavePledgebeforedbService()."Sắp ra mắt"(status=prelaunch), pre-launchCampaignCardlayout, organizer profile"Sắp ra mắt"grid with enrichedstarts_at, and teaser Open Graph card in/campaigns/[slug]/opengraph-image(with non-opted-in/expiredapprovedstill strictly 404).lib/notices.ts):campaign_launched,campaign_update_posted, andorganizer_campaign_launched./me/contributions,DonorImpactCard.tsx):"Dấu ấn đóng góp của tôi"summary card backed bygive.my_donor_impact_summary()andgive.list_my_followed_organizers()under the donor's own JWT.Verification
pnpm format:check— passedpnpm lint— passedpnpm typecheck— passedpnpm test— 192/192 test files, 2,754/2,754 tests passed (6 new test files + 10 updated test suites)pnpm build— passed (Next.js 16.4.6 production build)📌 TL;DR
This PR introduces a public "Pre-launch" (Sắp ra mắt) state for campaigns, allowing approved campaigns with future start dates to display a teaser page with a "Follow" feature while strictly blocking all donation, pledge, and payment surfaces until the campaign goes live.
🎯 Type of Change
🔍 Changes Walkthrough
apps/web/src/app/(public)/donations/actions.tsdonateaction to selectstatusand reject donations if the campaign is notlive.apps/web/src/app/(public)/donations/actions.test.tsapproved(pre-launch) campaigns.apps/web/src/app/campaigns/[slug]/follow-actions.tstoggleCampaignFollowto handle follow/unfollow logic, RLS error mapping, and path revalidation.apps/web/src/app/campaigns/[slug]/follow-actions.test.tsapps/web/src/app/campaigns/[slug]/page.tsxpublicPrelaunchstate, renders a teaser sidebar (goal, dates, follow button) instead of donation forms, and hides payment/pledge/statement sections.apps/web/src/app/campaigns/[slug]/page.test.tsapps/web/src/app/campaigns/[slug]/monthly-actions.tsstartMonthlyPlanto check campaignstatusand reject plans for non-livecampaigns.apps/web/src/app/campaigns/[slug]/monthly-actions.test.tsapps/web/src/app/campaigns/[slug]/pledge/actions.tssavePledgeto check campaignstatusand reject pledges for non-livecampaigns.apps/web/src/app/campaigns/[slug]/pledge/actions.test.tsapps/web/src/app/campaigns/[slug]/opengraph-image.tsxapps/web/src/app/campaigns/[slug]/opengraph-image.test.tsapps/web/src/app/campaigns/page.tsxapprovedcampaigns from money totals queries.apps/web/src/app/campaigns/page.test.tsapps/web/src/app/me/campaigns/[id]/PrelaunchSection.tsxapps/web/src/app/me/campaigns/[id]/PrelaunchSection.test.ts📊 Architectural Flow
flowchart TD A[Visitor / Organizer] --> B{Campaign Status?} B -->|Live / Ended| C[Standard Campaign Page] C --> D[Donation / Pledge Forms] C --> E[Payment / VietQR] C --> F[Statement / Totals] B -->|Approved + Future Start + prelaunch_public| G[Pre-launch Teaser Page] G --> H[Show Goal & Dates] G --> I[Follow Button] G --> J[Hide Payment / Pledge / Statement] B -->|Draft / In Review| K[Private Preview / 404] I --> L[Server Action: toggleCampaignFollow] L --> M{Auth Check} M -->|Signed Out| N[Redirect to Login] M -->|Signed In| O[DB: Insert/Delete Follow] O --> P[Revalidate Paths] P --> Q[Update UI State]