Skip to content

Commit 006d445

Browse files
authored
Merge pull request #496 from trycompai/main
[comp] Production Deploy
2 parents 660f17e + 9294609 commit 006d445

13 files changed

Lines changed: 75 additions & 341 deletions

File tree

apps/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"remark-parse": "^11.0.0",
9494
"resend": "^4.4.1",
9595
"sonner": "^1.7.4",
96-
"stripe": "^17.7.0",
96+
"stripe": "^18.1.0",
9797
"tiptap-markdown": "^0.8.10",
9898
"ts-pattern": "^5.7.0",
9999
"use-debounce": "^10.0.4",

apps/app/src/actions/organization/lib/stripe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let stripe: Stripe | undefined;
77

88
if (env.STRIPE_SECRET_KEY && env.STRIPE_WEBHOOK_SECRET) {
99
stripe = new Stripe(env.STRIPE_SECRET_KEY, {
10-
apiVersion: "2025-02-24.acacia",
10+
apiVersion: "2025-04-30.basil",
1111
});
1212
}
1313

apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/all/components/InviteMembersModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const selectableRoles = [
4242
"employee",
4343
] as const satisfies Readonly<Role[]>;
4444
type InviteRole = (typeof selectableRoles)[number];
45-
const DEFAULT_ROLES: InviteRole[] = ["employee"];
45+
const DEFAULT_ROLES: InviteRole[] = [];
4646

4747
// --- Schemas ---
4848
const manualInviteSchema = z.object({

apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/components/EmployeeCompletionChart.tsx renamed to apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/dashboard/components/EmployeeCompletionChart.tsx

File renamed without changes.

apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/components/EmployeesOverview.tsx renamed to apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/dashboard/components/EmployeesOverview.tsx

File renamed without changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { getI18n } from "@/locales/server";
2+
import type { Metadata } from "next";
3+
import { setStaticParamsLocale } from "next-international/server";
4+
import { EmployeesOverview } from "./components/EmployeesOverview";
5+
6+
export default async function PeopleOverviewPage({
7+
params,
8+
}: {
9+
params: Promise<{ locale: string }>;
10+
}) {
11+
const { locale } = await params;
12+
setStaticParamsLocale(locale);
13+
14+
return <EmployeesOverview />;
15+
}
16+
17+
export async function generateMetadata({
18+
params,
19+
}: {
20+
params: Promise<{ locale: string }>;
21+
}): Promise<Metadata> {
22+
const { locale } = await params;
23+
24+
setStaticParamsLocale(locale);
25+
const t = await getI18n();
26+
27+
return {
28+
title: t("sidebar.people"),
29+
};
30+
}

apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/people/layout.tsx

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -28,78 +28,28 @@ export default async function Layout({
2828
where: {
2929
organizationId: orgId,
3030
},
31-
include: {
32-
user: true,
33-
},
3431
});
3532

36-
// Filter in application code to handle multiple roles
3733
const employees = allMembers.filter((member) => {
3834
const roles = member.role.includes(",")
3935
? member.role.split(",")
4036
: [member.role];
4137
return roles.includes("employee");
4238
});
43-
44-
if (employees.length === 0) {
45-
return (
46-
<div className="max-w-[1200px] m-auto">
47-
<Suspense fallback={<div>Loading...</div>}>
48-
<div className="mt-8">
49-
<AppOnboarding
50-
title={t("app_onboarding.employees.title")}
51-
description={t(
52-
"app_onboarding.employees.description",
53-
)}
54-
cta={t("app_onboarding.employees.cta")}
55-
imageSrc="/onboarding/people-management.webp"
56-
imageAlt="Employee Management"
57-
href={`/${orgId}/settings/users`}
58-
faqs={[
59-
{
60-
questionKey: t(
61-
"app_onboarding.employees.faqs.question_1",
62-
),
63-
answerKey: t(
64-
"app_onboarding.employees.faqs.answer_1",
65-
),
66-
},
67-
{
68-
questionKey: t(
69-
"app_onboarding.employees.faqs.question_2",
70-
),
71-
answerKey: t(
72-
"app_onboarding.employees.faqs.answer_2",
73-
),
74-
},
75-
{
76-
questionKey: t(
77-
"app_onboarding.employees.faqs.question_3",
78-
),
79-
answerKey: t(
80-
"app_onboarding.employees.faqs.answer_3",
81-
),
82-
},
83-
]}
84-
/>
85-
</div>
86-
</Suspense>
87-
</div>
88-
);
89-
}
39+
9040

9141
return (
9242
<div className="max-w-[1200px] m-auto">
9343
<SecondaryMenu
9444
items={[
95-
{
96-
path: `/${orgId}/people`,
97-
label: t("people.dashboard.title"),
98-
},
9945
{
10046
path: `/${orgId}/people/all`,
10147
label: t("people.title"),
10248
},
49+
...(employees.length > 0 ? [{
50+
path: `/${orgId}/people/dashboard`,
51+
label: t("people.dashboard.title"),
52+
}] : []),
10353
]}
10454
/>
10555

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
1-
import { getI18n } from "@/locales/server";
2-
import type { Metadata } from "next";
3-
import { setStaticParamsLocale } from "next-international/server";
4-
import { EmployeesOverview } from "./components/EmployeesOverview";
1+
import { redirect } from "next/navigation";
52

6-
export default async function PeopleOverviewPage({
3+
export default async function Page({
74
params,
85
}: {
9-
params: Promise<{ locale: string }>;
6+
params: Promise<{ locale: string, orgId: string }>;
107
}) {
11-
const { locale } = await params;
12-
setStaticParamsLocale(locale);
13-
14-
return <EmployeesOverview />;
15-
}
16-
17-
export async function generateMetadata({
18-
params,
19-
}: {
20-
params: Promise<{ locale: string }>;
21-
}): Promise<Metadata> {
22-
const { locale } = await params;
23-
24-
setStaticParamsLocale(locale);
25-
const t = await getI18n();
26-
27-
return {
28-
title: t("sidebar.people"),
29-
};
8+
const { orgId } = await params;
9+
return redirect(`/${orgId}/people/all`);
3010
}

apps/app/src/components/main-menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function MainMenu({
104104
},
105105
{
106106
id: "people",
107-
path: "/:organizationId/people",
107+
path: "/:organizationId/people/all",
108108
name: t("sidebar.people"),
109109
disabled: false,
110110
icon: Users,

apps/app/src/locales/features/people.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ export const people = {
4747
auditor: "Auditor",
4848
employee: "Employee",
4949
owner_description:
50-
"Full access to manage users and settings and delete organization",
50+
"Can manage users, policies, tasks, and settings, and delete organization.",
5151
admin_description:
52-
"Full access to manage users and settings, without the ability to delete organization",
53-
employee_description: "Can access employee portal and complete tasks.",
52+
"Can manage users, policies, tasks, and settings.",
53+
employee_description: "Can sign policies and complete training.",
5454
auditor_description: "Read-only access for compliance checks.",
5555
},
5656
member_actions: {
@@ -121,7 +121,7 @@ export const people = {
121121
error: "Failed to add user",
122122
},
123123
dashboard: {
124-
title: "Dashboard",
124+
title: "Employee Tasks",
125125
employee_task_completion: "Employee Task Completion",
126126
policies_completed: "Policies Completed",
127127
policies_pending: "Policies Pending",

0 commit comments

Comments
 (0)