diff --git a/backend/ebios_rm/serializers.py b/backend/ebios_rm/serializers.py index fceac647ed..2845e70987 100644 --- a/backend/ebios_rm/serializers.py +++ b/backend/ebios_rm/serializers.py @@ -90,7 +90,7 @@ class RoToReadSerializer(BaseModelSerializer): str = serializers.CharField(source="__str__") ebios_rm_study = FieldsRelatedField() folder = FieldsRelatedField() - feared_events = FieldsRelatedField(many=True) + feared_events = FieldsRelatedField(["folder", "id"], many=True) class Meta: model = RoTo diff --git a/backend/ebios_rm/views.py b/backend/ebios_rm/views.py index 1ca61f709b..37f8e205fd 100644 --- a/backend/ebios_rm/views.py +++ b/backend/ebios_rm/views.py @@ -43,6 +43,10 @@ class FearedEventViewSet(BaseModelViewSet): class RoToViewSet(BaseModelViewSet): model = RoTo + filterset_fields = [ + "ebios_rm_study", + ] + @action(detail=False, name="Get risk origin choices", url_path="risk-origin") def risk_origin(self, request): return Response(dict(RoTo.RiskOrigin.choices)) diff --git a/frontend/messages/en.json b/frontend/messages/en.json index ca6cab15a9..c7ef5027ae 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -384,7 +384,7 @@ "exportDatabase": "Export database", "upload": "Upload", "add": "Add", - "undefined": "--", + "undefined": "undefined", "production": "Production", "design": "Design", "development": "Development", @@ -929,5 +929,12 @@ "impacts": "Impacts", "ebiosRmStudies": "Ebios RM studies", "bringTheEvidences": "Bring the evidences", - "bringTheEvidencesHelpText": "If disabled, the object will be duplicated without its evidences" + "bringTheEvidencesHelpText": "If disabled, the object will be duplicated without its evidences", + "fearedEvents": "Feared events", + "riskOrigin": "Risk origin", + "targetObjective": "Target objective", + "motivation": "Motivation", + "resources": "Resources", + "pertinence": "Pertinence", + "isSelected": "Is selected" } diff --git a/frontend/src/lib/components/Forms/ModelForm.svelte b/frontend/src/lib/components/Forms/ModelForm.svelte index 7f30a2a719..3866c9d84a 100644 --- a/frontend/src/lib/components/Forms/ModelForm.svelte +++ b/frontend/src/lib/components/Forms/ModelForm.svelte @@ -28,6 +28,7 @@ import GeneralSettingsForm from './ModelForm/GeneralSettingForm.svelte'; import EbiosRmForm from './ModelForm/EbiosRmForm.svelte'; import FearedEventForm from './ModelForm/FearedEventForm.svelte'; + import RoToForm from './ModelForm/RoToForm.svelte'; import AutocompleteSelect from './AutocompleteSelect.svelte'; @@ -261,6 +262,8 @@ {:else if URLModel === 'feared-events'} + {:else if URLModel === 'ro-to'} + {/if}
{#if closeModal} diff --git a/frontend/src/lib/components/Forms/ModelForm/RoToForm.svelte b/frontend/src/lib/components/Forms/ModelForm/RoToForm.svelte new file mode 100644 index 0000000000..cdbc7544ed --- /dev/null +++ b/frontend/src/lib/components/Forms/ModelForm/RoToForm.svelte @@ -0,0 +1,93 @@ + + +