Skip to content

Commit 282c326

Browse files
committed
feat(documents): add warning alerts in CompanySubmissionWizard for pre-filled content and enhance DocumentFindingsSection with Empty state
1 parent 880a3c6 commit 282c326

4 files changed

Lines changed: 192 additions & 42 deletions

File tree

apps/app/src/app/(app)/[orgId]/documents/components/CompanySubmissionWizard.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { api } from '@/lib/api-client';
1616
import { meetingFields } from '@trycompai/company';
1717
import { zodResolver } from '@hookform/resolvers/zod';
1818
import {
19+
Alert,
1920
Button,
2021
Field,
2122
FieldError,
@@ -548,6 +549,13 @@ export function CompanySubmissionWizard({
548549
{textareaFields.length === 0 && (
549550
<Text variant="muted">No additional fields required for this step.</Text>
550551
)}
552+
{textareaFields.some((f) => f.placeholder) && (
553+
<Alert
554+
variant="warning"
555+
title="Reference only"
556+
description="The pre-filled content below is provided as a template. You must review and edit it to reflect your organization's actual information before submitting."
557+
/>
558+
)}
551559
{textareaFields.map((field) => (
552560
<Controller
553561
key={field.key}
@@ -618,6 +626,13 @@ export function CompanySubmissionWizard({
618626
)}
619627
/>
620628
))}
629+
{extendedFields.some((f) => f.type === 'textarea' && f.placeholder) && (
630+
<Alert
631+
variant="warning"
632+
title="Reference only"
633+
description="The pre-filled content below is provided as a template. You must review and edit it to reflect your organization's actual information before submitting."
634+
/>
635+
)}
621636
{extendedFields.map((field) => (
622637
<Controller
623638
key={field.key}

apps/app/src/app/(app)/[orgId]/documents/components/DocumentFindingsSection.tsx

Lines changed: 29 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@
33
import { useFindingActions, useFormTypeFindings, type Finding } from '@/hooks/use-findings-api';
44
import { usePermissions } from '@/hooks/use-permissions';
55
import { useActiveMember } from '@/utils/auth-client';
6-
import { Button } from '@trycompai/design-system';
76
import { FindingStatus } from '@db';
8-
import { ChevronDown, ChevronUp, WarningAlt, WarningAltFilled } from '@trycompai/design-system/icons';
7+
import {
8+
Button,
9+
Empty,
10+
EmptyDescription,
11+
EmptyHeader,
12+
EmptyMedia,
13+
EmptyTitle,
14+
} from '@trycompai/design-system';
15+
import {
16+
ChevronDown,
17+
ChevronUp,
18+
WarningAlt,
19+
WarningAltFilled,
20+
} from '@trycompai/design-system/icons';
921
import { useCallback, useMemo, useState } from 'react';
1022
import { toast } from 'sonner';
1123
import { CreateFindingButton } from '../../tasks/[taskId]/components/findings/CreateFindingButton';
@@ -153,33 +165,22 @@ export function DocumentFindingsSection({
153165
finding.status === FindingStatus.open || finding.status === FindingStatus.needs_revision,
154166
).length;
155167

156-
if (allIsLoading) {
168+
if (allIsLoading || allError || sortedFindings.length === 0) {
157169
return (
158-
<div className="flex items-center justify-center py-8">
159-
<div className="h-6 w-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent" />
160-
</div>
161-
);
162-
}
163-
164-
if (allError) {
165-
return (
166-
<div className="flex items-center justify-center py-8 text-destructive">
167-
<WarningAlt size={20} className="mr-2" />
168-
<span>Failed to load findings</span>
169-
</div>
170-
);
171-
}
172-
173-
if (sortedFindings.length === 0) {
174-
return (
175-
<div className="flex flex-col items-center justify-center py-12 text-muted-foreground">
176-
<p className="text-sm">No findings for this document</p>
170+
<Empty>
171+
<EmptyMedia variant="icon">
172+
<WarningAlt size={32} />
173+
</EmptyMedia>
174+
<EmptyHeader>
175+
<EmptyTitle>No findings yet</EmptyTitle>
176+
<EmptyDescription>
177+
Findings will appear here when an auditor flags issues requiring attention.
178+
</EmptyDescription>
179+
</EmptyHeader>
177180
{canCreateFinding && (
178-
<div className="mt-3">
179-
<CreateFindingButton evidenceFormType={formType} onSuccess={mutateAll} />
180-
</div>
181+
<CreateFindingButton evidenceFormType={formType} onSuccess={mutateAll} />
181182
)}
182-
</div>
183+
</Empty>
183184
);
184185
}
185186

@@ -216,14 +217,7 @@ export function DocumentFindingsSection({
216217
</div>
217218

218219
<div className="p-5">
219-
{sortedFindings.length === 0 ? (
220-
<div className="flex flex-col items-center justify-center py-8 text-muted-foreground">
221-
<WarningAltFilled size={40} className="mb-3 opacity-50" />
222-
<p className="text-sm">No findings for this document</p>
223-
{canCreateFinding && <p className="text-xs mt-1">Create a finding to flag an issue</p>}
224-
</div>
225-
) : (
226-
<div className="space-y-2">
220+
<div className="space-y-2">
227221
{visibleFindings.map((finding: Finding) => (
228222
<FindingItem
229223
key={finding.id}
@@ -242,12 +236,7 @@ export function DocumentFindingsSection({
242236

243237
{sortedFindings.length > INITIAL_DISPLAY_COUNT && (
244238
<div className="mt-2 text-muted-foreground hover:text-foreground">
245-
<Button
246-
variant="ghost"
247-
size="sm"
248-
width="full"
249-
onClick={() => setShowAll(!showAll)}
250-
>
239+
<Button variant="ghost" size="sm" width="full" onClick={() => setShowAll(!showAll)}>
251240
{showAll ? (
252241
<>
253242
<ChevronUp size={16} className="mr-1.5" />
@@ -263,7 +252,6 @@ export function DocumentFindingsSection({
263252
</div>
264253
)}
265254
</div>
266-
)}
267255
</div>
268256
</div>
269257
);

packages/device-agent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"private": true,
88
"main": "dist/main/index.js",
99
"scripts": {
10-
"postinstall": "node node_modules/electron/install.js || true",
10+
"postinstall": "electron-builder install-app-deps",
1111
"dev": "electron-vite dev --watch",
1212
"build": "electron-vite build",
1313
"preview": "electron-vite preview",

packages/docs/openapi.json

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16457,6 +16457,62 @@
1645716457
]
1645816458
}
1645916459
},
16460+
"/v1/integrations/tasks/{taskId}/checks/disconnect": {
16461+
"post": {
16462+
"operationId": "TaskIntegrationsController_disconnectCheckFromTask_v1",
16463+
"parameters": [
16464+
{
16465+
"name": "taskId",
16466+
"required": true,
16467+
"in": "path",
16468+
"schema": {
16469+
"type": "string"
16470+
}
16471+
}
16472+
],
16473+
"responses": {
16474+
"201": {
16475+
"description": ""
16476+
}
16477+
},
16478+
"security": [
16479+
{
16480+
"apikey": []
16481+
}
16482+
],
16483+
"tags": [
16484+
"Integrations"
16485+
]
16486+
}
16487+
},
16488+
"/v1/integrations/tasks/{taskId}/checks/reconnect": {
16489+
"post": {
16490+
"operationId": "TaskIntegrationsController_reconnectCheckToTask_v1",
16491+
"parameters": [
16492+
{
16493+
"name": "taskId",
16494+
"required": true,
16495+
"in": "path",
16496+
"schema": {
16497+
"type": "string"
16498+
}
16499+
}
16500+
],
16501+
"responses": {
16502+
"201": {
16503+
"description": ""
16504+
}
16505+
},
16506+
"security": [
16507+
{
16508+
"apikey": []
16509+
}
16510+
],
16511+
"tags": [
16512+
"Integrations"
16513+
]
16514+
}
16515+
},
1646016516
"/v1/integrations/tasks/{taskId}/runs": {
1646116517
"get": {
1646216518
"operationId": "TaskIntegrationsController_getTaskCheckRuns_v1",
@@ -19638,6 +19694,38 @@
1963819694
]
1963919695
}
1964019696
},
19697+
"/v1/email/unsubscribe": {
19698+
"post": {
19699+
"operationId": "UnsubscribeController_unsubscribe_v1",
19700+
"parameters": [
19701+
{
19702+
"name": "email",
19703+
"required": true,
19704+
"in": "query",
19705+
"schema": {
19706+
"type": "string"
19707+
}
19708+
},
19709+
{
19710+
"name": "token",
19711+
"required": true,
19712+
"in": "query",
19713+
"schema": {
19714+
"type": "string"
19715+
}
19716+
}
19717+
],
19718+
"responses": {
19719+
"200": {
19720+
"description": ""
19721+
}
19722+
},
19723+
"summary": "One-click unsubscribe (RFC 8058)",
19724+
"tags": [
19725+
"Email - Unsubscribe"
19726+
]
19727+
}
19728+
},
1964119729
"/v1/secrets": {
1964219730
"get": {
1964319731
"operationId": "SecretsController_listSecrets_v1",
@@ -20269,6 +20357,65 @@
2026920357
]
2027020358
}
2027120359
},
20360+
"/v1/admin/organizations/activity": {
20361+
"get": {
20362+
"operationId": "AdminOrganizationsController_activity_v1",
20363+
"parameters": [
20364+
{
20365+
"name": "inactiveDays",
20366+
"required": false,
20367+
"in": "query",
20368+
"description": "Filter orgs with no session in N days (default: 90)",
20369+
"schema": {
20370+
"type": "string"
20371+
}
20372+
},
20373+
{
20374+
"name": "hasAccess",
20375+
"required": false,
20376+
"in": "query",
20377+
"description": "Filter by hasAccess (true/false)",
20378+
"schema": {
20379+
"type": "string"
20380+
}
20381+
},
20382+
{
20383+
"name": "onboarded",
20384+
"required": false,
20385+
"in": "query",
20386+
"description": "Filter by onboardingCompleted (true/false)",
20387+
"schema": {
20388+
"type": "string"
20389+
}
20390+
},
20391+
{
20392+
"name": "page",
20393+
"required": false,
20394+
"in": "query",
20395+
"schema": {
20396+
"type": "string"
20397+
}
20398+
},
20399+
{
20400+
"name": "limit",
20401+
"required": false,
20402+
"in": "query",
20403+
"schema": {
20404+
"type": "string"
20405+
}
20406+
}
20407+
],
20408+
"responses": {
20409+
"200": {
20410+
"description": ""
20411+
}
20412+
},
20413+
"summary": "Organization activity report - shows last session per org (platform admin)",
20414+
"tags": [
20415+
"Admin - Organizations"
20416+
]
20417+
}
20418+
},
2027220419
"/v1/admin/organizations/{id}": {
2027320420
"get": {
2027420421
"operationId": "AdminOrganizationsController_get_v1",

0 commit comments

Comments
 (0)