Skip to content

Commit a325c92

Browse files
committed
add help to partner onboarding
1 parent 901cfe6 commit a325c92

File tree

3 files changed

+59
-31
lines changed

3 files changed

+59
-31
lines changed
Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Toolbar from "@/ui/layout/toolbar/toolbar";
12
import { Grid, Wordmark } from "@dub/ui";
23

34
export default function PartnerOnboardingLayout({
@@ -6,18 +7,23 @@ export default function PartnerOnboardingLayout({
67
children: React.ReactNode;
78
}) {
89
return (
9-
<div className="flex min-h-screen flex-col">
10-
<div className="fixed inset-0 [mask-image:radial-gradient(60%_60%_at_50%_0%,black,transparent)]">
11-
<Grid className="text-neutral-200" />
12-
<div className="absolute inset-0 -translate-y-1/2 -scale-x-100 bg-[conic-gradient(from_-32deg,#f00_0deg,#EAB308_99deg,#5CFF80_162deg,#00FFF9_216deg,#3A8BFD_288deg,#855AFC_360deg)] opacity-25 blur-[200px]" />
13-
</div>
14-
<div className="relative z-10 mt-10 flex w-full flex-col items-center justify-center px-3 text-center md:px-8">
15-
<div className="animate-slide-up-fade relative flex w-auto flex-col items-center [--offset:10px] [animation-duration:1.3s] [animation-fill-mode:both]">
16-
<Wordmark className="relative h-10" />
17-
<span className="text-sm font-medium text-neutral-700">Partner</span>
10+
<>
11+
<div className="flex min-h-screen flex-col">
12+
<div className="fixed inset-0 [mask-image:radial-gradient(60%_60%_at_50%_0%,black,transparent)]">
13+
<Grid className="text-neutral-200" />
14+
<div className="absolute inset-0 -translate-y-1/2 -scale-x-100 bg-[conic-gradient(from_-32deg,#f00_0deg,#EAB308_99deg,#5CFF80_162deg,#00FFF9_216deg,#3A8BFD_288deg,#855AFC_360deg)] opacity-25 blur-[200px]" />
15+
</div>
16+
<div className="relative z-10 mt-10 flex w-full flex-col items-center justify-center px-3 text-center md:px-8">
17+
<div className="animate-slide-up-fade relative flex w-auto flex-col items-center [--offset:10px] [animation-duration:1.3s] [animation-fill-mode:both]">
18+
<Wordmark className="relative h-10" />
19+
<span className="text-sm font-medium text-neutral-700">
20+
Partner
21+
</span>
22+
</div>
23+
{children}
1824
</div>
19-
{children}
2025
</div>
21-
</div>
26+
<Toolbar show={["help"]} />
27+
</>
2228
);
2329
}

apps/web/scripts/download-links.ts

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,37 @@
11
import { prisma } from "@dub/prisma";
2-
import { linkConstructor } from "@dub/utils";
32
import "dotenv-flow/config";
43
import * as fs from "fs";
54
import * as Papa from "papaparse";
65

7-
const projectId = "xxx";
8-
96
async function main() {
107
const links = await prisma.link.findMany({
118
where: {
12-
projectId,
9+
projectId: "xxx",
10+
archived: false,
11+
folderId: null,
12+
domain: "xxx",
13+
clicks: {
14+
gt: 0,
15+
},
16+
key: {
17+
not: "_root",
18+
},
1319
},
1420
select: {
15-
domain: true,
21+
id: true,
22+
shortLink: true,
1623
key: true,
17-
url: true,
24+
externalId: true,
1825
clicks: true,
1926
createdAt: true,
2027
},
2128
orderBy: {
22-
createdAt: "asc",
29+
clicks: "desc",
2330
},
2431
});
32+
console.log(links.length);
2533

26-
const processedLinks = links.map(
27-
({ key, domain, url, clicks, createdAt }) => ({
28-
link: linkConstructor({
29-
domain,
30-
key,
31-
}),
32-
url,
33-
clicks,
34-
createdAt: createdAt.toISOString(),
35-
}),
36-
);
37-
38-
fs.writeFileSync("xxx.csv", Papa.unparse(processedLinks));
34+
fs.writeFileSync("xxx.csv", Papa.unparse(links));
3935
}
4036

4137
main();
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { prisma } from "@dub/prisma";
2+
import "dotenv-flow/config";
3+
4+
// one time script to reset partner countries for programs that imported from another platform
5+
// probably won't need it in the future
6+
async function main() {
7+
const partners = await prisma.partner.updateMany({
8+
where: {
9+
country: "US",
10+
programs: {
11+
some: {
12+
programId: "xxx",
13+
},
14+
},
15+
users: {
16+
none: {},
17+
},
18+
},
19+
data: {
20+
country: null,
21+
},
22+
});
23+
console.log(partners);
24+
}
25+
26+
main();

0 commit comments

Comments
 (0)