Skip to content

Commit

Permalink
Merge branch 'main' into CA-615-refactor-breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Dec 16, 2024
2 parents ab2d7a9 + f1b00d8 commit 7689066
Show file tree
Hide file tree
Showing 12 changed files with 572 additions and 123 deletions.
23 changes: 23 additions & 0 deletions backend/ebios_rm/migrations/0006_alter_attackpath_stakeholders.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.1.4 on 2024-12-16 12:57

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("ebios_rm", "0005_remove_operationalscenario_attack_paths_and_more"),
]

operations = [
migrations.AlterField(
model_name="attackpath",
name="stakeholders",
field=models.ManyToManyField(
blank=True,
help_text="Stakeholders leveraged by the attack path",
related_name="attack_paths",
to="ebios_rm.stakeholder",
verbose_name="Stakeholders",
),
),
]
4 changes: 1 addition & 3 deletions backend/ebios_rm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ class AttackPath(NameDescriptionMixin, FolderMixin):
verbose_name=_("Stakeholders"),
related_name="attack_paths",
help_text=_("Stakeholders leveraged by the attack path"),
blank=True,
)

ref_id = models.CharField(max_length=100, blank=True)
Expand All @@ -391,9 +392,6 @@ class Meta:
verbose_name_plural = _("Attack paths")
ordering = ["created_at"]

def __str__(self):
return f"{self.ro_to_couple} - {self.description}"

def save(self, *args, **kwargs):
self.folder = self.ebios_rm_study.folder
super().save(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion backend/ebios_rm/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class StakeholderReadSerializer(BaseModelSerializer):
entity = FieldsRelatedField()
applied_controls = FieldsRelatedField(many=True)

category = serializers.CharField(source="get_category_display")
current_criticality = serializers.IntegerField()
residual_criticality = serializers.IntegerField()

Expand All @@ -134,7 +135,6 @@ class Meta:


class AttackPathReadSerializer(BaseModelSerializer):
str = serializers.CharField(source="__str__")
ebios_rm_study = FieldsRelatedField()
folder = FieldsRelatedField()
ro_to_couple = FieldsRelatedField()
Expand Down
3 changes: 2 additions & 1 deletion frontend/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -996,5 +996,6 @@
"noAuthor": "No author assigned",
"noReviewer": "No reviewer assigned",
"selectAudit": "Select audit",
"errorAssetGraphMustNotContainCycles": "The asset graph must not contain cycles."
"errorAssetGraphMustNotContainCycles": "The asset graph must not contain cycles.",
"addStakeholder": "Add stakeholder"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<script lang="ts">
import type { SuperValidated } from 'sveltekit-superforms';
import type { ModelInfo, CacheLock } from '$lib/utils/types';
import TextField from '$lib/components/Forms/TextField.svelte';
import AutocompleteSelect from '$lib/components/Forms/AutocompleteSelect.svelte';
import Select from '$lib/components/Forms/Select.svelte';
import * as m from '$paraglide/messages.js';
import { getOptions } from '$lib/utils/crud';
import TextArea from '../TextArea.svelte';
import NumberField from '../NumberField.svelte';
import type { CacheLock, ModelInfo } from '$lib/utils/types';
import * as m from '$paraglide/messages.js';
import type { SuperValidated } from 'sveltekit-superforms';
import Checkbox from '../Checkbox.svelte';
import TextArea from '../TextArea.svelte';
export let form: SuperValidated<any>;
export let model: ModelInfo;
Expand Down
Loading

0 comments on commit 7689066

Please sign in to comment.