diff --git a/backend/core/serializers.py b/backend/core/serializers.py index fac6fff35..74ffd00a2 100644 --- a/backend/core/serializers.py +++ b/backend/core/serializers.py @@ -275,7 +275,7 @@ class RiskScenarioReadSerializer(RiskScenarioWriteSerializer): threats = FieldsRelatedField(many=True) assets = FieldsRelatedField(many=True) - treatment = serializers.CharField(source="get_treatment_display") + treatment = serializers.CharField() current_proba = serializers.JSONField(source="get_current_proba") current_impact = serializers.JSONField(source="get_current_impact") diff --git a/frontend/src/lib/utils/crud.ts b/frontend/src/lib/utils/crud.ts index 5bd78f49d..da9cf3434 100644 --- a/frontend/src/lib/utils/crud.ts +++ b/frontend/src/lib/utils/crud.ts @@ -510,11 +510,11 @@ export const FIELD_COLORED_TAG_MAP: FieldColoredTagMap = { name: { key: 'treatment', values: { - Open: { text: 'open', cssClasses: 'badge bg-green-300' }, - Mitigate: { text: 'mitigate', cssClasses: 'badge bg-lime-200' }, - Accept: { text: 'accept', cssClasses: 'badge bg-green-200' }, - Avoid: { text: 'avoid', cssClasses: 'badge bg-red-200' }, - Transfer: { text: 'transfer', cssClasses: 'badge bg-yellow-300' } + open: { text: 'open', cssClasses: 'badge bg-green-300' }, + mitigate: { text: 'mitigate', cssClasses: 'badge bg-lime-200' }, + accept: { text: 'accept', cssClasses: 'badge bg-green-200' }, + avoid: { text: 'avoid', cssClasses: 'badge bg-red-200' }, + transfer: { text: 'transfer', cssClasses: 'badge bg-yellow-300' } } } }, diff --git a/frontend/src/routes/(app)/risk-assessments/[id=uuid]/remediation-plan/+page.svelte b/frontend/src/routes/(app)/risk-assessments/[id=uuid]/remediation-plan/+page.svelte index f33d1a983..83e6ad2a7 100644 --- a/frontend/src/routes/(app)/risk-assessments/[id=uuid]/remediation-plan/+page.svelte +++ b/frontend/src/routes/(app)/risk-assessments/[id=uuid]/remediation-plan/+page.svelte @@ -17,7 +17,7 @@ avoid: 'bg-red-200', transfer: 'bg-violet-200' }; - return map[status.toLowerCase()] ?? 'bg-gray-200'; + return map[status] ?? 'bg-gray-200'; }; const measureStatusColorMap = (treatment: string) => { @@ -68,7 +68,7 @@ href="/risk-scenarios/{scenario.id}">{scenario.name} {scenario.treatment}{safeTranslate(scenario.treatment)}