Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3a169b8
feat(db): add scope column to Finding table
chasprowebdev Apr 8, 2026
97652c5
feat(app): create finding with new scope
chasprowebdev Apr 8, 2026
79fbde4
feat(app): add Findings section on People tab
chasprowebdev Apr 8, 2026
02f37c8
feat(app): add Findings on People/Tasks tab
chasprowebdev Apr 8, 2026
6e5ff45
fix(docs): update doc
chasprowebdev Apr 8, 2026
382d436
feat(app): add Findings on People/Devices tab
chasprowebdev Apr 8, 2026
b03e4b2
feat(app): add Findings on People/Chart tab
chasprowebdev Apr 8, 2026
50cfe11
fix(app): update finding title on Findings overview
chasprowebdev Apr 8, 2026
90b1f42
feat(app): sync people page tabs with URL hashes
chasprowebdev Apr 8, 2026
36bbc2c
fix(api): correct finding notifications for People scope findings
chasprowebdev Apr 8, 2026
977389e
fix(api): resolve scope finding notification recipients to owners/admins
chasprowebdev Apr 8, 2026
da038fe
fix(api): align finding notification deep links with context title pr…
chasprowebdev Apr 8, 2026
c48b845
fix(app): preserve #finding- hash on People page tab sync
chasprowebdev Apr 8, 2026
a82e84c
fix(app): fix finding redirect issue on FindingsOverview
chasprowebdev Apr 8, 2026
cf56042
fix(app): fix hash cleanup issue on PeopleFindingsList
chasprowebdev Apr 8, 2026
f820392
fix(api): fix people page url with tab
chasprowebdev Apr 8, 2026
576337b
fix(app): use tab param on people page instead of hash
chasprowebdev Apr 8, 2026
aface56
fix(app): remove hash-related code from PeopleFindingsList
chasprowebdev Apr 8, 2026
98882ba
fix(app): minor change - remove empty line
chasprowebdev Apr 8, 2026
bf86b21
Merge branch 'main' into chas/people-findings
Marfuen Apr 9, 2026
f16ce39
Merge branch 'main' of https://github.com/trycompai/comp into chas/pe…
chasprowebdev Apr 10, 2026
7851151
fix(app): remove Findings on People tabs and add new Findings tab on …
chasprowebdev Apr 10, 2026
c80845e
fix(app): add Scope select on 'Create Finding' sheet
chasprowebdev Apr 10, 2026
b7dd699
fix(api): add hasScope param to findings api endpoint
chasprowebdev Apr 10, 2026
50b474d
fix(app): show all people-scope findings on People
chasprowebdev Apr 10, 2026
6702305
fix(api): update deep link for people findings on finding notifier
chasprowebdev Apr 10, 2026
c05ce1e
fix(app): update deep link for people findings on overview
chasprowebdev Apr 10, 2026
85cf0d8
Merge branch 'main' of https://github.com/trycompai/comp into chas/pe…
chasprowebdev Apr 10, 2026
dc03a36
fix(app): remove unused line
chasprowebdev Apr 10, 2026
a9db080
Merge branch 'main' into chas/people-findings
Marfuen Apr 10, 2026
43f2831
fix(app): add scope filter on People Findings UI
chasprowebdev Apr 10, 2026
fab9ffc
Merge branch 'main' of https://github.com/trycompai/comp into chas/pe…
chasprowebdev Apr 10, 2026
502cf91
fix(db): update folder of add_finding script
chasprowebdev Apr 10, 2026
52734e0
Merge branch 'chas/people-findings' of https://github.com/trycompai/c…
chasprowebdev Apr 10, 2026
8ce0969
fix(app): empty commit
chasprowebdev Apr 10, 2026
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
12 changes: 11 additions & 1 deletion apps/api/src/findings/dto/create-finding.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
IsOptional,
MaxLength,
} from 'class-validator';
import { FindingType } from '@db';
import { FindingScope, FindingType } from '@db';
import {
evidenceFormTypeSchema,
type EvidenceFormType,
Expand Down Expand Up @@ -43,6 +43,16 @@ export class CreateFindingDto {
@IsOptional()
evidenceFormType?: EvidenceFormType;

@ApiProperty({
description:
'People area scope (e.g. people directory) when not tied to a task or evidence',
enum: FindingScope,
required: false,
})
@IsEnum(FindingScope)
@IsOptional()
scope?: FindingScope;

@ApiProperty({
description: 'Type of finding (SOC 2 or ISO 27001)',
enum: FindingType,
Expand Down
2 changes: 2 additions & 0 deletions apps/api/src/findings/finding-audit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class FindingAuditService {
taskTitle?: string;
evidenceSubmissionId?: string;
evidenceSubmissionFormType?: string;
findingScope?: string;
content: string;
type: FindingType;
},
Expand All @@ -41,6 +42,7 @@ export class FindingAuditService {
taskTitle: params.taskTitle,
evidenceSubmissionId: params.evidenceSubmissionId,
evidenceSubmissionFormType: params.evidenceSubmissionFormType,
findingScope: params.findingScope,
content: params.content,
type: params.type,
status: FindingStatus.open,
Expand Down
58 changes: 57 additions & 1 deletion apps/api/src/findings/finding-notifier.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jest.mock(
soc2: 'soc2',
iso27001: 'iso27001',
},
FindingScope: {
people: 'people',
people_tasks: 'people_tasks',
people_devices: 'people_devices',
people_chart: 'people_chart',
},
FindingStatus: {
open: 'open',
ready_for_review: 'ready_for_review',
Expand Down Expand Up @@ -75,8 +81,14 @@ const mockDbModule: {
soc2: 'soc2';
iso27001: 'iso27001';
};
FindingScope: {
people: 'people';
people_tasks: 'people_tasks';
people_devices: 'people_devices';
people_chart: 'people_chart';
};
} = jest.requireMock('@db');
const { db, FindingType } = mockDbModule;
const { db, FindingType, FindingScope } = mockDbModule;

describe('FindingNotifierService', () => {
const mockedDb = db;
Expand Down Expand Up @@ -192,5 +204,49 @@ describe('FindingNotifierService', () => {
}),
);
});

it('builds People page URLs with tab query for scope-based findings', async () => {
await service.notifyFindingCreated({
organizationId: 'org_123',
findingId: 'fdg_scope',
findingScope: FindingScope.people_devices,
findingContent: 'Device area finding',
findingType: FindingType.soc2,
actorUserId: 'usr_actor',
actorName: 'Actor',
});

expect(mockedDb.task.findUnique).not.toHaveBeenCalled();
expect(mockedDb.evidenceSubmission.findUnique).not.toHaveBeenCalled();

expect(novuTriggerMock).toHaveBeenCalledWith(
expect.objectContaining({
payload: expect.objectContaining({
findingUrl: 'https://app.trycomp.ai/org_123/people?tab=findings',
}),
}),
);
});

it('aligns title and URL by preferring People scope over document fields when both are set', async () => {
await service.notifyFindingCreated({
organizationId: 'org_123',
findingId: 'fdg_mixed',
findingScope: FindingScope.people,
evidenceSubmissionFormType: 'meeting',
findingContent: 'Ambiguous finding',
findingType: FindingType.soc2,
actorUserId: 'usr_actor',
actorName: 'Actor',
});

expect(novuTriggerMock).toHaveBeenCalledWith(
expect.objectContaining({
payload: expect.objectContaining({
findingUrl: 'https://app.trycomp.ai/org_123/people?tab=findings',
}),
}),
);
});
});
});
Loading
Loading