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
4 changes: 4 additions & 0 deletions apps/app/src/app/(app)/[orgId]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export default async function Layout({
return redirect('/auth/unauthorized');
}

if (member.role === 'employee') {
return redirect('/no-access');
}

// If this org is not accessible on current plan, redirect to upgrade
if (!organization.hasAccess) {
return redirect(`/upgrade/${organization.id}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import { Card, CardContent, CardHeader, CardTitle } from '@comp/ui/card';
import { Input } from '@comp/ui/input';
import { Search } from 'lucide-react';
import { ExternalLink, Search } from 'lucide-react';
import Link from 'next/link';
import { useParams } from 'next/navigation';
import type { CSSProperties } from 'react';
import * as React from 'react';

Expand Down Expand Up @@ -47,6 +49,8 @@ export function EmployeeCompletionChart({
trainingVideos,
showAll = false,
}: EmployeeCompletionChartProps) {
const params = useParams();
const orgId = params.orgId as string;
const [searchTerm, setSearchTerm] = React.useState('');
const [displayedItems, setDisplayedItems] = React.useState(showAll ? 20 : 5);
const [isLoading, setIsLoading] = React.useState(false);
Expand Down Expand Up @@ -209,8 +213,19 @@ export function EmployeeCompletionChart({
{sortedStats.map((stat) => (
<div key={stat.id} className="space-y-2">
<div className="flex items-center justify-between text-sm">
<div>
<p className="font-medium">{stat.name}</p>
<div className="flex-1">
<div className="flex items-center gap-2">
<p className="font-medium">{stat.name}</p>
<Link
href={`/${orgId}/people/${stat.id}`}
target="_blank"
rel="noopener noreferrer"
className="text-primary hover:text-primary/80 flex items-center gap-1 text-xs font-medium underline-offset-4 hover:underline"
>
View Profile
<ExternalLink className="h-3 w-3" />
</Link>
</div>
<p className="text-muted-foreground text-xs">{stat.email}</p>
</div>
<span className="text-muted-foreground">
Expand Down
4 changes: 0 additions & 4 deletions apps/app/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ export default async function RootPage({
},
});

if (member?.role === 'employee') {
return redirect(await buildUrlWithParams('/no-access'));
}

if (!member) {
return redirect(await buildUrlWithParams('/setup'));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"db:generate": "prisma generate",
"db:migrate": "prisma migrate dev",
"db:push": "prisma db push",
"db:seed": "prisma db seed",
"db:seed": "bun prisma/seed/seed.ts",
"db:studio": "prisma studio",
"docker:clean": "docker compose down -v",
"docker:down": "docker compose down",
Expand Down
136 changes: 0 additions & 136 deletions packages/db/prisma/seed/frameworkEditorSchemas.js

This file was deleted.

160 changes: 0 additions & 160 deletions packages/db/prisma/seed/seed.js

This file was deleted.

Loading