Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions apps/app/src/actions/organization/get-organization-users-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,32 @@ export const getOrganizationUsersAction = authActionClient
}

try {
const users = await db.user.findMany({
const users = await db.organizationMember.findMany({
where: {
organizationId: ctx.user.organizationId,
},
select: {
id: true,
name: true,
image: true,
user: {
select: {
id: true,
name: true,
image: true,
},
},
},
orderBy: {
name: "asc",
user: {
name: "asc",
},
},
});

return {
success: true,
data: users.map((user: User) => ({
id: user.id,
name: user.name || "",
image: user.image || "",
data: users.map((user) => ({
id: user.user.id,
name: user.user.name || "",
image: user.user.image || "",
})),
};
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { getI18n } from "@/locales/server";
import { SecondaryMenu } from "@bubba/ui/secondary-menu";
import { Suspense } from "react";

export default async function Layout({
children,
Expand All @@ -11,9 +10,7 @@ export default async function Layout({

return (
<div className="max-w-[1200px]">
<Suspense fallback={<div>Loading...</div>}>
<SecondaryMenu items={[{ path: "/", label: t("overview.title") }]} />
</Suspense>
<SecondaryMenu items={[{ path: "/", label: t("overview.title") }]} />

<main className="mt-8">{children}</main>
</div>
Expand Down
40 changes: 17 additions & 23 deletions apps/app/src/app/[locale]/(app)/(dashboard)/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
import { auth } from "@/auth";
import { FrameworkProgress } from "@/components/charts/framework-progress";
import { RequirementStatus } from "@/components/charts/requirement-status";

import { SkeletonLoader } from "@/components/skeleton-loader";

import { db } from "@bubba/db";
import { redirect } from "next/navigation";
import { Suspense } from "react";

async function getComplianceOverview(organizationId: string) {
const frameworks = await db.organizationFramework.findMany({
where: { organizationId },
include: {
organizationControl: true,
framework: true,
},
});

return { frameworks };
}

export default async function DashboardPage() {
const session = await auth();
Expand All @@ -32,13 +16,23 @@ export default async function DashboardPage() {
);

return (
<Suspense fallback={<SkeletonLoader amount={2} />}>
<div className="space-y-12">
<div className="grid gap-4 md:grid-cols-2">
<FrameworkProgress frameworks={frameworks} />
<RequirementStatus frameworks={frameworks} />
</div>
<div className="space-y-12">
<div className="grid gap-4 md:grid-cols-2">
<FrameworkProgress frameworks={frameworks} />
<RequirementStatus frameworks={frameworks} />
</div>
</Suspense>
</div>
);
}

async function getComplianceOverview(organizationId: string) {
const frameworks = await db.organizationFramework.findMany({
where: { organizationId },
include: {
organizationControl: true,
framework: true,
},
});

return { frameworks };
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { auth } from "@/auth";
import { Title } from "@/components/title";
import { getI18n } from "@/locales/server";
import { db } from "@bubba/db";
import { SecondaryMenu } from "@bubba/ui/secondary-menu";
import { unstable_cache } from "next/cache";
import { redirect } from "next/navigation";
import { Suspense } from "react";

export default async function Layout({
children,
Expand Down Expand Up @@ -33,13 +31,21 @@ export default async function Layout({
}

return (
<div className="h-[calc(100vh-4rem)] bg-background">
<div className="max-w-[1200px] space-y-4">
<Title title={policy.name} href="/policies/all" />

<main className="h-[calc(100vh-4rem-4rem)]">{children}</main>
</div>
);

/* return (
<div className="h-[calc(100vh-4rem)] bg-background max-w-[1200px]">
<div className="h-16 px-4 border-b flex items-center">
<Title title={policy.name} href="/policies/all" />
</div>
<main className="h-[calc(100vh-4rem-4rem)]">{children}</main>
</div>
);
); */
}

const getPolicy = unstable_cache(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export default async function Layout({
items={[
{ path: "/settings", label: t("settings.general.title") },
{ path: "/settings/members", label: t("settings.members.title") },
{ path: "/settings/billing", label: t("settings.billing.title") },
{
path: "/settings/billing",
label: t("settings.billing.title"),
enabled: false,
},
]}
/>
</Suspense>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { TeamMembers } from "@/components/settings/team/team-members";

export default async function Members() {
return (
<div className="space-y-4 sm:space-y-8">
<TeamMembers />
</div>
);
}
2 changes: 1 addition & 1 deletion apps/app/src/auth/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export const authConfig: NextAuthConfig = {
await db.user.update({
where: {
id: user.id,
organizationId: user.organizationId,
},
data: {
lastLogin: new Date(),
organizationId: user.organizationId,
},
});
}
Expand Down
12 changes: 9 additions & 3 deletions apps/app/src/auth/org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ export async function createOrganizationAndConnectUser(input: {
name: initialName,
tier: "free",
website: "",
users: {
connect: {
id: input.userId,
members: {
create: {
userId: input.userId,
role: "admin",
},
},
},
Expand Down Expand Up @@ -69,5 +70,10 @@ export async function createOrganizationAndConnectUser(input: {
data: { stripeCustomerId },
});

await db.user.update({
where: { id: input.userId },
data: { organizationId: organization.id },
});

return organization.id;
}
2 changes: 1 addition & 1 deletion apps/app/src/auth/stripe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if (!process.env.STRIPE_WEBHOOK_SECRET) {
export const stripeWebhookSecret = process.env.STRIPE_WEBHOOK_SECRET;

export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: "2024-12-18.acacia",
apiVersion: "2025-01-27.acacia",
});
21 changes: 21 additions & 0 deletions apps/app/src/components/settings/team/team-members.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@bubba/ui/tabs";
import { Suspense } from "react";

export function TeamMembers() {
return (
<Tabs defaultValue="members">
<TabsList className="bg-transparent border-b-[1px] w-full justify-start rounded-none mb-1 p-0 h-auto pb-4">
<TabsTrigger value="members" className="p-0 m-0 mr-4">
Team Members
</TabsTrigger>
<TabsTrigger value="pending" className="p-0 m-0">
Pending Invitations
</TabsTrigger>
</TabsList>

<TabsContent value="members">Test</TabsContent>

<TabsContent value="pending">Test 2</TabsContent>
</Tabs>
);
}
11 changes: 11 additions & 0 deletions apps/app/src/components/tables/members/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { getOrganizationUsersAction } from "@/actions/organization/get-organization-users-action";
import { auth } from "@/auth";
import { db } from "@bubba/db";

export async function MembersTable() {
const session = await auth();

const members = await getOrganizationUsersAction();

return <div>MembersTable</div>;
}
2 changes: 1 addition & 1 deletion apps/web/src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function Home() {
<div className="mt-12 w-full max-w-[800px]">
<div className="mt-8 text-center">
<Link
href="https://discord.gg/3JgpACjae6"
href="https://discord.gg/compai"
className="inline-flex items-center gap-2 px-4 py-2 rounded-md bg-primary/10 hover:bg-primary/20 transition-colors text-primary"
>
Join us on Discord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default function PrivacyPage() {
<section>
<div className="container mx-auto px-4">
<div className="flex flex-col items-center py-16 md:py-24">
<h1 className="text-4xl md:text-5xl font-bold leading-tight tracking-tighter lg:leading-[1.1] max-w-[800px] mx-auto text-center bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text text-transparent mb-16">
<h1 className="text-4xl md:text-5xl font-bold leading-tight tracking-tighter lg:leading-[1.1] max-w-[800px] mx-auto bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text text-transparent">
<Balancer>Privacy Policy</Balancer>
</h1>

<div className="w-full max-w-[800px]">
<div className="mt-10 w-full max-w-[800px]">
<PrivacyContent />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default function TermsPage() {
<section>
<div className="container mx-auto px-4">
<div className="flex flex-col items-center py-16 md:py-24">
<h1 className="text-4xl md:text-5xl font-bold leading-tight tracking-tighter lg:leading-[1.1] max-w-[800px] mx-auto text-center bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text text-transparent mb-16">
<h1 className="text-4xl md:text-5xl font-bold leading-tight tracking-tighter lg:leading-[1.1] max-w-[800px] mx-auto bg-gradient-to-r from-foreground to-foreground/70 bg-clip-text text-transparent">
<Balancer>Terms of Service</Balancer>
</h1>

<div className="w-full max-w-[800px]">
<div className="mt-10 w-full max-w-[800px]">
<TermsContent />
</div>
</div>
Expand Down
16 changes: 0 additions & 16 deletions apps/web/src/app/(legal)/layout.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion apps/web/src/app/components/legal/privacy-content.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function PrivacyContent() {
return (
<div className="prose prose-gray dark:prose-invert max-w-none">
<div className="prose prose-gray dark:prose-invert overflow-y-auto scrollbar-hide">
<p className="text-lg text-muted-foreground">
Last updated: February 1, 2025
</p>
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/app/components/legal/terms-content.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
export function TermsContent() {
return (
<div className="prose prose-gray dark:prose-invert max-w-none">
<div className="prose prose-gray dark:prose-invert overflow-y-auto scrollbar-hide">
<p className="text-lg text-muted-foreground">
Last updated: February 1, 2025
</p>

<section className="mt-12">
<h2 className="text-3xl font-semibold mb-6">1. Agreement to Terms</h2>
<p className="text-lg text-muted-foreground">
By accessing or using Bubba AI, Inc.'s services, you agree to be bound
by these Terms of Service and all applicable laws and regulations. If
you do not agree with any of these terms, you are prohibited from
using or accessing our services.
By accessing or using Comp AI's services, you agree to be bound by
these Terms of Service and all applicable laws and regulations. If you
do not agree with any of these terms, you are prohibited from using or
accessing our services.
</p>
</section>

Expand All @@ -22,7 +22,7 @@ export function TermsContent() {
non-exclusive, non-transferable license to use our services for your
organization's internal business purposes.
</p>
<h3 className="text-2xl font-medium mb-4">2.1 Restrictions</h3>
<h3 className="text-2xl font-medium mb-4 mt-6">2.1 Restrictions</h3>
<p className="text-lg text-muted-foreground">You may not:</p>
<ul className="space-y-2 list-disc pl-6 text-lg text-muted-foreground">
<li>Modify or copy our materials without explicit permission</li>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/components/waitlist-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function WaitlistForm() {
Thanks, you're on the list!
</p>
<Link
href="https://discord.gg/3JgpACjae6"
href="https://discord.gg/compai"
className="inline-flex items-center gap-2 px-4 py-2 rounded-md bg-primary/10 hover:bg-primary/20 transition-colors text-primary"
>
Join Community
Expand Down
Loading