Skip to content

Commit e0ae4dc

Browse files
[dev] [carhartlewis] lewis/comp-ui-fixes (#2114)
* chore(deps): update package versions and improve loading components * chore(deps): update cheerio, zod, and other package versions * style(FindingsOverview): update styling for no findings message and button * refactor(people): simplify member and invitation components with new design system, fixed findings on overview page, removed fade in from settings page, re-ordered tabs in trust center * refactor(ui): change onInput to onChange in QuantityInput component * chore(deps): update react-hook-form to version 7.71.1 * feat(secrets): enhance SecretsTable with search, pagination, and delete functionality --------- Co-authored-by: Lewis Carhart <lewis@trycomp.ai>
1 parent 218b7b9 commit e0ae4dc

38 files changed

Lines changed: 1171 additions & 1045 deletions

File tree

apps/api/src/trigger/vendor/vendor-risk-assessment-task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ async function normalizeRiskLevel(
214214

215215
try {
216216
const result = await generateObject({
217-
model: openai('gpt-4o-mini'),
217+
model: openai('gpt-5.2'),
218218
schema: normalizedRiskLevelSchema,
219219
prompt: `Classify this vendor security risk level into exactly one of these 5 categories.
220220

apps/app/src/app/(app)/[orgId]/cloud-tests/components/EmptyState.tsx

Lines changed: 63 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use client';
22

33
import { ConnectIntegrationDialog } from '@/components/integrations/ConnectIntegrationDialog';
4-
import { Button } from '@comp/ui/button';
54
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@comp/ui/card';
65
import { Input } from '@comp/ui/input';
76
import { Label } from '@comp/ui/label';
87
import MultipleSelector from '@comp/ui/multiple-selector';
98
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@comp/ui/select';
10-
import { ArrowLeft, CheckCircle2, Cloud, ExternalLink, Loader2 } from 'lucide-react';
9+
import { Button, PageHeader, PageLayout, Spinner } from '@trycompai/design-system';
10+
import { ArrowLeft, CheckmarkFilled, Launch } from '@trycompai/design-system/icons';
1111
import { useEffect, useState } from 'react';
1212
import { toast } from 'sonner';
1313
import { connectCloudAction } from '../actions/connect-cloud';
@@ -305,13 +305,15 @@ export function EmptyState({
305305
// AWS Step 2.5: Region Selection (after credential validation)
306306
if (step === 'validate-aws' && provider && selectedProvider === 'aws') {
307307
return (
308-
<div className="mx-auto max-w-7xl flex min-h-[600px] w-full flex-col gap-6 py-4 md:py-6 lg:py-8">
309-
<div className="flex items-center gap-4">
310-
<Button variant="ghost" size="sm" onClick={() => setStep('connect')}>
311-
<ArrowLeft className="mr-2 h-4 w-4" />
312-
Back
313-
</Button>
314-
</div>
308+
<PageLayout padding="default">
309+
<Button
310+
variant="ghost"
311+
size="sm"
312+
onClick={() => setStep('connect')}
313+
iconLeft={<ArrowLeft size={16} />}
314+
>
315+
Back
316+
</Button>
315317

316318
<div className="mx-auto w-full max-w-xl">
317319
<Card className="rounded-xl border-2 shadow-lg">
@@ -375,36 +377,39 @@ export function EmptyState({
375377
</p>
376378
</div>
377379

378-
<Button
379-
onClick={handleConnect}
380-
disabled={
381-
isConnecting ||
382-
!Array.isArray(credentials.regions) ||
383-
credentials.regions.length === 0
384-
}
385-
className="mt-6 h-11 w-full rounded-lg text-base font-medium"
386-
size="lg"
387-
>
388-
{isConnecting ? (
389-
<>
390-
<Loader2 className="mr-2 h-5 w-5 animate-spin" />
391-
Connecting...
392-
</>
393-
) : (
394-
<>Complete Setup</>
395-
)}
396-
</Button>
380+
<div className="mt-6">
381+
<Button
382+
onClick={handleConnect}
383+
disabled={!Array.isArray(credentials.regions) || credentials.regions.length === 0}
384+
loading={isConnecting}
385+
width="full"
386+
size="lg"
387+
>
388+
{isConnecting ? 'Connecting...' : 'Complete Setup'}
389+
</Button>
390+
</div>
397391
</CardContent>
398392
</Card>
399393
</div>
400-
</div>
394+
</PageLayout>
401395
);
402396
}
403397

404398
// Step 1: Choose Provider
405399
if (step === 'choose') {
406400
return (
407-
<div className="container mx-auto flex min-h-[600px] w-full flex-col items-center justify-center gap-8 p-4 md:p-6 lg:p-8">
401+
<PageLayout
402+
header={
403+
<>
404+
{onBack && (
405+
<Button variant="ghost" size="sm" onClick={onBack} iconLeft={<ArrowLeft size={16} />}>
406+
Back to Results
407+
</Button>
408+
)}
409+
<PageHeader title={onBack ? 'Add Another Cloud' : 'Cloud Tests'} />
410+
</>
411+
}
412+
>
408413
{showConnectDialog && (
409414
<ConnectIntegrationDialog
410415
open={showConnectDialog}
@@ -418,39 +423,8 @@ export function EmptyState({
418423
}}
419424
/>
420425
)}
421-
{onBack && (
422-
<div className="w-full max-w-4xl">
423-
<Button variant="ghost" size="sm" onClick={onBack}>
424-
<ArrowLeft className="mr-2 h-4 w-4" />
425-
Back to Results
426-
</Button>
427-
</div>
428-
)}
429-
<div className="mx-auto flex max-w-2xl flex-col items-center gap-6 text-center">
430-
<div className="relative">
431-
<div className="absolute inset-0 rounded-full" />
432-
<div className="relative rounded-2xl p-4">
433-
<Cloud className="text-primary h-16 w-16" />
434-
</div>
435-
</div>
436-
<div className="space-y-4">
437-
<h1 className="text-4xl font-bold tracking-tight">
438-
{onBack ? 'Add Another Cloud' : 'Continuous Cloud Scanning'}
439-
</h1>
440-
<div className="space-y-3">
441-
<p className="text-muted-foreground mx-auto max-w-lg text-lg leading-relaxed">
442-
Automatically monitor your cloud infrastructure for security vulnerabilities and
443-
compliance issues.
444-
</p>
445-
<div className="inline-flex items-center gap-2 rounded-full border border-primary/20 bg-primary/10 px-4 py-2">
446-
<div className="h-1.5 w-1.5 animate-pulse rounded-full bg-primary" />
447-
<span className="text-primary text-xs font-medium">Always-on monitoring</span>
448-
</div>
449-
</div>
450-
</div>
451-
</div>
452426

453-
<div className="grid w-full max-w-4xl gap-4 md:grid-cols-3">
427+
<div className="grid w-full gap-4 md:grid-cols-3">
454428
{CLOUD_PROVIDERS.filter(
455429
(cp) => cp.id === 'aws' || !connectedProviders.includes(cp.id),
456430
).map((cloudProvider) => (
@@ -482,7 +456,7 @@ export function EmptyState({
482456
</Card>
483457
))}
484458
</div>
485-
</div>
459+
</PageLayout>
486460
);
487461
}
488462

@@ -491,13 +465,10 @@ export function EmptyState({
491465
const fields = PROVIDER_FIELDS[provider.id];
492466

493467
return (
494-
<div className="mx-auto flex min-h-[600px] w-full max-w-7xl flex-col gap-6 py-4 md:py-6 lg:py-8">
495-
<div className="flex items-center gap-4">
496-
<Button variant="ghost" size="sm" onClick={handleBack}>
497-
<ArrowLeft className="mr-2 h-4 w-4" />
498-
Back
499-
</Button>
500-
</div>
468+
<PageLayout padding="default">
469+
<Button variant="ghost" size="sm" onClick={handleBack} iconLeft={<ArrowLeft size={16} />}>
470+
Back
471+
</Button>
501472

502473
<div className="mx-auto w-full max-w-xl">
503474
<Card className="rounded-xl border-2 shadow-lg">
@@ -529,7 +500,7 @@ export function EmptyState({
529500
rel="noopener noreferrer"
530501
className="text-primary hover:text-primary/80 flex w-fit items-center gap-1.5 text-sm font-medium transition-colors"
531502
>
532-
<ExternalLink className="h-3.5 w-3.5" />
503+
<Launch size={14} />
533504
Setup guide
534505
</a>
535506
</CardHeader>
@@ -604,35 +575,36 @@ export function EmptyState({
604575
);
605576
})}
606577

607-
<Button
608-
onClick={selectedProvider === 'aws' ? handleValidateAws : handleConnect}
609-
disabled={isConnecting}
610-
className="mt-6 h-11 w-full rounded-lg text-base font-medium"
611-
size="lg"
612-
>
613-
{isConnecting ? (
614-
<>
615-
<Loader2 className="mr-2 h-5 w-5 animate-spin" />
616-
{selectedProvider === 'aws' ? 'Validating credentials...' : 'Connecting...'}
617-
</>
618-
) : (
619-
<>{selectedProvider === 'aws' ? 'Continue' : `Connect ${provider.shortName}`}</>
620-
)}
621-
</Button>
578+
<div className="mt-6">
579+
<Button
580+
onClick={selectedProvider === 'aws' ? handleValidateAws : handleConnect}
581+
loading={isConnecting}
582+
width="full"
583+
size="lg"
584+
>
585+
{isConnecting
586+
? selectedProvider === 'aws'
587+
? 'Validating credentials...'
588+
: 'Connecting...'
589+
: selectedProvider === 'aws'
590+
? 'Continue'
591+
: `Connect ${provider.shortName}`}
592+
</Button>
593+
</div>
622594
</CardContent>
623595
</Card>
624596
</div>
625-
</div>
597+
</PageLayout>
626598
);
627599
}
628600

629601
// Step 3: Success
630602
if (step === 'success' && provider) {
631603
return (
632-
<div className="container mx-auto flex min-h-[600px] w-full flex-col items-center justify-center gap-8 p-4 md:p-6 lg:p-8">
604+
<PageLayout variant="center" fillHeight padding="default" maxWidth="xl">
633605
<div className="flex flex-col items-center gap-6 text-center">
634606
<div className="rounded-full bg-primary/10 p-6">
635-
<CheckCircle2 className="text-primary h-16 w-16" />
607+
<CheckmarkFilled size={64} className="text-primary" />
636608
</div>
637609
<div className="space-y-2">
638610
<h1 className="text-3xl font-bold tracking-tight">Successfully Connected!</h1>
@@ -642,14 +614,14 @@ export function EmptyState({
642614
</div>
643615
<div className="bg-muted/50 mt-4 rounded-lg border p-6">
644616
<div className="flex items-center gap-3">
645-
<Loader2 className="text-primary h-5 w-5 animate-spin" />
617+
<Spinner size={20} />
646618
<p className="text-muted-foreground text-sm">
647619
This usually takes 1-2 minutes. We'll show results as soon as they're ready.
648620
</p>
649621
</div>
650622
</div>
651623
</div>
652-
</div>
624+
</PageLayout>
653625
);
654626
}
655627

apps/app/src/app/(app)/[orgId]/cloud-tests/components/ProviderTabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export function ProviderTabs({
165165

166166
return (
167167
<TabsContent key={providerType} value={providerType}>
168-
<div className="mb-4 rounded-lg border bg-card p-4">
168+
<div className="mb-4">
169169
<Tabs
170170
value={activeConnId}
171171
onValueChange={(value) => onConnectionTabChange(providerType, value)}

apps/app/src/app/(app)/[orgId]/cloud-tests/components/TestsLayout.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ export function TestsLayout({ initialFindings, initialProviders, orgId }: TestsL
146146

147147
if (!result.success) {
148148
console.error('Legacy scan error:', result.errors);
149-
toast.error(
150-
`Scan failed: ${result.errors?.join(', ') || 'Unknown error'}`,
151-
);
149+
toast.error(`Scan failed: ${result.errors?.join(', ') || 'Unknown error'}`);
152150
return null;
153151
}
154152
} else {
@@ -236,7 +234,6 @@ export function TestsLayout({ initialFindings, initialProviders, orgId }: TestsL
236234
<>
237235
<Button
238236
variant="outline"
239-
size="sm"
240237
onClick={() => {
241238
setAddConnectionProvider(null);
242239
setViewingResults(false);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { PageHeader, PageLayout } from '@trycompai/design-system';
1+
import { PageLayout } from '@trycompai/design-system';
22

33
export default function Loading() {
4-
return <PageLayout loading header={<PageHeader title="Cloud Tests" />} />;
4+
return <PageLayout loading />;
55
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { PageHeader, PageLayout } from '@trycompai/design-system';
1+
import { PageLayout } from '@trycompai/design-system';
22

33
export default function Loading() {
4-
return (
5-
<PageLayout loading header={<PageHeader title="Controls" />} padding="default" />
6-
);
4+
return <PageLayout loading />;
75
}

0 commit comments

Comments
 (0)