Add processing activity registry snapshots

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-08-29 16:59:54 +02:00
parent 433101fce9
commit 612149afc8
29 changed files with 831 additions and 192 deletions

View File

@@ -5,6 +5,7 @@ export const snapshotTypes = [
"NONCONFORMITY_REGISTRIES",
"COMPLIANCE_REGISTRIES",
"CONTINUAL_IMPROVEMENT_REGISTRIES",
"PROCESSING_ACTIVITY_REGISTRIES",
] as const;
export function getSnapshotTypeLabel(__: Translator, type: string | null | undefined) {
@@ -27,6 +28,8 @@ export function getSnapshotTypeLabel(__: Translator, type: string | null | undef
return __("Compliance Registries");
case "CONTINUAL_IMPROVEMENT_REGISTRIES":
return __("Continual Improvement Registries");
case "PROCESSING_ACTIVITY_REGISTRIES":
return __("Processing Activity Registries");
default:
return __("Unknown");
}
@@ -42,6 +45,8 @@ export function getSnapshotTypeUrlPath(type?: string): string {
return "/compliance-registries";
case "CONTINUAL_IMPROVEMENT_REGISTRIES":
return "/continual-improvement-registries";
case "PROCESSING_ACTIVITY_REGISTRIES":
return "/processing-activity-registries";
default:
return "";
}

View File

@@ -5,6 +5,7 @@ import { IconCheckmark1 } from "../Icons";
type Props = {
checked: boolean;
onChange: (checked: boolean) => void;
disabled?: boolean;
};
const checkbox = tv({
@@ -16,19 +17,23 @@ const checkbox = tv({
checked: {
true: "bg-accent text-invert",
},
disabled: {
true: "opacity-50 cursor-not-allowed",
},
},
});
export function Checkbox({ checked, onChange }: Props) {
export function Checkbox({ checked, onChange, disabled = false }: Props) {
const [isFocused, setFocus] = useState(false);
return (
<div className={checkbox({ isFocused, checked })}>
<div className={checkbox({ isFocused, checked, disabled })}>
<input
className="absolute inset-0 opacity-0"
type="checkbox"
checked={checked}
onChange={(e) => onChange(e.target.checked)}
onFocus={() => setFocus(true)}
disabled={disabled}
onChange={(e) => !disabled && onChange(e.target.checked)}
onFocus={() => !disabled && setFocus(true)}
onBlur={() => setFocus(false)}
/>
{checked && <IconCheckmark1 size={12} />}