Change state of applicability

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-01-02 15:04:11 +01:00
parent c60e19a7a8
commit 4ed3f5a067
105 changed files with 18351 additions and 284 deletions

View File

@@ -52,6 +52,10 @@ export {
getObligationStatusLabel,
getObligationStatusOptions,
} from "./obligationStatus";
export {
getObligationTypeLabel,
getObligationTypeOptions,
} from "./obligationType";
export {
getTrustCenterVisibilityVariant,
getTrustCenterVisibilityLabel,

View File

@@ -0,0 +1,29 @@
type Translator = (s: string) => string;
export type ObligationType = "LEGAL" | "CONTRACTUAL";
export const obligationTypes = [
"LEGAL",
"CONTRACTUAL",
] as const;
export const getObligationTypeLabel = (type: ObligationType) => {
switch (type) {
case "LEGAL":
return "Legal";
case "CONTRACTUAL":
return "Contractual";
default:
return type;
}
};
export function getObligationTypeOptions(__: Translator) {
return obligationTypes.map((type) => ({
value: type,
label: __({
"LEGAL": "Legal",
"CONTRACTUAL": "Contractual",
}[type]),
}));
}

View File

@@ -9,6 +9,7 @@ export const snapshotTypes = [
"OBLIGATIONS",
"CONTINUAL_IMPROVEMENTS",
"PROCESSING_ACTIVITIES",
"STATES_OF_APPLICABILITY",
] as const;
export function getSnapshotTypeLabel(__: Translator, type: string | null | undefined) {
@@ -33,6 +34,8 @@ export function getSnapshotTypeLabel(__: Translator, type: string | null | undef
return __("Continual Improvements");
case "PROCESSING_ACTIVITIES":
return __("Processing Activities");
case "STATES_OF_APPLICABILITY":
return __("States of Applicability");
default:
return __("Unknown");
}
@@ -56,6 +59,8 @@ export function getSnapshotTypeUrlPath(type?: string): string {
return "/continual-improvements";
case "PROCESSING_ACTIVITIES":
return "/processing-activities";
case "STATES_OF_APPLICABILITY":
return "/states-of-applicability";
default:
return "";
}