Skip to content

Commit 1b52812

Browse files
committed
remove test, rearrange files
1 parent d9dc1c3 commit 1b52812

File tree

7 files changed

+46
-139
lines changed

7 files changed

+46
-139
lines changed

apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-details-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function ProfileDetailsForm({ partner }: { partner?: PartnerProps }) {
101101
</SettingsRow>
102102

103103
<SettingsRow
104-
id="sites"
104+
id="platforms"
105105
heading="Website and socials"
106106
description="Add your website and social accounts you use to share links. Verifying as many platforms as possible helps build trust with programs."
107107
>

apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/use-partner-discovery-requirements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getPartnerProfileChecklistProgress } from "@/lib/network/get-discoverability-requirements";
1+
import { getPartnerProfileChecklistProgress } from "@/lib/network/get-partner-profile-checklist-progress";
22
import usePartnerProfile from "@/lib/swr/use-partner-profile";
33
import useProgramEnrollments from "@/lib/swr/use-program-enrollments";
44
import { useMemo } from "react";

apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/[programSlug]/header-controls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { acceptProgramInviteAction } from "@/lib/actions/partners/accept-program-invite";
4-
import { getPartnerProfileChecklistProgress } from "@/lib/network/get-discoverability-requirements";
4+
import { getPartnerProfileChecklistProgress } from "@/lib/network/get-partner-profile-checklist-progress";
55
import { mutatePrefix } from "@/lib/swr/mutate";
66
import usePartnerProfile from "@/lib/swr/use-partner-profile";
77
import useProgramEnrollments from "@/lib/swr/use-program-enrollments";

apps/web/lib/actions/partners/create-program-application.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { notifyPartnerApplication } from "@/lib/api/partners/notify-partner-appl
66
import { getIP } from "@/lib/api/utils/get-ip";
77
import { getSession } from "@/lib/auth";
88
import { qstash } from "@/lib/cron";
9-
import { getPartnerProfileChecklistProgress } from "@/lib/network/get-discoverability-requirements";
9+
import { getPartnerProfileChecklistProgress } from "@/lib/network/get-partner-profile-checklist-progress";
1010
import {
1111
formatApplicationFormData,
1212
formatWebsiteAndSocialsFields,

apps/web/lib/network/get-discoverability-requirements.ts

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,6 @@ export const partnerIsNotBanned = (
2828
return programEnrollments.every((pe) => pe.status !== "banned");
2929
};
3030

31-
export type DiscoverabilityRequirement = {
32-
label: string;
33-
href?: string;
34-
completed: boolean;
35-
};
36-
37-
export function getPartnerProfileChecklistProgress({
38-
partner,
39-
programEnrollments,
40-
}: {
41-
partner: Pick<
42-
PartnerProps,
43-
| "image"
44-
| "description"
45-
| "monthlyTraffic"
46-
| "preferredEarningStructures"
47-
| "salesChannels"
48-
| "platforms"
49-
>;
50-
programEnrollments: Pick<
51-
EnrolledPartnerProps,
52-
"programId" | "status" | "totalCommissions"
53-
>[];
54-
}) {
55-
const tasks = getDiscoverabilityRequirements({
56-
partner,
57-
programEnrollments,
58-
});
59-
60-
const completedCount = tasks.filter(({ completed }) => completed).length;
61-
const totalCount = tasks.length;
62-
63-
return {
64-
tasks,
65-
completedCount,
66-
totalCount,
67-
isComplete: completedCount === totalCount,
68-
};
69-
}
70-
7131
export function getDiscoverabilityRequirements({
7232
partner,
7333
programEnrollments,
@@ -85,7 +45,11 @@ export function getDiscoverabilityRequirements({
8545
EnrolledPartnerProps,
8646
"programId" | "status" | "totalCommissions"
8747
>[];
88-
}): DiscoverabilityRequirement[] {
48+
}): {
49+
label: string;
50+
href?: string;
51+
completed: boolean;
52+
}[] {
8953
return [
9054
{
9155
label: "Upload your logo",
@@ -94,7 +58,7 @@ export function getDiscoverabilityRequirements({
9458
},
9559
{
9660
label: "Verify at least 2 social accounts/website",
97-
href: "#sites",
61+
href: "#platforms",
9862
completed:
9963
PARTNER_PLATFORM_FIELDS.filter(
10064
(field) => field.data(partner.platforms).verified,
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { EnrolledPartnerProps, PartnerProps } from "../types";
2+
import { getDiscoverabilityRequirements } from "./get-discoverability-requirements";
3+
4+
export function getPartnerProfileChecklistProgress({
5+
partner,
6+
programEnrollments,
7+
}: {
8+
partner: Pick<
9+
PartnerProps,
10+
| "image"
11+
| "description"
12+
| "monthlyTraffic"
13+
| "preferredEarningStructures"
14+
| "salesChannels"
15+
| "platforms"
16+
>;
17+
programEnrollments: Pick<
18+
EnrolledPartnerProps,
19+
"programId" | "status" | "totalCommissions"
20+
>[];
21+
}) {
22+
const tasks = getDiscoverabilityRequirements({
23+
partner,
24+
programEnrollments,
25+
});
26+
27+
const completedCount = tasks.filter(({ completed }) => completed).length;
28+
const totalCount = tasks.length;
29+
30+
return {
31+
tasks,
32+
completedCount,
33+
totalCount,
34+
isComplete: completedCount === totalCount,
35+
};
36+
}

apps/web/tests/misc/partner-profile-checklist-progress.test.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)