Skip to content

Commit 5d8b22b

Browse files
authored
Merge pull request #1038 from trycompai/main
[comp] Production Deploy
2 parents 3ddb363 + e5d7c7d commit 5d8b22b

File tree

18 files changed

+480
-337
lines changed

18 files changed

+480
-337
lines changed

.prettierignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Dependencies
2+
node_modules/
3+
.turbo/
4+
5+
# Build outputs
6+
dist/
7+
.next/
8+
generated/
9+
10+
# Logs
11+
*.log
12+
13+
# Environment files
14+
.env*
15+
16+
# Database specific files to exclude from formatting
17+
packages/db/prisma/seed/frameworkEditorSchemas.js
18+
packages/db/prisma/seed/seed.js
19+
packages/db/src/index.js
20+
packages/db/src/types.js
21+
22+
# Other generated files
23+
coverage/
24+
.DS_Store

apps/app/src/app/(app)/[orgId]/frameworks/components/FrameworkCard.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ export function FrameworkCard({
8989
const statusBadge = getStatusBadge(complianceScore);
9090

9191
// Calculate last activity date - use current date as fallback
92-
const lastActivityDate = new Date().toLocaleDateString();
92+
const lastActivityDate = new Date().toLocaleDateString('en-US', {
93+
year: 'numeric',
94+
month: 'short',
95+
day: '2-digit',
96+
});
9397

9498
return (
9599
<Link href={`/${orgId}/frameworks/${frameworkInstance.id}`} className="group block">

apps/app/src/app/(app)/[orgId]/people/all/components/MemberRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export function MemberRow({ member, onRemove, onUpdateRole }: MemberRowProps) {
155155
</div>
156156
</div>
157157
<div className="flex items-center gap-2">
158-
<div className="flex max-w-[150px] flex-wrap justify-end gap-1">
158+
<div className="flex max-w-[150px] flex-wrap justify-end gap-1 hidden md:block">
159159
{currentRoles.map((role) => (
160160
<Badge key={role} variant="secondary" className="text-xs">
161161
{(() => {

apps/app/src/app/(app)/[orgId]/people/all/components/PendingInvitationRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function PendingInvitationRow({ invitation, onCancel }: PendingInvitation
8383
<div>
8484
<div className="flex items-center gap-2 font-medium">
8585
<span>{invitation.email}</span>
86-
<Badge variant="outline" className="flex items-center gap-1 text-xs">
86+
<Badge variant="outline" className="hidden md:flex items-center gap-1 text-xs">
8787
<Clock className="mr-1 h-3 w-3" />
8888
Pending
8989
</Badge>
@@ -92,7 +92,7 @@ export function PendingInvitationRow({ invitation, onCancel }: PendingInvitation
9292
</div>
9393
</div>
9494
<div className="flex items-center gap-2">
95-
<div className="flex max-w-[150px] flex-wrap justify-end gap-1">
95+
<div className="max-w-[150px] flex-wrap justify-end gap-1 hidden md:flex">
9696
{(Array.isArray(invitation.role)
9797
? invitation.role
9898
: typeof invitation.role === 'string' && invitation.role.includes(',')

apps/app/src/app/(app)/[orgId]/settings/api-keys/components/CreateApiKeyDialog.tsx

Lines changed: 54 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client';
22

33
import { createApiKeyAction } from '@/actions/organization/create-api-key-action';
4+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@comp/ui/accordion';
45
import { Button } from '@comp/ui/button';
56
import {
67
Drawer,
@@ -14,7 +15,7 @@ import { Input } from '@comp/ui/input';
1415
import { ScrollArea } from '@comp/ui/scroll-area';
1516
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@comp/ui/select';
1617
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from '@comp/ui/sheet';
17-
import { Check, Copy, Loader2, X } from 'lucide-react';
18+
import { Check, Copy, X } from 'lucide-react';
1819
import { useAction } from 'next-safe-action/hooks';
1920
import { useState } from 'react';
2021
import { toast } from 'sonner';
@@ -82,49 +83,58 @@ export function CreateApiKeyDialog({ open, onOpenChange, onSuccess }: CreateApiK
8283

8384
// Form content for reuse in both Dialog and Sheet/Drawer
8485
const renderFormContent = () => (
85-
<form onSubmit={handleSubmit} className="space-y-4 p-1">
86-
<div className="space-y-2">
87-
<label htmlFor="name" className="text-sm leading-none font-medium">
88-
{'Name'}
89-
</label>
90-
<Input
91-
id="name"
92-
value={name}
93-
onChange={(e) => setName(e.target.value)}
94-
placeholder={'Enter a name for this API key'}
95-
required
96-
className="w-full"
97-
/>
98-
</div>
99-
<div className="space-y-2">
100-
<label htmlFor="expiration" className="text-sm leading-none font-medium">
101-
{'Expiration'}
102-
</label>
103-
<Select
104-
value={expiration}
105-
onValueChange={(value) => setExpiration(value as 'never' | '30days' | '90days' | '1year')}
106-
>
107-
<SelectTrigger id="expiration" className="w-full">
108-
<SelectValue placeholder={'Select expiration'} />
109-
</SelectTrigger>
110-
<SelectContent>
111-
<SelectItem value="never">{'Never'}</SelectItem>
112-
<SelectItem value="30days">{'30 days'}</SelectItem>
113-
<SelectItem value="90days">{'90 days'}</SelectItem>
114-
<SelectItem value="1year">{'1 year'}</SelectItem>
115-
</SelectContent>
116-
</Select>
117-
</div>
118-
<div className="flex flex-col justify-end gap-2 pt-2 sm:flex-row">
119-
<Button type="button" variant="outline" onClick={handleClose}>
120-
{'Cancel'}
121-
</Button>
122-
<Button type="submit" disabled={isCreating === 'executing'} className="w-full sm:w-auto">
123-
{isCreating === 'executing' && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
124-
{'New API Key'}
125-
</Button>
126-
</div>
127-
</form>
86+
<div className="scrollbar-hide h-[calc(100vh-250px)] overflow-auto">
87+
<Accordion type="multiple" defaultValue={['api-key']}>
88+
<AccordionItem value="api-key">
89+
<AccordionTrigger>{'API Key'}</AccordionTrigger>
90+
<AccordionContent>
91+
<form onSubmit={handleSubmit} className="space-y-4">
92+
<div className="space-y-2">
93+
<label htmlFor="name" className="text-sm leading-none font-medium">
94+
{'Name'}
95+
</label>
96+
<div className="mt-3">
97+
<Input
98+
id="name"
99+
value={name}
100+
onChange={(e) => setName(e.target.value)}
101+
placeholder={'Enter a name for this API key'}
102+
required
103+
className="w-full"
104+
/>
105+
</div>
106+
</div>
107+
<div className="space-y-2">
108+
<label htmlFor="expiration" className="text-sm leading-none font-medium">
109+
{'Expiration'}
110+
</label>
111+
<div className="mt-3">
112+
<Select
113+
value={expiration}
114+
onValueChange={(value) =>
115+
setExpiration(value as 'never' | '30days' | '90days' | '1year')
116+
}
117+
>
118+
<SelectTrigger id="expiration" className="w-full">
119+
<SelectValue placeholder={'Select expiration'} />
120+
</SelectTrigger>
121+
<SelectContent>
122+
<SelectItem value="never">{'Never'}</SelectItem>
123+
<SelectItem value="30days">{'30 days'}</SelectItem>
124+
<SelectItem value="90days">{'90 days'}</SelectItem>
125+
<SelectItem value="1year">{'1 year'}</SelectItem>
126+
</SelectContent>
127+
</Select>
128+
</div>
129+
</div>
130+
<Button type="submit" className="justify-self-end w-full">
131+
{'Create'}
132+
</Button>
133+
</form>
134+
</AccordionContent>
135+
</AccordionItem>
136+
</Accordion>
137+
</div>
128138
);
129139

130140
// Created key content for reuse in both Dialog and Sheet/Drawer

apps/app/src/app/(app)/[orgId]/settings/context-hub/components/context-form.tsx

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { createContextEntryAction } from '@/actions/context-hub/create-context-entry-action';
44
import { updateContextEntryAction } from '@/actions/context-hub/update-context-entry-action';
5+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@comp/ui/accordion';
56
import { Button } from '@comp/ui/button';
67
import { Input } from '@comp/ui/input';
78
import { Label } from '@comp/ui/label';
@@ -44,33 +45,45 @@ export function ContextForm({ entry, onSuccess }: { entry?: Context; onSuccess?:
4445
}
4546

4647
return (
47-
<form action={onSubmit} className="flex flex-col gap-4 space-y-4 p-1">
48-
<input type="hidden" name="id" value={entry?.id} />
49-
<div className="space-y-2">
50-
<Label htmlFor="question">Question</Label>
51-
<Input
52-
id="question"
53-
name="question"
54-
placeholder="What is the company's mission?"
55-
defaultValue={entry?.question}
56-
required
57-
/>
58-
</div>
59-
<div className="space-y-2">
60-
<Label htmlFor="answer">Answer</Label>
61-
<Textarea
62-
id="answer"
63-
name="answer"
64-
placeholder="Our mission is to provide the best possible service to our customers."
65-
defaultValue={entry?.answer}
66-
required
67-
/>
68-
</div>
69-
70-
<Button type="submit" disabled={isPending} className="justify-self-end">
71-
{entry ? 'Update' : 'Create'}{' '}
72-
{isPending && <Loader2 className="ml-2 h-4 w-4 animate-spin" />}
73-
</Button>
74-
</form>
48+
<div className="scrollbar-hide h-[calc(100vh-250px)] overflow-auto">
49+
<Accordion type="multiple" defaultValue={['context']}>
50+
<AccordionItem value="context">
51+
<AccordionTrigger>{'Context Entry'}</AccordionTrigger>
52+
<AccordionContent>
53+
<form action={onSubmit} className="flex flex-col gap-4 space-y-4">
54+
<input type="hidden" name="id" value={entry?.id} />
55+
<div className="space-y-2">
56+
<Label htmlFor="question">Question</Label>
57+
<div className="mt-3">
58+
<Input
59+
id="question"
60+
name="question"
61+
placeholder="What is the company's mission?"
62+
defaultValue={entry?.question}
63+
required
64+
/>
65+
</div>
66+
</div>
67+
<div className="space-y-2">
68+
<Label htmlFor="answer">Answer</Label>
69+
<div className="mt-3">
70+
<Textarea
71+
id="answer"
72+
name="answer"
73+
placeholder="Our mission is to provide the best possible service to our customers."
74+
defaultValue={entry?.answer}
75+
required
76+
/>
77+
</div>
78+
</div>
79+
<Button type="submit" disabled={isPending} className="justify-self-end">
80+
{entry ? 'Update' : 'Create'}{' '}
81+
{isPending && <Loader2 className="ml-2 h-4 w-4 animate-spin" />}
82+
</Button>
83+
</form>
84+
</AccordionContent>
85+
</AccordionItem>
86+
</Accordion>
87+
</div>
7588
);
7689
}

apps/app/src/app/(app)/[orgId]/tasks/[taskId]/components/TaskBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export function TaskBody({
151151
<input
152152
value={title}
153153
onChange={onTitleChange}
154-
className="h-auto shrink-0 border-none bg-transparent p-0 text-2xl font-semibold tracking-tight shadow-none focus-visible:ring-0"
154+
className="h-auto shrink-0 border-none bg-transparent p-0 md:text-lg font-semibold tracking-tight shadow-none focus-visible:ring-0"
155155
placeholder="Task Title"
156156
disabled={disabled || isUploadingFile || !!busyAttachmentId}
157157
/>

apps/app/src/app/(app)/[orgId]/tasks/[taskId]/components/TaskMainContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function TaskMainContent({ task, comments, attachments }: TaskMainContent
4545
};
4646

4747
return (
48-
<div className="flex flex-1 flex-col gap-4 lg:mx-auto lg:max-w-3xl lg:py-8">
48+
<div className="flex flex-1 flex-col gap-4 lg:mx-auto lg:max-w-3xl">
4949
<TaskBody
5050
taskId={task.id}
5151
title={title}

apps/app/src/app/(app)/[orgId]/vendors/[vendorId]/components/secondary-fields/secondary-fields.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import type { Member, User, Vendor } from '@comp/db/types';
3+
import type { GlobalVendors, Member, User, Vendor } from '@comp/db/types';
44
import { Button } from '@comp/ui/button';
55
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@comp/ui/card';
66
import { PencilIcon } from 'lucide-react';
@@ -11,9 +11,11 @@ import { UpdateSecondaryFieldsForm } from './update-secondary-fields-form';
1111
export function SecondaryFields({
1212
vendor,
1313
assignees,
14+
globalVendor,
1415
}: {
1516
vendor: Vendor & { assignee: { user: User | null } | null };
1617
assignees: (Member & { user: User })[];
18+
globalVendor: GlobalVendors | null;
1719
}) {
1820
const [_, setOpen] = useQueryState('vendor-overview-sheet');
1921

@@ -36,7 +38,7 @@ export function SecondaryFields({
3638
<CardDescription>{vendor.description}</CardDescription>
3739
</div>
3840
</CardHeader>
39-
<CardContent>
41+
<CardContent className="space-y-4">
4042
<UpdateSecondaryFieldsForm vendor={vendor} assignees={assignees} />
4143
</CardContent>
4244
</Card>

0 commit comments

Comments
 (0)