Update shared helpers for findings

Add new finding statuses (RISK_ACCEPTED, MITIGATED, FALSE_POSITIVE)
to the registry status helper. Update snapshot type references to
use FINDINGS instead of NONCONFORMITIES and CONTINUAL_IMPROVEMENTS.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-17 00:38:57 +01:00
parent fde65eb10b
commit a82e353a47
2 changed files with 26 additions and 9 deletions

View File

@@ -1,11 +1,14 @@
type Translator = (s: string) => string;
export type RegistryStatus = "CLOSED" | "IN_PROGRESS" | "OPEN";
export type RegistryStatus = "CLOSED" | "FALSE_POSITIVE" | "IN_PROGRESS" | "MITIGATED" | "OPEN" | "RISK_ACCEPTED";
export const registryStatuses = [
"OPEN",
"IN_PROGRESS",
"CLOSED",
"RISK_ACCEPTED",
"MITIGATED",
"FALSE_POSITIVE",
] as const;
export const getStatusVariant = (status: RegistryStatus) => {
@@ -16,6 +19,12 @@ export const getStatusVariant = (status: RegistryStatus) => {
return "warning" as const;
case "CLOSED":
return "success" as const;
case "MITIGATED":
return "success" as const;
case "RISK_ACCEPTED":
return "neutral" as const;
case "FALSE_POSITIVE":
return "neutral" as const;
default:
return "neutral" as const;
}
@@ -29,6 +38,12 @@ export const getStatusLabel = (status: RegistryStatus) => {
return "In Progress";
case "CLOSED":
return "Closed";
case "RISK_ACCEPTED":
return "Risk Accepted";
case "MITIGATED":
return "Mitigated";
case "FALSE_POSITIVE":
return "False Positive";
default:
return status;
}
@@ -41,6 +56,9 @@ export function getStatusOptions(__: Translator) {
"OPEN": "Open",
"IN_PROGRESS": "In Progress",
"CLOSED": "Closed",
"RISK_ACCEPTED": "Risk Accepted",
"MITIGATED": "Mitigated",
"FALSE_POSITIVE": "False Positive",
}[status]),
}));
}

View File

@@ -5,9 +5,8 @@ export const snapshotTypes = [
"VENDORS",
"ASSETS",
"DATA",
"NONCONFORMITIES",
"FINDINGS",
"OBLIGATIONS",
"CONTINUAL_IMPROVEMENTS",
"PROCESSING_ACTIVITIES",
"STATES_OF_APPLICABILITY",
] as const;
@@ -26,12 +25,12 @@ export function getSnapshotTypeLabel(__: Translator, type: string | null | undef
return __("Assets");
case "DATA":
return __("Data");
case "FINDINGS":
case "NONCONFORMITIES":
return __("Nonconformities");
case "CONTINUAL_IMPROVEMENTS":
return __("Findings");
case "OBLIGATIONS":
return __("Obligations");
case "CONTINUAL_IMPROVEMENTS":
return __("Continual Improvements");
case "PROCESSING_ACTIVITIES":
return __("Processing Activities");
case "STATES_OF_APPLICABILITY":
@@ -51,12 +50,12 @@ export function getSnapshotTypeUrlPath(type?: string): string {
return "/assets";
case "DATA":
return "/data";
case "FINDINGS":
case "NONCONFORMITIES":
return "/nonconformities";
case "CONTINUAL_IMPROVEMENTS":
return "/findings";
case "OBLIGATIONS":
return "/obligations";
case "CONTINUAL_IMPROVEMENTS":
return "/continual-improvements";
case "PROCESSING_ACTIVITIES":
return "/processing-activities";
case "STATES_OF_APPLICABILITY":