Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions apps/app/public/badges/nen7510.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const acceptRequestedPolicyChangesAction = authActionClient
userName: employee.user.name || employee.user.email || 'Employee',
policyName: policy.name,
organizationName: policy.organization.name,
url: `${process.env.NEXT_PUBLIC_APP_URL ?? 'https://app.trycomp.ai'}/${session.activeOrganizationId}/policies/${policy.id}`,
url: `${process.env.NEXT_PUBLIC_PORTAL_URL ?? 'https://portal.trycomp.ai'}/${session.activeOrganizationId}`,
description: `The "${policy.name}" policy has been ${isNewPolicy ? 'created' : 'updated'}.`,
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export function mapFrameworkToBadge(framework: FrameworkInstanceWithControls) {
return '/badges/pci-dss.svg';
}

if (framework.framework.name === 'NEN 7510') {
return '/badges/nen7510.svg';
}

return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ interface UpdateTrustPortalFrameworksParams {
gdpr?: boolean;
hipaa?: boolean;
pcidss?: boolean;
nen7510?: boolean;
soc2type1Status?: 'started' | 'in_progress' | 'compliant';
soc2type2Status?: 'started' | 'in_progress' | 'compliant';
iso27001Status?: 'started' | 'in_progress' | 'compliant';
iso42001Status?: 'started' | 'in_progress' | 'compliant';
gdprStatus?: 'started' | 'in_progress' | 'compliant';
hipaaStatus?: 'started' | 'in_progress' | 'compliant';
pcidssStatus?: 'started' | 'in_progress' | 'compliant';
nen7510Status?: 'started' | 'in_progress' | 'compliant';
}

