Skip to content

Commit 620426c

Browse files
authored
Merge pull request #540 from trycompai/claudio/comp-118-create-data-package-management-tool
[dev] [claudfuen] claudio/comp-118-create-data-package-management-tool
2 parents d97fd0b + 4952a3d commit 620426c

File tree

82 files changed

+10054
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+10054
-299
lines changed

.cursorrules

Lines changed: 0 additions & 94 deletions
This file was deleted.

apps/app/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"@ai-sdk/openai": "^1.3.19",
2020
"@ai-sdk/provider": "^1.1.3",
2121
"@ai-sdk/react": "^1.2.9",
22-
"@aws-sdk/client-s3": "^3.796.0",
23-
"@aws-sdk/s3-request-presigner": "^3.800.0",
22+
"@aws-sdk/client-s3": "^3.806.0",
23+
"@aws-sdk/s3-request-presigner": "^3.806.0",
2424
"@browserbasehq/sdk": "^2.5.0",
2525
"@comp/data": "workspace:*",
2626
"@comp/db": "workspace:*",
@@ -82,7 +82,6 @@
8282
"puppeteer-core": "^24.7.2",
8383
"react": "^19.1.0",
8484
"react-dom": "^19.1.0",
85-
"react-hook-form": "^7.56.1",
8685
"react-hotkeys-hook": "^4.6.2",
8786
"react-intersection-observer": "^9.16.0",
8887
"react-markdown": "^9.1.0",
@@ -122,5 +121,10 @@
122121
},
123122
"exports": {
124123
"./src/lib/encryption": "./src/lib/encryption.ts"
124+
},
125+
"peerDependencies": {
126+
"react": "^19.1.0",
127+
"react-dom": "^19.1.0",
128+
"react-hook-form": "^7.56.3"
125129
}
126130
}

apps/app/src/app/[locale]/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import "@/styles/globals.css";
2+
import "@comp/ui/globals.css";
3+
24
import { auth } from "@/utils/auth";
35
import { cn } from "@comp/ui/cn";
4-
import "@comp/ui/globals.css";
56
import { GeistMono } from "geist/font/mono";
67
import type { Metadata } from "next";
78
import localFont from "next/font/local";

apps/framework-editor/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/comp?schema=public"

apps/framework-editor/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# next.js
7+
/.next/
8+
/out/
9+
10+
# production
11+
/build
12+
13+
# debug
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
.pnpm-debug.log*
18+
19+
# env files
20+
.env*
21+
!.env.example
22+
23+
# vercel
24+
.vercel
25+
26+
# typescript
27+
*.tsbuildinfo
28+
next-env.d.ts
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
'use client';
2+
3+
import type { ColumnDef } from '@tanstack/react-table';
4+
import Link from 'next/link';
5+
import type { FrameworkEditorControlTemplate } from '@prisma/client';
6+
7+
export const columns: ColumnDef<FrameworkEditorControlTemplate>[] = [
8+
{
9+
accessorKey: 'name',
10+
header: 'Name',
11+
size: 350,
12+
cell: ({ row }) => {
13+
const control = row.original;
14+
return (
15+
<Link href={`/controls/${control.id}`} className="hover:underline">
16+
{control.name}
17+
</Link>
18+
);
19+
},
20+
},
21+
{
22+
accessorKey: 'description',
23+
header: 'Description',
24+
size: 700,
25+
minSize: 400,
26+
cell: ({ row }) => {
27+
const description = row.getValue('description') as string;
28+
return (
29+
<div style={{ wordBreak: 'break-word' }}>
30+
{description}
31+
</div>
32+
);
33+
},
34+
},
35+
// TODO: Add columns for policyTemplates, requirements, taskTemplates if needed
36+
// This might involve custom cell renderers to display counts or summaries.
37+
// Example for displaying count of policy templates:
38+
// {
39+
// id: 'policyTemplatesCount',
40+
// header: 'Policy Templates',
41+
// accessorFn: row => row.policyTemplates?.length || 0,
42+
// cell: ({ getValue }) => `${getValue()} policies`
43+
// },
44+
];
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { db } from "@comp/db";
2+
import PageLayout from "@/app/components/PageLayout";
3+
// import { ControlsTable } from "./components/ControlsTable"; // Old import
4+
import { DataTable } from "@/app/components/DataTable"; // New generic table
5+
import { columns } from "./components/columns"; // Import the new columns
6+
7+
export default async function Page() {
8+
const controls = await db.frameworkEditorControlTemplate.findMany({
9+
// Optionally include related data if you plan to display it and it's not too large
10+
// include: {
11+
// policyTemplates: true,
12+
// requirements: true,
13+
// taskTemplates: true,
14+
// }
15+
});
16+
17+
return (
18+
<PageLayout breadcrumbs={[{ label: "Controls", href: "/controls" }]}>
19+
{/* <ControlsTable controls={controls} /> */}
20+
<DataTable
21+
data={controls}
22+
columns={columns} // Pass the columns
23+
searchQueryParamName="controls-search"
24+
/>
25+
</PageLayout>
26+
);
27+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
'use client'
2+
3+
import { useState } from 'react';
4+
import { useRouter } from 'next/navigation';
5+
// import { db } from "@comp/db";
6+
import PageLayout from "@/app/components/PageLayout";
7+
import { DataTable } from "@/app/components/DataTable";
8+
import { columns } from "./components/columns";
9+
import { CreateFrameworkDialog } from './components/CreateFrameworkDialog';
10+
import type { FrameworkEditorFramework } from '@prisma/client';
11+
12+
export interface FrameworkWithCounts extends Omit<FrameworkEditorFramework, 'requirements'> {
13+
requirementsCount: number;
14+
controlsCount: number;
15+
}
16+
17+
interface FrameworksClientPageProps {
18+
initialFrameworks: FrameworkWithCounts[];
19+
}
20+
21+
export function FrameworksClientPage({ initialFrameworks }: FrameworksClientPageProps) {
22+
const [isCreateDialogOpen, setIsCreateDialogOpen] = useState(false);
23+
const router = useRouter();
24+
25+
const handleRowClick = (framework: FrameworkWithCounts) => {
26+
router.push(`/frameworks/${framework.id}`);
27+
};
28+
29+
return (
30+
<PageLayout breadcrumbs={[{ label: "Frameworks", href: "/frameworks" }]}>
31+
<DataTable
32+
data={initialFrameworks}
33+
columns={columns}
34+
searchQueryParamName="frameworks-search"
35+
searchPlaceholder="Search frameworks..."
36+
onCreateClick={() => setIsCreateDialogOpen(true)}
37+
createButtonLabel="Create New Framework"
38+
onRowClick={handleRowClick}
39+
/>
40+
<CreateFrameworkDialog
41+
isOpen={isCreateDialogOpen}
42+
onOpenChange={setIsCreateDialogOpen}
43+
onFrameworkCreated={() => setIsCreateDialogOpen(false)}
44+
/>
45+
</PageLayout>
46+
);
47+
}

0 commit comments

Comments
 (0)