Skip to content

Allow partners to view the marketplace#3447

Merged
steven-tey merged 4 commits intomainfrom
partner-marketplace-requirements
Feb 10, 2026
Merged

Allow partners to view the marketplace#3447
steven-tey merged 4 commits intomainfrom
partner-marketplace-requirements

Conversation

@marcusljf
Copy link
Collaborator

@marcusljf marcusljf commented Feb 10, 2026

But apply restrictions based on profile completion. Once their profile checklist is complete, they're able to apply to marketplace programs.

CleanShot.2026-02-09.at.16.47.14.mp4

Summary by CodeRabbit

  • New Features

    • Introduced partner profile completion checklist with specific requirements: logo upload, social account verification, profile description, monthly traffic, earning structures, and sales channels.
  • Improvements

    • Simplified marketplace access—all partners can now view available programs.
    • Updated program application flow to require profile completion before applying to new programs.

But apply restrictions based on profile completion. Once their profile checklist is complete, they're able to apply to marketplace programs.
@vercel
Copy link
Contributor

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dub Ready Ready Preview Feb 10, 2026 9:36pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

This PR removes marketplace access-control gates and replaces them with a profile-checklist system. Authorization checks for partnerCanViewMarketplace are deleted from API routes, layouts, and components. A new getPartnerProfileChecklistProgress utility evaluates profile completion, and marketplace access now depends on completing profile tasks rather than prior enrollment-based restrictions.

Changes

Cohort / File(s) Summary
Removed Authorization Functions
apps/web/lib/network/throw-if-partner-cannot-view-marketplace.ts
Entirely removed the throwIfPartnerCannotViewMarketplace async function and its associated Prisma query logic for marketplace access validation.
API Route Access Control
apps/web/app/(ee)/api/network/programs/route.ts, apps/web/app/(ee)/api/network/programs/count/route.ts
Deleted imports and calls to throwIfPartnerCannotViewMarketplace from GET handlers, eliminating pre-condition authorization checks.
Marketplace Layout Gating
apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/layout.tsx
Removed all access-control data fetching, loading states, and redirect logic; layout now unconditionally returns children.
New Checklist Progress System
apps/web/lib/network/get-partner-profile-checklist-progress.ts
Introduced new utility computing checklist progress from partner profile and program enrollments, returning tasks, completion counts, and completion status.
Discoverability Requirements Overhaul
apps/web/lib/network/get-discoverability-requirements.ts
Refactored to return array of DiscoverabilityRequirement objects; exported partnerIsNotBanned helper; expanded tasks to include logo upload, social verification, description, traffic, earning structures, and sales channels; removed legacy partnerCanViewMarketplace.
Profile Checklist Usage
apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/use-partner-discovery-requirements.ts
Replaced enrollment-based exclusion logic with direct call to getPartnerProfileChecklistProgress, simplifying to return tasks array.
Marketplace Header Controls
apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/[programSlug]/header-controls.tsx
Added getPartnerProfileChecklistProgress computation; extended disabledTooltip logic to display profile-completion UI block with ProgressCircle when checklist is incomplete.
Sidebar Navigation Simplification
apps/web/ui/layout/sidebar/partner-program-dropdown.tsx, apps/web/ui/layout/sidebar/partners-sidebar-nav.tsx
Removed partnerCanViewMarketplace checks; Marketplace link is now always rendered; simplified NAV_AREAS callback signatures and eliminated showMarketplace boolean field.
Marketplace Component Gating
apps/web/ui/partners/program-marketplace/program-marketplace-banner.tsx, apps/web/ui/partners/program-marketplace/program-marketplace-card.tsx
Removed partnerCanViewMarketplace and useProgramEnrollments dependencies; rendering now only checks partner existence and status, not enrollment-based permissions.
Program Application Access Control
apps/web/lib/actions/partners/create-program-application.ts
Replaced partnerCanViewMarketplace with getPartnerProfileChecklistProgress check; blocks published programs when checklist is incomplete; added platforms to partner query include.
User Referral Token Eligibility
apps/web/app/api/user/referrals-token/route.ts
Updated free-partner eligibility from partnerCanViewMarketplace to requiring both partnerHasEarnedCommissions and partnerIsNotBanned; tightened paid-workspace check.
Profile Details Form
apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx
Added id="info" to first SettingsRow; renamed second SettingsRow id from "sites" to "platforms".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #2886 — Directly related: both modify partner marketplace access logic and remove throwIfPartnerCannotViewMarketplace checks.
  • PR #3217 — Inverse operation: adds partnerCanViewMarketplace conditional to Marketplace link, while this PR removes the same check.
  • PR #3302 — Sidebar navigation structure changes: both modify partners-sidebar-nav.tsx callbacks and data shape.

Suggested reviewers

  • devkiran

Poem

🐰 Checks are dropped like morning dew,
Checklists bloom in place of few,
Profiles now must complete their quest,
Before the marketplace takes the test!
No gates remain—just tasks to do, 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective of the pull request: removing marketplace access restrictions to allow partners to view the marketplace, while shifting validation to profile completion checks.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch partner-marketplace-requirements

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
apps/web/lib/network/get-discoverability-requirements.ts (1)

48-52: Consider exporting the return type as a named type.

The inline return type { label: string; href?: string; completed: boolean }[] is repeated conceptually across consumers. Extracting it as a named export (e.g., DiscoverabilityRequirement) would improve type reuse in downstream files like get-partner-profile-checklist-progress.ts.

Proposed refactor
+export type DiscoverabilityRequirement = {
+  label: string;
+  href?: string;
+  completed: boolean;
+};
+
 export function getDiscoverabilityRequirements({
   partner,
   programEnrollments,
 }: {
   ...
-}): {
-  label: string;
-  href?: string;
-  completed: boolean;
-}[] {
+}): DiscoverabilityRequirement[] {

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@apps/web/app/`(ee)/partners.dub.co/(dashboard)/programs/marketplace/[programSlug]/header-controls.tsx:
- Around line 63-100: The disabledTooltip can be undefined while
partner/programEnrollments are still loading, enabling the Apply button briefly;
update the logic that computes disabledTooltip (referencing disabledTooltip,
programEnrollment, checklistProgress, partner, programEnrollments, isComplete)
to explicitly treat the loading state as disabled—e.g., if partner or
programEnrollments is null/undefined return a loading/disabled tooltip (or a
boolean disabled flag) before checking programEnrollment.status or
checklistProgress.isComplete so the button remains disabled until data finishes
loading. Ensure the new guard is included in the same useMemo branch that
computes disabledTooltip and that dependencies [partner, programEnrollments,
programEnrollment, checklistProgress] are updated if needed.
🧹 Nitpick comments (1)
apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/[programSlug]/header-controls.tsx (1)

52-61: useProgramEnrollments() is called in both the parent and child components.

MarketplaceProgramHeaderControls (Line 23) and ApplyButton (Line 53) both call useProgramEnrollments(). SWR deduplicates the network request, so there's no performance cost, but you could pass the already-resolved data down as a prop to avoid the redundant hook call.

@steven-tey steven-tey changed the title Allow allow partners to view the marketplace Allow partners to view the marketplace Feb 10, 2026
@steven-tey steven-tey merged commit 124ece2 into main Feb 10, 2026
10 checks passed
@steven-tey steven-tey deleted the partner-marketplace-requirements branch February 10, 2026 22:16
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.

2 participants