export async function updateTrustPortalFrameworks({
Expand All @@ -32,13 +34,15 @@ export async function updateTrustPortalFrameworks({
gdpr,
hipaa,
pcidss,
nen7510,
soc2type1Status,
soc2type2Status,
iso27001Status,
iso42001Status,
gdprStatus,
hipaaStatus,
pcidssStatus,
nen7510Status,
}: UpdateTrustPortalFrameworksParams) {
const session = await auth.api.getSession({
headers: await headers(),
Expand Down Expand Up @@ -71,6 +75,7 @@ export async function updateTrustPortalFrameworks({
gdpr: gdpr ?? trustPortal.gdpr,
hipaa: hipaa ?? trustPortal.hipaa,
pci_dss: pcidss ?? trustPortal.pci_dss,
nen7510: nen7510 ?? trustPortal.nen7510,
soc2_status: soc2type2Status ?? trustPortal.soc2_status,
soc2type1_status: soc2type1Status ?? trustPortal.soc2type1_status,
soc2type2_status: soc2type2Status ?? trustPortal.soc2type2_status,
Expand All @@ -79,6 +84,7 @@ export async function updateTrustPortalFrameworks({
gdpr_status: gdprStatus ?? trustPortal.gdpr_status,
hipaa_status: hipaaStatus ?? trustPortal.hipaa_status,
pci_dss_status: pcidssStatus ?? trustPortal.pci_dss_status,
nen7510_status: nen7510Status ?? trustPortal.nen7510_status,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { z } from 'zod';
import { isFriendlyAvailable } from '../actions/is-friendly-available';
import { trustPortalSwitchAction } from '../actions/trust-portal-switch';
import { updateTrustPortalFrameworks } from '../actions/update-trust-portal-frameworks';
import { GDPR, HIPAA, ISO27001, SOC2Type1, SOC2Type2, PCIDSS, ISO42001 } from './logos';
import { GDPR, HIPAA, ISO27001, SOC2Type1, SOC2Type2, PCIDSS, ISO42001, NEN7510 } from './logos';

const trustPortalSwitchSchema = z.object({
enabled: z.boolean(),
Expand All @@ -30,13 +30,15 @@ const trustPortalSwitchSchema = z.object({
gdpr: z.boolean(),
hipaa: z.boolean(),
pcidss: z.boolean(),
nen7510: z.boolean(),
soc2type1Status: z.enum(['started', 'in_progress', 'compliant']),
soc2type2Status: z.enum(['started', 'in_progress', 'compliant']),
iso27001Status: z.enum(['started', 'in_progress', 'compliant']),
iso42001Status: z.enum(['started', 'in_progress', 'compliant']),
gdprStatus: z.enum(['started', 'in_progress', 'compliant']),
hipaaStatus: z.enum(['started', 'in_progress', 'compliant']),
pcidssStatus: z.enum(['started', 'in_progress', 'compliant']),
nen7510Status: z.enum(['started', 'in_progress', 'compliant']),
});

export function TrustPortalSwitch({
Expand All @@ -60,6 +62,8 @@ export function TrustPortalSwitch({
gdprStatus,
hipaaStatus,
pcidssStatus,
nen7510,
nen7510Status,
friendlyUrl,
}: {
enabled: boolean;
Expand All @@ -75,13 +79,15 @@ export function TrustPortalSwitch({
gdpr: boolean;
hipaa: boolean;
pcidss: boolean;
nen7510: boolean;
soc2type1Status: 'started' | 'in_progress' | 'compliant';
soc2type2Status: 'started' | 'in_progress' | 'compliant';
iso27001Status: 'started' | 'in_progress' | 'compliant';
iso42001Status: 'started' | 'in_progress' | 'compliant';
gdprStatus: 'started' | 'in_progress' | 'compliant';
hipaaStatus: 'started' | 'in_progress' | 'compliant';
pcidssStatus: 'started' | 'in_progress' | 'compliant';
nen7510Status: 'started' | 'in_progress' | 'compliant';
friendlyUrl: string | null;
}) {
const trustPortalSwitch = useAction(trustPortalSwitchAction, {
Expand All @@ -107,13 +113,15 @@ export function TrustPortalSwitch({
gdpr: gdpr ?? false,
hipaa: hipaa ?? false,
pcidss: pcidss ?? false,
nen7510: nen7510 ?? false,
soc2type1Status: soc2type1Status ?? 'started',
soc2type2Status: soc2type2Status ?? 'started',
iso27001Status: iso27001Status ?? 'started',
iso42001Status: iso42001Status ?? 'started',
gdprStatus: gdprStatus ?? 'started',
hipaaStatus: hipaaStatus ?? 'started',
pcidssStatus: pcidssStatus ?? 'started',
nen7510Status: nen7510Status ?? 'started',
friendlyUrl: friendlyUrl ?? undefined,
},
});
Expand Down Expand Up @@ -541,6 +549,35 @@ export function TrustPortalSwitch({
}
}}
/>
{/* NEN 7510 */}
<ComplianceFramework
title="NEN 7510"
description="A Dutch standard for managing information security systems."
isEnabled={nen7510}
status={nen7510Status}
onStatusChange={async (value) => {
try {
await updateTrustPortalFrameworks({
orgId,
nen7510Status: value as 'started' | 'in_progress' | 'compliant',
});
toast.success('NEN 7510 status updated');
} catch (error) {
toast.error('Failed to update NEN 7510 status');
}
}}
onToggle={async (checked) => {
try {
await updateTrustPortalFrameworks({
orgId,
nen7510: checked,
});
toast.success('NEN 7510 status updated');
} catch (error) {
toast.error('Failed to update NEN 7510 status');
}
}}
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -594,9 +631,13 @@ function ComplianceFramework({
<SOC2Type2 className="max-h-full max-w-full" />
</div>
) : title === 'PCI DSS' ? (
<div className="h-16 w-16 flex items-center justify-center">
<PCIDSS className="max-h-full max-w-full" />
</div>
<div className="h-16 w-16 flex items-center justify-center">
<PCIDSS className="max-h-full max-w-full" />
</div>
) : title === 'NEN 7510' ? (
<div className="h-16 w-16 flex items-center justify-center">
<NEN7510 className="max-h-full max-w-full" />
</div>
) : null;

return (
Expand Down
Loading
Loading