Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add help to partners onboarding

Steven Teya00d6fed1a57
diff --git a/apps/web/app/partners.dub.co/(onboarding)/layout.tsx b/apps/web/app/partners.dub.co/(onboarding)/layout.tsx
index 86ea77e84f..a6aa272fd5 100644
--- a/apps/web/app/partners.dub.co/(onboarding)/layout.tsx
+++ b/apps/web/app/partners.dub.co/(onboarding)/layout.tsx
@@ -1,3 +1,4 @@
+import Toolbar from "@/ui/layout/toolbar/toolbar";
import { Grid, Wordmark } from "@dub/ui";
export default function PartnerOnboardingLayout({
@@ -6,18 +7,23 @@ export default function PartnerOnboardingLayout({
children: React.ReactNode;
}) {
return (
- <div className="flex min-h-screen flex-col">
- <div className="fixed inset-0 [mask-image:radial-gradient(60%_60%_at_50%_0%,black,transparent)]">
- <Grid className="text-neutral-200" />
- <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]" />
- </div>
- <div className="relative z-10 mt-10 flex w-full flex-col items-center justify-center px-3 text-center md:px-8">
- <div className="animate-slide-up-fade relative flex w-auto flex-col items-center [--offset:10px] [animation-duration:1.3s] [animation-fill-mode:both]">
- <Wordmark className="relative h-10" />
- <span className="text-sm font-medium text-neutral-700">Partner</span>
+ <>
+ <div className="flex min-h-screen flex-col">
+ <div className="fixed inset-0 [mask-image:radial-gradient(60%_60%_at_50%_0%,black,transparent)]">
+ <Grid className="text-neutral-200" />
+ <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]" />
+ </div>
+ <div className="relative z-10 mt-10 flex w-full flex-col items-center justify-center px-3 text-center md:px-8">
+ <div className="animate-slide-up-fade relative flex w-auto flex-col items-center [--offset:10px] [animation-duration:1.3s] [animation-fill-mode:both]">
+ <Wordmark className="relative h-10" />
+ <span className="text-sm font-medium text-neutral-700">
+ Partner
+ </span>
+ </div>
+ {children}
</div>
- {children}
</div>
- </div>
+ <Toolbar show={["help"]} />
+ </>
);
}
diff --git a/apps/web/scripts/download-links.ts b/apps/web/scripts/download-links.ts
index 14c4d571d1..5696525461 100644
--- a/apps/web/scripts/download-links.ts
+++ b/apps/web/scripts/download-links.ts
@@ -1,41 +1,37 @@
import { prisma } from "@dub/prisma";
-import { linkConstructor } from "@dub/utils";
import "dotenv-flow/config";
import * as fs from "fs";
import * as Papa from "papaparse";
-const projectId = "xxx";
-
async function main() {
const links = await prisma.link.findMany({
where: {
- projectId,
+ projectId: "xxx",
+ archived: false,
+ folderId: null,
+ domain: "xxx",
+ clicks: {
+ gt: 0,
+ },
+ key: {
+ not: "_root",
+ },
},
select: {
- domain: true,
+ id: true,
+ shortLink: true,
key: true,
- url: true,
+ externalId: true,
clicks: true,
createdAt: true,
},
orderBy: {
- createdAt: "asc",
+ clicks: "desc",
},
});
+ console.log(links.length);
- const processedLinks = links.map(
- ({ key, domain, url, clicks, createdAt }) => ({
- link: linkConstructor({
- domain,
- key,
- }),
- url,
- clicks,
- createdAt: createdAt.toISOString(),
- }),
- );
-
- fs.writeFileSync("xxx.csv", Papa.unparse(processedLinks));
+ fs.writeFileSync("xxx.csv", Papa.unparse(links));
}
main();
diff --git a/apps/web/scripts/reset-partner-country.ts b/apps/web/scripts/reset-partner-country.ts
new file mode 100644
index 0000000000..515e50cbd8
--- /dev/null
+++ b/apps/web/scripts/reset-partner-country.ts
@@ -0,0 +1,26 @@
+import { prisma } from "@dub/prisma";
+import "dotenv-flow/config";
+
+// one time script to reset partner countries for programs that imported from another platform
+// probably won't need it in the future
+async function main() {
+ const partners = await prisma.partner.updateMany({
+ where: {
+ country: "US",
+ programs: {
+ some: {
+ programId: "xxx",
+ },
+ },
+ users: {
+ none: {},
+ },
+ },
+ data: {
+ country: null,
+ },
+ });
+ console.log(partners);
+}
+
+main();