Change state of applicability
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -52,6 +52,10 @@ export {
|
||||
getObligationStatusLabel,
|
||||
getObligationStatusOptions,
|
||||
} from "./obligationStatus";
|
||||
export {
|
||||
getObligationTypeLabel,
|
||||
getObligationTypeOptions,
|
||||
} from "./obligationType";
|
||||
export {
|
||||
getTrustCenterVisibilityVariant,
|
||||
getTrustCenterVisibilityLabel,
|
||||
|
||||
29
packages/helpers/src/obligationType.ts
Normal file
29
packages/helpers/src/obligationType.ts
Normal 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]),
|
||||
}));
|
||||
}
|
||||
@@ -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 "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user